{
  "snapId": "npm:@metamask/stellar-wallet-snap",
  "manifest": {
    "version": "1.0.0",
    "description": "Manage Stellar using MetaMask",
    "proposedName": "Stellar",
    "repository": {
      "type": "git",
      "url": "https://github.com/MetaMask/internal-snaps.git"
    },
    "source": {
      "shasum": "4+EyTgTFLM70gl0+i/itlLe7RKHXXzkqoZ+02DMefJw=",
      "location": {
        "npm": {
          "filePath": "dist/bundle.js",
          "iconPath": "images/icon.svg",
          "packageName": "@metamask/stellar-wallet-snap",
          "registry": "https://registry.npmjs.org/"
        }
      }
    },
    "initialConnections": {
      "https://portfolio.metamask.io": {}
    },
    "initialPermissions": {
      "endowment:keyring": {
        "allowedOrigins": [
          "https://portfolio.metamask.io"
        ],
        "capabilities": {
          "scopes": [
            "stellar:pubnet"
          ],
          "bip44": {
            "deriveIndex": true,
            "deriveIndexRange": true,
            "discover": true
          }
        }
      },
      "snap_getBip32Entropy": [
        {
          "path": [
            "m",
            "44'",
            "148'"
          ],
          "curve": "ed25519"
        }
      ],
      "endowment:network-access": {},
      "snap_manageAccounts": {},
      "snap_manageState": {},
      "snap_dialog": {},
      "snap_getPreferences": {},
      "endowment:cronjob": {
        "jobs": [
          {
            "duration": "PT30S",
            "request": {
              "method": "synchronizeAccounts"
            }
          },
          {
            "duration": "PT1H",
            "request": {
              "method": "synchronizeAssets"
            }
          }
        ]
      },
      "endowment:assets": {
        "scopes": [
          "stellar:pubnet"
        ]
      }
    },
    "platformVersion": "12.0.1",
    "manifestVersion": "0.1"
  },
  "files": [
    {
      "path": "dist/bundle.js",
      "value": "(()=>{var e={2091(e,t,n){\"use strict\";t.x2=void 0;const r=n(9648),o=n(486),i=n(7004),a=n(2249),s=n(3654),c=n(9450);function u(e){if(\"string\"!=typeof e)throw new TypeError(\"Invalid mnemonic type: \"+typeof e);return e.normalize(\"NFKD\")}function l(e){const t=u(e),n=t.split(\" \");if(![12,15,18,21,24].includes(n.length))throw new Error(\"Invalid mnemonic\");return{nfkd:t,words:n}}function f(e){r.default.bytes(e,16,20,24,28,32)}const p=e=>{const t=8-e.length/4;return new Uint8Array([(0,i.sha256)(e)[0]>>t<<t])};function d(e){if(!Array.isArray(e)||2048!==e.length||\"string\"!=typeof e[0])throw new Error(\"Worlist: expected array of 2048 strings\");return e.forEach(e=>{if(\"string\"!=typeof e)throw new Error(`Wordlist: non-string element: ${e}`)}),c.utils.chain(c.utils.checksum(1,p),c.utils.radix2(11,!0),c.utils.alphabet(e))}function h(e,t){let n;if(\"string\"==typeof e){const{words:r}=l(e);n=d(t).decode(r)}else n=d(t).decode(Array.from(new Uint16Array(e.buffer)).map(e=>t[e]));return f(n),n}function y(e,t){f(e);const n=d(t).encode(e).map(e=>t.indexOf(e));return new Uint8Array(new Uint16Array(n).buffer)}t.x2=h;const g=e=>u(`mnemonic${e}`);function m(e,t){let n;return n=\"string\"==typeof e?(new TextEncoder).encode(l(e).nfkd):(new TextEncoder).encode(Array.from(new Uint16Array(e.buffer)).map(e=>t[e]).join(\" \")),n}},6925(e,t){\"use strict\";t.p=void 0,t.p=\"abandon\\nability\\nable\\nabout\\nabove\\nabsent\\nabsorb\\nabstract\\nabsurd\\nabuse\\naccess\\naccident\\naccount\\naccuse\\nachieve\\nacid\\nacoustic\\nacquire\\nacross\\nact\\naction\\nactor\\nactress\\nactual\\nadapt\\nadd\\naddict\\naddress\\nadjust\\nadmit\\nadult\\nadvance\\nadvice\\naerobic\\naffair\\nafford\\nafraid\\nagain\\nage\\nagent\\nagree\\nahead\\naim\\nair\\nairport\\naisle\\nalarm\\nalbum\\nalcohol\\nalert\\nalien\\nall\\nalley\\nallow\\nalmost\\nalone\\nalpha\\nalready\\nalso\\nalter\\nalways\\namateur\\namazing\\namong\\namount\\namused\\nanalyst\\nanchor\\nancient\\nanger\\nangle\\nangry\\nanimal\\nankle\\nannounce\\nannual\\nanother\\nanswer\\nantenna\\nantique\\nanxiety\\nany\\napart\\napology\\nappear\\napple\\napprove\\napril\\narch\\narctic\\narea\\narena\\nargue\\narm\\narmed\\narmor\\narmy\\naround\\narrange\\narrest\\narrive\\narrow\\nart\\nartefact\\nartist\\nartwork\\nask\\naspect\\nassault\\nasset\\nassist\\nassume\\nasthma\\nathlete\\natom\\nattack\\nattend\\nattitude\\nattract\\nauction\\naudit\\naugust\\naunt\\nauthor\\nauto\\nautumn\\naverage\\navocado\\navoid\\nawake\\naware\\naway\\nawesome\\nawful\\nawkward\\naxis\\nbaby\\nbachelor\\nbacon\\nbadge\\nbag\\nbalance\\nbalcony\\nball\\nbamboo\\nbanana\\nbanner\\nbar\\nbarely\\nbargain\\nbarrel\\nbase\\nbasic\\nbasket\\nbattle\\nbeach\\nbean\\nbeauty\\nbecause\\nbecome\\nbeef\\nbefore\\nbegin\\nbehave\\nbehind\\nbelieve\\nbelow\\nbelt\\nbench\\nbenefit\\nbest\\nbetray\\nbetter\\nbetween\\nbeyond\\nbicycle\\nbid\\nbike\\nbind\\nbiology\\nbird\\nbirth\\nbitter\\nblack\\nblade\\nblame\\nblanket\\nblast\\nbleak\\nbless\\nblind\\nblood\\nblossom\\nblouse\\nblue\\nblur\\nblush\\nboard\\nboat\\nbody\\nboil\\nbomb\\nbone\\nbonus\\nbook\\nboost\\nborder\\nboring\\nborrow\\nboss\\nbottom\\nbounce\\nbox\\nboy\\nbracket\\nbrain\\nbrand\\nbrass\\nbrave\\nbread\\nbreeze\\nbrick\\nbridge\\nbrief\\nbright\\nbring\\nbrisk\\nbroccoli\\nbroken\\nbronze\\nbroom\\nbrother\\nbrown\\nbrush\\nbubble\\nbuddy\\nbudget\\nbuffalo\\nbuild\\nbulb\\nbulk\\nbullet\\nbundle\\nbunker\\nburden\\nburger\\nburst\\nbus\\nbusiness\\nbusy\\nbutter\\nbuyer\\nbuzz\\ncabbage\\ncabin\\ncable\\ncactus\\ncage\\ncake\\ncall\\ncalm\\ncamera\\ncamp\\ncan\\ncanal\\ncancel\\ncandy\\ncannon\\ncanoe\\ncanvas\\ncanyon\\ncapable\\ncapital\\ncaptain\\ncar\\ncarbon\\ncard\\ncargo\\ncarpet\\ncarry\\ncart\\ncase\\ncash\\ncasino\\ncastle\\ncasual\\ncat\\ncatalog\\ncatch\\ncategory\\ncattle\\ncaught\\ncause\\ncaution\\ncave\\nceiling\\ncelery\\ncement\\ncensus\\ncentury\\ncereal\\ncertain\\nchair\\nchalk\\nchampion\\nchange\\nchaos\\nchapter\\ncharge\\nchase\\nchat\\ncheap\\ncheck\\ncheese\\nchef\\ncherry\\nchest\\nchicken\\nchief\\nchild\\nchimney\\nchoice\\nchoose\\nchronic\\nchuckle\\nchunk\\nchurn\\ncigar\\ncinnamon\\ncircle\\ncitizen\\ncity\\ncivil\\nclaim\\nclap\\nclarify\\nclaw\\nclay\\nclean\\nclerk\\nclever\\nclick\\nclient\\ncliff\\nclimb\\nclinic\\nclip\\nclock\\nclog\\nclose\\ncloth\\ncloud\\nclown\\nclub\\nclump\\ncluster\\nclutch\\ncoach\\ncoast\\ncoconut\\ncode\\ncoffee\\ncoil\\ncoin\\ncollect\\ncolor\\ncolumn\\ncombine\\ncome\\ncomfort\\ncomic\\ncommon\\ncompany\\nconcert\\nconduct\\nconfirm\\ncongress\\nconnect\\nconsider\\ncontrol\\nconvince\\ncook\\ncool\\ncopper\\ncopy\\ncoral\\ncore\\ncorn\\ncorrect\\ncost\\ncotton\\ncouch\\ncountry\\ncouple\\ncourse\\ncousin\\ncover\\ncoyote\\ncrack\\ncradle\\ncraft\\ncram\\ncrane\\ncrash\\ncrater\\ncrawl\\ncrazy\\ncream\\ncredit\\ncreek\\ncrew\\ncricket\\ncrime\\ncrisp\\ncritic\\ncrop\\ncross\\ncrouch\\ncrowd\\ncrucial\\ncruel\\ncruise\\ncrumble\\ncrunch\\ncrush\\ncry\\ncrystal\\ncube\\nculture\\ncup\\ncupboard\\ncurious\\ncurrent\\ncurtain\\ncurve\\ncushion\\ncustom\\ncute\\ncycle\\ndad\\ndamage\\ndamp\\ndance\\ndanger\\ndaring\\ndash\\ndaughter\\ndawn\\nday\\ndeal\\ndebate\\ndebris\\ndecade\\ndecember\\ndecide\\ndecline\\ndecorate\\ndecrease\\ndeer\\ndefense\\ndefine\\ndefy\\ndegree\\ndelay\\ndeliver\\ndemand\\ndemise\\ndenial\\ndentist\\ndeny\\ndepart\\ndepend\\ndeposit\\ndepth\\ndeputy\\nderive\\ndescribe\\ndesert\\ndesign\\ndesk\\ndespair\\ndestroy\\ndetail\\ndetect\\ndevelop\\ndevice\\ndevote\\ndiagram\\ndial\\ndiamond\\ndiary\\ndice\\ndiesel\\ndiet\\ndiffer\\ndigital\\ndignity\\ndilemma\\ndinner\\ndinosaur\\ndirect\\ndirt\\ndisagree\\ndiscover\\ndisease\\ndish\\ndismiss\\ndisorder\\ndisplay\\ndistance\\ndivert\\ndivide\\ndivorce\\ndizzy\\ndoctor\\ndocument\\ndog\\ndoll\\ndolphin\\ndomain\\ndonate\\ndonkey\\ndonor\\ndoor\\ndose\\ndouble\\ndove\\ndraft\\ndragon\\ndrama\\ndrastic\\ndraw\\ndream\\ndress\\ndrift\\ndrill\\ndrink\\ndrip\\ndrive\\ndrop\\ndrum\\ndry\\nduck\\ndumb\\ndune\\nduring\\ndust\\ndutch\\nduty\\ndwarf\\ndynamic\\neager\\neagle\\nearly\\nearn\\nearth\\neasily\\neast\\neasy\\necho\\necology\\neconomy\\nedge\\nedit\\neducate\\neffort\\negg\\neight\\neither\\nelbow\\nelder\\nelectric\\nelegant\\nelement\\nelephant\\nelevator\\nelite\\nelse\\nembark\\nembody\\nembrace\\nemerge\\nemotion\\nemploy\\nempower\\nempty\\nenable\\nenact\\nend\\nendless\\nendorse\\nenemy\\nenergy\\nenforce\\nengage\\nengine\\nenhance\\nenjoy\\nenlist\\nenough\\nenrich\\nenroll\\nensure\\nenter\\nentire\\nentry\\nenvelope\\nepisode\\nequal\\nequip\\nera\\nerase\\nerode\\nerosion\\nerror\\nerupt\\nescape\\nessay\\nessence\\nestate\\neternal\\nethics\\nevidence\\nevil\\nevoke\\nevolve\\nexact\\nexample\\nexcess\\nexchange\\nexcite\\nexclude\\nexcuse\\nexecute\\nexercise\\nexhaust\\nexhibit\\nexile\\nexist\\nexit\\nexotic\\nexpand\\nexpect\\nexpire\\nexplain\\nexpose\\nexpress\\nextend\\nextra\\neye\\neyebrow\\nfabric\\nface\\nfaculty\\nfade\\nfaint\\nfaith\\nfall\\nfalse\\nfame\\nfamily\\nfamous\\nfan\\nfancy\\nfantasy\\nfarm\\nfashion\\nfat\\nfatal\\nfather\\nfatigue\\nfault\\nfavorite\\nfeature\\nfebruary\\nfederal\\nfee\\nfeed\\nfeel\\nfemale\\nfence\\nfestival\\nfetch\\nfever\\nfew\\nfiber\\nfiction\\nfield\\nfigure\\nfile\\nfilm\\nfilter\\nfinal\\nfind\\nfine\\nfinger\\nfinish\\nfire\\nfirm\\nfirst\\nfiscal\\nfish\\nfit\\nfitness\\nfix\\nflag\\nflame\\nflash\\nflat\\nflavor\\nflee\\nflight\\nflip\\nfloat\\nflock\\nfloor\\nflower\\nfluid\\nflush\\nfly\\nfoam\\nfocus\\nfog\\nfoil\\nfold\\nfollow\\nfood\\nfoot\\nforce\\nforest\\nforget\\nfork\\nfortune\\nforum\\nforward\\nfossil\\nfoster\\nfound\\nfox\\nfragile\\nframe\\nfrequent\\nfresh\\nfriend\\nfringe\\nfrog\\nfront\\nfrost\\nfrown\\nfrozen\\nfruit\\nfuel\\nfun\\nfunny\\nfurnace\\nfury\\nfuture\\ngadget\\ngain\\ngalaxy\\ngallery\\ngame\\ngap\\ngarage\\ngarbage\\ngarden\\ngarlic\\ngarment\\ngas\\ngasp\\ngate\\ngather\\ngauge\\ngaze\\ngeneral\\ngenius\\ngenre\\ngentle\\ngenuine\\ngesture\\nghost\\ngiant\\ngift\\ngiggle\\nginger\\ngiraffe\\ngirl\\ngive\\nglad\\nglance\\nglare\\nglass\\nglide\\nglimpse\\nglobe\\ngloom\\nglory\\nglove\\nglow\\nglue\\ngoat\\ngoddess\\ngold\\ngood\\ngoose\\ngorilla\\ngospel\\ngossip\\ngovern\\ngown\\ngrab\\ngrace\\ngrain\\ngrant\\ngrape\\ngrass\\ngravity\\ngreat\\ngreen\\ngrid\\ngrief\\ngrit\\ngrocery\\ngroup\\ngrow\\ngrunt\\nguard\\nguess\\nguide\\nguilt\\nguitar\\ngun\\ngym\\nhabit\\nhair\\nhalf\\nhammer\\nhamster\\nhand\\nhappy\\nharbor\\nhard\\nharsh\\nharvest\\nhat\\nhave\\nhawk\\nhazard\\nhead\\nhealth\\nheart\\nheavy\\nhedgehog\\nheight\\nhello\\nhelmet\\nhelp\\nhen\\nhero\\nhidden\\nhigh\\nhill\\nhint\\nhip\\nhire\\nhistory\\nhobby\\nhockey\\nhold\\nhole\\nholiday\\nhollow\\nhome\\nhoney\\nhood\\nhope\\nhorn\\nhorror\\nhorse\\nhospital\\nhost\\nhotel\\nhour\\nhover\\nhub\\nhuge\\nhuman\\nhumble\\nhumor\\nhundred\\nhungry\\nhunt\\nhurdle\\nhurry\\nhurt\\nhusband\\nhybrid\\nice\\nicon\\nidea\\nidentify\\nidle\\nignore\\nill\\nillegal\\nillness\\nimage\\nimitate\\nimmense\\nimmune\\nimpact\\nimpose\\nimprove\\nimpulse\\ninch\\ninclude\\nincome\\nincrease\\nindex\\nindicate\\nindoor\\nindustry\\ninfant\\ninflict\\ninform\\ninhale\\ninherit\\ninitial\\ninject\\ninjury\\ninmate\\ninner\\ninnocent\\ninput\\ninquiry\\ninsane\\ninsect\\ninside\\ninspire\\ninstall\\nintact\\ninterest\\ninto\\ninvest\\ninvite\\ninvolve\\niron\\nisland\\nisolate\\nissue\\nitem\\nivory\\njacket\\njaguar\\njar\\njazz\\njealous\\njeans\\njelly\\njewel\\njob\\njoin\\njoke\\njourney\\njoy\\njudge\\njuice\\njump\\njungle\\njunior\\njunk\\njust\\nkangaroo\\nkeen\\nkeep\\nketchup\\nkey\\nkick\\nkid\\nkidney\\nkind\\nkingdom\\nkiss\\nkit\\nkitchen\\nkite\\nkitten\\nkiwi\\nknee\\nknife\\nknock\\nknow\\nlab\\nlabel\\nlabor\\nladder\\nlady\\nlake\\nlamp\\nlanguage\\nlaptop\\nlarge\\nlater\\nlatin\\nlaugh\\nlaundry\\nlava\\nlaw\\nlawn\\nlawsuit\\nlayer\\nlazy\\nleader\\nleaf\\nlearn\\nleave\\nlecture\\nleft\\nleg\\nlegal\\nlegend\\nleisure\\nlemon\\nlend\\nlength\\nlens\\nleopard\\nlesson\\nletter\\nlevel\\nliar\\nliberty\\nlibrary\\nlicense\\nlife\\nlift\\nlight\\nlike\\nlimb\\nlimit\\nlink\\nlion\\nliquid\\nlist\\nlittle\\nlive\\nlizard\\nload\\nloan\\nlobster\\nlocal\\nlock\\nlogic\\nlonely\\nlong\\nloop\\nlottery\\nloud\\nlounge\\nlove\\nloyal\\nlucky\\nluggage\\nlumber\\nlunar\\nlunch\\nluxury\\nlyrics\\nmachine\\nmad\\nmagic\\nmagnet\\nmaid\\nmail\\nmain\\nmajor\\nmake\\nmammal\\nman\\nmanage\\nmandate\\nmango\\nmansion\\nmanual\\nmaple\\nmarble\\nmarch\\nmargin\\nmarine\\nmarket\\nmarriage\\nmask\\nmass\\nmaster\\nmatch\\nmaterial\\nmath\\nmatrix\\nmatter\\nmaximum\\nmaze\\nmeadow\\nmean\\nmeasure\\nmeat\\nmechanic\\nmedal\\nmedia\\nmelody\\nmelt\\nmember\\nmemory\\nmention\\nmenu\\nmercy\\nmerge\\nmerit\\nmerry\\nmesh\\nmessage\\nmetal\\nmethod\\nmiddle\\nmidnight\\nmilk\\nmillion\\nmimic\\nmind\\nminimum\\nminor\\nminute\\nmiracle\\nmirror\\nmisery\\nmiss\\nmistake\\nmix\\nmixed\\nmixture\\nmobile\\nmodel\\nmodify\\nmom\\nmoment\\nmonitor\\nmonkey\\nmonster\\nmonth\\nmoon\\nmoral\\nmore\\nmorning\\nmosquito\\nmother\\nmotion\\nmotor\\nmountain\\nmouse\\nmove\\nmovie\\nmuch\\nmuffin\\nmule\\nmultiply\\nmuscle\\nmuseum\\nmushroom\\nmusic\\nmust\\nmutual\\nmyself\\nmystery\\nmyth\\nnaive\\nname\\nnapkin\\nnarrow\\nnasty\\nnation\\nnature\\nnear\\nneck\\nneed\\nnegative\\nneglect\\nneither\\nnephew\\nnerve\\nnest\\nnet\\nnetwork\\nneutral\\nnever\\nnews\\nnext\\nnice\\nnight\\nnoble\\nnoise\\nnominee\\nnoodle\\nnormal\\nnorth\\nnose\\nnotable\\nnote\\nnothing\\nnotice\\nnovel\\nnow\\nnuclear\\nnumber\\nnurse\\nnut\\noak\\nobey\\nobject\\noblige\\nobscure\\nobserve\\nobtain\\nobvious\\noccur\\nocean\\noctober\\nodor\\noff\\noffer\\noffice\\noften\\noil\\nokay\\nold\\nolive\\nolympic\\nomit\\nonce\\none\\nonion\\nonline\\nonly\\nopen\\nopera\\nopinion\\noppose\\noption\\norange\\norbit\\norchard\\norder\\nordinary\\norgan\\norient\\noriginal\\norphan\\nostrich\\nother\\noutdoor\\nouter\\noutput\\noutside\\noval\\noven\\nover\\nown\\nowner\\noxygen\\noyster\\nozone\\npact\\npaddle\\npage\\npair\\npalace\\npalm\\npanda\\npanel\\npanic\\npanther\\npaper\\nparade\\nparent\\npark\\nparrot\\nparty\\npass\\npatch\\npath\\npatient\\npatrol\\npattern\\npause\\npave\\npayment\\npeace\\npeanut\\npear\\npeasant\\npelican\\npen\\npenalty\\npencil\\npeople\\npepper\\nperfect\\npermit\\nperson\\npet\\nphone\\nphoto\\nphrase\\nphysical\\npiano\\npicnic\\npicture\\npiece\\npig\\npigeon\\npill\\npilot\\npink\\npioneer\\npipe\\npistol\\npitch\\npizza\\nplace\\nplanet\\nplastic\\nplate\\nplay\\nplease\\npledge\\npluck\\nplug\\nplunge\\npoem\\npoet\\npoint\\npolar\\npole\\npolice\\npond\\npony\\npool\\npopular\\nportion\\nposition\\npossible\\npost\\npotato\\npottery\\npoverty\\npowder\\npower\\npractice\\npraise\\npredict\\nprefer\\nprepare\\npresent\\npretty\\nprevent\\nprice\\npride\\nprimary\\nprint\\npriority\\nprison\\nprivate\\nprize\\nproblem\\nprocess\\nproduce\\nprofit\\nprogram\\nproject\\npromote\\nproof\\nproperty\\nprosper\\nprotect\\nproud\\nprovide\\npublic\\npudding\\npull\\npulp\\npulse\\npumpkin\\npunch\\npupil\\npuppy\\npurchase\\npurity\\npurpose\\npurse\\npush\\nput\\npuzzle\\npyramid\\nquality\\nquantum\\nquarter\\nquestion\\nquick\\nquit\\nquiz\\nquote\\nrabbit\\nraccoon\\nrace\\nrack\\nradar\\nradio\\nrail\\nrain\\nraise\\nrally\\nramp\\nranch\\nrandom\\nrange\\nrapid\\nrare\\nrate\\nrather\\nraven\\nraw\\nrazor\\nready\\nreal\\nreason\\nrebel\\nrebuild\\nrecall\\nreceive\\nrecipe\\nrecord\\nrecycle\\nreduce\\nreflect\\nreform\\nrefuse\\nregion\\nregret\\nregular\\nreject\\nrelax\\nrelease\\nrelief\\nrely\\nremain\\nremember\\nremind\\nremove\\nrender\\nrenew\\nrent\\nreopen\\nrepair\\nrepeat\\nreplace\\nreport\\nrequire\\nrescue\\nresemble\\nresist\\nresource\\nresponse\\nresult\\nretire\\nretreat\\nreturn\\nreunion\\nreveal\\nreview\\nreward\\nrhythm\\nrib\\nribbon\\nrice\\nrich\\nride\\nridge\\nrifle\\nright\\nrigid\\nring\\nriot\\nripple\\nrisk\\nritual\\nrival\\nriver\\nroad\\nroast\\nrobot\\nrobust\\nrocket\\nromance\\nroof\\nrookie\\nroom\\nrose\\nrotate\\nrough\\nround\\nroute\\nroyal\\nrubber\\nrude\\nrug\\nrule\\nrun\\nrunway\\nrural\\nsad\\nsaddle\\nsadness\\nsafe\\nsail\\nsalad\\nsalmon\\nsalon\\nsalt\\nsalute\\nsame\\nsample\\nsand\\nsatisfy\\nsatoshi\\nsauce\\nsausage\\nsave\\nsay\\nscale\\nscan\\nscare\\nscatter\\nscene\\nscheme\\nschool\\nscience\\nscissors\\nscorpion\\nscout\\nscrap\\nscreen\\nscript\\nscrub\\nsea\\nsearch\\nseason\\nseat\\nsecond\\nsecret\\nsection\\nsecurity\\nseed\\nseek\\nsegment\\nselect\\nsell\\nseminar\\nsenior\\nsense\\nsentence\\nseries\\nservice\\nsession\\nsettle\\nsetup\\nseven\\nshadow\\nshaft\\nshallow\\nshare\\nshed\\nshell\\nsheriff\\nshield\\nshift\\nshine\\nship\\nshiver\\nshock\\nshoe\\nshoot\\nshop\\nshort\\nshoulder\\nshove\\nshrimp\\nshrug\\nshuffle\\nshy\\nsibling\\nsick\\nside\\nsiege\\nsight\\nsign\\nsilent\\nsilk\\nsilly\\nsilver\\nsimilar\\nsimple\\nsince\\nsing\\nsiren\\nsister\\nsituate\\nsix\\nsize\\nskate\\nsketch\\nski\\nskill\\nskin\\nskirt\\nskull\\nslab\\nslam\\nsleep\\nslender\\nslice\\nslide\\nslight\\nslim\\nslogan\\nslot\\nslow\\nslush\\nsmall\\nsmart\\nsmile\\nsmoke\\nsmooth\\nsnack\\nsnake\\nsnap\\nsniff\\nsnow\\nsoap\\nsoccer\\nsocial\\nsock\\nsoda\\nsoft\\nsolar\\nsoldier\\nsolid\\nsolution\\nsolve\\nsomeone\\nsong\\nsoon\\nsorry\\nsort\\nsoul\\nsound\\nsoup\\nsource\\nsouth\\nspace\\nspare\\nspatial\\nspawn\\nspeak\\nspecial\\nspeed\\nspell\\nspend\\nsphere\\nspice\\nspider\\nspike\\nspin\\nspirit\\nsplit\\nspoil\\nsponsor\\nspoon\\nsport\\nspot\\nspray\\nspread\\nspring\\nspy\\nsquare\\nsqueeze\\nsquirrel\\nstable\\nstadium\\nstaff\\nstage\\nstairs\\nstamp\\nstand\\nstart\\nstate\\nstay\\nsteak\\nsteel\\nstem\\nstep\\nstereo\\nstick\\nstill\\nsting\\nstock\\nstomach\\nstone\\nstool\\nstory\\nstove\\nstrategy\\nstreet\\nstrike\\nstrong\\nstruggle\\nstudent\\nstuff\\nstumble\\nstyle\\nsubject\\nsubmit\\nsubway\\nsuccess\\nsuch\\nsudden\\nsuffer\\nsugar\\nsuggest\\nsuit\\nsummer\\nsun\\nsunny\\nsunset\\nsuper\\nsupply\\nsupreme\\nsure\\nsurface\\nsurge\\nsurprise\\nsurround\\nsurvey\\nsuspect\\nsustain\\nswallow\\nswamp\\nswap\\nswarm\\nswear\\nsweet\\nswift\\nswim\\nswing\\nswitch\\nsword\\nsymbol\\nsymptom\\nsyrup\\nsystem\\ntable\\ntackle\\ntag\\ntail\\ntalent\\ntalk\\ntank\\ntape\\ntarget\\ntask\\ntaste\\ntattoo\\ntaxi\\nteach\\nteam\\ntell\\nten\\ntenant\\ntennis\\ntent\\nterm\\ntest\\ntext\\nthank\\nthat\\ntheme\\nthen\\ntheory\\nthere\\nthey\\nthing\\nthis\\nthought\\nthree\\nthrive\\nthrow\\nthumb\\nthunder\\nticket\\ntide\\ntiger\\ntilt\\ntimber\\ntime\\ntiny\\ntip\\ntired\\ntissue\\ntitle\\ntoast\\ntobacco\\ntoday\\ntoddler\\ntoe\\ntogether\\ntoilet\\ntoken\\ntomato\\ntomorrow\\ntone\\ntongue\\ntonight\\ntool\\ntooth\\ntop\\ntopic\\ntopple\\ntorch\\ntornado\\ntortoise\\ntoss\\ntotal\\ntourist\\ntoward\\ntower\\ntown\\ntoy\\ntrack\\ntrade\\ntraffic\\ntragic\\ntrain\\ntransfer\\ntrap\\ntrash\\ntravel\\ntray\\ntreat\\ntree\\ntrend\\ntrial\\ntribe\\ntrick\\ntrigger\\ntrim\\ntrip\\ntrophy\\ntrouble\\ntruck\\ntrue\\ntruly\\ntrumpet\\ntrust\\ntruth\\ntry\\ntube\\ntuition\\ntumble\\ntuna\\ntunnel\\nturkey\\nturn\\nturtle\\ntwelve\\ntwenty\\ntwice\\ntwin\\ntwist\\ntwo\\ntype\\ntypical\\nugly\\numbrella\\nunable\\nunaware\\nuncle\\nuncover\\nunder\\nundo\\nunfair\\nunfold\\nunhappy\\nuniform\\nunique\\nunit\\nuniverse\\nunknown\\nunlock\\nuntil\\nunusual\\nunveil\\nupdate\\nupgrade\\nuphold\\nupon\\nupper\\nupset\\nurban\\nurge\\nusage\\nuse\\nused\\nuseful\\nuseless\\nusual\\nutility\\nvacant\\nvacuum\\nvague\\nvalid\\nvalley\\nvalve\\nvan\\nvanish\\nvapor\\nvarious\\nvast\\nvault\\nvehicle\\nvelvet\\nvendor\\nventure\\nvenue\\nverb\\nverify\\nversion\\nvery\\nvessel\\nveteran\\nviable\\nvibrant\\nvicious\\nvictory\\nvideo\\nview\\nvillage\\nvintage\\nviolin\\nvirtual\\nvirus\\nvisa\\nvisit\\nvisual\\nvital\\nvivid\\nvocal\\nvoice\\nvoid\\nvolcano\\nvolume\\nvote\\nvoyage\\nwage\\nwagon\\nwait\\nwalk\\nwall\\nwalnut\\nwant\\nwarfare\\nwarm\\nwarrior\\nwash\\nwasp\\nwaste\\nwater\\nwave\\nway\\nwealth\\nweapon\\nwear\\nweasel\\nweather\\nweb\\nwedding\\nweekend\\nweird\\nwelcome\\nwest\\nwet\\nwhale\\nwhat\\nwheat\\nwheel\\nwhen\\nwhere\\nwhip\\nwhisper\\nwide\\nwidth\\nwife\\nwild\\nwill\\nwin\\nwindow\\nwine\\nwing\\nwink\\nwinner\\nwinter\\nwire\\nwisdom\\nwise\\nwish\\nwitness\\nwolf\\nwoman\\nwonder\\nwood\\nwool\\nword\\nwork\\nworld\\nworry\\nworth\\nwrap\\nwreck\\nwrestle\\nwrist\\nwrite\\nwrong\\nyard\\nyear\\nyellow\\nyou\\nyoung\\nyouth\\nzebra\\nzero\\nzone\\nzoo\".split(\"\\n\")},9648(e,t){\"use strict\";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function r(e){if(\"boolean\"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function o(e,...t){if(!((n=e)instanceof Uint8Array||null!=n&&\"object\"==typeof n&&\"Uint8Array\"===n.constructor.name))throw new Error(\"Expected Uint8Array\");var n;if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if(\"function\"!=typeof e||\"function\"!=typeof e.create)throw new Error(\"Hash should be wrapped by utils.wrapConstructor\");n(e.outputLen),n(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function s(e,t){o(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}t.output=t.exists=t.hash=t.bytes=t.number=void 0,t.number=n,t.bytes=o,t.hash=i,t.exists=a,t.output=s;const c={number:n,bool:r,bytes:o,hash:i,exists:a,output:s};t.default=c},3134(e,t,n){\"use strict\";t.SHA2=void 0;const r=n(9648),o=n(3654);class i extends o.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,o.createView)(this.buffer)}update(e){(0,r.exists)(this);const{view:t,buffer:n,blockLen:i}=this,a=(e=(0,o.toBytes)(e)).length;for(let r=0;r<a;){const s=Math.min(i-this.pos,a-r);if(s===i){const t=(0,o.createView)(e);for(;i<=a-r;r+=i)this.process(t,r);continue}n.set(e.subarray(r,r+s),this.pos),this.pos+=s,r+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,r.exists)(this),(0,r.output)(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(e,t,n,r){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,i-8,BigInt(8*this.length),a),this.process(n,0);const c=(0,o.createView)(e),u=this.outputLen;if(u%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const l=u/4,f=this.get();if(l>f.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<l;e++)c.setUint32(4*e,f[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:i,pos:a}=this;return e.length=r,e.pos=a,e.finished=o,e.destroyed=i,r%t&&e.buffer.set(n),e}}t.SHA2=i},3109(e,t){\"use strict\";const n=BigInt(2**32-1),r=BigInt(32);function o(e,t=!1){return t?{h:Number(e&n),l:Number(e>>r&n)}:{h:0|Number(e>>r&n),l:0|Number(e&n)}}function i(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:a,l:s}=o(e[i],t);[n[i],r[i]]=[a,s]}return[n,r]}const a=(e,t)=>BigInt(e>>>0)<<r|BigInt(t>>>0);const s=(e,t,n)=>e>>>n;const c=(e,t,n)=>e<<32-n|t>>>n;const u=(e,t,n)=>e>>>n|t<<32-n;const l=(e,t,n)=>e<<32-n|t>>>n;const f=(e,t,n)=>e<<64-n|t>>>n-32;const p=(e,t,n)=>e>>>n-32|t<<64-n;const d=(e,t)=>t;const h=(e,t)=>e;const y=(e,t,n)=>e<<n|t>>>32-n;const g=(e,t,n)=>t<<n|e>>>32-n;const m=(e,t,n)=>t<<n-32|e>>>64-n;const v=(e,t,n)=>e<<n-32|t>>>64-n;function b(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}const w=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);const S=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;const A=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);const E=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0;const x=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0);const T=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0;const k={fromBig:o,split:i,toBig:a,shrSH:s,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:f,rotrBL:p,rotr32H:d,rotr32L:h,rotlSH:y,rotlSL:g,rotlBH:m,rotlBL:v,add:b,add3L:w,add3H:S,add4L:A,add4H:E,add5H:T,add5L:x};t.default=k},4610(e,t){\"use strict\";t.crypto=void 0,t.crypto=\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0},4832(e,t,n){\"use strict\";t.hmac=void 0;const r=n(9648),o=n(3654);class i extends o.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,r.hash)(e);const n=(0,o.toBytes)(t);if(this.iHash=e.create(),\"function\"!=typeof this.iHash.update)throw new Error(\"Expected instance of class which extends utils.Hash\");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return(0,r.exists)(this),this.iHash.update(e),this}digestInto(e){(0,r.exists)(this),(0,r.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:a}=this;return e.finished=r,e.destroyed=o,e.blockLen=i,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.hmac=(e,t,n)=>new i(e,t).update(n).digest(),t.hmac.create=(e,t)=>new i(e,t)},486(e,t,n){\"use strict\";t.pbkdf2Async=t.pbkdf2=void 0;const r=n(9648),o=n(4832),i=n(3654);function a(e,t,n,a){(0,r.hash)(e);const s=(0,i.checkOpts)({dkLen:32,asyncTick:10},a),{c,dkLen:u,asyncTick:l}=s;if((0,r.number)(c),(0,r.number)(u),(0,r.number)(l),c<1)throw new Error(\"PBKDF2: iterations (c) should be >= 1\");const f=(0,i.toBytes)(t),p=(0,i.toBytes)(n),d=new Uint8Array(u),h=o.hmac.create(e,f),y=h._cloneInto().update(p);return{c,dkLen:u,asyncTick:l,DK:d,PRF:h,PRFSalt:y}}function s(e,t,n,r,o){return e.destroy(),t.destroy(),r&&r.destroy(),o.fill(0),n}t.pbkdf2=function(e,t,n,r){const{c:o,dkLen:c,DK:u,PRF:l,PRFSalt:f}=a(e,t,n,r);let p;const d=new Uint8Array(4),h=(0,i.createView)(d),y=new Uint8Array(l.outputLen);for(let e=1,t=0;t<c;e++,t+=l.outputLen){const n=u.subarray(t,t+l.outputLen);h.setInt32(0,e,!1),(p=f._cloneInto(p)).update(d).digestInto(y),n.set(y.subarray(0,n.length));for(let e=1;e<o;e++){l._cloneInto(p).update(y).digestInto(y);for(let e=0;e<n.length;e++)n[e]^=y[e]}}return s(l,f,u,p,y)},t.pbkdf2Async=async function(e,t,n,r){const{c:o,dkLen:c,asyncTick:u,DK:l,PRF:f,PRFSalt:p}=a(e,t,n,r);let d;const h=new Uint8Array(4),y=(0,i.createView)(h),g=new Uint8Array(f.outputLen);for(let e=1,t=0;t<c;e++,t+=f.outputLen){const n=l.subarray(t,t+f.outputLen);y.setInt32(0,e,!1),(d=p._cloneInto(d)).update(h).digestInto(g),n.set(g.subarray(0,n.length)),await(0,i.asyncLoop)(o-1,u,()=>{f._cloneInto(d).update(g).digestInto(g);for(let e=0;e<n.length;e++)n[e]^=g[e]})}return s(f,p,l,d,g)}},7004(e,t,n){\"use strict\";t.sha256=void 0;const r=n(3134),o=n(3654),i=(e,t,n)=>e&t^~e&n,a=(e,t,n)=>e&t^e&n^t&n,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),c=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class l extends r.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)u[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],n=u[e-2],r=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(n,17)^(0,o.rotr)(n,19)^n>>>10;u[e]=i+u[e-7]+r+u[e-16]|0}let{A:n,B:r,C:c,D:l,E:f,F:p,G:d,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,o.rotr)(f,6)^(0,o.rotr)(f,11)^(0,o.rotr)(f,25))+i(f,p,d)+s[e]+u[e]|0,y=((0,o.rotr)(n,2)^(0,o.rotr)(n,13)^(0,o.rotr)(n,22))+a(n,r,c)|0;h=d,d=p,p=f,f=l+t|0,l=c,c=r,r=n,n=t+y|0}n=n+this.A|0,r=r+this.B|0,c=c+this.C|0,l=l+this.D|0,f=f+this.E|0,p=p+this.F|0,d=d+this.G|0,h=h+this.H|0,this.set(n,r,c,l,f,p,d,h)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class f extends l{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,o.wrapConstructor)(()=>new l),(0,o.wrapConstructor)(()=>new f)},2249(e,t,n){\"use strict\";t.sha512=void 0;const r=n(3134),o=n(3109),i=n(3654),[a,s]=o.default.split([\"0x428a2f98d728ae22\",\"0x7137449123ef65cd\",\"0xb5c0fbcfec4d3b2f\",\"0xe9b5dba58189dbbc\",\"0x3956c25bf348b538\",\"0x59f111f1b605d019\",\"0x923f82a4af194f9b\",\"0xab1c5ed5da6d8118\",\"0xd807aa98a3030242\",\"0x12835b0145706fbe\",\"0x243185be4ee4b28c\",\"0x550c7dc3d5ffb4e2\",\"0x72be5d74f27b896f\",\"0x80deb1fe3b1696b1\",\"0x9bdc06a725c71235\",\"0xc19bf174cf692694\",\"0xe49b69c19ef14ad2\",\"0xefbe4786384f25e3\",\"0x0fc19dc68b8cd5b5\",\"0x240ca1cc77ac9c65\",\"0x2de92c6f592b0275\",\"0x4a7484aa6ea6e483\",\"0x5cb0a9dcbd41fbd4\",\"0x76f988da831153b5\",\"0x983e5152ee66dfab\",\"0xa831c66d2db43210\",\"0xb00327c898fb213f\",\"0xbf597fc7beef0ee4\",\"0xc6e00bf33da88fc2\",\"0xd5a79147930aa725\",\"0x06ca6351e003826f\",\"0x142929670a0e6e70\",\"0x27b70a8546d22ffc\",\"0x2e1b21385c26c926\",\"0x4d2c6dfc5ac42aed\",\"0x53380d139d95b3df\",\"0x650a73548baf63de\",\"0x766a0abb3c77b2a8\",\"0x81c2c92e47edaee6\",\"0x92722c851482353b\",\"0xa2bfe8a14cf10364\",\"0xa81a664bbc423001\",\"0xc24b8b70d0f89791\",\"0xc76c51a30654be30\",\"0xd192e819d6ef5218\",\"0xd69906245565a910\",\"0xf40e35855771202a\",\"0x106aa07032bbd1b8\",\"0x19a4c116b8d2d0c8\",\"0x1e376c085141ab53\",\"0x2748774cdf8eeb99\",\"0x34b0bcb5e19b48a8\",\"0x391c0cb3c5c95a63\",\"0x4ed8aa4ae3418acb\",\"0x5b9cca4f7763e373\",\"0x682e6ff3d6b2b8a3\",\"0x748f82ee5defb2fc\",\"0x78a5636f43172f60\",\"0x84c87814a1f0ab72\",\"0x8cc702081a6439ec\",\"0x90befffa23631e28\",\"0xa4506cebde82bde9\",\"0xbef9a3f7b2c67915\",\"0xc67178f2e372532b\",\"0xca273eceea26619c\",\"0xd186b8c721c0c207\",\"0xeada7dd6cde0eb1e\",\"0xf57d4f7fee6ed178\",\"0x06f067aa72176fba\",\"0x0a637dc5a2c898a6\",\"0x113f9804bef90dae\",\"0x1b710b35131c471b\",\"0x28db77f523047d84\",\"0x32caab7b40c72493\",\"0x3c9ebe0a15c9bebc\",\"0x431d67c49c100d4c\",\"0x4cc5d4becb3e42b6\",\"0x597f299cfc657e2a\",\"0x5fcb6fab3ad6faec\",\"0x6c44198c4a475817\"].map(e=>BigInt(e))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends r.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:f,Gh:p,Gl:d,Hh:h,Hl:y}=this;return[e,t,n,r,o,i,a,s,c,u,l,f,p,d,h,y]}set(e,t,n,r,o,i,a,s,c,u,l,f,p,d,h,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|f,this.Gh=0|p,this.Gl=0|d,this.Hh=0|h,this.Hl=0|y}process(e,t){for(let n=0;n<16;n++,t+=4)c[n]=e.getUint32(t),u[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],n=0|u[e-15],r=o.default.rotrSH(t,n,1)^o.default.rotrSH(t,n,8)^o.default.shrSH(t,n,7),i=o.default.rotrSL(t,n,1)^o.default.rotrSL(t,n,8)^o.default.shrSL(t,n,7),a=0|c[e-2],s=0|u[e-2],l=o.default.rotrSH(a,s,19)^o.default.rotrBH(a,s,61)^o.default.shrSH(a,s,6),f=o.default.rotrSL(a,s,19)^o.default.rotrBL(a,s,61)^o.default.shrSL(a,s,6),p=o.default.add4L(i,f,u[e-7],u[e-16]),d=o.default.add4H(p,r,l,c[e-7],c[e-16]);c[e]=0|d,u[e]=0|p}let{Ah:n,Al:r,Bh:i,Bl:l,Ch:f,Cl:p,Dh:d,Dl:h,Eh:y,El:g,Fh:m,Fl:v,Gh:b,Gl:w,Hh:S,Hl:A}=this;for(let e=0;e<80;e++){const t=o.default.rotrSH(y,g,14)^o.default.rotrSH(y,g,18)^o.default.rotrBH(y,g,41),E=o.default.rotrSL(y,g,14)^o.default.rotrSL(y,g,18)^o.default.rotrBL(y,g,41),x=y&m^~y&b,T=g&v^~g&w,k=o.default.add5L(A,E,T,s[e],u[e]),O=o.default.add5H(k,S,t,x,a[e],c[e]),_=0|k,I=o.default.rotrSH(n,r,28)^o.default.rotrBH(n,r,34)^o.default.rotrBH(n,r,39),C=o.default.rotrSL(n,r,28)^o.default.rotrBL(n,r,34)^o.default.rotrBL(n,r,39),B=n&i^n&f^i&f,P=r&l^r&p^l&p;S=0|b,A=0|w,b=0|m,w=0|v,m=0|y,v=0|g,({h:y,l:g}=o.default.add(0|d,0|h,0|O,0|_)),d=0|f,h=0|p,f=0|i,p=0|l,i=0|n,l=0|r;const R=o.default.add3L(_,C,P);n=o.default.add3H(R,O,I,B),r=0|R}({h:n,l:r}=o.default.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l}=o.default.add(0|this.Bh,0|this.Bl,0|i,0|l)),({h:f,l:p}=o.default.add(0|this.Ch,0|this.Cl,0|f,0|p)),({h:d,l:h}=o.default.add(0|this.Dh,0|this.Dl,0|d,0|h)),({h:y,l:g}=o.default.add(0|this.Eh,0|this.El,0|y,0|g)),({h:m,l:v}=o.default.add(0|this.Fh,0|this.Fl,0|m,0|v)),({h:b,l:w}=o.default.add(0|this.Gh,0|this.Gl,0|b,0|w)),({h:S,l:A}=o.default.add(0|this.Hh,0|this.Hl,0|S,0|A)),this.set(n,r,i,l,f,p,d,h,y,g,m,v,b,w,S,A)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class f extends l{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class p extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class d extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,i.wrapConstructor)(()=>new l),(0,i.wrapConstructor)(()=>new f),(0,i.wrapConstructor)(()=>new p),(0,i.wrapConstructor)(()=>new d)},3654(e,t,n){\"use strict\";t.randomBytes=t.wrapConstructor=t.checkOpts=t.Hash=t.toBytes=t.asyncLoop=t.dY=t.qv=t.rotr=t.createView=void 0;const r=n(4610);function o(e){return e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name}t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.qv=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.qv)throw new Error(\"Non little-endian hardware is not supported\");const i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\"));const a=48,s=57,c=65,u=70,l=97,f=102;function p(e){return e>=a&&e<=s?e-a:e>=c&&e<=u?e-(c-10):e>=l&&e<=f?e-(l-10):void 0}function d(e){if(\"string\"!=typeof e)throw new Error(\"utf8ToBytes expected string, got \"+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function h(e){if(\"string\"==typeof e&&(e=d(e)),!o(e))throw new Error(\"expected Uint8Array, got \"+typeof e);return e}t.dY=async()=>{},t.asyncLoop=async function(e,n,r){let o=Date.now();for(let i=0;i<e;i++){r(i);const e=Date.now()-o;e>=0&&e<n||(await(0,t.dY)(),o+=e)}},t.toBytes=h;t.Hash=class{clone(){return this._cloneInto()}};const y={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&\"[object Object]\"!==y.call(t))throw new Error(\"Options should be object or undefined\");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(h(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},t.randomBytes=function(e=32){if(r.crypto&&\"function\"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));throw new Error(\"crypto.getRandomValues must be defined\")}},9450(e,t){\"use strict\";function n(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function r(e){return e instanceof Uint8Array||null!=e&&\"object\"==typeof e&&\"Uint8Array\"===e.constructor.name}function o(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function i(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&\"number\"!=typeof t[0])throw new Error(\"alphabet.encode input should be an array of numbers\");return t.map(t=>{if(n(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})},decode:t=>{if(!Array.isArray(t)||t.length&&\"string\"!=typeof t[0])throw new Error(\"alphabet.decode input should be array of strings\");return t.map(t=>{if(\"string\"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return n})}}}function a(e=\"\"){if(\"string\"!=typeof e)throw new Error(\"join separator should be string\");return{encode:t=>{if(!Array.isArray(t)||t.length&&\"string\"!=typeof t[0])throw new Error(\"join.encode input should be array of strings\");for(let e of t)if(\"string\"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if(\"string\"!=typeof t)throw new Error(\"join.decode input should be string\");return t.split(e)}}}function s(e,t=\"=\"){if(n(e),\"string\"!=typeof t)throw new Error(\"padding chr should be string\");return{encode(n){if(!Array.isArray(n)||n.length&&\"string\"!=typeof n[0])throw new Error(\"padding.encode input should be array of strings\");for(let e of n)if(\"string\"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&\"string\"!=typeof n[0])throw new Error(\"padding.encode input should be array of strings\");for(let e of n)if(\"string\"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let r=n.length;if(r*e%8)throw new Error(\"Invalid padding: string should have whole number of bytes\");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error(\"Invalid padding: string has too much padding\");return n.slice(0,r)}}}function c(e){if(\"function\"!=typeof e)throw new Error(\"normalize fn should be function\");return{encode:e=>e,decode:t=>e(t)}}function u(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error(\"convertRadix: data should be array\");if(!e.length)return[];let o=0;const i=[],a=Array.from(e);for(a.forEach(e=>{if(n(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)});;){let e=0,n=!0;for(let i=o;i<a.length;i++){const s=a[i],c=t*e+s;if(!Number.isSafeInteger(c)||t*e/t!==e||c-s!==t*e)throw new Error(\"convertRadix: carry overflow\");e=c%r;const u=Math.floor(c/r);if(a[i]=u,!Number.isSafeInteger(u)||u*r+e!==c)throw new Error(\"convertRadix: carry overflow\");n&&(u?n=!1:o=i)}if(i.push(e),n)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}t.Af=t.Ar=t.uh=t.As=t.rg=t.ic=t.tw=t.r0=t.K3=t.RG=t.xn=t.utils=void 0;const l=(e,t)=>t?l(t,e%t):e,f=(e,t)=>e+(t-l(e,t));function p(e,t,r,o){if(!Array.isArray(e))throw new Error(\"convertRadix2: data should be array\");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(f(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${f(t,r)}`);let i=0,a=0;const s=2**r-1,c=[];for(const o of e){if(n(o),o>=2**t)throw new Error(`convertRadix2: invalid data word=${o} from=${t}`);if(i=i<<t|o,a+t>32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=r;a-=r)c.push((i>>a-r&s)>>>0);i&=2**a-1}if(i=i<<r-a&s,!o&&a>=t)throw new Error(\"Excess padding\");if(!o&&i)throw new Error(`Non-zero padding: ${i}`);return o&&a>0&&c.push(i>>>0),c}function d(e){return n(e),{encode:t=>{if(!r(t))throw new Error(\"radix.encode input should be Uint8Array\");return u(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&\"number\"!=typeof t[0])throw new Error(\"radix.decode input should be array of numbers\");return Uint8Array.from(u(t,e,256))}}}function h(e,t=!1){if(n(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if(f(8,e)>32||f(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:n=>{if(!r(n))throw new Error(\"radix2.encode input should be Uint8Array\");return p(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&\"number\"!=typeof n[0])throw new Error(\"radix2.decode input should be array of numbers\");return Uint8Array.from(p(n,e,8,t))}}}function y(e){if(\"function\"!=typeof e)throw new Error(\"unsafeWrapper fn should be function\");return function(...t){try{return e.apply(null,t)}catch(e){}}}function g(e,t){if(n(e),\"function\"!=typeof t)throw new Error(\"checksum fn should be function\");return{encode(n){if(!r(n))throw new Error(\"checksum.encode: input should be Uint8Array\");const o=t(n).slice(0,e),i=new Uint8Array(n.length+e);return i.set(n),i.set(o,n.length),i},decode(n){if(!r(n))throw new Error(\"checksum.decode: input should be Uint8Array\");const o=n.slice(0,-e),i=t(o).slice(0,e),a=n.slice(-e);for(let t=0;t<e;t++)if(i[t]!==a[t])throw new Error(\"Invalid checksum\");return o}}}t.utils={alphabet:i,chain:o,checksum:g,convertRadix:u,convertRadix2:p,radix:d,radix2:h,join:a,padding:s},t.xn=o(h(4),i(\"0123456789ABCDEF\"),a(\"\")),t.RG=o(h(5),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),s(5),a(\"\")),o(h(5),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),a(\"\")),o(h(5),i(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),s(5),a(\"\")),o(h(5),i(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),a(\"\")),o(h(5),i(\"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"),a(\"\"),c(e=>e.toUpperCase().replace(/O/g,\"0\").replace(/[IL]/g,\"1\"))),t.K3=o(h(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),s(6),a(\"\")),o(h(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),a(\"\")),t.r0=o(h(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),s(6),a(\"\")),o(h(6),i(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),a(\"\"));const m=e=>o(d(58),i(e),a(\"\"));t.tw=m(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"),m(\"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\"),m(\"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz\");const v=[0,2,3,5,6,7,9,10,11];t.ic={encode(e){let n=\"\";for(let r=0;r<e.length;r+=8){const o=e.subarray(r,r+8);n+=t.tw.encode(o).padStart(v[o.length],\"1\")}return n},decode(e){let n=[];for(let r=0;r<e.length;r+=11){const o=e.slice(r,r+11),i=v.indexOf(o.length),a=t.tw.decode(o);for(let e=0;e<a.length-i;e++)if(0!==a[e])throw new Error(\"base58xmr: wrong padding\");n=n.concat(Array.from(a.slice(a.length-i)))}return Uint8Array.from(n)}};t.rg=e=>o(g(4,t=>e(e(t))),t.tw),t.rg;const b=o(i(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),a(\"\")),w=[996825010,642813549,513874426,1027748829,705979059];function S(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<w.length;e++)1==(t>>e&1)&&(n^=w[e]);return n}function A(e,t,n=1){const r=e.length;let o=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);o=S(o)^n>>5}o=S(o);for(let t=0;t<r;t++)o=S(o)^31&e.charCodeAt(t);for(let e of t)o=S(o)^e;for(let e=0;e<6;e++)o=S(o);return o^=n,b.encode(p([o%2**30],30,5,!1))}function E(e){const t=\"bech32\"===e?1:734539939,n=h(5),r=n.decode,o=n.encode,i=y(r);function a(e,n,r=90){if(\"string\"!=typeof e)throw new Error(\"bech32.encode prefix should be string, not \"+typeof e);if(n instanceof Uint8Array&&(n=Array.from(n)),!Array.isArray(n)||n.length&&\"number\"!=typeof n[0])throw new Error(\"bech32.encode words should be array of numbers, not \"+typeof n);if(0===e.length)throw new TypeError(`Invalid prefix length ${e.length}`);const o=e.length+7+n.length;if(!1!==r&&o>r)throw new TypeError(`Length ${o} exceeds limit ${r}`);const i=e.toLowerCase(),a=A(i,n,t);return`${i}1${b.encode(n)}${a}`}function s(e,n=90){if(\"string\"!=typeof e)throw new Error(\"bech32.decode input should be string, not \"+typeof e);if(e.length<8||!1!==n&&e.length>n)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${n})`);const r=e.toLowerCase();if(e!==r&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const o=r.lastIndexOf(\"1\");if(0===o||-1===o)throw new Error('Letter \"1\" must be present between prefix and data only');const i=r.slice(0,o),a=r.slice(o+1);if(a.length<6)throw new Error(\"Data must be at least 6 characters long\");const s=b.decode(a).slice(0,-6),c=A(i,s,t);if(!a.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected \"${c}\"`);return{prefix:i,words:s}}return{encode:a,decode:s,encodeFromBytes:function(e,t){return a(e,o(t))},decodeToBytes:function(e){const{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}},decodeUnsafe:y(s),fromWords:r,fromWordsUnsafe:i,toWords:o}}E(\"bech32\"),E(\"bech32m\"),t.As={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.uh=o(h(4),i(\"0123456789abcdef\"),a(\"\"),c(e=>{if(\"string\"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const x={utf8:t.As,hex:t.uh,base16:t.xn,base32:t.RG,base64:t.K3,base64url:t.r0,base58:t.tw,base58xmr:t.ic},T=\"Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr\";t.Ar=(e,t)=>{if(\"string\"!=typeof e||!x.hasOwnProperty(e))throw new TypeError(T);if(!r(t))throw new TypeError(\"bytesToString() expects Uint8Array\");return x[e].encode(t)},t.Ar;t.Af=(e,t)=>{if(!x.hasOwnProperty(e))throw new TypeError(T);if(\"string\"!=typeof t)throw new TypeError(\"stringToBytes() expects string\");return x[e].decode(t)},t.Af},5263(e){var t;self,t=()=>(()=>{var e={8950(e){var t;self,t=()=>(()=>{var e={41(e,t,n){\"use strict\";var r=n(655),o=n(8068),i=n(9675),a=n(5795);e.exports=function(e,t,n){if(!e||\"object\"!=typeof e&&\"function\"!=typeof e)throw new i(\"`obj` must be an object or a function`\");if(\"string\"!=typeof t&&\"symbol\"!=typeof t)throw new i(\"`property` must be a string or a symbol`\");if(arguments.length>3&&\"boolean\"!=typeof arguments[3]&&null!==arguments[3])throw new i(\"`nonEnumerable`, if provided, must be a boolean or null\");if(arguments.length>4&&\"boolean\"!=typeof arguments[4]&&null!==arguments[4])throw new i(\"`nonWritable`, if provided, must be a boolean or null\");if(arguments.length>5&&\"boolean\"!=typeof arguments[5]&&null!==arguments[5])throw new i(\"`nonConfigurable`, if provided, must be a boolean or null\");if(arguments.length>6&&\"boolean\"!=typeof arguments[6])throw new i(\"`loose`, if provided, must be a boolean\");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!a&&a(e,t);if(r)r(e,t,{configurable:null===u&&f?f.configurable:!u,enumerable:null===s&&f?f.enumerable:!s,value:n,writable:null===c&&f?f.writable:!c});else{if(!l&&(s||c||u))throw new o(\"This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.\");e[t]=n}}},76(e){\"use strict\";e.exports=Function.prototype.call},251(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<<s)-1,u=c>>1,l=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=u}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<<u)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+d]=255&a,d+=h,a/=256,u-=8);e[n+d-h]|=128*y}},392(e,t,n){\"use strict\";var r=n(2861).Buffer,o=n(5377);function i(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){e=o(e,t||\"utf8\");for(var n=this._block,r=this._blockSize,i=e.length,a=this._len,s=0;s<i;){for(var c=a%r,u=Math.min(i-s,r-c),l=0;l<u;l++)n[c+l]=e[s+l];s+=u,(a+=u)%r===0&&this._update(n)}return this._len+=i,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},i.prototype._update=function(){throw new Error(\"_update must be implemented by subclass\")},e.exports=i},414(e){\"use strict\";e.exports=Math.round},448(e,t,n){\"use strict\";n.r(t),n.d(t,{Account:()=>Vr,Address:()=>nr,Asset:()=>Gt,AuthClawbackEnabledFlag:()=>fr,AuthImmutableFlag:()=>lr,AuthRequiredFlag:()=>cr,AuthRevocableFlag:()=>ur,BASE_FEE:()=>ai,Claimant:()=>Fn,Contract:()=>no,FeeBumpTransaction:()=>Mr,Hyper:()=>r.Hyper,Int128:()=>xo,Int256:()=>Bo,Keypair:()=>Vt,LiquidityPoolAsset:()=>Pn,LiquidityPoolFeeV18:()=>Zt,LiquidityPoolId:()=>Dn,Memo:()=>Er,MemoHash:()=>Sr,MemoID:()=>br,MemoNone:()=>vr,MemoReturn:()=>Ar,MemoText:()=>wr,MuxedAccount:()=>$r,Networks:()=>li,Operation:()=>pr,ScInt:()=>Vo,SignerKey:()=>Qr,Soroban:()=>hi,SorobanDataBuilder:()=>Zr,StrKey:()=>Rt,TimeoutInfinite:()=>si,Transaction:()=>Br,TransactionBase:()=>tn,TransactionBuilder:()=>ci,Uint128:()=>uo,Uint256:()=>mo,UnsignedHyper:()=>r.UnsignedHyper,XdrLargeInt:()=>Fo,authorizeEntry:()=>Ti,authorizeInvocation:()=>Oi,buildInvocationTree:()=>Bi,cereal:()=>a,decodeAddressToMuxedAccount:()=>Vn,default:()=>ji,encodeMuxedAccount:()=>Kn,encodeMuxedAccountToAddress:()=>zn,extractBaseAddress:()=>Hn,getLiquidityPoolId:()=>Yt,hash:()=>c,humanizeEvents:()=>bi,nativeToScVal:()=>Zo,scValToBigInt:()=>zo,scValToNative:()=>Yo,sign:()=>St,verify:()=>At,walkInvocationTree:()=>Pi,xdr:()=>i});var r=n(3740),o=r.config(function(e){var t=1024;e.typedef(\"Value\",e.varOpaque()),e.struct(\"ScpBallot\",[[\"counter\",e.lookup(\"Uint32\")],[\"value\",e.lookup(\"Value\")]]),e.enum(\"ScpStatementType\",{scpStPrepare:0,scpStConfirm:1,scpStExternalize:2,scpStNominate:3}),e.struct(\"ScpNomination\",[[\"quorumSetHash\",e.lookup(\"Hash\")],[\"votes\",e.varArray(e.lookup(\"Value\"),2147483647)],[\"accepted\",e.varArray(e.lookup(\"Value\"),2147483647)]]),e.struct(\"ScpStatementPrepare\",[[\"quorumSetHash\",e.lookup(\"Hash\")],[\"ballot\",e.lookup(\"ScpBallot\")],[\"prepared\",e.option(e.lookup(\"ScpBallot\"))],[\"preparedPrime\",e.option(e.lookup(\"ScpBallot\"))],[\"nC\",e.lookup(\"Uint32\")],[\"nH\",e.lookup(\"Uint32\")]]),e.struct(\"ScpStatementConfirm\",[[\"ballot\",e.lookup(\"ScpBallot\")],[\"nPrepared\",e.lookup(\"Uint32\")],[\"nCommit\",e.lookup(\"Uint32\")],[\"nH\",e.lookup(\"Uint32\")],[\"quorumSetHash\",e.lookup(\"Hash\")]]),e.struct(\"ScpStatementExternalize\",[[\"commit\",e.lookup(\"ScpBallot\")],[\"nH\",e.lookup(\"Uint32\")],[\"commitQuorumSetHash\",e.lookup(\"Hash\")]]),e.union(\"ScpStatementPledges\",{switchOn:e.lookup(\"ScpStatementType\"),switchName:\"type\",switches:[[\"scpStPrepare\",\"prepare\"],[\"scpStConfirm\",\"confirm\"],[\"scpStExternalize\",\"externalize\"],[\"scpStNominate\",\"nominate\"]],arms:{prepare:e.lookup(\"ScpStatementPrepare\"),confirm:e.lookup(\"ScpStatementConfirm\"),externalize:e.lookup(\"ScpStatementExternalize\"),nominate:e.lookup(\"ScpNomination\")}}),e.struct(\"ScpStatement\",[[\"nodeId\",e.lookup(\"NodeId\")],[\"slotIndex\",e.lookup(\"Uint64\")],[\"pledges\",e.lookup(\"ScpStatementPledges\")]]),e.struct(\"ScpEnvelope\",[[\"statement\",e.lookup(\"ScpStatement\")],[\"signature\",e.lookup(\"Signature\")]]),e.struct(\"ScpQuorumSet\",[[\"threshold\",e.lookup(\"Uint32\")],[\"validators\",e.varArray(e.lookup(\"NodeId\"),2147483647)],[\"innerSets\",e.varArray(e.lookup(\"ScpQuorumSet\"),2147483647)]]),e.typedef(\"Thresholds\",e.opaque(4)),e.typedef(\"String32\",e.string(32)),e.typedef(\"String64\",e.string(64)),e.typedef(\"SequenceNumber\",e.lookup(\"Int64\")),e.typedef(\"DataValue\",e.varOpaque(64)),e.typedef(\"AssetCode4\",e.opaque(4)),e.typedef(\"AssetCode12\",e.opaque(12)),e.enum(\"AssetType\",{assetTypeNative:0,assetTypeCreditAlphanum4:1,assetTypeCreditAlphanum12:2,assetTypePoolShare:3}),e.union(\"AssetCode\",{switchOn:e.lookup(\"AssetType\"),switchName:\"type\",switches:[[\"assetTypeCreditAlphanum4\",\"assetCode4\"],[\"assetTypeCreditAlphanum12\",\"assetCode12\"]],arms:{assetCode4:e.lookup(\"AssetCode4\"),assetCode12:e.lookup(\"AssetCode12\")}}),e.struct(\"AlphaNum4\",[[\"assetCode\",e.lookup(\"AssetCode4\")],[\"issuer\",e.lookup(\"AccountId\")]]),e.struct(\"AlphaNum12\",[[\"assetCode\",e.lookup(\"AssetCode12\")],[\"issuer\",e.lookup(\"AccountId\")]]),e.union(\"Asset\",{switchOn:e.lookup(\"AssetType\"),switchName:\"type\",switches:[[\"assetTypeNative\",e.void()],[\"assetTypeCreditAlphanum4\",\"alphaNum4\"],[\"assetTypeCreditAlphanum12\",\"alphaNum12\"]],arms:{alphaNum4:e.lookup(\"AlphaNum4\"),alphaNum12:e.lookup(\"AlphaNum12\")}}),e.struct(\"Price\",[[\"n\",e.lookup(\"Int32\")],[\"d\",e.lookup(\"Int32\")]]),e.struct(\"Liabilities\",[[\"buying\",e.lookup(\"Int64\")],[\"selling\",e.lookup(\"Int64\")]]),e.enum(\"ThresholdIndices\",{thresholdMasterWeight:0,thresholdLow:1,thresholdMed:2,thresholdHigh:3}),e.enum(\"LedgerEntryType\",{account:0,trustline:1,offer:2,data:3,claimableBalance:4,liquidityPool:5,contractData:6,contractCode:7,configSetting:8,ttl:9}),e.struct(\"Signer\",[[\"key\",e.lookup(\"SignerKey\")],[\"weight\",e.lookup(\"Uint32\")]]),e.enum(\"AccountFlags\",{authRequiredFlag:1,authRevocableFlag:2,authImmutableFlag:4,authClawbackEnabledFlag:8}),e.const(\"MASK_ACCOUNT_FLAGS\",7),e.const(\"MASK_ACCOUNT_FLAGS_V17\",15),e.const(\"MAX_SIGNERS\",20),e.typedef(\"SponsorshipDescriptor\",e.option(e.lookup(\"AccountId\"))),e.struct(\"AccountEntryExtensionV3\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"seqLedger\",e.lookup(\"Uint32\")],[\"seqTime\",e.lookup(\"TimePoint\")]]),e.union(\"AccountEntryExtensionV2Ext\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[3,\"v3\"]],arms:{v3:e.lookup(\"AccountEntryExtensionV3\")}}),e.struct(\"AccountEntryExtensionV2\",[[\"numSponsored\",e.lookup(\"Uint32\")],[\"numSponsoring\",e.lookup(\"Uint32\")],[\"signerSponsoringIDs\",e.varArray(e.lookup(\"SponsorshipDescriptor\"),e.lookup(\"MAX_SIGNERS\"))],[\"ext\",e.lookup(\"AccountEntryExtensionV2Ext\")]]),e.union(\"AccountEntryExtensionV1Ext\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[2,\"v2\"]],arms:{v2:e.lookup(\"AccountEntryExtensionV2\")}}),e.struct(\"AccountEntryExtensionV1\",[[\"liabilities\",e.lookup(\"Liabilities\")],[\"ext\",e.lookup(\"AccountEntryExtensionV1Ext\")]]),e.union(\"AccountEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"v1\"]],arms:{v1:e.lookup(\"AccountEntryExtensionV1\")}}),e.struct(\"AccountEntry\",[[\"accountId\",e.lookup(\"AccountId\")],[\"balance\",e.lookup(\"Int64\")],[\"seqNum\",e.lookup(\"SequenceNumber\")],[\"numSubEntries\",e.lookup(\"Uint32\")],[\"inflationDest\",e.option(e.lookup(\"AccountId\"))],[\"flags\",e.lookup(\"Uint32\")],[\"homeDomain\",e.lookup(\"String32\")],[\"thresholds\",e.lookup(\"Thresholds\")],[\"signers\",e.varArray(e.lookup(\"Signer\"),e.lookup(\"MAX_SIGNERS\"))],[\"ext\",e.lookup(\"AccountEntryExt\")]]),e.enum(\"TrustLineFlags\",{authorizedFlag:1,authorizedToMaintainLiabilitiesFlag:2,trustlineClawbackEnabledFlag:4}),e.const(\"MASK_TRUSTLINE_FLAGS\",1),e.const(\"MASK_TRUSTLINE_FLAGS_V13\",3),e.const(\"MASK_TRUSTLINE_FLAGS_V17\",7),e.enum(\"LiquidityPoolType\",{liquidityPoolConstantProduct:0}),e.union(\"TrustLineAsset\",{switchOn:e.lookup(\"AssetType\"),switchName:\"type\",switches:[[\"assetTypeNative\",e.void()],[\"assetTypeCreditAlphanum4\",\"alphaNum4\"],[\"assetTypeCreditAlphanum12\",\"alphaNum12\"],[\"assetTypePoolShare\",\"liquidityPoolId\"]],arms:{alphaNum4:e.lookup(\"AlphaNum4\"),alphaNum12:e.lookup(\"AlphaNum12\"),liquidityPoolId:e.lookup(\"PoolId\")}}),e.union(\"TrustLineEntryExtensionV2Ext\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"TrustLineEntryExtensionV2\",[[\"liquidityPoolUseCount\",e.lookup(\"Int32\")],[\"ext\",e.lookup(\"TrustLineEntryExtensionV2Ext\")]]),e.union(\"TrustLineEntryV1Ext\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[2,\"v2\"]],arms:{v2:e.lookup(\"TrustLineEntryExtensionV2\")}}),e.struct(\"TrustLineEntryV1\",[[\"liabilities\",e.lookup(\"Liabilities\")],[\"ext\",e.lookup(\"TrustLineEntryV1Ext\")]]),e.union(\"TrustLineEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"v1\"]],arms:{v1:e.lookup(\"TrustLineEntryV1\")}}),e.struct(\"TrustLineEntry\",[[\"accountId\",e.lookup(\"AccountId\")],[\"asset\",e.lookup(\"TrustLineAsset\")],[\"balance\",e.lookup(\"Int64\")],[\"limit\",e.lookup(\"Int64\")],[\"flags\",e.lookup(\"Uint32\")],[\"ext\",e.lookup(\"TrustLineEntryExt\")]]),e.enum(\"OfferEntryFlags\",{passiveFlag:1}),e.const(\"MASK_OFFERENTRY_FLAGS\",1),e.union(\"OfferEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"OfferEntry\",[[\"sellerId\",e.lookup(\"AccountId\")],[\"offerId\",e.lookup(\"Int64\")],[\"selling\",e.lookup(\"Asset\")],[\"buying\",e.lookup(\"Asset\")],[\"amount\",e.lookup(\"Int64\")],[\"price\",e.lookup(\"Price\")],[\"flags\",e.lookup(\"Uint32\")],[\"ext\",e.lookup(\"OfferEntryExt\")]]),e.union(\"DataEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"DataEntry\",[[\"accountId\",e.lookup(\"AccountId\")],[\"dataName\",e.lookup(\"String64\")],[\"dataValue\",e.lookup(\"DataValue\")],[\"ext\",e.lookup(\"DataEntryExt\")]]),e.enum(\"ClaimPredicateType\",{claimPredicateUnconditional:0,claimPredicateAnd:1,claimPredicateOr:2,claimPredicateNot:3,claimPredicateBeforeAbsoluteTime:4,claimPredicateBeforeRelativeTime:5}),e.union(\"ClaimPredicate\",{switchOn:e.lookup(\"ClaimPredicateType\"),switchName:\"type\",switches:[[\"claimPredicateUnconditional\",e.void()],[\"claimPredicateAnd\",\"andPredicates\"],[\"claimPredicateOr\",\"orPredicates\"],[\"claimPredicateNot\",\"notPredicate\"],[\"claimPredicateBeforeAbsoluteTime\",\"absBefore\"],[\"claimPredicateBeforeRelativeTime\",\"relBefore\"]],arms:{andPredicates:e.varArray(e.lookup(\"ClaimPredicate\"),2),orPredicates:e.varArray(e.lookup(\"ClaimPredicate\"),2),notPredicate:e.option(e.lookup(\"ClaimPredicate\")),absBefore:e.lookup(\"Int64\"),relBefore:e.lookup(\"Int64\")}}),e.enum(\"ClaimantType\",{claimantTypeV0:0}),e.struct(\"ClaimantV0\",[[\"destination\",e.lookup(\"AccountId\")],[\"predicate\",e.lookup(\"ClaimPredicate\")]]),e.union(\"Claimant\",{switchOn:e.lookup(\"ClaimantType\"),switchName:\"type\",switches:[[\"claimantTypeV0\",\"v0\"]],arms:{v0:e.lookup(\"ClaimantV0\")}}),e.enum(\"ClaimableBalanceFlags\",{claimableBalanceClawbackEnabledFlag:1}),e.const(\"MASK_CLAIMABLE_BALANCE_FLAGS\",1),e.union(\"ClaimableBalanceEntryExtensionV1Ext\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"ClaimableBalanceEntryExtensionV1\",[[\"ext\",e.lookup(\"ClaimableBalanceEntryExtensionV1Ext\")],[\"flags\",e.lookup(\"Uint32\")]]),e.union(\"ClaimableBalanceEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"v1\"]],arms:{v1:e.lookup(\"ClaimableBalanceEntryExtensionV1\")}}),e.struct(\"ClaimableBalanceEntry\",[[\"balanceId\",e.lookup(\"ClaimableBalanceId\")],[\"claimants\",e.varArray(e.lookup(\"Claimant\"),10)],[\"asset\",e.lookup(\"Asset\")],[\"amount\",e.lookup(\"Int64\")],[\"ext\",e.lookup(\"ClaimableBalanceEntryExt\")]]),e.struct(\"LiquidityPoolConstantProductParameters\",[[\"assetA\",e.lookup(\"Asset\")],[\"assetB\",e.lookup(\"Asset\")],[\"fee\",e.lookup(\"Int32\")]]),e.struct(\"LiquidityPoolEntryConstantProduct\",[[\"params\",e.lookup(\"LiquidityPoolConstantProductParameters\")],[\"reserveA\",e.lookup(\"Int64\")],[\"reserveB\",e.lookup(\"Int64\")],[\"totalPoolShares\",e.lookup(\"Int64\")],[\"poolSharesTrustLineCount\",e.lookup(\"Int64\")]]),e.union(\"LiquidityPoolEntryBody\",{switchOn:e.lookup(\"LiquidityPoolType\"),switchName:\"type\",switches:[[\"liquidityPoolConstantProduct\",\"constantProduct\"]],arms:{constantProduct:e.lookup(\"LiquidityPoolEntryConstantProduct\")}}),e.struct(\"LiquidityPoolEntry\",[[\"liquidityPoolId\",e.lookup(\"PoolId\")],[\"body\",e.lookup(\"LiquidityPoolEntryBody\")]]),e.enum(\"ContractDataDurability\",{temporary:0,persistent:1}),e.struct(\"ContractDataEntry\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"contract\",e.lookup(\"ScAddress\")],[\"key\",e.lookup(\"ScVal\")],[\"durability\",e.lookup(\"ContractDataDurability\")],[\"val\",e.lookup(\"ScVal\")]]),e.struct(\"ContractCodeCostInputs\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"nInstructions\",e.lookup(\"Uint32\")],[\"nFunctions\",e.lookup(\"Uint32\")],[\"nGlobals\",e.lookup(\"Uint32\")],[\"nTableEntries\",e.lookup(\"Uint32\")],[\"nTypes\",e.lookup(\"Uint32\")],[\"nDataSegments\",e.lookup(\"Uint32\")],[\"nElemSegments\",e.lookup(\"Uint32\")],[\"nImports\",e.lookup(\"Uint32\")],[\"nExports\",e.lookup(\"Uint32\")],[\"nDataSegmentBytes\",e.lookup(\"Uint32\")]]),e.struct(\"ContractCodeEntryV1\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"costInputs\",e.lookup(\"ContractCodeCostInputs\")]]),e.union(\"ContractCodeEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"v1\"]],arms:{v1:e.lookup(\"ContractCodeEntryV1\")}}),e.struct(\"ContractCodeEntry\",[[\"ext\",e.lookup(\"ContractCodeEntryExt\")],[\"hash\",e.lookup(\"Hash\")],[\"code\",e.varOpaque()]]),e.struct(\"TtlEntry\",[[\"keyHash\",e.lookup(\"Hash\")],[\"liveUntilLedgerSeq\",e.lookup(\"Uint32\")]]),e.union(\"LedgerEntryExtensionV1Ext\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"LedgerEntryExtensionV1\",[[\"sponsoringId\",e.lookup(\"SponsorshipDescriptor\")],[\"ext\",e.lookup(\"LedgerEntryExtensionV1Ext\")]]),e.union(\"LedgerEntryData\",{switchOn:e.lookup(\"LedgerEntryType\"),switchName:\"type\",switches:[[\"account\",\"account\"],[\"trustline\",\"trustLine\"],[\"offer\",\"offer\"],[\"data\",\"data\"],[\"claimableBalance\",\"claimableBalance\"],[\"liquidityPool\",\"liquidityPool\"],[\"contractData\",\"contractData\"],[\"contractCode\",\"contractCode\"],[\"configSetting\",\"configSetting\"],[\"ttl\",\"ttl\"]],arms:{account:e.lookup(\"AccountEntry\"),trustLine:e.lookup(\"TrustLineEntry\"),offer:e.lookup(\"OfferEntry\"),data:e.lookup(\"DataEntry\"),claimableBalance:e.lookup(\"ClaimableBalanceEntry\"),liquidityPool:e.lookup(\"LiquidityPoolEntry\"),contractData:e.lookup(\"ContractDataEntry\"),contractCode:e.lookup(\"ContractCodeEntry\"),configSetting:e.lookup(\"ConfigSettingEntry\"),ttl:e.lookup(\"TtlEntry\")}}),e.union(\"LedgerEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"v1\"]],arms:{v1:e.lookup(\"LedgerEntryExtensionV1\")}}),e.struct(\"LedgerEntry\",[[\"lastModifiedLedgerSeq\",e.lookup(\"Uint32\")],[\"data\",e.lookup(\"LedgerEntryData\")],[\"ext\",e.lookup(\"LedgerEntryExt\")]]),e.struct(\"LedgerKeyAccount\",[[\"accountId\",e.lookup(\"AccountId\")]]),e.struct(\"LedgerKeyTrustLine\",[[\"accountId\",e.lookup(\"AccountId\")],[\"asset\",e.lookup(\"TrustLineAsset\")]]),e.struct(\"LedgerKeyOffer\",[[\"sellerId\",e.lookup(\"AccountId\")],[\"offerId\",e.lookup(\"Int64\")]]),e.struct(\"LedgerKeyData\",[[\"accountId\",e.lookup(\"AccountId\")],[\"dataName\",e.lookup(\"String64\")]]),e.struct(\"LedgerKeyClaimableBalance\",[[\"balanceId\",e.lookup(\"ClaimableBalanceId\")]]),e.struct(\"LedgerKeyLiquidityPool\",[[\"liquidityPoolId\",e.lookup(\"PoolId\")]]),e.struct(\"LedgerKeyContractData\",[[\"contract\",e.lookup(\"ScAddress\")],[\"key\",e.lookup(\"ScVal\")],[\"durability\",e.lookup(\"ContractDataDurability\")]]),e.struct(\"LedgerKeyContractCode\",[[\"hash\",e.lookup(\"Hash\")]]),e.struct(\"LedgerKeyConfigSetting\",[[\"configSettingId\",e.lookup(\"ConfigSettingId\")]]),e.struct(\"LedgerKeyTtl\",[[\"keyHash\",e.lookup(\"Hash\")]]),e.union(\"LedgerKey\",{switchOn:e.lookup(\"LedgerEntryType\"),switchName:\"type\",switches:[[\"account\",\"account\"],[\"trustline\",\"trustLine\"],[\"offer\",\"offer\"],[\"data\",\"data\"],[\"claimableBalance\",\"claimableBalance\"],[\"liquidityPool\",\"liquidityPool\"],[\"contractData\",\"contractData\"],[\"contractCode\",\"contractCode\"],[\"configSetting\",\"configSetting\"],[\"ttl\",\"ttl\"]],arms:{account:e.lookup(\"LedgerKeyAccount\"),trustLine:e.lookup(\"LedgerKeyTrustLine\"),offer:e.lookup(\"LedgerKeyOffer\"),data:e.lookup(\"LedgerKeyData\"),claimableBalance:e.lookup(\"LedgerKeyClaimableBalance\"),liquidityPool:e.lookup(\"LedgerKeyLiquidityPool\"),contractData:e.lookup(\"LedgerKeyContractData\"),contractCode:e.lookup(\"LedgerKeyContractCode\"),configSetting:e.lookup(\"LedgerKeyConfigSetting\"),ttl:e.lookup(\"LedgerKeyTtl\")}}),e.enum(\"EnvelopeType\",{envelopeTypeTxV0:0,envelopeTypeScp:1,envelopeTypeTx:2,envelopeTypeAuth:3,envelopeTypeScpvalue:4,envelopeTypeTxFeeBump:5,envelopeTypeOpId:6,envelopeTypePoolRevokeOpId:7,envelopeTypeContractId:8,envelopeTypeSorobanAuthorization:9}),e.enum(\"BucketListType\",{live:0,hotArchive:1}),e.enum(\"BucketEntryType\",{metaentry:-1,liveentry:0,deadentry:1,initentry:2}),e.enum(\"HotArchiveBucketEntryType\",{hotArchiveMetaentry:-1,hotArchiveArchived:0,hotArchiveLive:1}),e.union(\"BucketMetadataExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"bucketListType\"]],arms:{bucketListType:e.lookup(\"BucketListType\")}}),e.struct(\"BucketMetadata\",[[\"ledgerVersion\",e.lookup(\"Uint32\")],[\"ext\",e.lookup(\"BucketMetadataExt\")]]),e.union(\"BucketEntry\",{switchOn:e.lookup(\"BucketEntryType\"),switchName:\"type\",switches:[[\"liveentry\",\"liveEntry\"],[\"initentry\",\"liveEntry\"],[\"deadentry\",\"deadEntry\"],[\"metaentry\",\"metaEntry\"]],arms:{liveEntry:e.lookup(\"LedgerEntry\"),deadEntry:e.lookup(\"LedgerKey\"),metaEntry:e.lookup(\"BucketMetadata\")}}),e.union(\"HotArchiveBucketEntry\",{switchOn:e.lookup(\"HotArchiveBucketEntryType\"),switchName:\"type\",switches:[[\"hotArchiveArchived\",\"archivedEntry\"],[\"hotArchiveLive\",\"key\"],[\"hotArchiveMetaentry\",\"metaEntry\"]],arms:{archivedEntry:e.lookup(\"LedgerEntry\"),key:e.lookup(\"LedgerKey\"),metaEntry:e.lookup(\"BucketMetadata\")}}),e.typedef(\"UpgradeType\",e.varOpaque(128)),e.enum(\"StellarValueType\",{stellarValueBasic:0,stellarValueSigned:1}),e.struct(\"LedgerCloseValueSignature\",[[\"nodeId\",e.lookup(\"NodeId\")],[\"signature\",e.lookup(\"Signature\")]]),e.union(\"StellarValueExt\",{switchOn:e.lookup(\"StellarValueType\"),switchName:\"v\",switches:[[\"stellarValueBasic\",e.void()],[\"stellarValueSigned\",\"lcValueSignature\"]],arms:{lcValueSignature:e.lookup(\"LedgerCloseValueSignature\")}}),e.struct(\"StellarValue\",[[\"txSetHash\",e.lookup(\"Hash\")],[\"closeTime\",e.lookup(\"TimePoint\")],[\"upgrades\",e.varArray(e.lookup(\"UpgradeType\"),6)],[\"ext\",e.lookup(\"StellarValueExt\")]]),e.const(\"MASK_LEDGER_HEADER_FLAGS\",7),e.enum(\"LedgerHeaderFlags\",{disableLiquidityPoolTradingFlag:1,disableLiquidityPoolDepositFlag:2,disableLiquidityPoolWithdrawalFlag:4}),e.union(\"LedgerHeaderExtensionV1Ext\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"LedgerHeaderExtensionV1\",[[\"flags\",e.lookup(\"Uint32\")],[\"ext\",e.lookup(\"LedgerHeaderExtensionV1Ext\")]]),e.union(\"LedgerHeaderExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"v1\"]],arms:{v1:e.lookup(\"LedgerHeaderExtensionV1\")}}),e.struct(\"LedgerHeader\",[[\"ledgerVersion\",e.lookup(\"Uint32\")],[\"previousLedgerHash\",e.lookup(\"Hash\")],[\"scpValue\",e.lookup(\"StellarValue\")],[\"txSetResultHash\",e.lookup(\"Hash\")],[\"bucketListHash\",e.lookup(\"Hash\")],[\"ledgerSeq\",e.lookup(\"Uint32\")],[\"totalCoins\",e.lookup(\"Int64\")],[\"feePool\",e.lookup(\"Int64\")],[\"inflationSeq\",e.lookup(\"Uint32\")],[\"idPool\",e.lookup(\"Uint64\")],[\"baseFee\",e.lookup(\"Uint32\")],[\"baseReserve\",e.lookup(\"Uint32\")],[\"maxTxSetSize\",e.lookup(\"Uint32\")],[\"skipList\",e.array(e.lookup(\"Hash\"),4)],[\"ext\",e.lookup(\"LedgerHeaderExt\")]]),e.enum(\"LedgerUpgradeType\",{ledgerUpgradeVersion:1,ledgerUpgradeBaseFee:2,ledgerUpgradeMaxTxSetSize:3,ledgerUpgradeBaseReserve:4,ledgerUpgradeFlags:5,ledgerUpgradeConfig:6,ledgerUpgradeMaxSorobanTxSetSize:7}),e.struct(\"ConfigUpgradeSetKey\",[[\"contractId\",e.lookup(\"ContractId\")],[\"contentHash\",e.lookup(\"Hash\")]]),e.union(\"LedgerUpgrade\",{switchOn:e.lookup(\"LedgerUpgradeType\"),switchName:\"type\",switches:[[\"ledgerUpgradeVersion\",\"newLedgerVersion\"],[\"ledgerUpgradeBaseFee\",\"newBaseFee\"],[\"ledgerUpgradeMaxTxSetSize\",\"newMaxTxSetSize\"],[\"ledgerUpgradeBaseReserve\",\"newBaseReserve\"],[\"ledgerUpgradeFlags\",\"newFlags\"],[\"ledgerUpgradeConfig\",\"newConfig\"],[\"ledgerUpgradeMaxSorobanTxSetSize\",\"newMaxSorobanTxSetSize\"]],arms:{newLedgerVersion:e.lookup(\"Uint32\"),newBaseFee:e.lookup(\"Uint32\"),newMaxTxSetSize:e.lookup(\"Uint32\"),newBaseReserve:e.lookup(\"Uint32\"),newFlags:e.lookup(\"Uint32\"),newConfig:e.lookup(\"ConfigUpgradeSetKey\"),newMaxSorobanTxSetSize:e.lookup(\"Uint32\")}}),e.struct(\"ConfigUpgradeSet\",[[\"updatedEntry\",e.varArray(e.lookup(\"ConfigSettingEntry\"),2147483647)]]),e.enum(\"TxSetComponentType\",{txsetCompTxsMaybeDiscountedFee:0}),e.typedef(\"DependentTxCluster\",e.varArray(e.lookup(\"TransactionEnvelope\"),2147483647)),e.typedef(\"ParallelTxExecutionStage\",e.varArray(e.lookup(\"DependentTxCluster\"),2147483647)),e.struct(\"ParallelTxsComponent\",[[\"baseFee\",e.option(e.lookup(\"Int64\"))],[\"executionStages\",e.varArray(e.lookup(\"ParallelTxExecutionStage\"),2147483647)]]),e.struct(\"TxSetComponentTxsMaybeDiscountedFee\",[[\"baseFee\",e.option(e.lookup(\"Int64\"))],[\"txes\",e.varArray(e.lookup(\"TransactionEnvelope\"),2147483647)]]),e.union(\"TxSetComponent\",{switchOn:e.lookup(\"TxSetComponentType\"),switchName:\"type\",switches:[[\"txsetCompTxsMaybeDiscountedFee\",\"txsMaybeDiscountedFee\"]],arms:{txsMaybeDiscountedFee:e.lookup(\"TxSetComponentTxsMaybeDiscountedFee\")}}),e.union(\"TransactionPhase\",{switchOn:e.int(),switchName:\"v\",switches:[[0,\"v0Components\"],[1,\"parallelTxsComponent\"]],arms:{v0Components:e.varArray(e.lookup(\"TxSetComponent\"),2147483647),parallelTxsComponent:e.lookup(\"ParallelTxsComponent\")}}),e.struct(\"TransactionSet\",[[\"previousLedgerHash\",e.lookup(\"Hash\")],[\"txes\",e.varArray(e.lookup(\"TransactionEnvelope\"),2147483647)]]),e.struct(\"TransactionSetV1\",[[\"previousLedgerHash\",e.lookup(\"Hash\")],[\"phases\",e.varArray(e.lookup(\"TransactionPhase\"),2147483647)]]),e.union(\"GeneralizedTransactionSet\",{switchOn:e.int(),switchName:\"v\",switches:[[1,\"v1TxSet\"]],arms:{v1TxSet:e.lookup(\"TransactionSetV1\")}}),e.struct(\"TransactionResultPair\",[[\"transactionHash\",e.lookup(\"Hash\")],[\"result\",e.lookup(\"TransactionResult\")]]),e.struct(\"TransactionResultSet\",[[\"results\",e.varArray(e.lookup(\"TransactionResultPair\"),2147483647)]]),e.union(\"TransactionHistoryEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"generalizedTxSet\"]],arms:{generalizedTxSet:e.lookup(\"GeneralizedTransactionSet\")}}),e.struct(\"TransactionHistoryEntry\",[[\"ledgerSeq\",e.lookup(\"Uint32\")],[\"txSet\",e.lookup(\"TransactionSet\")],[\"ext\",e.lookup(\"TransactionHistoryEntryExt\")]]),e.union(\"TransactionHistoryResultEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"TransactionHistoryResultEntry\",[[\"ledgerSeq\",e.lookup(\"Uint32\")],[\"txResultSet\",e.lookup(\"TransactionResultSet\")],[\"ext\",e.lookup(\"TransactionHistoryResultEntryExt\")]]),e.union(\"LedgerHeaderHistoryEntryExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"LedgerHeaderHistoryEntry\",[[\"hash\",e.lookup(\"Hash\")],[\"header\",e.lookup(\"LedgerHeader\")],[\"ext\",e.lookup(\"LedgerHeaderHistoryEntryExt\")]]),e.struct(\"LedgerScpMessages\",[[\"ledgerSeq\",e.lookup(\"Uint32\")],[\"messages\",e.varArray(e.lookup(\"ScpEnvelope\"),2147483647)]]),e.struct(\"ScpHistoryEntryV0\",[[\"quorumSets\",e.varArray(e.lookup(\"ScpQuorumSet\"),2147483647)],[\"ledgerMessages\",e.lookup(\"LedgerScpMessages\")]]),e.union(\"ScpHistoryEntry\",{switchOn:e.int(),switchName:\"v\",switches:[[0,\"v0\"]],arms:{v0:e.lookup(\"ScpHistoryEntryV0\")}}),e.enum(\"LedgerEntryChangeType\",{ledgerEntryCreated:0,ledgerEntryUpdated:1,ledgerEntryRemoved:2,ledgerEntryState:3,ledgerEntryRestored:4}),e.union(\"LedgerEntryChange\",{switchOn:e.lookup(\"LedgerEntryChangeType\"),switchName:\"type\",switches:[[\"ledgerEntryCreated\",\"created\"],[\"ledgerEntryUpdated\",\"updated\"],[\"ledgerEntryRemoved\",\"removed\"],[\"ledgerEntryState\",\"state\"],[\"ledgerEntryRestored\",\"restored\"]],arms:{created:e.lookup(\"LedgerEntry\"),updated:e.lookup(\"LedgerEntry\"),removed:e.lookup(\"LedgerKey\"),state:e.lookup(\"LedgerEntry\"),restored:e.lookup(\"LedgerEntry\")}}),e.typedef(\"LedgerEntryChanges\",e.varArray(e.lookup(\"LedgerEntryChange\"),2147483647)),e.struct(\"OperationMeta\",[[\"changes\",e.lookup(\"LedgerEntryChanges\")]]),e.struct(\"TransactionMetaV1\",[[\"txChanges\",e.lookup(\"LedgerEntryChanges\")],[\"operations\",e.varArray(e.lookup(\"OperationMeta\"),2147483647)]]),e.struct(\"TransactionMetaV2\",[[\"txChangesBefore\",e.lookup(\"LedgerEntryChanges\")],[\"operations\",e.varArray(e.lookup(\"OperationMeta\"),2147483647)],[\"txChangesAfter\",e.lookup(\"LedgerEntryChanges\")]]),e.enum(\"ContractEventType\",{system:0,contract:1,diagnostic:2}),e.struct(\"ContractEventV0\",[[\"topics\",e.varArray(e.lookup(\"ScVal\"),2147483647)],[\"data\",e.lookup(\"ScVal\")]]),e.union(\"ContractEventBody\",{switchOn:e.int(),switchName:\"v\",switches:[[0,\"v0\"]],arms:{v0:e.lookup(\"ContractEventV0\")}}),e.struct(\"ContractEvent\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"contractId\",e.option(e.lookup(\"ContractId\"))],[\"type\",e.lookup(\"ContractEventType\")],[\"body\",e.lookup(\"ContractEventBody\")]]),e.struct(\"DiagnosticEvent\",[[\"inSuccessfulContractCall\",e.bool()],[\"event\",e.lookup(\"ContractEvent\")]]),e.struct(\"SorobanTransactionMetaExtV1\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"totalNonRefundableResourceFeeCharged\",e.lookup(\"Int64\")],[\"totalRefundableResourceFeeCharged\",e.lookup(\"Int64\")],[\"rentFeeCharged\",e.lookup(\"Int64\")]]),e.union(\"SorobanTransactionMetaExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"v1\"]],arms:{v1:e.lookup(\"SorobanTransactionMetaExtV1\")}}),e.struct(\"SorobanTransactionMeta\",[[\"ext\",e.lookup(\"SorobanTransactionMetaExt\")],[\"events\",e.varArray(e.lookup(\"ContractEvent\"),2147483647)],[\"returnValue\",e.lookup(\"ScVal\")],[\"diagnosticEvents\",e.varArray(e.lookup(\"DiagnosticEvent\"),2147483647)]]),e.struct(\"TransactionMetaV3\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"txChangesBefore\",e.lookup(\"LedgerEntryChanges\")],[\"operations\",e.varArray(e.lookup(\"OperationMeta\"),2147483647)],[\"txChangesAfter\",e.lookup(\"LedgerEntryChanges\")],[\"sorobanMeta\",e.option(e.lookup(\"SorobanTransactionMeta\"))]]),e.struct(\"OperationMetaV2\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"changes\",e.lookup(\"LedgerEntryChanges\")],[\"events\",e.varArray(e.lookup(\"ContractEvent\"),2147483647)]]),e.struct(\"SorobanTransactionMetaV2\",[[\"ext\",e.lookup(\"SorobanTransactionMetaExt\")],[\"returnValue\",e.option(e.lookup(\"ScVal\"))]]),e.enum(\"TransactionEventStage\",{transactionEventStageBeforeAllTxes:0,transactionEventStageAfterTx:1,transactionEventStageAfterAllTxes:2}),e.struct(\"TransactionEvent\",[[\"stage\",e.lookup(\"TransactionEventStage\")],[\"event\",e.lookup(\"ContractEvent\")]]),e.struct(\"TransactionMetaV4\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"txChangesBefore\",e.lookup(\"LedgerEntryChanges\")],[\"operations\",e.varArray(e.lookup(\"OperationMetaV2\"),2147483647)],[\"txChangesAfter\",e.lookup(\"LedgerEntryChanges\")],[\"sorobanMeta\",e.option(e.lookup(\"SorobanTransactionMetaV2\"))],[\"events\",e.varArray(e.lookup(\"TransactionEvent\"),2147483647)],[\"diagnosticEvents\",e.varArray(e.lookup(\"DiagnosticEvent\"),2147483647)]]),e.struct(\"InvokeHostFunctionSuccessPreImage\",[[\"returnValue\",e.lookup(\"ScVal\")],[\"events\",e.varArray(e.lookup(\"ContractEvent\"),2147483647)]]),e.union(\"TransactionMeta\",{switchOn:e.int(),switchName:\"v\",switches:[[0,\"operations\"],[1,\"v1\"],[2,\"v2\"],[3,\"v3\"],[4,\"v4\"]],arms:{operations:e.varArray(e.lookup(\"OperationMeta\"),2147483647),v1:e.lookup(\"TransactionMetaV1\"),v2:e.lookup(\"TransactionMetaV2\"),v3:e.lookup(\"TransactionMetaV3\"),v4:e.lookup(\"TransactionMetaV4\")}}),e.struct(\"TransactionResultMeta\",[[\"result\",e.lookup(\"TransactionResultPair\")],[\"feeProcessing\",e.lookup(\"LedgerEntryChanges\")],[\"txApplyProcessing\",e.lookup(\"TransactionMeta\")]]),e.struct(\"TransactionResultMetaV1\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"result\",e.lookup(\"TransactionResultPair\")],[\"feeProcessing\",e.lookup(\"LedgerEntryChanges\")],[\"txApplyProcessing\",e.lookup(\"TransactionMeta\")],[\"postTxApplyFeeProcessing\",e.lookup(\"LedgerEntryChanges\")]]),e.struct(\"UpgradeEntryMeta\",[[\"upgrade\",e.lookup(\"LedgerUpgrade\")],[\"changes\",e.lookup(\"LedgerEntryChanges\")]]),e.struct(\"LedgerCloseMetaV0\",[[\"ledgerHeader\",e.lookup(\"LedgerHeaderHistoryEntry\")],[\"txSet\",e.lookup(\"TransactionSet\")],[\"txProcessing\",e.varArray(e.lookup(\"TransactionResultMeta\"),2147483647)],[\"upgradesProcessing\",e.varArray(e.lookup(\"UpgradeEntryMeta\"),2147483647)],[\"scpInfo\",e.varArray(e.lookup(\"ScpHistoryEntry\"),2147483647)]]),e.struct(\"LedgerCloseMetaExtV1\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"sorobanFeeWrite1Kb\",e.lookup(\"Int64\")]]),e.union(\"LedgerCloseMetaExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"v1\"]],arms:{v1:e.lookup(\"LedgerCloseMetaExtV1\")}}),e.struct(\"LedgerCloseMetaV1\",[[\"ext\",e.lookup(\"LedgerCloseMetaExt\")],[\"ledgerHeader\",e.lookup(\"LedgerHeaderHistoryEntry\")],[\"txSet\",e.lookup(\"GeneralizedTransactionSet\")],[\"txProcessing\",e.varArray(e.lookup(\"TransactionResultMeta\"),2147483647)],[\"upgradesProcessing\",e.varArray(e.lookup(\"UpgradeEntryMeta\"),2147483647)],[\"scpInfo\",e.varArray(e.lookup(\"ScpHistoryEntry\"),2147483647)],[\"totalByteSizeOfLiveSorobanState\",e.lookup(\"Uint64\")],[\"evictedKeys\",e.varArray(e.lookup(\"LedgerKey\"),2147483647)],[\"unused\",e.varArray(e.lookup(\"LedgerEntry\"),2147483647)]]),e.struct(\"LedgerCloseMetaV2\",[[\"ext\",e.lookup(\"LedgerCloseMetaExt\")],[\"ledgerHeader\",e.lookup(\"LedgerHeaderHistoryEntry\")],[\"txSet\",e.lookup(\"GeneralizedTransactionSet\")],[\"txProcessing\",e.varArray(e.lookup(\"TransactionResultMetaV1\"),2147483647)],[\"upgradesProcessing\",e.varArray(e.lookup(\"UpgradeEntryMeta\"),2147483647)],[\"scpInfo\",e.varArray(e.lookup(\"ScpHistoryEntry\"),2147483647)],[\"totalByteSizeOfLiveSorobanState\",e.lookup(\"Uint64\")],[\"evictedKeys\",e.varArray(e.lookup(\"LedgerKey\"),2147483647)]]),e.union(\"LedgerCloseMeta\",{switchOn:e.int(),switchName:\"v\",switches:[[0,\"v0\"],[1,\"v1\"],[2,\"v2\"]],arms:{v0:e.lookup(\"LedgerCloseMetaV0\"),v1:e.lookup(\"LedgerCloseMetaV1\"),v2:e.lookup(\"LedgerCloseMetaV2\")}}),e.enum(\"ErrorCode\",{errMisc:0,errData:1,errConf:2,errAuth:3,errLoad:4}),e.struct(\"Error\",[[\"code\",e.lookup(\"ErrorCode\")],[\"msg\",e.string(100)]]),e.struct(\"SendMore\",[[\"numMessages\",e.lookup(\"Uint32\")]]),e.struct(\"SendMoreExtended\",[[\"numMessages\",e.lookup(\"Uint32\")],[\"numBytes\",e.lookup(\"Uint32\")]]),e.struct(\"AuthCert\",[[\"pubkey\",e.lookup(\"Curve25519Public\")],[\"expiration\",e.lookup(\"Uint64\")],[\"sig\",e.lookup(\"Signature\")]]),e.struct(\"Hello\",[[\"ledgerVersion\",e.lookup(\"Uint32\")],[\"overlayVersion\",e.lookup(\"Uint32\")],[\"overlayMinVersion\",e.lookup(\"Uint32\")],[\"networkId\",e.lookup(\"Hash\")],[\"versionStr\",e.string(100)],[\"listeningPort\",e.int()],[\"peerId\",e.lookup(\"NodeId\")],[\"cert\",e.lookup(\"AuthCert\")],[\"nonce\",e.lookup(\"Uint256\")]]),e.const(\"AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED\",200),e.struct(\"Auth\",[[\"flags\",e.int()]]),e.enum(\"IpAddrType\",{iPv4:0,iPv6:1}),e.union(\"PeerAddressIp\",{switchOn:e.lookup(\"IpAddrType\"),switchName:\"type\",switches:[[\"iPv4\",\"ipv4\"],[\"iPv6\",\"ipv6\"]],arms:{ipv4:e.opaque(4),ipv6:e.opaque(16)}}),e.struct(\"PeerAddress\",[[\"ip\",e.lookup(\"PeerAddressIp\")],[\"port\",e.lookup(\"Uint32\")],[\"numFailures\",e.lookup(\"Uint32\")]]),e.enum(\"MessageType\",{errorMsg:0,auth:2,dontHave:3,peers:5,getTxSet:6,txSet:7,generalizedTxSet:17,transaction:8,getScpQuorumset:9,scpQuorumset:10,scpMessage:11,getScpState:12,hello:13,sendMore:16,sendMoreExtended:20,floodAdvert:18,floodDemand:19,timeSlicedSurveyRequest:21,timeSlicedSurveyResponse:22,timeSlicedSurveyStartCollecting:23,timeSlicedSurveyStopCollecting:24}),e.struct(\"DontHave\",[[\"type\",e.lookup(\"MessageType\")],[\"reqHash\",e.lookup(\"Uint256\")]]),e.enum(\"SurveyMessageCommandType\",{timeSlicedSurveyTopology:1}),e.enum(\"SurveyMessageResponseType\",{surveyTopologyResponseV2:2}),e.struct(\"TimeSlicedSurveyStartCollectingMessage\",[[\"surveyorId\",e.lookup(\"NodeId\")],[\"nonce\",e.lookup(\"Uint32\")],[\"ledgerNum\",e.lookup(\"Uint32\")]]),e.struct(\"SignedTimeSlicedSurveyStartCollectingMessage\",[[\"signature\",e.lookup(\"Signature\")],[\"startCollecting\",e.lookup(\"TimeSlicedSurveyStartCollectingMessage\")]]),e.struct(\"TimeSlicedSurveyStopCollectingMessage\",[[\"surveyorId\",e.lookup(\"NodeId\")],[\"nonce\",e.lookup(\"Uint32\")],[\"ledgerNum\",e.lookup(\"Uint32\")]]),e.struct(\"SignedTimeSlicedSurveyStopCollectingMessage\",[[\"signature\",e.lookup(\"Signature\")],[\"stopCollecting\",e.lookup(\"TimeSlicedSurveyStopCollectingMessage\")]]),e.struct(\"SurveyRequestMessage\",[[\"surveyorPeerId\",e.lookup(\"NodeId\")],[\"surveyedPeerId\",e.lookup(\"NodeId\")],[\"ledgerNum\",e.lookup(\"Uint32\")],[\"encryptionKey\",e.lookup(\"Curve25519Public\")],[\"commandType\",e.lookup(\"SurveyMessageCommandType\")]]),e.struct(\"TimeSlicedSurveyRequestMessage\",[[\"request\",e.lookup(\"SurveyRequestMessage\")],[\"nonce\",e.lookup(\"Uint32\")],[\"inboundPeersIndex\",e.lookup(\"Uint32\")],[\"outboundPeersIndex\",e.lookup(\"Uint32\")]]),e.struct(\"SignedTimeSlicedSurveyRequestMessage\",[[\"requestSignature\",e.lookup(\"Signature\")],[\"request\",e.lookup(\"TimeSlicedSurveyRequestMessage\")]]),e.typedef(\"EncryptedBody\",e.varOpaque(64e3)),e.struct(\"SurveyResponseMessage\",[[\"surveyorPeerId\",e.lookup(\"NodeId\")],[\"surveyedPeerId\",e.lookup(\"NodeId\")],[\"ledgerNum\",e.lookup(\"Uint32\")],[\"commandType\",e.lookup(\"SurveyMessageCommandType\")],[\"encryptedBody\",e.lookup(\"EncryptedBody\")]]),e.struct(\"TimeSlicedSurveyResponseMessage\",[[\"response\",e.lookup(\"SurveyResponseMessage\")],[\"nonce\",e.lookup(\"Uint32\")]]),e.struct(\"SignedTimeSlicedSurveyResponseMessage\",[[\"responseSignature\",e.lookup(\"Signature\")],[\"response\",e.lookup(\"TimeSlicedSurveyResponseMessage\")]]),e.struct(\"PeerStats\",[[\"id\",e.lookup(\"NodeId\")],[\"versionStr\",e.string(100)],[\"messagesRead\",e.lookup(\"Uint64\")],[\"messagesWritten\",e.lookup(\"Uint64\")],[\"bytesRead\",e.lookup(\"Uint64\")],[\"bytesWritten\",e.lookup(\"Uint64\")],[\"secondsConnected\",e.lookup(\"Uint64\")],[\"uniqueFloodBytesRecv\",e.lookup(\"Uint64\")],[\"duplicateFloodBytesRecv\",e.lookup(\"Uint64\")],[\"uniqueFetchBytesRecv\",e.lookup(\"Uint64\")],[\"duplicateFetchBytesRecv\",e.lookup(\"Uint64\")],[\"uniqueFloodMessageRecv\",e.lookup(\"Uint64\")],[\"duplicateFloodMessageRecv\",e.lookup(\"Uint64\")],[\"uniqueFetchMessageRecv\",e.lookup(\"Uint64\")],[\"duplicateFetchMessageRecv\",e.lookup(\"Uint64\")]]),e.struct(\"TimeSlicedNodeData\",[[\"addedAuthenticatedPeers\",e.lookup(\"Uint32\")],[\"droppedAuthenticatedPeers\",e.lookup(\"Uint32\")],[\"totalInboundPeerCount\",e.lookup(\"Uint32\")],[\"totalOutboundPeerCount\",e.lookup(\"Uint32\")],[\"p75ScpFirstToSelfLatencyMs\",e.lookup(\"Uint32\")],[\"p75ScpSelfToOtherLatencyMs\",e.lookup(\"Uint32\")],[\"lostSyncCount\",e.lookup(\"Uint32\")],[\"isValidator\",e.bool()],[\"maxInboundPeerCount\",e.lookup(\"Uint32\")],[\"maxOutboundPeerCount\",e.lookup(\"Uint32\")]]),e.struct(\"TimeSlicedPeerData\",[[\"peerStats\",e.lookup(\"PeerStats\")],[\"averageLatencyMs\",e.lookup(\"Uint32\")]]),e.typedef(\"TimeSlicedPeerDataList\",e.varArray(e.lookup(\"TimeSlicedPeerData\"),25)),e.struct(\"TopologyResponseBodyV2\",[[\"inboundPeers\",e.lookup(\"TimeSlicedPeerDataList\")],[\"outboundPeers\",e.lookup(\"TimeSlicedPeerDataList\")],[\"nodeData\",e.lookup(\"TimeSlicedNodeData\")]]),e.union(\"SurveyResponseBody\",{switchOn:e.lookup(\"SurveyMessageResponseType\"),switchName:\"type\",switches:[[\"surveyTopologyResponseV2\",\"topologyResponseBodyV2\"]],arms:{topologyResponseBodyV2:e.lookup(\"TopologyResponseBodyV2\")}}),e.const(\"TX_ADVERT_VECTOR_MAX_SIZE\",1e3),e.typedef(\"TxAdvertVector\",e.varArray(e.lookup(\"Hash\"),e.lookup(\"TX_ADVERT_VECTOR_MAX_SIZE\"))),e.struct(\"FloodAdvert\",[[\"txHashes\",e.lookup(\"TxAdvertVector\")]]),e.const(\"TX_DEMAND_VECTOR_MAX_SIZE\",1e3),e.typedef(\"TxDemandVector\",e.varArray(e.lookup(\"Hash\"),e.lookup(\"TX_DEMAND_VECTOR_MAX_SIZE\"))),e.struct(\"FloodDemand\",[[\"txHashes\",e.lookup(\"TxDemandVector\")]]),e.union(\"StellarMessage\",{switchOn:e.lookup(\"MessageType\"),switchName:\"type\",switches:[[\"errorMsg\",\"error\"],[\"hello\",\"hello\"],[\"auth\",\"auth\"],[\"dontHave\",\"dontHave\"],[\"peers\",\"peers\"],[\"getTxSet\",\"txSetHash\"],[\"txSet\",\"txSet\"],[\"generalizedTxSet\",\"generalizedTxSet\"],[\"transaction\",\"transaction\"],[\"timeSlicedSurveyRequest\",\"signedTimeSlicedSurveyRequestMessage\"],[\"timeSlicedSurveyResponse\",\"signedTimeSlicedSurveyResponseMessage\"],[\"timeSlicedSurveyStartCollecting\",\"signedTimeSlicedSurveyStartCollectingMessage\"],[\"timeSlicedSurveyStopCollecting\",\"signedTimeSlicedSurveyStopCollectingMessage\"],[\"getScpQuorumset\",\"qSetHash\"],[\"scpQuorumset\",\"qSet\"],[\"scpMessage\",\"envelope\"],[\"getScpState\",\"getScpLedgerSeq\"],[\"sendMore\",\"sendMoreMessage\"],[\"sendMoreExtended\",\"sendMoreExtendedMessage\"],[\"floodAdvert\",\"floodAdvert\"],[\"floodDemand\",\"floodDemand\"]],arms:{error:e.lookup(\"Error\"),hello:e.lookup(\"Hello\"),auth:e.lookup(\"Auth\"),dontHave:e.lookup(\"DontHave\"),peers:e.varArray(e.lookup(\"PeerAddress\"),100),txSetHash:e.lookup(\"Uint256\"),txSet:e.lookup(\"TransactionSet\"),generalizedTxSet:e.lookup(\"GeneralizedTransactionSet\"),transaction:e.lookup(\"TransactionEnvelope\"),signedTimeSlicedSurveyRequestMessage:e.lookup(\"SignedTimeSlicedSurveyRequestMessage\"),signedTimeSlicedSurveyResponseMessage:e.lookup(\"SignedTimeSlicedSurveyResponseMessage\"),signedTimeSlicedSurveyStartCollectingMessage:e.lookup(\"SignedTimeSlicedSurveyStartCollectingMessage\"),signedTimeSlicedSurveyStopCollectingMessage:e.lookup(\"SignedTimeSlicedSurveyStopCollectingMessage\"),qSetHash:e.lookup(\"Uint256\"),qSet:e.lookup(\"ScpQuorumSet\"),envelope:e.lookup(\"ScpEnvelope\"),getScpLedgerSeq:e.lookup(\"Uint32\"),sendMoreMessage:e.lookup(\"SendMore\"),sendMoreExtendedMessage:e.lookup(\"SendMoreExtended\"),floodAdvert:e.lookup(\"FloodAdvert\"),floodDemand:e.lookup(\"FloodDemand\")}}),e.struct(\"AuthenticatedMessageV0\",[[\"sequence\",e.lookup(\"Uint64\")],[\"message\",e.lookup(\"StellarMessage\")],[\"mac\",e.lookup(\"HmacSha256Mac\")]]),e.union(\"AuthenticatedMessage\",{switchOn:e.lookup(\"Uint32\"),switchName:\"v\",switches:[[0,\"v0\"]],arms:{v0:e.lookup(\"AuthenticatedMessageV0\")}}),e.const(\"MAX_OPS_PER_TX\",100),e.union(\"LiquidityPoolParameters\",{switchOn:e.lookup(\"LiquidityPoolType\"),switchName:\"type\",switches:[[\"liquidityPoolConstantProduct\",\"constantProduct\"]],arms:{constantProduct:e.lookup(\"LiquidityPoolConstantProductParameters\")}}),e.struct(\"MuxedAccountMed25519\",[[\"id\",e.lookup(\"Uint64\")],[\"ed25519\",e.lookup(\"Uint256\")]]),e.union(\"MuxedAccount\",{switchOn:e.lookup(\"CryptoKeyType\"),switchName:\"type\",switches:[[\"keyTypeEd25519\",\"ed25519\"],[\"keyTypeMuxedEd25519\",\"med25519\"]],arms:{ed25519:e.lookup(\"Uint256\"),med25519:e.lookup(\"MuxedAccountMed25519\")}}),e.struct(\"DecoratedSignature\",[[\"hint\",e.lookup(\"SignatureHint\")],[\"signature\",e.lookup(\"Signature\")]]),e.enum(\"OperationType\",{createAccount:0,payment:1,pathPaymentStrictReceive:2,manageSellOffer:3,createPassiveSellOffer:4,setOptions:5,changeTrust:6,allowTrust:7,accountMerge:8,inflation:9,manageData:10,bumpSequence:11,manageBuyOffer:12,pathPaymentStrictSend:13,createClaimableBalance:14,claimClaimableBalance:15,beginSponsoringFutureReserves:16,endSponsoringFutureReserves:17,revokeSponsorship:18,clawback:19,clawbackClaimableBalance:20,setTrustLineFlags:21,liquidityPoolDeposit:22,liquidityPoolWithdraw:23,invokeHostFunction:24,extendFootprintTtl:25,restoreFootprint:26}),e.struct(\"CreateAccountOp\",[[\"destination\",e.lookup(\"AccountId\")],[\"startingBalance\",e.lookup(\"Int64\")]]),e.struct(\"PaymentOp\",[[\"destination\",e.lookup(\"MuxedAccount\")],[\"asset\",e.lookup(\"Asset\")],[\"amount\",e.lookup(\"Int64\")]]),e.struct(\"PathPaymentStrictReceiveOp\",[[\"sendAsset\",e.lookup(\"Asset\")],[\"sendMax\",e.lookup(\"Int64\")],[\"destination\",e.lookup(\"MuxedAccount\")],[\"destAsset\",e.lookup(\"Asset\")],[\"destAmount\",e.lookup(\"Int64\")],[\"path\",e.varArray(e.lookup(\"Asset\"),5)]]),e.struct(\"PathPaymentStrictSendOp\",[[\"sendAsset\",e.lookup(\"Asset\")],[\"sendAmount\",e.lookup(\"Int64\")],[\"destination\",e.lookup(\"MuxedAccount\")],[\"destAsset\",e.lookup(\"Asset\")],[\"destMin\",e.lookup(\"Int64\")],[\"path\",e.varArray(e.lookup(\"Asset\"),5)]]),e.struct(\"ManageSellOfferOp\",[[\"selling\",e.lookup(\"Asset\")],[\"buying\",e.lookup(\"Asset\")],[\"amount\",e.lookup(\"Int64\")],[\"price\",e.lookup(\"Price\")],[\"offerId\",e.lookup(\"Int64\")]]),e.struct(\"ManageBuyOfferOp\",[[\"selling\",e.lookup(\"Asset\")],[\"buying\",e.lookup(\"Asset\")],[\"buyAmount\",e.lookup(\"Int64\")],[\"price\",e.lookup(\"Price\")],[\"offerId\",e.lookup(\"Int64\")]]),e.struct(\"CreatePassiveSellOfferOp\",[[\"selling\",e.lookup(\"Asset\")],[\"buying\",e.lookup(\"Asset\")],[\"amount\",e.lookup(\"Int64\")],[\"price\",e.lookup(\"Price\")]]),e.struct(\"SetOptionsOp\",[[\"inflationDest\",e.option(e.lookup(\"AccountId\"))],[\"clearFlags\",e.option(e.lookup(\"Uint32\"))],[\"setFlags\",e.option(e.lookup(\"Uint32\"))],[\"masterWeight\",e.option(e.lookup(\"Uint32\"))],[\"lowThreshold\",e.option(e.lookup(\"Uint32\"))],[\"medThreshold\",e.option(e.lookup(\"Uint32\"))],[\"highThreshold\",e.option(e.lookup(\"Uint32\"))],[\"homeDomain\",e.option(e.lookup(\"String32\"))],[\"signer\",e.option(e.lookup(\"Signer\"))]]),e.union(\"ChangeTrustAsset\",{switchOn:e.lookup(\"AssetType\"),switchName:\"type\",switches:[[\"assetTypeNative\",e.void()],[\"assetTypeCreditAlphanum4\",\"alphaNum4\"],[\"assetTypeCreditAlphanum12\",\"alphaNum12\"],[\"assetTypePoolShare\",\"liquidityPool\"]],arms:{alphaNum4:e.lookup(\"AlphaNum4\"),alphaNum12:e.lookup(\"AlphaNum12\"),liquidityPool:e.lookup(\"LiquidityPoolParameters\")}}),e.struct(\"ChangeTrustOp\",[[\"line\",e.lookup(\"ChangeTrustAsset\")],[\"limit\",e.lookup(\"Int64\")]]),e.struct(\"AllowTrustOp\",[[\"trustor\",e.lookup(\"AccountId\")],[\"asset\",e.lookup(\"AssetCode\")],[\"authorize\",e.lookup(\"Uint32\")]]),e.struct(\"ManageDataOp\",[[\"dataName\",e.lookup(\"String64\")],[\"dataValue\",e.option(e.lookup(\"DataValue\"))]]),e.struct(\"BumpSequenceOp\",[[\"bumpTo\",e.lookup(\"SequenceNumber\")]]),e.struct(\"CreateClaimableBalanceOp\",[[\"asset\",e.lookup(\"Asset\")],[\"amount\",e.lookup(\"Int64\")],[\"claimants\",e.varArray(e.lookup(\"Claimant\"),10)]]),e.struct(\"ClaimClaimableBalanceOp\",[[\"balanceId\",e.lookup(\"ClaimableBalanceId\")]]),e.struct(\"BeginSponsoringFutureReservesOp\",[[\"sponsoredId\",e.lookup(\"AccountId\")]]),e.enum(\"RevokeSponsorshipType\",{revokeSponsorshipLedgerEntry:0,revokeSponsorshipSigner:1}),e.struct(\"RevokeSponsorshipOpSigner\",[[\"accountId\",e.lookup(\"AccountId\")],[\"signerKey\",e.lookup(\"SignerKey\")]]),e.union(\"RevokeSponsorshipOp\",{switchOn:e.lookup(\"RevokeSponsorshipType\"),switchName:\"type\",switches:[[\"revokeSponsorshipLedgerEntry\",\"ledgerKey\"],[\"revokeSponsorshipSigner\",\"signer\"]],arms:{ledgerKey:e.lookup(\"LedgerKey\"),signer:e.lookup(\"RevokeSponsorshipOpSigner\")}}),e.struct(\"ClawbackOp\",[[\"asset\",e.lookup(\"Asset\")],[\"from\",e.lookup(\"MuxedAccount\")],[\"amount\",e.lookup(\"Int64\")]]),e.struct(\"ClawbackClaimableBalanceOp\",[[\"balanceId\",e.lookup(\"ClaimableBalanceId\")]]),e.struct(\"SetTrustLineFlagsOp\",[[\"trustor\",e.lookup(\"AccountId\")],[\"asset\",e.lookup(\"Asset\")],[\"clearFlags\",e.lookup(\"Uint32\")],[\"setFlags\",e.lookup(\"Uint32\")]]),e.const(\"LIQUIDITY_POOL_FEE_V18\",30),e.struct(\"LiquidityPoolDepositOp\",[[\"liquidityPoolId\",e.lookup(\"PoolId\")],[\"maxAmountA\",e.lookup(\"Int64\")],[\"maxAmountB\",e.lookup(\"Int64\")],[\"minPrice\",e.lookup(\"Price\")],[\"maxPrice\",e.lookup(\"Price\")]]),e.struct(\"LiquidityPoolWithdrawOp\",[[\"liquidityPoolId\",e.lookup(\"PoolId\")],[\"amount\",e.lookup(\"Int64\")],[\"minAmountA\",e.lookup(\"Int64\")],[\"minAmountB\",e.lookup(\"Int64\")]]),e.enum(\"HostFunctionType\",{hostFunctionTypeInvokeContract:0,hostFunctionTypeCreateContract:1,hostFunctionTypeUploadContractWasm:2,hostFunctionTypeCreateContractV2:3}),e.enum(\"ContractIdPreimageType\",{contractIdPreimageFromAddress:0,contractIdPreimageFromAsset:1}),e.struct(\"ContractIdPreimageFromAddress\",[[\"address\",e.lookup(\"ScAddress\")],[\"salt\",e.lookup(\"Uint256\")]]),e.union(\"ContractIdPreimage\",{switchOn:e.lookup(\"ContractIdPreimageType\"),switchName:\"type\",switches:[[\"contractIdPreimageFromAddress\",\"fromAddress\"],[\"contractIdPreimageFromAsset\",\"fromAsset\"]],arms:{fromAddress:e.lookup(\"ContractIdPreimageFromAddress\"),fromAsset:e.lookup(\"Asset\")}}),e.struct(\"CreateContractArgs\",[[\"contractIdPreimage\",e.lookup(\"ContractIdPreimage\")],[\"executable\",e.lookup(\"ContractExecutable\")]]),e.struct(\"CreateContractArgsV2\",[[\"contractIdPreimage\",e.lookup(\"ContractIdPreimage\")],[\"executable\",e.lookup(\"ContractExecutable\")],[\"constructorArgs\",e.varArray(e.lookup(\"ScVal\"),2147483647)]]),e.struct(\"InvokeContractArgs\",[[\"contractAddress\",e.lookup(\"ScAddress\")],[\"functionName\",e.lookup(\"ScSymbol\")],[\"args\",e.varArray(e.lookup(\"ScVal\"),2147483647)]]),e.union(\"HostFunction\",{switchOn:e.lookup(\"HostFunctionType\"),switchName:\"type\",switches:[[\"hostFunctionTypeInvokeContract\",\"invokeContract\"],[\"hostFunctionTypeCreateContract\",\"createContract\"],[\"hostFunctionTypeUploadContractWasm\",\"wasm\"],[\"hostFunctionTypeCreateContractV2\",\"createContractV2\"]],arms:{invokeContract:e.lookup(\"InvokeContractArgs\"),createContract:e.lookup(\"CreateContractArgs\"),wasm:e.varOpaque(),createContractV2:e.lookup(\"CreateContractArgsV2\")}}),e.enum(\"SorobanAuthorizedFunctionType\",{sorobanAuthorizedFunctionTypeContractFn:0,sorobanAuthorizedFunctionTypeCreateContractHostFn:1,sorobanAuthorizedFunctionTypeCreateContractV2HostFn:2}),e.union(\"SorobanAuthorizedFunction\",{switchOn:e.lookup(\"SorobanAuthorizedFunctionType\"),switchName:\"type\",switches:[[\"sorobanAuthorizedFunctionTypeContractFn\",\"contractFn\"],[\"sorobanAuthorizedFunctionTypeCreateContractHostFn\",\"createContractHostFn\"],[\"sorobanAuthorizedFunctionTypeCreateContractV2HostFn\",\"createContractV2HostFn\"]],arms:{contractFn:e.lookup(\"InvokeContractArgs\"),createContractHostFn:e.lookup(\"CreateContractArgs\"),createContractV2HostFn:e.lookup(\"CreateContractArgsV2\")}}),e.struct(\"SorobanAuthorizedInvocation\",[[\"function\",e.lookup(\"SorobanAuthorizedFunction\")],[\"subInvocations\",e.varArray(e.lookup(\"SorobanAuthorizedInvocation\"),2147483647)]]),e.struct(\"SorobanAddressCredentials\",[[\"address\",e.lookup(\"ScAddress\")],[\"nonce\",e.lookup(\"Int64\")],[\"signatureExpirationLedger\",e.lookup(\"Uint32\")],[\"signature\",e.lookup(\"ScVal\")]]),e.enum(\"SorobanCredentialsType\",{sorobanCredentialsSourceAccount:0,sorobanCredentialsAddress:1}),e.union(\"SorobanCredentials\",{switchOn:e.lookup(\"SorobanCredentialsType\"),switchName:\"type\",switches:[[\"sorobanCredentialsSourceAccount\",e.void()],[\"sorobanCredentialsAddress\",\"address\"]],arms:{address:e.lookup(\"SorobanAddressCredentials\")}}),e.struct(\"SorobanAuthorizationEntry\",[[\"credentials\",e.lookup(\"SorobanCredentials\")],[\"rootInvocation\",e.lookup(\"SorobanAuthorizedInvocation\")]]),e.typedef(\"SorobanAuthorizationEntries\",e.varArray(e.lookup(\"SorobanAuthorizationEntry\"),2147483647)),e.struct(\"InvokeHostFunctionOp\",[[\"hostFunction\",e.lookup(\"HostFunction\")],[\"auth\",e.varArray(e.lookup(\"SorobanAuthorizationEntry\"),2147483647)]]),e.struct(\"ExtendFootprintTtlOp\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"extendTo\",e.lookup(\"Uint32\")]]),e.struct(\"RestoreFootprintOp\",[[\"ext\",e.lookup(\"ExtensionPoint\")]]),e.union(\"OperationBody\",{switchOn:e.lookup(\"OperationType\"),switchName:\"type\",switches:[[\"createAccount\",\"createAccountOp\"],[\"payment\",\"paymentOp\"],[\"pathPaymentStrictReceive\",\"pathPaymentStrictReceiveOp\"],[\"manageSellOffer\",\"manageSellOfferOp\"],[\"createPassiveSellOffer\",\"createPassiveSellOfferOp\"],[\"setOptions\",\"setOptionsOp\"],[\"changeTrust\",\"changeTrustOp\"],[\"allowTrust\",\"allowTrustOp\"],[\"accountMerge\",\"destination\"],[\"inflation\",e.void()],[\"manageData\",\"manageDataOp\"],[\"bumpSequence\",\"bumpSequenceOp\"],[\"manageBuyOffer\",\"manageBuyOfferOp\"],[\"pathPaymentStrictSend\",\"pathPaymentStrictSendOp\"],[\"createClaimableBalance\",\"createClaimableBalanceOp\"],[\"claimClaimableBalance\",\"claimClaimableBalanceOp\"],[\"beginSponsoringFutureReserves\",\"beginSponsoringFutureReservesOp\"],[\"endSponsoringFutureReserves\",e.void()],[\"revokeSponsorship\",\"revokeSponsorshipOp\"],[\"clawback\",\"clawbackOp\"],[\"clawbackClaimableBalance\",\"clawbackClaimableBalanceOp\"],[\"setTrustLineFlags\",\"setTrustLineFlagsOp\"],[\"liquidityPoolDeposit\",\"liquidityPoolDepositOp\"],[\"liquidityPoolWithdraw\",\"liquidityPoolWithdrawOp\"],[\"invokeHostFunction\",\"invokeHostFunctionOp\"],[\"extendFootprintTtl\",\"extendFootprintTtlOp\"],[\"restoreFootprint\",\"restoreFootprintOp\"]],arms:{createAccountOp:e.lookup(\"CreateAccountOp\"),paymentOp:e.lookup(\"PaymentOp\"),pathPaymentStrictReceiveOp:e.lookup(\"PathPaymentStrictReceiveOp\"),manageSellOfferOp:e.lookup(\"ManageSellOfferOp\"),createPassiveSellOfferOp:e.lookup(\"CreatePassiveSellOfferOp\"),setOptionsOp:e.lookup(\"SetOptionsOp\"),changeTrustOp:e.lookup(\"ChangeTrustOp\"),allowTrustOp:e.lookup(\"AllowTrustOp\"),destination:e.lookup(\"MuxedAccount\"),manageDataOp:e.lookup(\"ManageDataOp\"),bumpSequenceOp:e.lookup(\"BumpSequenceOp\"),manageBuyOfferOp:e.lookup(\"ManageBuyOfferOp\"),pathPaymentStrictSendOp:e.lookup(\"PathPaymentStrictSendOp\"),createClaimableBalanceOp:e.lookup(\"CreateClaimableBalanceOp\"),claimClaimableBalanceOp:e.lookup(\"ClaimClaimableBalanceOp\"),beginSponsoringFutureReservesOp:e.lookup(\"BeginSponsoringFutureReservesOp\"),revokeSponsorshipOp:e.lookup(\"RevokeSponsorshipOp\"),clawbackOp:e.lookup(\"ClawbackOp\"),clawbackClaimableBalanceOp:e.lookup(\"ClawbackClaimableBalanceOp\"),setTrustLineFlagsOp:e.lookup(\"SetTrustLineFlagsOp\"),liquidityPoolDepositOp:e.lookup(\"LiquidityPoolDepositOp\"),liquidityPoolWithdrawOp:e.lookup(\"LiquidityPoolWithdrawOp\"),invokeHostFunctionOp:e.lookup(\"InvokeHostFunctionOp\"),extendFootprintTtlOp:e.lookup(\"ExtendFootprintTtlOp\"),restoreFootprintOp:e.lookup(\"RestoreFootprintOp\")}}),e.struct(\"Operation\",[[\"sourceAccount\",e.option(e.lookup(\"MuxedAccount\"))],[\"body\",e.lookup(\"OperationBody\")]]),e.struct(\"HashIdPreimageOperationId\",[[\"sourceAccount\",e.lookup(\"AccountId\")],[\"seqNum\",e.lookup(\"SequenceNumber\")],[\"opNum\",e.lookup(\"Uint32\")]]),e.struct(\"HashIdPreimageRevokeId\",[[\"sourceAccount\",e.lookup(\"AccountId\")],[\"seqNum\",e.lookup(\"SequenceNumber\")],[\"opNum\",e.lookup(\"Uint32\")],[\"liquidityPoolId\",e.lookup(\"PoolId\")],[\"asset\",e.lookup(\"Asset\")]]),e.struct(\"HashIdPreimageContractId\",[[\"networkId\",e.lookup(\"Hash\")],[\"contractIdPreimage\",e.lookup(\"ContractIdPreimage\")]]),e.struct(\"HashIdPreimageSorobanAuthorization\",[[\"networkId\",e.lookup(\"Hash\")],[\"nonce\",e.lookup(\"Int64\")],[\"signatureExpirationLedger\",e.lookup(\"Uint32\")],[\"invocation\",e.lookup(\"SorobanAuthorizedInvocation\")]]),e.union(\"HashIdPreimage\",{switchOn:e.lookup(\"EnvelopeType\"),switchName:\"type\",switches:[[\"envelopeTypeOpId\",\"operationId\"],[\"envelopeTypePoolRevokeOpId\",\"revokeId\"],[\"envelopeTypeContractId\",\"contractId\"],[\"envelopeTypeSorobanAuthorization\",\"sorobanAuthorization\"]],arms:{operationId:e.lookup(\"HashIdPreimageOperationId\"),revokeId:e.lookup(\"HashIdPreimageRevokeId\"),contractId:e.lookup(\"HashIdPreimageContractId\"),sorobanAuthorization:e.lookup(\"HashIdPreimageSorobanAuthorization\")}}),e.enum(\"MemoType\",{memoNone:0,memoText:1,memoId:2,memoHash:3,memoReturn:4}),e.union(\"Memo\",{switchOn:e.lookup(\"MemoType\"),switchName:\"type\",switches:[[\"memoNone\",e.void()],[\"memoText\",\"text\"],[\"memoId\",\"id\"],[\"memoHash\",\"hash\"],[\"memoReturn\",\"retHash\"]],arms:{text:e.string(28),id:e.lookup(\"Uint64\"),hash:e.lookup(\"Hash\"),retHash:e.lookup(\"Hash\")}}),e.struct(\"TimeBounds\",[[\"minTime\",e.lookup(\"TimePoint\")],[\"maxTime\",e.lookup(\"TimePoint\")]]),e.struct(\"LedgerBounds\",[[\"minLedger\",e.lookup(\"Uint32\")],[\"maxLedger\",e.lookup(\"Uint32\")]]),e.struct(\"PreconditionsV2\",[[\"timeBounds\",e.option(e.lookup(\"TimeBounds\"))],[\"ledgerBounds\",e.option(e.lookup(\"LedgerBounds\"))],[\"minSeqNum\",e.option(e.lookup(\"SequenceNumber\"))],[\"minSeqAge\",e.lookup(\"Duration\")],[\"minSeqLedgerGap\",e.lookup(\"Uint32\")],[\"extraSigners\",e.varArray(e.lookup(\"SignerKey\"),2)]]),e.enum(\"PreconditionType\",{precondNone:0,precondTime:1,precondV2:2}),e.union(\"Preconditions\",{switchOn:e.lookup(\"PreconditionType\"),switchName:\"type\",switches:[[\"precondNone\",e.void()],[\"precondTime\",\"timeBounds\"],[\"precondV2\",\"v2\"]],arms:{timeBounds:e.lookup(\"TimeBounds\"),v2:e.lookup(\"PreconditionsV2\")}}),e.struct(\"LedgerFootprint\",[[\"readOnly\",e.varArray(e.lookup(\"LedgerKey\"),2147483647)],[\"readWrite\",e.varArray(e.lookup(\"LedgerKey\"),2147483647)]]),e.struct(\"SorobanResources\",[[\"footprint\",e.lookup(\"LedgerFootprint\")],[\"instructions\",e.lookup(\"Uint32\")],[\"diskReadBytes\",e.lookup(\"Uint32\")],[\"writeBytes\",e.lookup(\"Uint32\")]]),e.struct(\"SorobanResourcesExtV0\",[[\"archivedSorobanEntries\",e.varArray(e.lookup(\"Uint32\"),2147483647)]]),e.union(\"SorobanTransactionDataExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"resourceExt\"]],arms:{resourceExt:e.lookup(\"SorobanResourcesExtV0\")}}),e.struct(\"SorobanTransactionData\",[[\"ext\",e.lookup(\"SorobanTransactionDataExt\")],[\"resources\",e.lookup(\"SorobanResources\")],[\"resourceFee\",e.lookup(\"Int64\")]]),e.union(\"TransactionV0Ext\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"TransactionV0\",[[\"sourceAccountEd25519\",e.lookup(\"Uint256\")],[\"fee\",e.lookup(\"Uint32\")],[\"seqNum\",e.lookup(\"SequenceNumber\")],[\"timeBounds\",e.option(e.lookup(\"TimeBounds\"))],[\"memo\",e.lookup(\"Memo\")],[\"operations\",e.varArray(e.lookup(\"Operation\"),e.lookup(\"MAX_OPS_PER_TX\"))],[\"ext\",e.lookup(\"TransactionV0Ext\")]]),e.struct(\"TransactionV0Envelope\",[[\"tx\",e.lookup(\"TransactionV0\")],[\"signatures\",e.varArray(e.lookup(\"DecoratedSignature\"),20)]]),e.union(\"TransactionExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()],[1,\"sorobanData\"]],arms:{sorobanData:e.lookup(\"SorobanTransactionData\")}}),e.struct(\"Transaction\",[[\"sourceAccount\",e.lookup(\"MuxedAccount\")],[\"fee\",e.lookup(\"Uint32\")],[\"seqNum\",e.lookup(\"SequenceNumber\")],[\"cond\",e.lookup(\"Preconditions\")],[\"memo\",e.lookup(\"Memo\")],[\"operations\",e.varArray(e.lookup(\"Operation\"),e.lookup(\"MAX_OPS_PER_TX\"))],[\"ext\",e.lookup(\"TransactionExt\")]]),e.struct(\"TransactionV1Envelope\",[[\"tx\",e.lookup(\"Transaction\")],[\"signatures\",e.varArray(e.lookup(\"DecoratedSignature\"),20)]]),e.union(\"FeeBumpTransactionInnerTx\",{switchOn:e.lookup(\"EnvelopeType\"),switchName:\"type\",switches:[[\"envelopeTypeTx\",\"v1\"]],arms:{v1:e.lookup(\"TransactionV1Envelope\")}}),e.union(\"FeeBumpTransactionExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"FeeBumpTransaction\",[[\"feeSource\",e.lookup(\"MuxedAccount\")],[\"fee\",e.lookup(\"Int64\")],[\"innerTx\",e.lookup(\"FeeBumpTransactionInnerTx\")],[\"ext\",e.lookup(\"FeeBumpTransactionExt\")]]),e.struct(\"FeeBumpTransactionEnvelope\",[[\"tx\",e.lookup(\"FeeBumpTransaction\")],[\"signatures\",e.varArray(e.lookup(\"DecoratedSignature\"),20)]]),e.union(\"TransactionEnvelope\",{switchOn:e.lookup(\"EnvelopeType\"),switchName:\"type\",switches:[[\"envelopeTypeTxV0\",\"v0\"],[\"envelopeTypeTx\",\"v1\"],[\"envelopeTypeTxFeeBump\",\"feeBump\"]],arms:{v0:e.lookup(\"TransactionV0Envelope\"),v1:e.lookup(\"TransactionV1Envelope\"),feeBump:e.lookup(\"FeeBumpTransactionEnvelope\")}}),e.union(\"TransactionSignaturePayloadTaggedTransaction\",{switchOn:e.lookup(\"EnvelopeType\"),switchName:\"type\",switches:[[\"envelopeTypeTx\",\"tx\"],[\"envelopeTypeTxFeeBump\",\"feeBump\"]],arms:{tx:e.lookup(\"Transaction\"),feeBump:e.lookup(\"FeeBumpTransaction\")}}),e.struct(\"TransactionSignaturePayload\",[[\"networkId\",e.lookup(\"Hash\")],[\"taggedTransaction\",e.lookup(\"TransactionSignaturePayloadTaggedTransaction\")]]),e.enum(\"ClaimAtomType\",{claimAtomTypeV0:0,claimAtomTypeOrderBook:1,claimAtomTypeLiquidityPool:2}),e.struct(\"ClaimOfferAtomV0\",[[\"sellerEd25519\",e.lookup(\"Uint256\")],[\"offerId\",e.lookup(\"Int64\")],[\"assetSold\",e.lookup(\"Asset\")],[\"amountSold\",e.lookup(\"Int64\")],[\"assetBought\",e.lookup(\"Asset\")],[\"amountBought\",e.lookup(\"Int64\")]]),e.struct(\"ClaimOfferAtom\",[[\"sellerId\",e.lookup(\"AccountId\")],[\"offerId\",e.lookup(\"Int64\")],[\"assetSold\",e.lookup(\"Asset\")],[\"amountSold\",e.lookup(\"Int64\")],[\"assetBought\",e.lookup(\"Asset\")],[\"amountBought\",e.lookup(\"Int64\")]]),e.struct(\"ClaimLiquidityAtom\",[[\"liquidityPoolId\",e.lookup(\"PoolId\")],[\"assetSold\",e.lookup(\"Asset\")],[\"amountSold\",e.lookup(\"Int64\")],[\"assetBought\",e.lookup(\"Asset\")],[\"amountBought\",e.lookup(\"Int64\")]]),e.union(\"ClaimAtom\",{switchOn:e.lookup(\"ClaimAtomType\"),switchName:\"type\",switches:[[\"claimAtomTypeV0\",\"v0\"],[\"claimAtomTypeOrderBook\",\"orderBook\"],[\"claimAtomTypeLiquidityPool\",\"liquidityPool\"]],arms:{v0:e.lookup(\"ClaimOfferAtomV0\"),orderBook:e.lookup(\"ClaimOfferAtom\"),liquidityPool:e.lookup(\"ClaimLiquidityAtom\")}}),e.enum(\"CreateAccountResultCode\",{createAccountSuccess:0,createAccountMalformed:-1,createAccountUnderfunded:-2,createAccountLowReserve:-3,createAccountAlreadyExist:-4}),e.union(\"CreateAccountResult\",{switchOn:e.lookup(\"CreateAccountResultCode\"),switchName:\"code\",switches:[[\"createAccountSuccess\",e.void()],[\"createAccountMalformed\",e.void()],[\"createAccountUnderfunded\",e.void()],[\"createAccountLowReserve\",e.void()],[\"createAccountAlreadyExist\",e.void()]],arms:{}}),e.enum(\"PaymentResultCode\",{paymentSuccess:0,paymentMalformed:-1,paymentUnderfunded:-2,paymentSrcNoTrust:-3,paymentSrcNotAuthorized:-4,paymentNoDestination:-5,paymentNoTrust:-6,paymentNotAuthorized:-7,paymentLineFull:-8,paymentNoIssuer:-9}),e.union(\"PaymentResult\",{switchOn:e.lookup(\"PaymentResultCode\"),switchName:\"code\",switches:[[\"paymentSuccess\",e.void()],[\"paymentMalformed\",e.void()],[\"paymentUnderfunded\",e.void()],[\"paymentSrcNoTrust\",e.void()],[\"paymentSrcNotAuthorized\",e.void()],[\"paymentNoDestination\",e.void()],[\"paymentNoTrust\",e.void()],[\"paymentNotAuthorized\",e.void()],[\"paymentLineFull\",e.void()],[\"paymentNoIssuer\",e.void()]],arms:{}}),e.enum(\"PathPaymentStrictReceiveResultCode\",{pathPaymentStrictReceiveSuccess:0,pathPaymentStrictReceiveMalformed:-1,pathPaymentStrictReceiveUnderfunded:-2,pathPaymentStrictReceiveSrcNoTrust:-3,pathPaymentStrictReceiveSrcNotAuthorized:-4,pathPaymentStrictReceiveNoDestination:-5,pathPaymentStrictReceiveNoTrust:-6,pathPaymentStrictReceiveNotAuthorized:-7,pathPaymentStrictReceiveLineFull:-8,pathPaymentStrictReceiveNoIssuer:-9,pathPaymentStrictReceiveTooFewOffers:-10,pathPaymentStrictReceiveOfferCrossSelf:-11,pathPaymentStrictReceiveOverSendmax:-12}),e.struct(\"SimplePaymentResult\",[[\"destination\",e.lookup(\"AccountId\")],[\"asset\",e.lookup(\"Asset\")],[\"amount\",e.lookup(\"Int64\")]]),e.struct(\"PathPaymentStrictReceiveResultSuccess\",[[\"offers\",e.varArray(e.lookup(\"ClaimAtom\"),2147483647)],[\"last\",e.lookup(\"SimplePaymentResult\")]]),e.union(\"PathPaymentStrictReceiveResult\",{switchOn:e.lookup(\"PathPaymentStrictReceiveResultCode\"),switchName:\"code\",switches:[[\"pathPaymentStrictReceiveSuccess\",\"success\"],[\"pathPaymentStrictReceiveMalformed\",e.void()],[\"pathPaymentStrictReceiveUnderfunded\",e.void()],[\"pathPaymentStrictReceiveSrcNoTrust\",e.void()],[\"pathPaymentStrictReceiveSrcNotAuthorized\",e.void()],[\"pathPaymentStrictReceiveNoDestination\",e.void()],[\"pathPaymentStrictReceiveNoTrust\",e.void()],[\"pathPaymentStrictReceiveNotAuthorized\",e.void()],[\"pathPaymentStrictReceiveLineFull\",e.void()],[\"pathPaymentStrictReceiveNoIssuer\",\"noIssuer\"],[\"pathPaymentStrictReceiveTooFewOffers\",e.void()],[\"pathPaymentStrictReceiveOfferCrossSelf\",e.void()],[\"pathPaymentStrictReceiveOverSendmax\",e.void()]],arms:{success:e.lookup(\"PathPaymentStrictReceiveResultSuccess\"),noIssuer:e.lookup(\"Asset\")}}),e.enum(\"PathPaymentStrictSendResultCode\",{pathPaymentStrictSendSuccess:0,pathPaymentStrictSendMalformed:-1,pathPaymentStrictSendUnderfunded:-2,pathPaymentStrictSendSrcNoTrust:-3,pathPaymentStrictSendSrcNotAuthorized:-4,pathPaymentStrictSendNoDestination:-5,pathPaymentStrictSendNoTrust:-6,pathPaymentStrictSendNotAuthorized:-7,pathPaymentStrictSendLineFull:-8,pathPaymentStrictSendNoIssuer:-9,pathPaymentStrictSendTooFewOffers:-10,pathPaymentStrictSendOfferCrossSelf:-11,pathPaymentStrictSendUnderDestmin:-12}),e.struct(\"PathPaymentStrictSendResultSuccess\",[[\"offers\",e.varArray(e.lookup(\"ClaimAtom\"),2147483647)],[\"last\",e.lookup(\"SimplePaymentResult\")]]),e.union(\"PathPaymentStrictSendResult\",{switchOn:e.lookup(\"PathPaymentStrictSendResultCode\"),switchName:\"code\",switches:[[\"pathPaymentStrictSendSuccess\",\"success\"],[\"pathPaymentStrictSendMalformed\",e.void()],[\"pathPaymentStrictSendUnderfunded\",e.void()],[\"pathPaymentStrictSendSrcNoTrust\",e.void()],[\"pathPaymentStrictSendSrcNotAuthorized\",e.void()],[\"pathPaymentStrictSendNoDestination\",e.void()],[\"pathPaymentStrictSendNoTrust\",e.void()],[\"pathPaymentStrictSendNotAuthorized\",e.void()],[\"pathPaymentStrictSendLineFull\",e.void()],[\"pathPaymentStrictSendNoIssuer\",\"noIssuer\"],[\"pathPaymentStrictSendTooFewOffers\",e.void()],[\"pathPaymentStrictSendOfferCrossSelf\",e.void()],[\"pathPaymentStrictSendUnderDestmin\",e.void()]],arms:{success:e.lookup(\"PathPaymentStrictSendResultSuccess\"),noIssuer:e.lookup(\"Asset\")}}),e.enum(\"ManageSellOfferResultCode\",{manageSellOfferSuccess:0,manageSellOfferMalformed:-1,manageSellOfferSellNoTrust:-2,manageSellOfferBuyNoTrust:-3,manageSellOfferSellNotAuthorized:-4,manageSellOfferBuyNotAuthorized:-5,manageSellOfferLineFull:-6,manageSellOfferUnderfunded:-7,manageSellOfferCrossSelf:-8,manageSellOfferSellNoIssuer:-9,manageSellOfferBuyNoIssuer:-10,manageSellOfferNotFound:-11,manageSellOfferLowReserve:-12}),e.enum(\"ManageOfferEffect\",{manageOfferCreated:0,manageOfferUpdated:1,manageOfferDeleted:2}),e.union(\"ManageOfferSuccessResultOffer\",{switchOn:e.lookup(\"ManageOfferEffect\"),switchName:\"effect\",switches:[[\"manageOfferCreated\",\"offer\"],[\"manageOfferUpdated\",\"offer\"],[\"manageOfferDeleted\",e.void()]],arms:{offer:e.lookup(\"OfferEntry\")}}),e.struct(\"ManageOfferSuccessResult\",[[\"offersClaimed\",e.varArray(e.lookup(\"ClaimAtom\"),2147483647)],[\"offer\",e.lookup(\"ManageOfferSuccessResultOffer\")]]),e.union(\"ManageSellOfferResult\",{switchOn:e.lookup(\"ManageSellOfferResultCode\"),switchName:\"code\",switches:[[\"manageSellOfferSuccess\",\"success\"],[\"manageSellOfferMalformed\",e.void()],[\"manageSellOfferSellNoTrust\",e.void()],[\"manageSellOfferBuyNoTrust\",e.void()],[\"manageSellOfferSellNotAuthorized\",e.void()],[\"manageSellOfferBuyNotAuthorized\",e.void()],[\"manageSellOfferLineFull\",e.void()],[\"manageSellOfferUnderfunded\",e.void()],[\"manageSellOfferCrossSelf\",e.void()],[\"manageSellOfferSellNoIssuer\",e.void()],[\"manageSellOfferBuyNoIssuer\",e.void()],[\"manageSellOfferNotFound\",e.void()],[\"manageSellOfferLowReserve\",e.void()]],arms:{success:e.lookup(\"ManageOfferSuccessResult\")}}),e.enum(\"ManageBuyOfferResultCode\",{manageBuyOfferSuccess:0,manageBuyOfferMalformed:-1,manageBuyOfferSellNoTrust:-2,manageBuyOfferBuyNoTrust:-3,manageBuyOfferSellNotAuthorized:-4,manageBuyOfferBuyNotAuthorized:-5,manageBuyOfferLineFull:-6,manageBuyOfferUnderfunded:-7,manageBuyOfferCrossSelf:-8,manageBuyOfferSellNoIssuer:-9,manageBuyOfferBuyNoIssuer:-10,manageBuyOfferNotFound:-11,manageBuyOfferLowReserve:-12}),e.union(\"ManageBuyOfferResult\",{switchOn:e.lookup(\"ManageBuyOfferResultCode\"),switchName:\"code\",switches:[[\"manageBuyOfferSuccess\",\"success\"],[\"manageBuyOfferMalformed\",e.void()],[\"manageBuyOfferSellNoTrust\",e.void()],[\"manageBuyOfferBuyNoTrust\",e.void()],[\"manageBuyOfferSellNotAuthorized\",e.void()],[\"manageBuyOfferBuyNotAuthorized\",e.void()],[\"manageBuyOfferLineFull\",e.void()],[\"manageBuyOfferUnderfunded\",e.void()],[\"manageBuyOfferCrossSelf\",e.void()],[\"manageBuyOfferSellNoIssuer\",e.void()],[\"manageBuyOfferBuyNoIssuer\",e.void()],[\"manageBuyOfferNotFound\",e.void()],[\"manageBuyOfferLowReserve\",e.void()]],arms:{success:e.lookup(\"ManageOfferSuccessResult\")}}),e.enum(\"SetOptionsResultCode\",{setOptionsSuccess:0,setOptionsLowReserve:-1,setOptionsTooManySigners:-2,setOptionsBadFlags:-3,setOptionsInvalidInflation:-4,setOptionsCantChange:-5,setOptionsUnknownFlag:-6,setOptionsThresholdOutOfRange:-7,setOptionsBadSigner:-8,setOptionsInvalidHomeDomain:-9,setOptionsAuthRevocableRequired:-10}),e.union(\"SetOptionsResult\",{switchOn:e.lookup(\"SetOptionsResultCode\"),switchName:\"code\",switches:[[\"setOptionsSuccess\",e.void()],[\"setOptionsLowReserve\",e.void()],[\"setOptionsTooManySigners\",e.void()],[\"setOptionsBadFlags\",e.void()],[\"setOptionsInvalidInflation\",e.void()],[\"setOptionsCantChange\",e.void()],[\"setOptionsUnknownFlag\",e.void()],[\"setOptionsThresholdOutOfRange\",e.void()],[\"setOptionsBadSigner\",e.void()],[\"setOptionsInvalidHomeDomain\",e.void()],[\"setOptionsAuthRevocableRequired\",e.void()]],arms:{}}),e.enum(\"ChangeTrustResultCode\",{changeTrustSuccess:0,changeTrustMalformed:-1,changeTrustNoIssuer:-2,changeTrustInvalidLimit:-3,changeTrustLowReserve:-4,changeTrustSelfNotAllowed:-5,changeTrustTrustLineMissing:-6,changeTrustCannotDelete:-7,changeTrustNotAuthMaintainLiabilities:-8}),e.union(\"ChangeTrustResult\",{switchOn:e.lookup(\"ChangeTrustResultCode\"),switchName:\"code\",switches:[[\"changeTrustSuccess\",e.void()],[\"changeTrustMalformed\",e.void()],[\"changeTrustNoIssuer\",e.void()],[\"changeTrustInvalidLimit\",e.void()],[\"changeTrustLowReserve\",e.void()],[\"changeTrustSelfNotAllowed\",e.void()],[\"changeTrustTrustLineMissing\",e.void()],[\"changeTrustCannotDelete\",e.void()],[\"changeTrustNotAuthMaintainLiabilities\",e.void()]],arms:{}}),e.enum(\"AllowTrustResultCode\",{allowTrustSuccess:0,allowTrustMalformed:-1,allowTrustNoTrustLine:-2,allowTrustTrustNotRequired:-3,allowTrustCantRevoke:-4,allowTrustSelfNotAllowed:-5,allowTrustLowReserve:-6}),e.union(\"AllowTrustResult\",{switchOn:e.lookup(\"AllowTrustResultCode\"),switchName:\"code\",switches:[[\"allowTrustSuccess\",e.void()],[\"allowTrustMalformed\",e.void()],[\"allowTrustNoTrustLine\",e.void()],[\"allowTrustTrustNotRequired\",e.void()],[\"allowTrustCantRevoke\",e.void()],[\"allowTrustSelfNotAllowed\",e.void()],[\"allowTrustLowReserve\",e.void()]],arms:{}}),e.enum(\"AccountMergeResultCode\",{accountMergeSuccess:0,accountMergeMalformed:-1,accountMergeNoAccount:-2,accountMergeImmutableSet:-3,accountMergeHasSubEntries:-4,accountMergeSeqnumTooFar:-5,accountMergeDestFull:-6,accountMergeIsSponsor:-7}),e.union(\"AccountMergeResult\",{switchOn:e.lookup(\"AccountMergeResultCode\"),switchName:\"code\",switches:[[\"accountMergeSuccess\",\"sourceAccountBalance\"],[\"accountMergeMalformed\",e.void()],[\"accountMergeNoAccount\",e.void()],[\"accountMergeImmutableSet\",e.void()],[\"accountMergeHasSubEntries\",e.void()],[\"accountMergeSeqnumTooFar\",e.void()],[\"accountMergeDestFull\",e.void()],[\"accountMergeIsSponsor\",e.void()]],arms:{sourceAccountBalance:e.lookup(\"Int64\")}}),e.enum(\"InflationResultCode\",{inflationSuccess:0,inflationNotTime:-1}),e.struct(\"InflationPayout\",[[\"destination\",e.lookup(\"AccountId\")],[\"amount\",e.lookup(\"Int64\")]]),e.union(\"InflationResult\",{switchOn:e.lookup(\"InflationResultCode\"),switchName:\"code\",switches:[[\"inflationSuccess\",\"payouts\"],[\"inflationNotTime\",e.void()]],arms:{payouts:e.varArray(e.lookup(\"InflationPayout\"),2147483647)}}),e.enum(\"ManageDataResultCode\",{manageDataSuccess:0,manageDataNotSupportedYet:-1,manageDataNameNotFound:-2,manageDataLowReserve:-3,manageDataInvalidName:-4}),e.union(\"ManageDataResult\",{switchOn:e.lookup(\"ManageDataResultCode\"),switchName:\"code\",switches:[[\"manageDataSuccess\",e.void()],[\"manageDataNotSupportedYet\",e.void()],[\"manageDataNameNotFound\",e.void()],[\"manageDataLowReserve\",e.void()],[\"manageDataInvalidName\",e.void()]],arms:{}}),e.enum(\"BumpSequenceResultCode\",{bumpSequenceSuccess:0,bumpSequenceBadSeq:-1}),e.union(\"BumpSequenceResult\",{switchOn:e.lookup(\"BumpSequenceResultCode\"),switchName:\"code\",switches:[[\"bumpSequenceSuccess\",e.void()],[\"bumpSequenceBadSeq\",e.void()]],arms:{}}),e.enum(\"CreateClaimableBalanceResultCode\",{createClaimableBalanceSuccess:0,createClaimableBalanceMalformed:-1,createClaimableBalanceLowReserve:-2,createClaimableBalanceNoTrust:-3,createClaimableBalanceNotAuthorized:-4,createClaimableBalanceUnderfunded:-5}),e.union(\"CreateClaimableBalanceResult\",{switchOn:e.lookup(\"CreateClaimableBalanceResultCode\"),switchName:\"code\",switches:[[\"createClaimableBalanceSuccess\",\"balanceId\"],[\"createClaimableBalanceMalformed\",e.void()],[\"createClaimableBalanceLowReserve\",e.void()],[\"createClaimableBalanceNoTrust\",e.void()],[\"createClaimableBalanceNotAuthorized\",e.void()],[\"createClaimableBalanceUnderfunded\",e.void()]],arms:{balanceId:e.lookup(\"ClaimableBalanceId\")}}),e.enum(\"ClaimClaimableBalanceResultCode\",{claimClaimableBalanceSuccess:0,claimClaimableBalanceDoesNotExist:-1,claimClaimableBalanceCannotClaim:-2,claimClaimableBalanceLineFull:-3,claimClaimableBalanceNoTrust:-4,claimClaimableBalanceNotAuthorized:-5,claimClaimableBalanceTrustlineFrozen:-6}),e.union(\"ClaimClaimableBalanceResult\",{switchOn:e.lookup(\"ClaimClaimableBalanceResultCode\"),switchName:\"code\",switches:[[\"claimClaimableBalanceSuccess\",e.void()],[\"claimClaimableBalanceDoesNotExist\",e.void()],[\"claimClaimableBalanceCannotClaim\",e.void()],[\"claimClaimableBalanceLineFull\",e.void()],[\"claimClaimableBalanceNoTrust\",e.void()],[\"claimClaimableBalanceNotAuthorized\",e.void()],[\"claimClaimableBalanceTrustlineFrozen\",e.void()]],arms:{}}),e.enum(\"BeginSponsoringFutureReservesResultCode\",{beginSponsoringFutureReservesSuccess:0,beginSponsoringFutureReservesMalformed:-1,beginSponsoringFutureReservesAlreadySponsored:-2,beginSponsoringFutureReservesRecursive:-3}),e.union(\"BeginSponsoringFutureReservesResult\",{switchOn:e.lookup(\"BeginSponsoringFutureReservesResultCode\"),switchName:\"code\",switches:[[\"beginSponsoringFutureReservesSuccess\",e.void()],[\"beginSponsoringFutureReservesMalformed\",e.void()],[\"beginSponsoringFutureReservesAlreadySponsored\",e.void()],[\"beginSponsoringFutureReservesRecursive\",e.void()]],arms:{}}),e.enum(\"EndSponsoringFutureReservesResultCode\",{endSponsoringFutureReservesSuccess:0,endSponsoringFutureReservesNotSponsored:-1}),e.union(\"EndSponsoringFutureReservesResult\",{switchOn:e.lookup(\"EndSponsoringFutureReservesResultCode\"),switchName:\"code\",switches:[[\"endSponsoringFutureReservesSuccess\",e.void()],[\"endSponsoringFutureReservesNotSponsored\",e.void()]],arms:{}}),e.enum(\"RevokeSponsorshipResultCode\",{revokeSponsorshipSuccess:0,revokeSponsorshipDoesNotExist:-1,revokeSponsorshipNotSponsor:-2,revokeSponsorshipLowReserve:-3,revokeSponsorshipOnlyTransferable:-4,revokeSponsorshipMalformed:-5}),e.union(\"RevokeSponsorshipResult\",{switchOn:e.lookup(\"RevokeSponsorshipResultCode\"),switchName:\"code\",switches:[[\"revokeSponsorshipSuccess\",e.void()],[\"revokeSponsorshipDoesNotExist\",e.void()],[\"revokeSponsorshipNotSponsor\",e.void()],[\"revokeSponsorshipLowReserve\",e.void()],[\"revokeSponsorshipOnlyTransferable\",e.void()],[\"revokeSponsorshipMalformed\",e.void()]],arms:{}}),e.enum(\"ClawbackResultCode\",{clawbackSuccess:0,clawbackMalformed:-1,clawbackNotClawbackEnabled:-2,clawbackNoTrust:-3,clawbackUnderfunded:-4}),e.union(\"ClawbackResult\",{switchOn:e.lookup(\"ClawbackResultCode\"),switchName:\"code\",switches:[[\"clawbackSuccess\",e.void()],[\"clawbackMalformed\",e.void()],[\"clawbackNotClawbackEnabled\",e.void()],[\"clawbackNoTrust\",e.void()],[\"clawbackUnderfunded\",e.void()]],arms:{}}),e.enum(\"ClawbackClaimableBalanceResultCode\",{clawbackClaimableBalanceSuccess:0,clawbackClaimableBalanceDoesNotExist:-1,clawbackClaimableBalanceNotIssuer:-2,clawbackClaimableBalanceNotClawbackEnabled:-3}),e.union(\"ClawbackClaimableBalanceResult\",{switchOn:e.lookup(\"ClawbackClaimableBalanceResultCode\"),switchName:\"code\",switches:[[\"clawbackClaimableBalanceSuccess\",e.void()],[\"clawbackClaimableBalanceDoesNotExist\",e.void()],[\"clawbackClaimableBalanceNotIssuer\",e.void()],[\"clawbackClaimableBalanceNotClawbackEnabled\",e.void()]],arms:{}}),e.enum(\"SetTrustLineFlagsResultCode\",{setTrustLineFlagsSuccess:0,setTrustLineFlagsMalformed:-1,setTrustLineFlagsNoTrustLine:-2,setTrustLineFlagsCantRevoke:-3,setTrustLineFlagsInvalidState:-4,setTrustLineFlagsLowReserve:-5}),e.union(\"SetTrustLineFlagsResult\",{switchOn:e.lookup(\"SetTrustLineFlagsResultCode\"),switchName:\"code\",switches:[[\"setTrustLineFlagsSuccess\",e.void()],[\"setTrustLineFlagsMalformed\",e.void()],[\"setTrustLineFlagsNoTrustLine\",e.void()],[\"setTrustLineFlagsCantRevoke\",e.void()],[\"setTrustLineFlagsInvalidState\",e.void()],[\"setTrustLineFlagsLowReserve\",e.void()]],arms:{}}),e.enum(\"LiquidityPoolDepositResultCode\",{liquidityPoolDepositSuccess:0,liquidityPoolDepositMalformed:-1,liquidityPoolDepositNoTrust:-2,liquidityPoolDepositNotAuthorized:-3,liquidityPoolDepositUnderfunded:-4,liquidityPoolDepositLineFull:-5,liquidityPoolDepositBadPrice:-6,liquidityPoolDepositPoolFull:-7,liquidityPoolDepositTrustlineFrozen:-8}),e.union(\"LiquidityPoolDepositResult\",{switchOn:e.lookup(\"LiquidityPoolDepositResultCode\"),switchName:\"code\",switches:[[\"liquidityPoolDepositSuccess\",e.void()],[\"liquidityPoolDepositMalformed\",e.void()],[\"liquidityPoolDepositNoTrust\",e.void()],[\"liquidityPoolDepositNotAuthorized\",e.void()],[\"liquidityPoolDepositUnderfunded\",e.void()],[\"liquidityPoolDepositLineFull\",e.void()],[\"liquidityPoolDepositBadPrice\",e.void()],[\"liquidityPoolDepositPoolFull\",e.void()],[\"liquidityPoolDepositTrustlineFrozen\",e.void()]],arms:{}}),e.enum(\"LiquidityPoolWithdrawResultCode\",{liquidityPoolWithdrawSuccess:0,liquidityPoolWithdrawMalformed:-1,liquidityPoolWithdrawNoTrust:-2,liquidityPoolWithdrawUnderfunded:-3,liquidityPoolWithdrawLineFull:-4,liquidityPoolWithdrawUnderMinimum:-5,liquidityPoolWithdrawTrustlineFrozen:-6}),e.union(\"LiquidityPoolWithdrawResult\",{switchOn:e.lookup(\"LiquidityPoolWithdrawResultCode\"),switchName:\"code\",switches:[[\"liquidityPoolWithdrawSuccess\",e.void()],[\"liquidityPoolWithdrawMalformed\",e.void()],[\"liquidityPoolWithdrawNoTrust\",e.void()],[\"liquidityPoolWithdrawUnderfunded\",e.void()],[\"liquidityPoolWithdrawLineFull\",e.void()],[\"liquidityPoolWithdrawUnderMinimum\",e.void()],[\"liquidityPoolWithdrawTrustlineFrozen\",e.void()]],arms:{}}),e.enum(\"InvokeHostFunctionResultCode\",{invokeHostFunctionSuccess:0,invokeHostFunctionMalformed:-1,invokeHostFunctionTrapped:-2,invokeHostFunctionResourceLimitExceeded:-3,invokeHostFunctionEntryArchived:-4,invokeHostFunctionInsufficientRefundableFee:-5}),e.union(\"InvokeHostFunctionResult\",{switchOn:e.lookup(\"InvokeHostFunctionResultCode\"),switchName:\"code\",switches:[[\"invokeHostFunctionSuccess\",\"success\"],[\"invokeHostFunctionMalformed\",e.void()],[\"invokeHostFunctionTrapped\",e.void()],[\"invokeHostFunctionResourceLimitExceeded\",e.void()],[\"invokeHostFunctionEntryArchived\",e.void()],[\"invokeHostFunctionInsufficientRefundableFee\",e.void()]],arms:{success:e.lookup(\"Hash\")}}),e.enum(\"ExtendFootprintTtlResultCode\",{extendFootprintTtlSuccess:0,extendFootprintTtlMalformed:-1,extendFootprintTtlResourceLimitExceeded:-2,extendFootprintTtlInsufficientRefundableFee:-3}),e.union(\"ExtendFootprintTtlResult\",{switchOn:e.lookup(\"ExtendFootprintTtlResultCode\"),switchName:\"code\",switches:[[\"extendFootprintTtlSuccess\",e.void()],[\"extendFootprintTtlMalformed\",e.void()],[\"extendFootprintTtlResourceLimitExceeded\",e.void()],[\"extendFootprintTtlInsufficientRefundableFee\",e.void()]],arms:{}}),e.enum(\"RestoreFootprintResultCode\",{restoreFootprintSuccess:0,restoreFootprintMalformed:-1,restoreFootprintResourceLimitExceeded:-2,restoreFootprintInsufficientRefundableFee:-3}),e.union(\"RestoreFootprintResult\",{switchOn:e.lookup(\"RestoreFootprintResultCode\"),switchName:\"code\",switches:[[\"restoreFootprintSuccess\",e.void()],[\"restoreFootprintMalformed\",e.void()],[\"restoreFootprintResourceLimitExceeded\",e.void()],[\"restoreFootprintInsufficientRefundableFee\",e.void()]],arms:{}}),e.enum(\"OperationResultCode\",{opInner:0,opBadAuth:-1,opNoAccount:-2,opNotSupported:-3,opTooManySubentries:-4,opExceededWorkLimit:-5,opTooManySponsoring:-6}),e.union(\"OperationResultTr\",{switchOn:e.lookup(\"OperationType\"),switchName:\"type\",switches:[[\"createAccount\",\"createAccountResult\"],[\"payment\",\"paymentResult\"],[\"pathPaymentStrictReceive\",\"pathPaymentStrictReceiveResult\"],[\"manageSellOffer\",\"manageSellOfferResult\"],[\"createPassiveSellOffer\",\"createPassiveSellOfferResult\"],[\"setOptions\",\"setOptionsResult\"],[\"changeTrust\",\"changeTrustResult\"],[\"allowTrust\",\"allowTrustResult\"],[\"accountMerge\",\"accountMergeResult\"],[\"inflation\",\"inflationResult\"],[\"manageData\",\"manageDataResult\"],[\"bumpSequence\",\"bumpSeqResult\"],[\"manageBuyOffer\",\"manageBuyOfferResult\"],[\"pathPaymentStrictSend\",\"pathPaymentStrictSendResult\"],[\"createClaimableBalance\",\"createClaimableBalanceResult\"],[\"claimClaimableBalance\",\"claimClaimableBalanceResult\"],[\"beginSponsoringFutureReserves\",\"beginSponsoringFutureReservesResult\"],[\"endSponsoringFutureReserves\",\"endSponsoringFutureReservesResult\"],[\"revokeSponsorship\",\"revokeSponsorshipResult\"],[\"clawback\",\"clawbackResult\"],[\"clawbackClaimableBalance\",\"clawbackClaimableBalanceResult\"],[\"setTrustLineFlags\",\"setTrustLineFlagsResult\"],[\"liquidityPoolDeposit\",\"liquidityPoolDepositResult\"],[\"liquidityPoolWithdraw\",\"liquidityPoolWithdrawResult\"],[\"invokeHostFunction\",\"invokeHostFunctionResult\"],[\"extendFootprintTtl\",\"extendFootprintTtlResult\"],[\"restoreFootprint\",\"restoreFootprintResult\"]],arms:{createAccountResult:e.lookup(\"CreateAccountResult\"),paymentResult:e.lookup(\"PaymentResult\"),pathPaymentStrictReceiveResult:e.lookup(\"PathPaymentStrictReceiveResult\"),manageSellOfferResult:e.lookup(\"ManageSellOfferResult\"),createPassiveSellOfferResult:e.lookup(\"ManageSellOfferResult\"),setOptionsResult:e.lookup(\"SetOptionsResult\"),changeTrustResult:e.lookup(\"ChangeTrustResult\"),allowTrustResult:e.lookup(\"AllowTrustResult\"),accountMergeResult:e.lookup(\"AccountMergeResult\"),inflationResult:e.lookup(\"InflationResult\"),manageDataResult:e.lookup(\"ManageDataResult\"),bumpSeqResult:e.lookup(\"BumpSequenceResult\"),manageBuyOfferResult:e.lookup(\"ManageBuyOfferResult\"),pathPaymentStrictSendResult:e.lookup(\"PathPaymentStrictSendResult\"),createClaimableBalanceResult:e.lookup(\"CreateClaimableBalanceResult\"),claimClaimableBalanceResult:e.lookup(\"ClaimClaimableBalanceResult\"),beginSponsoringFutureReservesResult:e.lookup(\"BeginSponsoringFutureReservesResult\"),endSponsoringFutureReservesResult:e.lookup(\"EndSponsoringFutureReservesResult\"),revokeSponsorshipResult:e.lookup(\"RevokeSponsorshipResult\"),clawbackResult:e.lookup(\"ClawbackResult\"),clawbackClaimableBalanceResult:e.lookup(\"ClawbackClaimableBalanceResult\"),setTrustLineFlagsResult:e.lookup(\"SetTrustLineFlagsResult\"),liquidityPoolDepositResult:e.lookup(\"LiquidityPoolDepositResult\"),liquidityPoolWithdrawResult:e.lookup(\"LiquidityPoolWithdrawResult\"),invokeHostFunctionResult:e.lookup(\"InvokeHostFunctionResult\"),extendFootprintTtlResult:e.lookup(\"ExtendFootprintTtlResult\"),restoreFootprintResult:e.lookup(\"RestoreFootprintResult\")}}),e.union(\"OperationResult\",{switchOn:e.lookup(\"OperationResultCode\"),switchName:\"code\",switches:[[\"opInner\",\"tr\"],[\"opBadAuth\",e.void()],[\"opNoAccount\",e.void()],[\"opNotSupported\",e.void()],[\"opTooManySubentries\",e.void()],[\"opExceededWorkLimit\",e.void()],[\"opTooManySponsoring\",e.void()]],arms:{tr:e.lookup(\"OperationResultTr\")}}),e.enum(\"TransactionResultCode\",{txFeeBumpInnerSuccess:1,txSuccess:0,txFailed:-1,txTooEarly:-2,txTooLate:-3,txMissingOperation:-4,txBadSeq:-5,txBadAuth:-6,txInsufficientBalance:-7,txNoAccount:-8,txInsufficientFee:-9,txBadAuthExtra:-10,txInternalError:-11,txNotSupported:-12,txFeeBumpInnerFailed:-13,txBadSponsorship:-14,txBadMinSeqAgeOrGap:-15,txMalformed:-16,txSorobanInvalid:-17,txFrozenKeyAccessed:-18}),e.union(\"InnerTransactionResultResult\",{switchOn:e.lookup(\"TransactionResultCode\"),switchName:\"code\",switches:[[\"txSuccess\",\"results\"],[\"txFailed\",\"results\"],[\"txTooEarly\",e.void()],[\"txTooLate\",e.void()],[\"txMissingOperation\",e.void()],[\"txBadSeq\",e.void()],[\"txBadAuth\",e.void()],[\"txInsufficientBalance\",e.void()],[\"txNoAccount\",e.void()],[\"txInsufficientFee\",e.void()],[\"txBadAuthExtra\",e.void()],[\"txInternalError\",e.void()],[\"txNotSupported\",e.void()],[\"txBadSponsorship\",e.void()],[\"txBadMinSeqAgeOrGap\",e.void()],[\"txMalformed\",e.void()],[\"txSorobanInvalid\",e.void()],[\"txFrozenKeyAccessed\",e.void()]],arms:{results:e.varArray(e.lookup(\"OperationResult\"),2147483647)}}),e.union(\"InnerTransactionResultExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"InnerTransactionResult\",[[\"feeCharged\",e.lookup(\"Int64\")],[\"result\",e.lookup(\"InnerTransactionResultResult\")],[\"ext\",e.lookup(\"InnerTransactionResultExt\")]]),e.struct(\"InnerTransactionResultPair\",[[\"transactionHash\",e.lookup(\"Hash\")],[\"result\",e.lookup(\"InnerTransactionResult\")]]),e.union(\"TransactionResultResult\",{switchOn:e.lookup(\"TransactionResultCode\"),switchName:\"code\",switches:[[\"txFeeBumpInnerSuccess\",\"innerResultPair\"],[\"txFeeBumpInnerFailed\",\"innerResultPair\"],[\"txSuccess\",\"results\"],[\"txFailed\",\"results\"],[\"txTooEarly\",e.void()],[\"txTooLate\",e.void()],[\"txMissingOperation\",e.void()],[\"txBadSeq\",e.void()],[\"txBadAuth\",e.void()],[\"txInsufficientBalance\",e.void()],[\"txNoAccount\",e.void()],[\"txInsufficientFee\",e.void()],[\"txBadAuthExtra\",e.void()],[\"txInternalError\",e.void()],[\"txNotSupported\",e.void()],[\"txBadSponsorship\",e.void()],[\"txBadMinSeqAgeOrGap\",e.void()],[\"txMalformed\",e.void()],[\"txSorobanInvalid\",e.void()],[\"txFrozenKeyAccessed\",e.void()]],arms:{innerResultPair:e.lookup(\"InnerTransactionResultPair\"),results:e.varArray(e.lookup(\"OperationResult\"),2147483647)}}),e.union(\"TransactionResultExt\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.struct(\"TransactionResult\",[[\"feeCharged\",e.lookup(\"Int64\")],[\"result\",e.lookup(\"TransactionResultResult\")],[\"ext\",e.lookup(\"TransactionResultExt\")]]),e.typedef(\"Hash\",e.opaque(32)),e.typedef(\"Uint256\",e.opaque(32)),e.typedef(\"Uint32\",e.uint()),e.typedef(\"Int32\",e.int()),e.typedef(\"Uint64\",e.uhyper()),e.typedef(\"Int64\",e.hyper()),e.typedef(\"TimePoint\",e.lookup(\"Uint64\")),e.typedef(\"Duration\",e.lookup(\"Uint64\")),e.union(\"ExtensionPoint\",{switchOn:e.int(),switchName:\"v\",switches:[[0,e.void()]],arms:{}}),e.enum(\"CryptoKeyType\",{keyTypeEd25519:0,keyTypePreAuthTx:1,keyTypeHashX:2,keyTypeEd25519SignedPayload:3,keyTypeMuxedEd25519:256}),e.enum(\"PublicKeyType\",{publicKeyTypeEd25519:0}),e.enum(\"SignerKeyType\",{signerKeyTypeEd25519:0,signerKeyTypePreAuthTx:1,signerKeyTypeHashX:2,signerKeyTypeEd25519SignedPayload:3}),e.union(\"PublicKey\",{switchOn:e.lookup(\"PublicKeyType\"),switchName:\"type\",switches:[[\"publicKeyTypeEd25519\",\"ed25519\"]],arms:{ed25519:e.lookup(\"Uint256\")}}),e.struct(\"SignerKeyEd25519SignedPayload\",[[\"ed25519\",e.lookup(\"Uint256\")],[\"payload\",e.varOpaque(64)]]),e.union(\"SignerKey\",{switchOn:e.lookup(\"SignerKeyType\"),switchName:\"type\",switches:[[\"signerKeyTypeEd25519\",\"ed25519\"],[\"signerKeyTypePreAuthTx\",\"preAuthTx\"],[\"signerKeyTypeHashX\",\"hashX\"],[\"signerKeyTypeEd25519SignedPayload\",\"ed25519SignedPayload\"]],arms:{ed25519:e.lookup(\"Uint256\"),preAuthTx:e.lookup(\"Uint256\"),hashX:e.lookup(\"Uint256\"),ed25519SignedPayload:e.lookup(\"SignerKeyEd25519SignedPayload\")}}),e.typedef(\"Signature\",e.varOpaque(64)),e.typedef(\"SignatureHint\",e.opaque(4)),e.typedef(\"NodeId\",e.lookup(\"PublicKey\")),e.typedef(\"AccountId\",e.lookup(\"PublicKey\")),e.typedef(\"ContractId\",e.lookup(\"Hash\")),e.struct(\"Curve25519Secret\",[[\"key\",e.opaque(32)]]),e.struct(\"Curve25519Public\",[[\"key\",e.opaque(32)]]),e.struct(\"HmacSha256Key\",[[\"key\",e.opaque(32)]]),e.struct(\"HmacSha256Mac\",[[\"mac\",e.opaque(32)]]),e.struct(\"ShortHashSeed\",[[\"seed\",e.opaque(16)]]),e.enum(\"BinaryFuseFilterType\",{binaryFuseFilter8Bit:0,binaryFuseFilter16Bit:1,binaryFuseFilter32Bit:2}),e.struct(\"SerializedBinaryFuseFilter\",[[\"type\",e.lookup(\"BinaryFuseFilterType\")],[\"inputHashSeed\",e.lookup(\"ShortHashSeed\")],[\"filterSeed\",e.lookup(\"ShortHashSeed\")],[\"segmentLength\",e.lookup(\"Uint32\")],[\"segementLengthMask\",e.lookup(\"Uint32\")],[\"segmentCount\",e.lookup(\"Uint32\")],[\"segmentCountLength\",e.lookup(\"Uint32\")],[\"fingerprintLength\",e.lookup(\"Uint32\")],[\"fingerprints\",e.varOpaque()]]),e.typedef(\"PoolId\",e.lookup(\"Hash\")),e.enum(\"ClaimableBalanceIdType\",{claimableBalanceIdTypeV0:0}),e.union(\"ClaimableBalanceId\",{switchOn:e.lookup(\"ClaimableBalanceIdType\"),switchName:\"type\",switches:[[\"claimableBalanceIdTypeV0\",\"v0\"]],arms:{v0:e.lookup(\"Hash\")}}),e.enum(\"ScValType\",{scvBool:0,scvVoid:1,scvError:2,scvU32:3,scvI32:4,scvU64:5,scvI64:6,scvTimepoint:7,scvDuration:8,scvU128:9,scvI128:10,scvU256:11,scvI256:12,scvBytes:13,scvString:14,scvSymbol:15,scvVec:16,scvMap:17,scvAddress:18,scvContractInstance:19,scvLedgerKeyContractInstance:20,scvLedgerKeyNonce:21}),e.enum(\"ScErrorType\",{sceContract:0,sceWasmVm:1,sceContext:2,sceStorage:3,sceObject:4,sceCrypto:5,sceEvents:6,sceBudget:7,sceValue:8,sceAuth:9}),e.enum(\"ScErrorCode\",{scecArithDomain:0,scecIndexBounds:1,scecInvalidInput:2,scecMissingValue:3,scecExistingValue:4,scecExceededLimit:5,scecInvalidAction:6,scecInternalError:7,scecUnexpectedType:8,scecUnexpectedSize:9}),e.union(\"ScError\",{switchOn:e.lookup(\"ScErrorType\"),switchName:\"type\",switches:[[\"sceContract\",\"contractCode\"],[\"sceWasmVm\",\"code\"],[\"sceContext\",\"code\"],[\"sceStorage\",\"code\"],[\"sceObject\",\"code\"],[\"sceCrypto\",\"code\"],[\"sceEvents\",\"code\"],[\"sceBudget\",\"code\"],[\"sceValue\",\"code\"],[\"sceAuth\",\"code\"]],arms:{contractCode:e.lookup(\"Uint32\"),code:e.lookup(\"ScErrorCode\")}}),e.struct(\"UInt128Parts\",[[\"hi\",e.lookup(\"Uint64\")],[\"lo\",e.lookup(\"Uint64\")]]),e.struct(\"Int128Parts\",[[\"hi\",e.lookup(\"Int64\")],[\"lo\",e.lookup(\"Uint64\")]]),e.struct(\"UInt256Parts\",[[\"hiHi\",e.lookup(\"Uint64\")],[\"hiLo\",e.lookup(\"Uint64\")],[\"loHi\",e.lookup(\"Uint64\")],[\"loLo\",e.lookup(\"Uint64\")]]),e.struct(\"Int256Parts\",[[\"hiHi\",e.lookup(\"Int64\")],[\"hiLo\",e.lookup(\"Uint64\")],[\"loHi\",e.lookup(\"Uint64\")],[\"loLo\",e.lookup(\"Uint64\")]]),e.enum(\"ContractExecutableType\",{contractExecutableWasm:0,contractExecutableStellarAsset:1}),e.union(\"ContractExecutable\",{switchOn:e.lookup(\"ContractExecutableType\"),switchName:\"type\",switches:[[\"contractExecutableWasm\",\"wasmHash\"],[\"contractExecutableStellarAsset\",e.void()]],arms:{wasmHash:e.lookup(\"Hash\")}}),e.enum(\"ScAddressType\",{scAddressTypeAccount:0,scAddressTypeContract:1,scAddressTypeMuxedAccount:2,scAddressTypeClaimableBalance:3,scAddressTypeLiquidityPool:4}),e.struct(\"MuxedEd25519Account\",[[\"id\",e.lookup(\"Uint64\")],[\"ed25519\",e.lookup(\"Uint256\")]]),e.union(\"ScAddress\",{switchOn:e.lookup(\"ScAddressType\"),switchName:\"type\",switches:[[\"scAddressTypeAccount\",\"accountId\"],[\"scAddressTypeContract\",\"contractId\"],[\"scAddressTypeMuxedAccount\",\"muxedAccount\"],[\"scAddressTypeClaimableBalance\",\"claimableBalanceId\"],[\"scAddressTypeLiquidityPool\",\"liquidityPoolId\"]],arms:{accountId:e.lookup(\"AccountId\"),contractId:e.lookup(\"ContractId\"),muxedAccount:e.lookup(\"MuxedEd25519Account\"),claimableBalanceId:e.lookup(\"ClaimableBalanceId\"),liquidityPoolId:e.lookup(\"PoolId\")}}),e.const(\"SCSYMBOL_LIMIT\",32),e.typedef(\"ScVec\",e.varArray(e.lookup(\"ScVal\"),2147483647)),e.typedef(\"ScMap\",e.varArray(e.lookup(\"ScMapEntry\"),2147483647)),e.typedef(\"ScBytes\",e.varOpaque()),e.typedef(\"ScString\",e.string()),e.typedef(\"ScSymbol\",e.string(32)),e.struct(\"ScNonceKey\",[[\"nonce\",e.lookup(\"Int64\")]]),e.struct(\"ScContractInstance\",[[\"executable\",e.lookup(\"ContractExecutable\")],[\"storage\",e.option(e.lookup(\"ScMap\"))]]),e.union(\"ScVal\",{switchOn:e.lookup(\"ScValType\"),switchName:\"type\",switches:[[\"scvBool\",\"b\"],[\"scvVoid\",e.void()],[\"scvError\",\"error\"],[\"scvU32\",\"u32\"],[\"scvI32\",\"i32\"],[\"scvU64\",\"u64\"],[\"scvI64\",\"i64\"],[\"scvTimepoint\",\"timepoint\"],[\"scvDuration\",\"duration\"],[\"scvU128\",\"u128\"],[\"scvI128\",\"i128\"],[\"scvU256\",\"u256\"],[\"scvI256\",\"i256\"],[\"scvBytes\",\"bytes\"],[\"scvString\",\"str\"],[\"scvSymbol\",\"sym\"],[\"scvVec\",\"vec\"],[\"scvMap\",\"map\"],[\"scvAddress\",\"address\"],[\"scvContractInstance\",\"instance\"],[\"scvLedgerKeyContractInstance\",e.void()],[\"scvLedgerKeyNonce\",\"nonceKey\"]],arms:{b:e.bool(),error:e.lookup(\"ScError\"),u32:e.lookup(\"Uint32\"),i32:e.lookup(\"Int32\"),u64:e.lookup(\"Uint64\"),i64:e.lookup(\"Int64\"),timepoint:e.lookup(\"TimePoint\"),duration:e.lookup(\"Duration\"),u128:e.lookup(\"UInt128Parts\"),i128:e.lookup(\"Int128Parts\"),u256:e.lookup(\"UInt256Parts\"),i256:e.lookup(\"Int256Parts\"),bytes:e.lookup(\"ScBytes\"),str:e.lookup(\"ScString\"),sym:e.lookup(\"ScSymbol\"),vec:e.option(e.lookup(\"ScVec\")),map:e.option(e.lookup(\"ScMap\")),address:e.lookup(\"ScAddress\"),instance:e.lookup(\"ScContractInstance\"),nonceKey:e.lookup(\"ScNonceKey\")}}),e.struct(\"ScMapEntry\",[[\"key\",e.lookup(\"ScVal\")],[\"val\",e.lookup(\"ScVal\")]]),e.enum(\"ScEnvMetaKind\",{scEnvMetaKindInterfaceVersion:0}),e.struct(\"ScEnvMetaEntryInterfaceVersion\",[[\"protocol\",e.lookup(\"Uint32\")],[\"preRelease\",e.lookup(\"Uint32\")]]),e.union(\"ScEnvMetaEntry\",{switchOn:e.lookup(\"ScEnvMetaKind\"),switchName:\"kind\",switches:[[\"scEnvMetaKindInterfaceVersion\",\"interfaceVersion\"]],arms:{interfaceVersion:e.lookup(\"ScEnvMetaEntryInterfaceVersion\")}}),e.struct(\"ScMetaV0\",[[\"key\",e.string()],[\"val\",e.string()]]),e.enum(\"ScMetaKind\",{scMetaV0:0}),e.union(\"ScMetaEntry\",{switchOn:e.lookup(\"ScMetaKind\"),switchName:\"kind\",switches:[[\"scMetaV0\",\"v0\"]],arms:{v0:e.lookup(\"ScMetaV0\")}}),e.const(\"SC_SPEC_DOC_LIMIT\",1024),e.enum(\"ScSpecType\",{scSpecTypeVal:0,scSpecTypeBool:1,scSpecTypeVoid:2,scSpecTypeError:3,scSpecTypeU32:4,scSpecTypeI32:5,scSpecTypeU64:6,scSpecTypeI64:7,scSpecTypeTimepoint:8,scSpecTypeDuration:9,scSpecTypeU128:10,scSpecTypeI128:11,scSpecTypeU256:12,scSpecTypeI256:13,scSpecTypeBytes:14,scSpecTypeString:16,scSpecTypeSymbol:17,scSpecTypeAddress:19,scSpecTypeMuxedAddress:20,scSpecTypeOption:1e3,scSpecTypeResult:1001,scSpecTypeVec:1002,scSpecTypeMap:1004,scSpecTypeTuple:1005,scSpecTypeBytesN:1006,scSpecTypeUdt:2e3}),e.struct(\"ScSpecTypeOption\",[[\"valueType\",e.lookup(\"ScSpecTypeDef\")]]),e.struct(\"ScSpecTypeResult\",[[\"okType\",e.lookup(\"ScSpecTypeDef\")],[\"errorType\",e.lookup(\"ScSpecTypeDef\")]]),e.struct(\"ScSpecTypeVec\",[[\"elementType\",e.lookup(\"ScSpecTypeDef\")]]),e.struct(\"ScSpecTypeMap\",[[\"keyType\",e.lookup(\"ScSpecTypeDef\")],[\"valueType\",e.lookup(\"ScSpecTypeDef\")]]),e.struct(\"ScSpecTypeTuple\",[[\"valueTypes\",e.varArray(e.lookup(\"ScSpecTypeDef\"),12)]]),e.struct(\"ScSpecTypeBytesN\",[[\"n\",e.lookup(\"Uint32\")]]),e.struct(\"ScSpecTypeUdt\",[[\"name\",e.string(60)]]),e.union(\"ScSpecTypeDef\",{switchOn:e.lookup(\"ScSpecType\"),switchName:\"type\",switches:[[\"scSpecTypeVal\",e.void()],[\"scSpecTypeBool\",e.void()],[\"scSpecTypeVoid\",e.void()],[\"scSpecTypeError\",e.void()],[\"scSpecTypeU32\",e.void()],[\"scSpecTypeI32\",e.void()],[\"scSpecTypeU64\",e.void()],[\"scSpecTypeI64\",e.void()],[\"scSpecTypeTimepoint\",e.void()],[\"scSpecTypeDuration\",e.void()],[\"scSpecTypeU128\",e.void()],[\"scSpecTypeI128\",e.void()],[\"scSpecTypeU256\",e.void()],[\"scSpecTypeI256\",e.void()],[\"scSpecTypeBytes\",e.void()],[\"scSpecTypeString\",e.void()],[\"scSpecTypeSymbol\",e.void()],[\"scSpecTypeAddress\",e.void()],[\"scSpecTypeMuxedAddress\",e.void()],[\"scSpecTypeOption\",\"option\"],[\"scSpecTypeResult\",\"result\"],[\"scSpecTypeVec\",\"vec\"],[\"scSpecTypeMap\",\"map\"],[\"scSpecTypeTuple\",\"tuple\"],[\"scSpecTypeBytesN\",\"bytesN\"],[\"scSpecTypeUdt\",\"udt\"]],arms:{option:e.lookup(\"ScSpecTypeOption\"),result:e.lookup(\"ScSpecTypeResult\"),vec:e.lookup(\"ScSpecTypeVec\"),map:e.lookup(\"ScSpecTypeMap\"),tuple:e.lookup(\"ScSpecTypeTuple\"),bytesN:e.lookup(\"ScSpecTypeBytesN\"),udt:e.lookup(\"ScSpecTypeUdt\")}}),e.struct(\"ScSpecUdtStructFieldV0\",[[\"doc\",e.string(t)],[\"name\",e.string(30)],[\"type\",e.lookup(\"ScSpecTypeDef\")]]),e.struct(\"ScSpecUdtStructV0\",[[\"doc\",e.string(t)],[\"lib\",e.string(80)],[\"name\",e.string(60)],[\"fields\",e.varArray(e.lookup(\"ScSpecUdtStructFieldV0\"),2147483647)]]),e.struct(\"ScSpecUdtUnionCaseVoidV0\",[[\"doc\",e.string(t)],[\"name\",e.string(60)]]),e.struct(\"ScSpecUdtUnionCaseTupleV0\",[[\"doc\",e.string(t)],[\"name\",e.string(60)],[\"type\",e.varArray(e.lookup(\"ScSpecTypeDef\"),2147483647)]]),e.enum(\"ScSpecUdtUnionCaseV0Kind\",{scSpecUdtUnionCaseVoidV0:0,scSpecUdtUnionCaseTupleV0:1}),e.union(\"ScSpecUdtUnionCaseV0\",{switchOn:e.lookup(\"ScSpecUdtUnionCaseV0Kind\"),switchName:\"kind\",switches:[[\"scSpecUdtUnionCaseVoidV0\",\"voidCase\"],[\"scSpecUdtUnionCaseTupleV0\",\"tupleCase\"]],arms:{voidCase:e.lookup(\"ScSpecUdtUnionCaseVoidV0\"),tupleCase:e.lookup(\"ScSpecUdtUnionCaseTupleV0\")}}),e.struct(\"ScSpecUdtUnionV0\",[[\"doc\",e.string(t)],[\"lib\",e.string(80)],[\"name\",e.string(60)],[\"cases\",e.varArray(e.lookup(\"ScSpecUdtUnionCaseV0\"),2147483647)]]),e.struct(\"ScSpecUdtEnumCaseV0\",[[\"doc\",e.string(t)],[\"name\",e.string(60)],[\"value\",e.lookup(\"Uint32\")]]),e.struct(\"ScSpecUdtEnumV0\",[[\"doc\",e.string(t)],[\"lib\",e.string(80)],[\"name\",e.string(60)],[\"cases\",e.varArray(e.lookup(\"ScSpecUdtEnumCaseV0\"),2147483647)]]),e.struct(\"ScSpecUdtErrorEnumCaseV0\",[[\"doc\",e.string(t)],[\"name\",e.string(60)],[\"value\",e.lookup(\"Uint32\")]]),e.struct(\"ScSpecUdtErrorEnumV0\",[[\"doc\",e.string(t)],[\"lib\",e.string(80)],[\"name\",e.string(60)],[\"cases\",e.varArray(e.lookup(\"ScSpecUdtErrorEnumCaseV0\"),2147483647)]]),e.struct(\"ScSpecFunctionInputV0\",[[\"doc\",e.string(t)],[\"name\",e.string(30)],[\"type\",e.lookup(\"ScSpecTypeDef\")]]),e.struct(\"ScSpecFunctionV0\",[[\"doc\",e.string(t)],[\"name\",e.lookup(\"ScSymbol\")],[\"inputs\",e.varArray(e.lookup(\"ScSpecFunctionInputV0\"),2147483647)],[\"outputs\",e.varArray(e.lookup(\"ScSpecTypeDef\"),1)]]),e.enum(\"ScSpecEventParamLocationV0\",{scSpecEventParamLocationData:0,scSpecEventParamLocationTopicList:1}),e.struct(\"ScSpecEventParamV0\",[[\"doc\",e.string(t)],[\"name\",e.string(30)],[\"type\",e.lookup(\"ScSpecTypeDef\")],[\"location\",e.lookup(\"ScSpecEventParamLocationV0\")]]),e.enum(\"ScSpecEventDataFormat\",{scSpecEventDataFormatSingleValue:0,scSpecEventDataFormatVec:1,scSpecEventDataFormatMap:2}),e.struct(\"ScSpecEventV0\",[[\"doc\",e.string(t)],[\"lib\",e.string(80)],[\"name\",e.lookup(\"ScSymbol\")],[\"prefixTopics\",e.varArray(e.lookup(\"ScSymbol\"),2)],[\"params\",e.varArray(e.lookup(\"ScSpecEventParamV0\"),2147483647)],[\"dataFormat\",e.lookup(\"ScSpecEventDataFormat\")]]),e.enum(\"ScSpecEntryKind\",{scSpecEntryFunctionV0:0,scSpecEntryUdtStructV0:1,scSpecEntryUdtUnionV0:2,scSpecEntryUdtEnumV0:3,scSpecEntryUdtErrorEnumV0:4,scSpecEntryEventV0:5}),e.union(\"ScSpecEntry\",{switchOn:e.lookup(\"ScSpecEntryKind\"),switchName:\"kind\",switches:[[\"scSpecEntryFunctionV0\",\"functionV0\"],[\"scSpecEntryUdtStructV0\",\"udtStructV0\"],[\"scSpecEntryUdtUnionV0\",\"udtUnionV0\"],[\"scSpecEntryUdtEnumV0\",\"udtEnumV0\"],[\"scSpecEntryUdtErrorEnumV0\",\"udtErrorEnumV0\"],[\"scSpecEntryEventV0\",\"eventV0\"]],arms:{functionV0:e.lookup(\"ScSpecFunctionV0\"),udtStructV0:e.lookup(\"ScSpecUdtStructV0\"),udtUnionV0:e.lookup(\"ScSpecUdtUnionV0\"),udtEnumV0:e.lookup(\"ScSpecUdtEnumV0\"),udtErrorEnumV0:e.lookup(\"ScSpecUdtErrorEnumV0\"),eventV0:e.lookup(\"ScSpecEventV0\")}}),e.typedef(\"EncodedLedgerKey\",e.varOpaque()),e.struct(\"ConfigSettingContractExecutionLanesV0\",[[\"ledgerMaxTxCount\",e.lookup(\"Uint32\")]]),e.struct(\"ConfigSettingContractComputeV0\",[[\"ledgerMaxInstructions\",e.lookup(\"Int64\")],[\"txMaxInstructions\",e.lookup(\"Int64\")],[\"feeRatePerInstructionsIncrement\",e.lookup(\"Int64\")],[\"txMemoryLimit\",e.lookup(\"Uint32\")]]),e.struct(\"ConfigSettingContractParallelComputeV0\",[[\"ledgerMaxDependentTxClusters\",e.lookup(\"Uint32\")]]),e.struct(\"ConfigSettingContractLedgerCostV0\",[[\"ledgerMaxDiskReadEntries\",e.lookup(\"Uint32\")],[\"ledgerMaxDiskReadBytes\",e.lookup(\"Uint32\")],[\"ledgerMaxWriteLedgerEntries\",e.lookup(\"Uint32\")],[\"ledgerMaxWriteBytes\",e.lookup(\"Uint32\")],[\"txMaxDiskReadEntries\",e.lookup(\"Uint32\")],[\"txMaxDiskReadBytes\",e.lookup(\"Uint32\")],[\"txMaxWriteLedgerEntries\",e.lookup(\"Uint32\")],[\"txMaxWriteBytes\",e.lookup(\"Uint32\")],[\"feeDiskReadLedgerEntry\",e.lookup(\"Int64\")],[\"feeWriteLedgerEntry\",e.lookup(\"Int64\")],[\"feeDiskRead1Kb\",e.lookup(\"Int64\")],[\"sorobanStateTargetSizeBytes\",e.lookup(\"Int64\")],[\"rentFee1KbSorobanStateSizeLow\",e.lookup(\"Int64\")],[\"rentFee1KbSorobanStateSizeHigh\",e.lookup(\"Int64\")],[\"sorobanStateRentFeeGrowthFactor\",e.lookup(\"Uint32\")]]),e.struct(\"ConfigSettingContractLedgerCostExtV0\",[[\"txMaxFootprintEntries\",e.lookup(\"Uint32\")],[\"feeWrite1Kb\",e.lookup(\"Int64\")]]),e.struct(\"ConfigSettingContractHistoricalDataV0\",[[\"feeHistorical1Kb\",e.lookup(\"Int64\")]]),e.struct(\"ConfigSettingContractEventsV0\",[[\"txMaxContractEventsSizeBytes\",e.lookup(\"Uint32\")],[\"feeContractEvents1Kb\",e.lookup(\"Int64\")]]),e.struct(\"ConfigSettingContractBandwidthV0\",[[\"ledgerMaxTxsSizeBytes\",e.lookup(\"Uint32\")],[\"txMaxSizeBytes\",e.lookup(\"Uint32\")],[\"feeTxSize1Kb\",e.lookup(\"Int64\")]]),e.enum(\"ContractCostType\",{wasmInsnExec:0,memAlloc:1,memCpy:2,memCmp:3,dispatchHostFunction:4,visitObject:5,valSer:6,valDeser:7,computeSha256Hash:8,computeEd25519PubKey:9,verifyEd25519Sig:10,vmInstantiation:11,vmCachedInstantiation:12,invokeVmFunction:13,computeKeccak256Hash:14,decodeEcdsaCurve256Sig:15,recoverEcdsaSecp256k1Key:16,int256AddSub:17,int256Mul:18,int256Div:19,int256Pow:20,int256Shift:21,chaCha20DrawBytes:22,parseWasmInstructions:23,parseWasmFunctions:24,parseWasmGlobals:25,parseWasmTableEntries:26,parseWasmTypes:27,parseWasmDataSegments:28,parseWasmElemSegments:29,parseWasmImports:30,parseWasmExports:31,parseWasmDataSegmentBytes:32,instantiateWasmInstructions:33,instantiateWasmFunctions:34,instantiateWasmGlobals:35,instantiateWasmTableEntries:36,instantiateWasmTypes:37,instantiateWasmDataSegments:38,instantiateWasmElemSegments:39,instantiateWasmImports:40,instantiateWasmExports:41,instantiateWasmDataSegmentBytes:42,sec1DecodePointUncompressed:43,verifyEcdsaSecp256r1Sig:44,bls12381EncodeFp:45,bls12381DecodeFp:46,bls12381G1CheckPointOnCurve:47,bls12381G1CheckPointInSubgroup:48,bls12381G2CheckPointOnCurve:49,bls12381G2CheckPointInSubgroup:50,bls12381G1ProjectiveToAffine:51,bls12381G2ProjectiveToAffine:52,bls12381G1Add:53,bls12381G1Mul:54,bls12381G1Msm:55,bls12381MapFpToG1:56,bls12381HashToG1:57,bls12381G2Add:58,bls12381G2Mul:59,bls12381G2Msm:60,bls12381MapFp2ToG2:61,bls12381HashToG2:62,bls12381Pairing:63,bls12381FrFromU256:64,bls12381FrToU256:65,bls12381FrAddSub:66,bls12381FrMul:67,bls12381FrPow:68,bls12381FrInv:69,bn254EncodeFp:70,bn254DecodeFp:71,bn254G1CheckPointOnCurve:72,bn254G2CheckPointOnCurve:73,bn254G2CheckPointInSubgroup:74,bn254G1ProjectiveToAffine:75,bn254G1Add:76,bn254G1Mul:77,bn254Pairing:78,bn254FrFromU256:79,bn254FrToU256:80,bn254FrAddSub:81,bn254FrMul:82,bn254FrPow:83,bn254FrInv:84,bn254G1Msm:85}),e.struct(\"ContractCostParamEntry\",[[\"ext\",e.lookup(\"ExtensionPoint\")],[\"constTerm\",e.lookup(\"Int64\")],[\"linearTerm\",e.lookup(\"Int64\")]]),e.struct(\"StateArchivalSettings\",[[\"maxEntryTtl\",e.lookup(\"Uint32\")],[\"minTemporaryTtl\",e.lookup(\"Uint32\")],[\"minPersistentTtl\",e.lookup(\"Uint32\")],[\"persistentRentRateDenominator\",e.lookup(\"Int64\")],[\"tempRentRateDenominator\",e.lookup(\"Int64\")],[\"maxEntriesToArchive\",e.lookup(\"Uint32\")],[\"liveSorobanStateSizeWindowSampleSize\",e.lookup(\"Uint32\")],[\"liveSorobanStateSizeWindowSamplePeriod\",e.lookup(\"Uint32\")],[\"evictionScanSize\",e.lookup(\"Uint32\")],[\"startingEvictionScanLevel\",e.lookup(\"Uint32\")]]),e.struct(\"EvictionIterator\",[[\"bucketListLevel\",e.lookup(\"Uint32\")],[\"isCurrBucket\",e.bool()],[\"bucketFileOffset\",e.lookup(\"Uint64\")]]),e.struct(\"ConfigSettingScpTiming\",[[\"ledgerTargetCloseTimeMilliseconds\",e.lookup(\"Uint32\")],[\"nominationTimeoutInitialMilliseconds\",e.lookup(\"Uint32\")],[\"nominationTimeoutIncrementMilliseconds\",e.lookup(\"Uint32\")],[\"ballotTimeoutInitialMilliseconds\",e.lookup(\"Uint32\")],[\"ballotTimeoutIncrementMilliseconds\",e.lookup(\"Uint32\")]]),e.struct(\"FrozenLedgerKeys\",[[\"keys\",e.varArray(e.lookup(\"EncodedLedgerKey\"),2147483647)]]),e.struct(\"FrozenLedgerKeysDelta\",[[\"keysToFreeze\",e.varArray(e.lookup(\"EncodedLedgerKey\"),2147483647)],[\"keysToUnfreeze\",e.varArray(e.lookup(\"EncodedLedgerKey\"),2147483647)]]),e.struct(\"FreezeBypassTxes\",[[\"txHashes\",e.varArray(e.lookup(\"Hash\"),2147483647)]]),e.struct(\"FreezeBypassTxsDelta\",[[\"addTxes\",e.varArray(e.lookup(\"Hash\"),2147483647)],[\"removeTxes\",e.varArray(e.lookup(\"Hash\"),2147483647)]]),e.const(\"CONTRACT_COST_COUNT_LIMIT\",1024),e.typedef(\"ContractCostParams\",e.varArray(e.lookup(\"ContractCostParamEntry\"),e.lookup(\"CONTRACT_COST_COUNT_LIMIT\"))),e.enum(\"ConfigSettingId\",{configSettingContractMaxSizeBytes:0,configSettingContractComputeV0:1,configSettingContractLedgerCostV0:2,configSettingContractHistoricalDataV0:3,configSettingContractEventsV0:4,configSettingContractBandwidthV0:5,configSettingContractCostParamsCpuInstructions:6,configSettingContractCostParamsMemoryBytes:7,configSettingContractDataKeySizeBytes:8,configSettingContractDataEntrySizeBytes:9,configSettingStateArchival:10,configSettingContractExecutionLanes:11,configSettingLiveSorobanStateSizeWindow:12,configSettingEvictionIterator:13,configSettingContractParallelComputeV0:14,configSettingContractLedgerCostExtV0:15,configSettingScpTiming:16,configSettingFrozenLedgerKeys:17,configSettingFrozenLedgerKeysDelta:18,configSettingFreezeBypassTxes:19,configSettingFreezeBypassTxsDelta:20}),e.union(\"ConfigSettingEntry\",{switchOn:e.lookup(\"ConfigSettingId\"),switchName:\"configSettingId\",switches:[[\"configSettingContractMaxSizeBytes\",\"contractMaxSizeBytes\"],[\"configSettingContractComputeV0\",\"contractCompute\"],[\"configSettingContractLedgerCostV0\",\"contractLedgerCost\"],[\"configSettingContractHistoricalDataV0\",\"contractHistoricalData\"],[\"configSettingContractEventsV0\",\"contractEvents\"],[\"configSettingContractBandwidthV0\",\"contractBandwidth\"],[\"configSettingContractCostParamsCpuInstructions\",\"contractCostParamsCpuInsns\"],[\"configSettingContractCostParamsMemoryBytes\",\"contractCostParamsMemBytes\"],[\"configSettingContractDataKeySizeBytes\",\"contractDataKeySizeBytes\"],[\"configSettingContractDataEntrySizeBytes\",\"contractDataEntrySizeBytes\"],[\"configSettingStateArchival\",\"stateArchivalSettings\"],[\"configSettingContractExecutionLanes\",\"contractExecutionLanes\"],[\"configSettingLiveSorobanStateSizeWindow\",\"liveSorobanStateSizeWindow\"],[\"configSettingEvictionIterator\",\"evictionIterator\"],[\"configSettingContractParallelComputeV0\",\"contractParallelCompute\"],[\"configSettingContractLedgerCostExtV0\",\"contractLedgerCostExt\"],[\"configSettingScpTiming\",\"contractScpTiming\"],[\"configSettingFrozenLedgerKeys\",\"frozenLedgerKeys\"],[\"configSettingFrozenLedgerKeysDelta\",\"frozenLedgerKeysDelta\"],[\"configSettingFreezeBypassTxes\",\"freezeBypassTxes\"],[\"configSettingFreezeBypassTxsDelta\",\"freezeBypassTxsDelta\"]],arms:{contractMaxSizeBytes:e.lookup(\"Uint32\"),contractCompute:e.lookup(\"ConfigSettingContractComputeV0\"),contractLedgerCost:e.lookup(\"ConfigSettingContractLedgerCostV0\"),contractHistoricalData:e.lookup(\"ConfigSettingContractHistoricalDataV0\"),contractEvents:e.lookup(\"ConfigSettingContractEventsV0\"),contractBandwidth:e.lookup(\"ConfigSettingContractBandwidthV0\"),contractCostParamsCpuInsns:e.lookup(\"ContractCostParams\"),contractCostParamsMemBytes:e.lookup(\"ContractCostParams\"),contractDataKeySizeBytes:e.lookup(\"Uint32\"),contractDataEntrySizeBytes:e.lookup(\"Uint32\"),stateArchivalSettings:e.lookup(\"StateArchivalSettings\"),contractExecutionLanes:e.lookup(\"ConfigSettingContractExecutionLanesV0\"),liveSorobanStateSizeWindow:e.varArray(e.lookup(\"Uint64\"),2147483647),evictionIterator:e.lookup(\"EvictionIterator\"),contractParallelCompute:e.lookup(\"ConfigSettingContractParallelComputeV0\"),contractLedgerCostExt:e.lookup(\"ConfigSettingContractLedgerCostExtV0\"),contractScpTiming:e.lookup(\"ConfigSettingScpTiming\"),frozenLedgerKeys:e.lookup(\"FrozenLedgerKeys\"),frozenLedgerKeysDelta:e.lookup(\"FrozenLedgerKeysDelta\"),freezeBypassTxes:e.lookup(\"FreezeBypassTxes\"),freezeBypassTxsDelta:e.lookup(\"FreezeBypassTxsDelta\")}}),e.struct(\"LedgerCloseMetaBatch\",[[\"startSequence\",e.lookup(\"Uint32\")],[\"endSequence\",e.lookup(\"Uint32\")],[\"ledgerCloseMeta\",e.varArray(e.lookup(\"LedgerCloseMeta\"),2147483647)]])});const i=o,a={XdrWriter:r.XdrWriter,XdrReader:r.XdrReader};var s=n(2802);function c(e){var t=new s.sha256;return t.update(e,\"utf8\"),t.digest()}const u=\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0;function l(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function f(e,...t){if(!l(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function p(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function d(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const y=\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex,g=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\"));function m(e){if(f(e),y)return e.toHex();let t=\"\";for(let n=0;n<e.length;n++)t+=g[e[n]];return t}function v(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function b(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);if(y)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error(\"hex string expected, got unpadded hex of length \"+t);const r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){const n=v(e.charCodeAt(o)),i=v(e.charCodeAt(o+1));if(void 0===n||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character \"'+t+'\" at index '+o)}r[t]=16*n+i}return r}function w(e){if(\"string\"!=typeof e)throw new Error(\"string expected\");return new Uint8Array((new TextEncoder).encode(e))}function S(e){return\"string\"==typeof e&&(e=w(e)),f(e),e}function A(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];f(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n}class E{}function x(e=32){if(u&&\"function\"==typeof u.getRandomValues)return u.getRandomValues(new Uint8Array(e));if(u&&\"function\"==typeof u.randomBytes)return Uint8Array.from(u.randomBytes(e));throw new Error(\"crypto.getRandomValues must be defined\")}class T extends E{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=h(this.buffer)}update(e){p(this),f(e=S(e));const{view:t,buffer:n,blockLen:r}=this,o=e.length;for(let i=0;i<o;){const a=Math.min(r-this.pos,o-i);if(a===r){const t=h(e);for(;r<=o-i;i+=r)this.process(t,i);continue}n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){p(this),function(e,t){f(e);const n=t.outputLen;if(e.length<n)throw new Error(\"digestInto() expects output buffer of length at least \"+n)}(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:o}=this;let{pos:i}=this;t[i++]=128,d(this.buffer.subarray(i)),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;e<r;e++)t[e]=0;!function(e,t,n,r){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,r-8,BigInt(8*this.length),o),this.process(n,0);const a=h(e),s=this.outputLen;if(s%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const c=s/4,u=this.get();if(c>u.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=r,e.pos=a,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const k=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),O=BigInt(2**32-1),_=BigInt(32);function I(e,t=!1){return t?{h:Number(e&O),l:Number(e>>_&O)}:{h:0|Number(e>>_&O),l:0|Number(e&O)}}const C=(e,t,n)=>e>>>n,B=(e,t,n)=>e<<32-n|t>>>n,P=(e,t,n)=>e>>>n|t<<32-n,R=(e,t,n)=>e<<32-n|t>>>n,j=(e,t,n)=>e<<64-n|t>>>n-32,U=(e,t,n)=>e>>>n-32|t<<64-n;function F(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}const N=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),L=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,M=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),D=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,q=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),V=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,z=function(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:a}=I(e[i],t);[r[i],o[i]]=[n,a]}return[r,o]}([\"0x428a2f98d728ae22\",\"0x7137449123ef65cd\",\"0xb5c0fbcfec4d3b2f\",\"0xe9b5dba58189dbbc\",\"0x3956c25bf348b538\",\"0x59f111f1b605d019\",\"0x923f82a4af194f9b\",\"0xab1c5ed5da6d8118\",\"0xd807aa98a3030242\",\"0x12835b0145706fbe\",\"0x243185be4ee4b28c\",\"0x550c7dc3d5ffb4e2\",\"0x72be5d74f27b896f\",\"0x80deb1fe3b1696b1\",\"0x9bdc06a725c71235\",\"0xc19bf174cf692694\",\"0xe49b69c19ef14ad2\",\"0xefbe4786384f25e3\",\"0x0fc19dc68b8cd5b5\",\"0x240ca1cc77ac9c65\",\"0x2de92c6f592b0275\",\"0x4a7484aa6ea6e483\",\"0x5cb0a9dcbd41fbd4\",\"0x76f988da831153b5\",\"0x983e5152ee66dfab\",\"0xa831c66d2db43210\",\"0xb00327c898fb213f\",\"0xbf597fc7beef0ee4\",\"0xc6e00bf33da88fc2\",\"0xd5a79147930aa725\",\"0x06ca6351e003826f\",\"0x142929670a0e6e70\",\"0x27b70a8546d22ffc\",\"0x2e1b21385c26c926\",\"0x4d2c6dfc5ac42aed\",\"0x53380d139d95b3df\",\"0x650a73548baf63de\",\"0x766a0abb3c77b2a8\",\"0x81c2c92e47edaee6\",\"0x92722c851482353b\",\"0xa2bfe8a14cf10364\",\"0xa81a664bbc423001\",\"0xc24b8b70d0f89791\",\"0xc76c51a30654be30\",\"0xd192e819d6ef5218\",\"0xd69906245565a910\",\"0xf40e35855771202a\",\"0x106aa07032bbd1b8\",\"0x19a4c116b8d2d0c8\",\"0x1e376c085141ab53\",\"0x2748774cdf8eeb99\",\"0x34b0bcb5e19b48a8\",\"0x391c0cb3c5c95a63\",\"0x4ed8aa4ae3418acb\",\"0x5b9cca4f7763e373\",\"0x682e6ff3d6b2b8a3\",\"0x748f82ee5defb2fc\",\"0x78a5636f43172f60\",\"0x84c87814a1f0ab72\",\"0x8cc702081a6439ec\",\"0x90befffa23631e28\",\"0xa4506cebde82bde9\",\"0xbef9a3f7b2c67915\",\"0xc67178f2e372532b\",\"0xca273eceea26619c\",\"0xd186b8c721c0c207\",\"0xeada7dd6cde0eb1e\",\"0xf57d4f7fee6ed178\",\"0x06f067aa72176fba\",\"0x0a637dc5a2c898a6\",\"0x113f9804bef90dae\",\"0x1b710b35131c471b\",\"0x28db77f523047d84\",\"0x32caab7b40c72493\",\"0x3c9ebe0a15c9bebc\",\"0x431d67c49c100d4c\",\"0x4cc5d4becb3e42b6\",\"0x597f299cfc657e2a\",\"0x5fcb6fab3ad6faec\",\"0x6c44198c4a475817\"].map(e=>BigInt(e))),K=z[0],H=z[1],$=new Uint32Array(80),G=new Uint32Array(80);class W extends T{constructor(e=64){super(128,e,16,!1),this.Ah=0|k[0],this.Al=0|k[1],this.Bh=0|k[2],this.Bl=0|k[3],this.Ch=0|k[4],this.Cl=0|k[5],this.Dh=0|k[6],this.Dl=0|k[7],this.Eh=0|k[8],this.El=0|k[9],this.Fh=0|k[10],this.Fl=0|k[11],this.Gh=0|k[12],this.Gl=0|k[13],this.Hh=0|k[14],this.Hl=0|k[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:f,Gh:p,Gl:d,Hh:h,Hl:y}=this;return[e,t,n,r,o,i,a,s,c,u,l,f,p,d,h,y]}set(e,t,n,r,o,i,a,s,c,u,l,f,p,d,h,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|f,this.Gh=0|p,this.Gl=0|d,this.Hh=0|h,this.Hl=0|y}process(e,t){for(let n=0;n<16;n++,t+=4)$[n]=e.getUint32(t),G[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|$[e-15],n=0|G[e-15],r=P(t,n,1)^P(t,n,8)^C(t,0,7),o=R(t,n,1)^R(t,n,8)^B(t,n,7),i=0|$[e-2],a=0|G[e-2],s=P(i,a,19)^j(i,a,61)^C(i,0,6),c=R(i,a,19)^U(i,a,61)^B(i,a,6),u=M(o,c,G[e-7],G[e-16]),l=D(u,r,s,$[e-7],$[e-16]);$[e]=0|l,G[e]=0|u}let{Ah:n,Al:r,Bh:o,Bl:i,Ch:a,Cl:s,Dh:c,Dl:u,Eh:l,El:f,Fh:p,Fl:d,Gh:h,Gl:y,Hh:g,Hl:m}=this;for(let e=0;e<80;e++){const t=P(l,f,14)^P(l,f,18)^j(l,f,41),v=R(l,f,14)^R(l,f,18)^U(l,f,41),b=l&p^~l&h,w=q(m,v,f&d^~f&y,H[e],G[e]),S=V(w,g,t,b,K[e],$[e]),A=0|w,E=P(n,r,28)^j(n,r,34)^j(n,r,39),x=R(n,r,28)^U(n,r,34)^U(n,r,39),T=n&o^n&a^o&a,k=r&i^r&s^i&s;g=0|h,m=0|y,h=0|p,y=0|d,p=0|l,d=0|f,({h:l,l:f}=F(0|c,0|u,0|S,0|A)),c=0|a,u=0|s,a=0|o,s=0|i,o=0|n,i=0|r;const O=N(A,x,k);n=L(O,S,E,T),r=0|O}({h:n,l:r}=F(0|this.Ah,0|this.Al,0|n,0|r)),({h:o,l:i}=F(0|this.Bh,0|this.Bl,0|o,0|i)),({h:a,l:s}=F(0|this.Ch,0|this.Cl,0|a,0|s)),({h:c,l:u}=F(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:f}=F(0|this.Eh,0|this.El,0|l,0|f)),({h:p,l:d}=F(0|this.Fh,0|this.Fl,0|p,0|d)),({h,l:y}=F(0|this.Gh,0|this.Gl,0|h,0|y)),({h:g,l:m}=F(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(n,r,o,i,a,s,c,u,l,f,p,d,h,y,g,m)}roundClean(){d($,G)}destroy(){d(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const X=function(e){const t=t=>e().update(S(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}(()=>new W),Z=BigInt(0),Y=BigInt(1);function J(e,t=\"\"){if(\"boolean\"!=typeof e)throw new Error((t&&`\"${t}\"`)+\"expected boolean, got type=\"+typeof e);return e}function Q(e,t,n=\"\"){const r=l(e),o=e?.length,i=void 0!==t;if(!r||i&&o!==t)throw new Error((n&&`\"${n}\" `)+\"expected Uint8Array\"+(i?` of length ${t}`:\"\")+\", got \"+(r?`length=${o}`:\"type=\"+typeof e));return e}function ee(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);return\"\"===e?Z:BigInt(\"0x\"+e)}function te(e){return f(e),ee(m(Uint8Array.from(e).reverse()))}function ne(e,t){return b(e.toString(16).padStart(2*t,\"0\"))}function re(e,t,n){let r;if(\"string\"==typeof t)try{r=b(t)}catch(t){throw new Error(e+\" must be hex string or Uint8Array, cause: \"+t)}else{if(!l(t))throw new Error(e+\" must be hex string or Uint8Array\");r=Uint8Array.from(t)}const o=r.length;if(\"number\"==typeof n&&o!==n)throw new Error(e+\" of length \"+n+\" expected, got \"+o);return r}function oe(e){return Uint8Array.from(e)}const ie=e=>\"bigint\"==typeof e&&Z<=e;function ae(e,t,n,r){if(!function(e,t,n){return ie(e)&&ie(t)&&ie(n)&&t<=e&&e<n}(t,n,r))throw new Error(\"expected valid \"+e+\": \"+n+\" <= n < \"+r+\", got \"+t)}const se=e=>(Y<<BigInt(e))-Y;function ce(e,t,n={}){if(!e||\"object\"!=typeof e)throw new Error(\"expected valid options object\");function r(t,n,r){const o=e[t];if(r&&void 0===o)return;const i=typeof o;if(i!==n||null===o)throw new Error(`param \"${t}\" is invalid: expected ${n}, got ${i}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}const ue=()=>{throw new Error(\"not implemented\")};function le(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(void 0!==o)return o;const i=e(n,...r);return t.set(n,i),i}}const fe=BigInt(0),pe=BigInt(1),de=BigInt(2),he=BigInt(3),ye=BigInt(4),ge=BigInt(5),me=BigInt(7),ve=BigInt(8),be=BigInt(9),we=BigInt(16);function Se(e,t){const n=e%t;return n>=fe?n:t+n}function Ae(e,t,n){let r=e;for(;t-- >fe;)r*=r,r%=n;return r}function Ee(e,t){if(e===fe)throw new Error(\"invert: expected non-zero number\");if(t<=fe)throw new Error(\"invert: expected positive modulus, got \"+t);let n=Se(e,t),r=t,o=fe,i=pe,a=pe,s=fe;for(;n!==fe;){const e=r/n,t=r%n,c=o-a*e,u=i-s*e;r=n,n=t,o=a,i=s,a=c,s=u}if(r!==pe)throw new Error(\"invert: does not exist\");return Se(o,t)}function xe(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error(\"Cannot find square root\")}function Te(e,t){const n=(e.ORDER+pe)/ye,r=e.pow(t,n);return xe(e,r,t),r}function ke(e,t){const n=(e.ORDER-ge)/ve,r=e.mul(t,de),o=e.pow(r,n),i=e.mul(t,o),a=e.mul(e.mul(i,de),o),s=e.mul(i,e.sub(a,e.ONE));return xe(e,s,t),s}function Oe(e){if(e<he)throw new Error(\"sqrt is not defined for small field\");let t=e-pe,n=0;for(;t%de===fe;)t/=de,n++;let r=de;const o=Pe(e);for(;1===Be(o,r);)if(r++>1e3)throw new Error(\"Cannot find square root: probably non-prime P\");if(1===n)return Te;let i=o.pow(r,t);const a=(t+pe)/de;return function(e,r){if(e.is0(r))return r;if(1!==Be(e,r))throw new Error(\"Cannot find square root\");let o=n,s=e.mul(e.ONE,i),c=e.pow(r,t),u=e.pow(r,a);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===o)throw new Error(\"Cannot find square root\");const r=pe<<BigInt(o-t-1),i=e.pow(s,r);o=t,s=e.sqr(i),c=e.mul(c,s),u=e.mul(u,i)}return u}}const _e=(e,t)=>(Se(e,t)&pe)===pe,Ie=[\"create\",\"isValid\",\"is0\",\"neg\",\"inv\",\"sqrt\",\"sqr\",\"eql\",\"add\",\"sub\",\"mul\",\"pow\",\"div\",\"addN\",\"subN\",\"mulN\",\"sqrN\"];function Ce(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n)),e.ONE),i=e.inv(o);return t.reduceRight((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n)),i),r}function Be(e,t){const n=(e.ORDER-pe)/de,r=e.pow(t,n),o=e.eql(r,e.ONE),i=e.eql(r,e.ZERO),a=e.eql(r,e.neg(e.ONE));if(!o&&!i&&!a)throw new Error(\"invalid Legendre symbol result\");return o?1:i?0:-1}function Pe(e,t,n=!1,r={}){if(e<=fe)throw new Error(\"invalid field: expected ORDER > 0, got \"+e);let o,i,a,s=!1;if(\"object\"==typeof t&&null!=t){if(r.sqrt||n)throw new Error(\"cannot specify opts in two arguments\");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(i=e.sqrt),\"boolean\"==typeof e.isLE&&(n=e.isLE),\"boolean\"==typeof e.modFromBytes&&(s=e.modFromBytes),a=e.allowedLengths}else\"number\"==typeof t&&(o=t),r.sqrt&&(i=r.sqrt);const{nBitLength:c,nByteLength:u}=function(e,t){void 0!==t&&function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(\"positive integer expected, got \"+e)}(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}(e,o);if(u>2048)throw new Error(\"invalid field: expected ORDER of <= 2048 bytes\");let l;const f=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:u,MASK:se(c),ZERO:fe,ONE:pe,allowedLengths:a,create:t=>Se(t,e),isValid:t=>{if(\"bigint\"!=typeof t)throw new Error(\"invalid field element: expected bigint, got \"+typeof t);return fe<=t&&t<e},is0:e=>e===fe,isValidNot0:e=>!f.is0(e)&&f.isValid(e),isOdd:e=>(e&pe)===pe,neg:t=>Se(-t,e),eql:(e,t)=>e===t,sqr:t=>Se(t*t,e),add:(t,n)=>Se(t+n,e),sub:(t,n)=>Se(t-n,e),mul:(t,n)=>Se(t*n,e),pow:(e,t)=>function(e,t,n){if(n<fe)throw new Error(\"invalid exponent, negatives unsupported\");if(n===fe)return e.ONE;if(n===pe)return t;let r=e.ONE,o=t;for(;n>fe;)n&pe&&(r=e.mul(r,o)),o=e.sqr(o),n>>=pe;return r}(f,e,t),div:(t,n)=>Se(t*Ee(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Ee(t,e),sqrt:i||(t=>(l||(l=function(e){return e%ye===he?Te:e%ve===ge?ke:e%we===be?function(e){const t=Pe(e),n=Oe(e),r=n(t,t.neg(t.ONE)),o=n(t,r),i=n(t,t.neg(r)),a=(e+me)/we;return(e,t)=>{let n=e.pow(t,a),s=e.mul(n,r);const c=e.mul(n,o),u=e.mul(n,i),l=e.eql(e.sqr(s),t),f=e.eql(e.sqr(c),t);n=e.cmov(n,s,l),s=e.cmov(u,c,f);const p=e.eql(e.sqr(s),t),d=e.cmov(n,s,p);return xe(e,d,t),d}}(e):Oe(e)}(e)),l(f,t))),toBytes:e=>n?ne(e,u).reverse():ne(e,u),fromBytes:(t,r=!0)=>{if(a){if(!a.includes(t.length)||t.length>u)throw new Error(\"Field.fromBytes: expected \"+a+\" bytes, got \"+t.length);const e=new Uint8Array(u);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==u)throw new Error(\"Field.fromBytes: expected \"+u+\" bytes, got \"+t.length);let o=n?te(t):function(e){return ee(m(e))}(t);if(s&&(o=Se(o,e)),!r&&!f.isValid(o))throw new Error(\"invalid field element: outside of range 0..ORDER\");return o},invertBatch:e=>Ce(f,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(f)}const Re=BigInt(0),je=BigInt(1);function Ue(e,t){const n=t.negate();return e?n:t}function Fe(e,t){const n=Ce(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function Ne(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error(\"invalid window size, expected [1..\"+t+\"], got W=\"+e)}function Le(e,t){Ne(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:se(e),maxNumber:n,shiftBy:BigInt(e)}}function Me(e,t,n){const{windowSize:r,mask:o,maxNumber:i,shiftBy:a}=n;let s=Number(e&o),c=e>>a;s>r&&(s-=i,c+=je);const u=t*r;return{nextN:c,offset:u+Math.abs(s)-1,isZero:0===s,isNeg:s<0,isNegF:t%2!=0,offsetF:u}}const De=new WeakMap,qe=new WeakMap;function Ve(e){return qe.get(e)||1}function ze(e){if(e!==Re)throw new Error(\"invalid wNAF\")}class Ke{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>Re;)t&je&&(n=n.add(r)),r=r.double(),t>>=je;return n}precomputeWindow(e,t){const{windows:n,windowSize:r}=Le(t,this.bits),o=[];let i=e,a=i;for(let e=0;e<n;e++){a=i,o.push(a);for(let e=1;e<r;e++)a=a.add(i),o.push(a);i=a.double()}return o}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error(\"invalid scalar\");let r=this.ZERO,o=this.BASE;const i=Le(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:a,offset:s,isZero:c,isNeg:u,isNegF:l,offsetF:f}=Me(n,e,i);n=a,c?o=o.add(Ue(l,t[f])):r=r.add(Ue(u,t[s]))}return ze(n),{p:r,f:o}}wNAFUnsafe(e,t,n,r=this.ZERO){const o=Le(e,this.bits);for(let e=0;e<o.windows&&n!==Re;e++){const{nextN:i,offset:a,isZero:s,isNeg:c}=Me(n,e,o);if(n=i,!s){const e=t[a];r=r.add(c?e.negate():e)}}return ze(n),r}getPrecomputes(e,t,n){let r=De.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&(\"function\"==typeof n&&(r=n(r)),De.set(t,r))),r}cached(e,t,n){const r=Ve(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){const o=Ve(e);return 1===o?this._unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)}createCache(e,t){Ne(t,this.bits),qe.set(e,t),De.delete(e)}hasCache(e){return 1!==Ve(e)}}function He(e,t,n,r){(function(e,t){if(!Array.isArray(e))throw new Error(\"array expected\");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error(\"invalid point at index \"+n)})})(n,e),function(e,t){if(!Array.isArray(e))throw new Error(\"array of scalars expected\");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error(\"invalid scalar at index \"+n)})}(r,t);const o=n.length,i=r.length;if(o!==i)throw new Error(\"arrays of points and scalars must have equal length\");const a=e.ZERO,s=function(e){let t;for(t=0;e>Z;e>>=Y,t+=1);return t}(BigInt(o));let c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);const u=se(c),l=new Array(Number(u)+1).fill(a);let f=a;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){l.fill(a);for(let t=0;t<i;t++){const o=r[t],i=Number(o>>BigInt(e)&u);l[i]=l[i].add(n[t])}let t=a;for(let e=l.length-1,n=a;e>0;e--)n=n.add(l[e]),t=t.add(n);if(f=f.add(t),0!==e)for(let e=0;e<c;e++)f=f.double()}return f}function $e(e,t,n){if(t){if(t.ORDER!==e)throw new Error(\"Field.ORDER must match order: Fp == p, Fn == n\");return function(e){ce(e,Ie.reduce((e,t)=>(e[t]=\"function\",e),{ORDER:\"bigint\",MASK:\"bigint\",BYTES:\"number\",BITS:\"number\"}))}(t),t}return Pe(e,{isLE:n})}const Ge=BigInt(0),We=BigInt(1),Xe=BigInt(2),Ze=BigInt(8);class Ye{constructor(e){this.ep=e}static fromBytes(e){ue()}static fromHex(e){ue()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return m(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.init(this.ep.precompute(e,t))}toRawBytes(){return this.toBytes()}}w(\"HashToScalar-\");const Je=BigInt(0),Qe=BigInt(1),et=BigInt(2),tt=(BigInt(3),BigInt(5)),nt=BigInt(8),rt=BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed\"),ot={p:rt,n:BigInt(\"0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed\"),h:nt,a:BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec\"),d:BigInt(\"0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3\"),Gx:BigInt(\"0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\"),Gy:BigInt(\"0x6666666666666666666666666666666666666666666666666666666666666658\")},it=BigInt(\"19681161376707505956807079304988542015446066515923890162744021073123829784752\");function at(e,t){const n=rt,r=Se(t*t*t,n),o=Se(r*r*t,n);let i=Se(e*r*function(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),o=BigInt(80),i=rt,a=e*e%i*e%i,s=Ae(a,et,i)*a%i,c=Ae(s,Qe,i)*e%i,u=Ae(c,tt,i)*c%i,l=Ae(u,t,i)*u%i,f=Ae(l,n,i)*l%i,p=Ae(f,r,i)*f%i,d=Ae(p,o,i)*p%i,h=Ae(d,o,i)*p%i,y=Ae(h,t,i)*u%i;return{pow_p_5_8:Ae(y,et,i)*e%i,b2:a}}(e*o).pow_p_5_8,n);const a=Se(t*i*i,n),s=i,c=Se(i*it,n),u=a===e,l=a===Se(-e,n),f=a===Se(-e*it,n);return u&&(i=s),(l||f)&&(i=c),_e(i,n)&&(i=Se(-i,n)),{isValid:u||l,value:i}}const st=Pe(ot.p,{isLE:!0}),ct=Pe(ot.n,{isLE:!0}),ut=function(e){const{CURVE:t,curveOpts:n,hash:r,eddsaOpts:o}=function(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n={Fp:e.Fp,Fn:Pe(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},r={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:n,hash:e.hash,eddsaOpts:r}}(e);return function(e,t){const n=t.Point;return Object.assign({},t,{ExtendedPoint:n,CURVE:e,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}(e,function(e,t,n={}){if(\"function\"!=typeof t)throw new Error('\"hash\" function param is required');ce(n,{},{adjustScalarBytes:\"function\",randomBytes:\"function\",domain:\"function\",prehash:\"function\",mapToCurve:\"function\"});const{prehash:r}=n,{BASE:o,Fp:i,Fn:a}=e,s=n.randomBytes||x,c=n.adjustScalarBytes||(e=>e),u=n.domain||((e,t,n)=>{if(J(n,\"phflag\"),t.length||n)throw new Error(\"Contexts/pre-hash are not supported\");return e});function f(e){return a.create(te(e))}function p(e){const{head:n,prefix:r,scalar:i}=function(e){const n=m.secretKey;e=re(\"private key\",e,n);const r=re(\"hashed private key\",t(e),2*n),o=c(r.slice(0,n));return{head:o,prefix:r.slice(n,2*n),scalar:f(o)}}(e),a=o.multiply(i),s=a.toBytes();return{head:n,prefix:r,scalar:i,point:a,pointBytes:s}}function d(e){return p(e).pointBytes}function h(e=Uint8Array.of(),...n){const o=A(...n);return f(t(u(o,re(\"context\",e),!!r)))}const y={zip215:!0},g=i.BYTES,m={secretKey:g,publicKey:g,signature:2*g,seed:g};function v(e=s(m.seed)){return Q(e,m.seed,\"seed\")}const b={getExtendedPublicKey:p,randomSecretKey:v,isValidSecretKey:function(e){return l(e)&&e.length===a.BYTES},isValidPublicKey:function(t,n){try{return!!e.fromBytes(t,n)}catch(e){return!1}},toMontgomery(t){const{y:n}=e.fromBytes(t),r=m.publicKey,o=32===r;if(!o&&57!==r)throw new Error(\"only defined for 25519 and 448\");const a=o?i.div(We+n,We-n):i.div(n-We,n+We);return i.toBytes(a)},toMontgomerySecret(e){const n=m.secretKey;Q(e,n);const r=t(e.subarray(0,n));return c(r).subarray(0,n)},randomPrivateKey:v,precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({keygen:function(e){const t=b.randomSecretKey(e);return{secretKey:t,publicKey:d(t)}},getPublicKey:d,sign:function(e,t,n={}){e=re(\"message\",e),r&&(e=r(e));const{prefix:i,scalar:s,pointBytes:c}=p(t),u=h(n.context,i,e),l=o.multiply(u).toBytes(),f=h(n.context,l,c,e),d=a.create(u+f*s);if(!a.isValid(d))throw new Error(\"sign failed: invalid s\");return Q(A(l,a.toBytes(d)),m.signature,\"result\")},verify:function(t,n,i,a=y){const{context:s,zip215:c}=a,u=m.signature;t=re(\"signature\",t,u),n=re(\"message\",n),i=re(\"publicKey\",i,m.publicKey),void 0!==c&&J(c,\"zip215\"),r&&(n=r(n));const l=u/2,f=t.subarray(0,l),p=te(t.subarray(l,u));let d,g,v;try{d=e.fromBytes(i,c),g=e.fromBytes(f,c),v=o.multiplyUnsafe(p)}catch(e){return!1}if(!c&&d.isSmallOrder())return!1;const b=h(s,g.toBytes(),d.toBytes(),n);return g.add(d.multiplyUnsafe(b)).subtract(v).clearCofactor().is0()},utils:b,Point:e,lengths:m})}(function(e,t={}){const n=function(e,t,n={},r){if(void 0===r&&(r=\"edwards\"===e),!t||\"object\"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of[\"p\",\"n\",\"h\"]){const n=t[e];if(!(\"bigint\"==typeof n&&n>Re))throw new Error(`CURVE.${e} must be positive bigint`)}const o=$e(t.p,n.Fp,r),i=$e(t.n,n.Fn,r),a=[\"Gx\",\"Gy\",\"a\",\"weierstrass\"===e?\"b\":\"d\"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}}(\"edwards\",e,t,t.FpFnLE),{Fp:r,Fn:o}=n;let i=n.CURVE;const{h:a}=i;ce(t,{},{uvRatio:\"function\"});const s=Xe<<BigInt(8*o.BYTES)-We,c=e=>r.create(e),u=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(r.div(e,t))}}catch(e){return{isValid:!1,value:Ge}}});if(!function(e,t,n,r){const o=e.sqr(n),i=e.sqr(r),a=e.add(e.mul(t.a,o),i),s=e.add(e.ONE,e.mul(t.d,e.mul(o,i)));return e.eql(a,s)}(r,i,i.Gx,i.Gy))throw new Error(\"bad curve params: generator point\");function l(e,t,n=!1){return ae(\"coordinate \"+e,t,n?We:Ge,s),t}function f(e){if(!(e instanceof h))throw new Error(\"ExtendedPoint expected\")}const p=le((e,t)=>{const{X:n,Y:o,Z:i}=e,a=e.is0();null==t&&(t=a?Ze:r.inv(i));const s=c(n*t),u=c(o*t),l=r.mul(i,t);if(a)return{x:Ge,y:We};if(l!==We)throw new Error(\"invZ was invalid\");return{x:s,y:u}}),d=le(e=>{const{a:t,d:n}=i;if(e.is0())throw new Error(\"bad point: ZERO\");const{X:r,Y:o,Z:a,T:s}=e,u=c(r*r),l=c(o*o),f=c(a*a),p=c(f*f),d=c(u*t);if(c(f*c(d+l))!==c(p+c(n*c(u*l))))throw new Error(\"bad point: equation left != right (1)\");if(c(r*o)!==c(a*s))throw new Error(\"bad point: equation left != right (2)\");return!0});class h{constructor(e,t,n,r){this.X=l(\"x\",e),this.Y=l(\"y\",t),this.Z=l(\"z\",n,!0),this.T=l(\"t\",r),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){if(e instanceof h)throw new Error(\"extended point not allowed\");const{x:t,y:n}=e||{};return l(\"x\",t),l(\"y\",n),new h(t,n,We,c(t*n))}static fromBytes(e,t=!1){const n=r.BYTES,{a:o,d:a}=i;e=oe(Q(e,n,\"point\")),J(t,\"zip215\");const l=oe(e),f=e[n-1];l[n-1]=-129&f;const p=te(l),d=t?s:r.ORDER;ae(\"point.y\",p,Ge,d);const y=c(p*p),g=c(y-We),m=c(a*y-o);let{isValid:v,value:b}=u(g,m);if(!v)throw new Error(\"bad point: invalid y coordinate\");const w=(b&We)===We,S=!!(128&f);if(!t&&b===Ge&&S)throw new Error(\"bad point: x=0 and x_0=1\");return S!==w&&(b=c(-b)),h.fromAffine({x:b,y:p})}static fromHex(e,t=!1){return h.fromBytes(re(\"point\",e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return y.createCache(this,e),t||this.multiply(Xe),this}assertValidity(){d(this)}equals(e){f(e);const{X:t,Y:n,Z:r}=this,{X:o,Y:i,Z:a}=e,s=c(t*a),u=c(o*r),l=c(n*a),p=c(i*r);return s===u&&l===p}is0(){return this.equals(h.ZERO)}negate(){return new h(c(-this.X),this.Y,this.Z,c(-this.T))}double(){const{a:e}=i,{X:t,Y:n,Z:r}=this,o=c(t*t),a=c(n*n),s=c(Xe*c(r*r)),u=c(e*o),l=t+n,f=c(c(l*l)-o-a),p=u+a,d=p-s,y=u-a,g=c(f*d),m=c(p*y),v=c(f*y),b=c(d*p);return new h(g,m,b,v)}add(e){f(e);const{a:t,d:n}=i,{X:r,Y:o,Z:a,T:s}=this,{X:u,Y:l,Z:p,T:d}=e,y=c(r*u),g=c(o*l),m=c(s*n*d),v=c(a*p),b=c((r+o)*(u+l)-y-g),w=v-m,S=v+m,A=c(g-t*y),E=c(b*w),x=c(S*A),T=c(b*A),k=c(w*S);return new h(E,x,k,T)}subtract(e){return this.add(e.negate())}multiply(e){if(!o.isValidNot0(e))throw new Error(\"invalid scalar: expected 1 <= sc < curve.n\");const{p:t,f:n}=y.cached(this,e,e=>Fe(h,e));return Fe(h,[t,n])[0]}multiplyUnsafe(e,t=h.ZERO){if(!o.isValid(e))throw new Error(\"invalid scalar: expected 0 <= sc < curve.n\");return e===Ge?h.ZERO:this.is0()||e===We?this:y.unsafe(this,e,e=>Fe(h,e),t)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return y.unsafe(this,i.n).is0()}toAffine(e){return p(this,e)}clearCofactor(){return a===We?this:this.multiplyUnsafe(a)}toBytes(){const{x:e,y:t}=this.toAffine(),n=r.toBytes(t);return n[n.length-1]|=e&We?128:0,n}toHex(){return m(this.toBytes())}toString(){return`<Point ${this.is0()?\"ZERO\":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(e){return Fe(h,e)}static msm(e,t){return He(h,o,e,t)}_setWindowSize(e){this.precompute(e)}toRawBytes(){return this.toBytes()}}h.BASE=new h(i.Gx,i.Gy,We,c(i.Gx*i.Gy)),h.ZERO=new h(Ge,We,We,Ge),h.Fp=r,h.Fn=o;const y=new Ke(h,o.BITS);return h.BASE.precompute(8),h}(t,n),r,o))}({...ot,Fp:st,hash:X,adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e},uvRatio:at}),lt=it,ft=BigInt(\"25063068953384623474111414158702152701244531502492656460079210482610430750235\"),pt=BigInt(\"54469307008909316920995813868745141605393597292927456921205312896311721017578\"),dt=BigInt(\"1159843021668779879193775521855586647937357759715417654439879720876111806838\"),ht=BigInt(\"40440834346308536858101042469323190826248399146238708352240133220865137265952\"),yt=e=>at(Qe,e),gt=BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"),mt=e=>ut.Point.Fp.create(te(e)&gt);function vt(e){const{d:t}=ot,n=rt,r=e=>st.create(e),o=r(lt*e*e),i=r((o+Qe)*dt);let a=BigInt(-1);const s=r((a-t*o)*r(o+t));let{isValid:c,value:u}=at(i,s),l=r(u*e);_e(l,n)||(l=r(-l)),c||(u=l),c||(a=o);const f=r(a*(o-Qe)*ht-s),p=u*u,d=r((u+u)*s),h=r(f*ft),y=r(Qe-p),g=r(Qe+p);return new ut.Point(r(d*g),r(y*h),r(h*g),r(d*y))}class bt extends Ye{constructor(e){super(e)}static fromAffine(e){return new bt(ut.Point.fromAffine(e))}assertSame(e){if(!(e instanceof bt))throw new Error(\"RistrettoPoint expected\")}init(e){return new bt(e)}static hashToCurve(e){return function(e){f(e,64);const t=vt(mt(e.subarray(0,32))),n=vt(mt(e.subarray(32,64)));return new bt(t.add(n))}(re(\"ristrettoHash\",e,64))}static fromBytes(e){f(e,32);const{a:t,d:n}=ot,r=rt,o=e=>st.create(e),i=mt(e);if(!function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n}(st.toBytes(i),e)||_e(i,r))throw new Error(\"invalid ristretto255 encoding 1\");const a=o(i*i),s=o(Qe+t*a),c=o(Qe-t*a),u=o(s*s),l=o(c*c),p=o(t*n*u-l),{isValid:d,value:h}=yt(o(p*l)),y=o(h*c),g=o(h*y*p);let m=o((i+i)*y);_e(m,r)&&(m=o(-m));const v=o(s*g),b=o(m*v);if(!d||_e(b,r)||v===Je)throw new Error(\"invalid ristretto255 encoding 2\");return new bt(new ut.Point(m,v,Qe,b))}static fromHex(e){return bt.fromBytes(re(\"ristrettoHex\",e,32))}static msm(e,t){return He(bt,ut.Point.Fn,e,t)}toBytes(){let{X:e,Y:t,Z:n,T:r}=this.ep;const o=rt,i=e=>st.create(e),a=i(i(n+t)*i(n-t)),s=i(e*t),c=i(s*s),{value:u}=yt(i(a*c)),l=i(u*a),f=i(u*s),p=i(l*f*r);let d;if(_e(r*p,o)){let n=i(t*lt),r=i(e*lt);e=n,t=r,d=i(l*pt)}else d=f;_e(e*p,o)&&(t=i(-t));let h=i((n-t)*d);return _e(h,o)&&(h=i(-h)),st.toBytes(h)}equals(e){this.assertSame(e);const{X:t,Y:n}=this.ep,{X:r,Y:o}=e.ep,i=e=>st.create(e),a=i(t*o)===i(n*r),s=i(n*o)===i(t*r);return a||s}is0(){return this.equals(bt.ZERO)}}bt.BASE=new bt(ut.Point.BASE),bt.ZERO=new bt(ut.Point.ZERO),bt.Fp=st,bt.Fn=ct;var wt=n(8287).Buffer;function St(e,t){return wt.from(ut.sign(wt.from(e),t))}function At(e,t,n){return ut.verify(wt.from(t),wt.from(e),wt.from(n),{zip215:!1})}var Et=function(e,t){for(var n=\"number\"==typeof e,r=String(e);r.endsWith(t);)r=r.slice(0,-1);return n?Number(r):r},xt=n(5360),Tt=n(8287).Buffer;function kt(e){return kt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},kt(e)}function Ot(e){var t=function(e){if(\"object\"!=kt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=kt(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==kt(t)?t:t+\"\"}var _t,It,Ct,Bt={ed25519PublicKey:48,ed25519SecretSeed:144,med25519PublicKey:96,preAuthTx:152,sha256Hash:184,signedPayload:120,contract:16,liquidityPool:88,claimableBalance:8},Pt={G:\"ed25519PublicKey\",S:\"ed25519SecretSeed\",M:\"med25519PublicKey\",T:\"preAuthTx\",X:\"sha256Hash\",P:\"signedPayload\",C:\"contract\",L:\"liquidityPool\",B:\"claimableBalance\"},Rt=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e)},t=[{key:\"encodeEd25519PublicKey\",value:function(e){return Ft(\"ed25519PublicKey\",e)}},{key:\"decodeEd25519PublicKey\",value:function(e){return Ut(\"ed25519PublicKey\",e)}},{key:\"isValidEd25519PublicKey\",value:function(e){return jt(\"ed25519PublicKey\",e)}},{key:\"encodeEd25519SecretSeed\",value:function(e){return Ft(\"ed25519SecretSeed\",e)}},{key:\"decodeEd25519SecretSeed\",value:function(e){return Ut(\"ed25519SecretSeed\",e)}},{key:\"isValidEd25519SecretSeed\",value:function(e){return jt(\"ed25519SecretSeed\",e)}},{key:\"encodeMed25519PublicKey\",value:function(e){return Ft(\"med25519PublicKey\",e)}},{key:\"decodeMed25519PublicKey\",value:function(e){return Ut(\"med25519PublicKey\",e)}},{key:\"isValidMed25519PublicKey\",value:function(e){return jt(\"med25519PublicKey\",e)}},{key:\"encodePreAuthTx\",value:function(e){return Ft(\"preAuthTx\",e)}},{key:\"decodePreAuthTx\",value:function(e){return Ut(\"preAuthTx\",e)}},{key:\"encodeSha256Hash\",value:function(e){return Ft(\"sha256Hash\",e)}},{key:\"decodeSha256Hash\",value:function(e){return Ut(\"sha256Hash\",e)}},{key:\"encodeSignedPayload\",value:function(e){return Ft(\"signedPayload\",e)}},{key:\"decodeSignedPayload\",value:function(e){return Ut(\"signedPayload\",e)}},{key:\"isValidSignedPayload\",value:function(e){return jt(\"signedPayload\",e)}},{key:\"encodeContract\",value:function(e){return Ft(\"contract\",e)}},{key:\"decodeContract\",value:function(e){return Ut(\"contract\",e)}},{key:\"isValidContract\",value:function(e){return jt(\"contract\",e)}},{key:\"encodeClaimableBalance\",value:function(e){return Ft(\"claimableBalance\",e)}},{key:\"decodeClaimableBalance\",value:function(e){return Ut(\"claimableBalance\",e)}},{key:\"isValidClaimableBalance\",value:function(e){return jt(\"claimableBalance\",e)}},{key:\"encodeLiquidityPool\",value:function(e){return Ft(\"liquidityPool\",e)}},{key:\"decodeLiquidityPool\",value:function(e){return Ut(\"liquidityPool\",e)}},{key:\"isValidLiquidityPool\",value:function(e){return jt(\"liquidityPool\",e)}},{key:\"getVersionByteForPrefix\",value:function(e){return Pt[e[0]]}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Ot(r.key),r)}}(e,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e;var e,t}();function jt(e,t){if(\"string\"!=typeof t)return!1;switch(e){case\"ed25519PublicKey\":case\"ed25519SecretSeed\":case\"preAuthTx\":case\"sha256Hash\":case\"contract\":case\"liquidityPool\":if(56!==t.length)return!1;break;case\"claimableBalance\":if(58!==t.length)return!1;break;case\"med25519PublicKey\":if(69!==t.length)return!1;break;case\"signedPayload\":if(t.length<56||t.length>165)return!1;break;default:return!1}var n=\"\";try{n=Ut(e,t)}catch(e){return!1}switch(e){case\"ed25519PublicKey\":case\"ed25519SecretSeed\":case\"preAuthTx\":case\"sha256Hash\":case\"contract\":case\"liquidityPool\":return 32===n.length;case\"claimableBalance\":return 33===n.length;case\"med25519PublicKey\":return 40===n.length;case\"signedPayload\":return n.length>=40&&n.length<=100;default:return!1}}function Ut(e,t){if(\"string\"!=typeof t)throw new TypeError(\"encoded argument must be of type String\");var n=xt.decode(t),r=n[0],o=n.slice(0,-2),i=o.slice(1),a=n.slice(-2);if(t!==xt.encode(n))throw new Error(\"invalid encoded string\");var s=Bt[e];if(void 0===s)throw new Error(\"\".concat(e,\" is not a valid version byte name. \")+\"Expected one of \".concat(Object.keys(Bt).join(\", \")));if(r!==s)throw new Error(\"invalid version byte. expected \".concat(s,\", got \").concat(r));if(!function(e,t){if(e.length!==t.length)return!1;if(0===e.length)return!0;for(var n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}(Nt(o),a))throw new Error(\"invalid checksum\");return Tt.from(i)}function Ft(e,t){if(null==t)throw new Error(\"cannot encode null data\");var n=Bt[e];if(void 0===n)throw new Error(\"\".concat(e,\" is not a valid version byte name. \")+\"Expected one of \".concat(Object.keys(Bt).join(\", \")));t=Tt.from(t);var r=Tt.from([n]),o=Tt.concat([r,t]),i=Tt.from(Nt(o)),a=Tt.concat([o,i]);return xt.encode(a)}function Nt(e){for(var t=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],n=0,r=0;r<e.length;r+=1)n=n<<8^t[n>>8^e[r]],n&=65535;var o=new Uint8Array(2);return o[0]=255&n,o[1]=n>>8&255,o}_t=Rt,Ct=Pt,(It=Ot(It=\"types\"))in _t?Object.defineProperty(_t,It,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):_t[It]=Ct;var Lt=n(8287).Buffer;function Mt(e){return Mt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Mt(e)}function Dt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,qt(r.key),r)}}function qt(e){var t=function(e){if(\"object\"!=Mt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Mt(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Mt(t)?t:t+\"\"}var Vt=function(e,t,n){return t&&Dt(e.prototype,t),n&&Dt(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),\"ed25519\"!==t.type)throw new Error(\"Invalid keys type\");if(this.type=t.type,t.secretKey){if(t.secretKey=Lt.from(t.secretKey),32!==t.secretKey.length)throw new Error(\"secretKey length is invalid\");if(this._secretSeed=t.secretKey,this._publicKey=(n=t.secretKey,wt.from(ut.getPublicKey(n))),this._secretKey=t.secretKey,t.publicKey&&!this._publicKey.equals(Lt.from(t.publicKey)))throw new Error(\"secretKey does not match publicKey\")}else if(this._publicKey=Lt.from(t.publicKey),32!==this._publicKey.length)throw new Error(\"publicKey length is invalid\");var n},[{key:\"xdrAccountId\",value:function(){return new i.AccountId.publicKeyTypeEd25519(this._publicKey)}},{key:\"xdrPublicKey\",value:function(){return new i.PublicKey.publicKeyTypeEd25519(this._publicKey)}},{key:\"xdrMuxedAccount\",value:function(e){if(void 0!==e){if(\"string\"!=typeof e)throw new TypeError(\"expected string for ID, got \".concat(Mt(e)));return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromString(e),ed25519:this._publicKey}))}return new i.MuxedAccount.keyTypeEd25519(this._publicKey)}},{key:\"rawPublicKey\",value:function(){return this._publicKey}},{key:\"signatureHint\",value:function(){var e=this.xdrAccountId().toXDR();return e.slice(e.length-4)}},{key:\"publicKey\",value:function(){return Rt.encodeEd25519PublicKey(this._publicKey)}},{key:\"secret\",value:function(){if(!this._secretSeed)throw new Error(\"no secret key available\");if(\"ed25519\"===this.type)return Rt.encodeEd25519SecretSeed(this._secretSeed);throw new Error(\"Invalid Keypair type\")}},{key:\"rawSecretKey\",value:function(){return this._secretSeed}},{key:\"canSign\",value:function(){return!!this._secretKey}},{key:\"sign\",value:function(e){if(!this.canSign())throw new Error(\"cannot sign: no secret key available\");return St(e,this._secretKey)}},{key:\"verify\",value:function(e,t){try{return At(e,t,this._publicKey)}catch(e){return!1}}},{key:\"signDecorated\",value:function(e){var t=this.sign(e),n=this.signatureHint();return new i.DecoratedSignature({hint:n,signature:t})}},{key:\"signPayloadDecorated\",value:function(e){var t=this.sign(e),n=this.signatureHint(),r=Lt.from(e.slice(-4));return r.length<4&&(r=Lt.concat([r,Lt.alloc(4-e.length,0)])),new i.DecoratedSignature({hint:r.map(function(e,t){return e^n[t]}),signature:t})}}],[{key:\"fromSecret\",value:function(e){var t=Rt.decodeEd25519SecretSeed(e);return this.fromRawEd25519Seed(t)}},{key:\"fromRawEd25519Seed\",value:function(e){return new this({type:\"ed25519\",secretKey:e})}},{key:\"master\",value:function(e){if(!e)throw new Error(\"No network selected. Please pass a network argument, e.g. `Keypair.master(Networks.PUBLIC)`.\");return this.fromRawEd25519Seed(c(e))}},{key:\"fromPublicKey\",value:function(e){if(32!==(e=Rt.decodeEd25519PublicKey(e)).length)throw new Error(\"Invalid Stellar public key\");return new this({type:\"ed25519\",publicKey:e})}},{key:\"random\",value:function(){var e=ut.utils.randomPrivateKey();return this.fromRawEd25519Seed(e)}}]),zt=n(8287).Buffer;function Kt(e){return Kt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Kt(e)}function Ht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,$t(r.key),r)}}function $t(e){var t=function(e){if(\"object\"!=Kt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Kt(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Kt(t)?t:t+\"\"}var Gt=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),!/^[a-zA-Z0-9]{1,12}$/.test(t))throw new Error(\"Asset code is invalid (maximum alphanumeric, 12 characters at max)\");if(\"xlm\"!==String(t).toLowerCase()&&!n)throw new Error(\"Issuer cannot be null\");if(n&&!Rt.isValidEd25519PublicKey(n))throw new Error(\"Issuer is invalid\");\"xlm\"===String(t).toLowerCase()?this.code=\"XLM\":this.code=t,this.issuer=n}return function(e,t,n){return t&&Ht(e.prototype,t),n&&Ht(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(e,[{key:\"toXDRObject\",value:function(){return this._toXDRObject(i.Asset)}},{key:\"toChangeTrustXDRObject\",value:function(){return this._toXDRObject(i.ChangeTrustAsset)}},{key:\"toTrustLineXDRObject\",value:function(){return this._toXDRObject(i.TrustLineAsset)}},{key:\"contractId\",value:function(e){var t=c(zt.from(e)),n=i.HashIdPreimage.envelopeTypeContractId(new i.HashIdPreimageContractId({networkId:t,contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAsset(this.toXDRObject())}));return Rt.encodeContract(c(n.toXDR()))}},{key:\"_toXDRObject\",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.Asset;if(this.isNative())return n.assetTypeNative();this.code.length<=4?(e=i.AlphaNum4,t=\"assetTypeCreditAlphanum4\"):(e=i.AlphaNum12,t=\"assetTypeCreditAlphanum12\");var r=this.code.length<=4?4:12;return new n(t,new e({assetCode:this.code.padEnd(r,\"\\0\"),issuer:Vt.fromPublicKey(this.issuer).xdrAccountId()}))}},{key:\"getCode\",value:function(){if(void 0!==this.code)return String(this.code)}},{key:\"getIssuer\",value:function(){if(void 0!==this.issuer)return String(this.issuer)}},{key:\"getAssetType\",value:function(){switch(this.getRawAssetType().value){case i.AssetType.assetTypeNative().value:return\"native\";case i.AssetType.assetTypeCreditAlphanum4().value:return\"credit_alphanum4\";case i.AssetType.assetTypeCreditAlphanum12().value:return\"credit_alphanum12\";default:return\"unknown\"}}},{key:\"getRawAssetType\",value:function(){return this.isNative()?i.AssetType.assetTypeNative():this.code.length<=4?i.AssetType.assetTypeCreditAlphanum4():i.AssetType.assetTypeCreditAlphanum12()}},{key:\"isNative\",value:function(){return!this.issuer}},{key:\"equals\",value:function(e){return this.code===e.getCode()&&this.issuer===e.getIssuer()}},{key:\"toString\",value:function(){return this.isNative()?\"native\":\"\".concat(this.getCode(),\":\").concat(this.getIssuer())}}],[{key:\"native\",value:function(){return new e(\"XLM\")}},{key:\"fromOperation\",value:function(e){var t,n;switch(e.switch()){case i.AssetType.assetTypeNative():return this.native();case i.AssetType.assetTypeCreditAlphanum4():t=e.alphaNum4();case i.AssetType.assetTypeCreditAlphanum12():return t=t||e.alphaNum12(),n=Rt.encodeEd25519PublicKey(t.issuer().ed25519()),new this(Et(t.assetCode(),\"\\0\"),n);default:throw new Error(\"Invalid asset type: \".concat(e.switch().name))}}},{key:\"compare\",value:function(t,n){if(!(t&&t instanceof e))throw new Error(\"assetA is invalid\");if(!(n&&n instanceof e))throw new Error(\"assetB is invalid\");if(t.equals(n))return 0;var r=t.getRawAssetType().value,o=n.getRawAssetType().value;if(r!==o)return r<o?-1:1;var i=Wt(t.getCode(),n.getCode());return 0!==i?i:Wt(t.getIssuer(),n.getIssuer())}}])}();function Wt(e,t){return zt.compare(zt.from(e,\"ascii\"),zt.from(t,\"ascii\"))}var Xt=n(8287).Buffer,Zt=30;function Yt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(\"constant_product\"!==e)throw new Error(\"liquidityPoolType is invalid\");var n=t.assetA,r=t.assetB,o=t.fee;if(!(n&&n instanceof Gt))throw new Error(\"assetA is invalid\");if(!(r&&r instanceof Gt))throw new Error(\"assetB is invalid\");if(!o||o!==Zt)throw new Error(\"fee is invalid\");if(-1!==Gt.compare(n,r))throw new Error(\"Assets are not in lexicographic order\");var a=i.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(),s=new i.LiquidityPoolConstantProductParameters({assetA:n.toXDRObject(),assetB:r.toXDRObject(),fee:o}).toXDR();return c(Xt.concat([a,s]))}var Jt=n(8287).Buffer;function Qt(e){return Qt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Qt(e)}function en(e){var t=function(e){if(\"object\"!=Qt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Qt(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Qt(t)?t:t+\"\"}var tn=function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,en(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t,n,r,o){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),\"string\"!=typeof o)throw new Error(\"Invalid passphrase provided to Transaction: expected a string but got a \".concat(Qt(o)));this._networkPassphrase=o,this._tx=t,this._signatures=n,this._fee=r},[{key:\"signatures\",get:function(){return this._signatures},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"tx\",get:function(){return this._tx},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"fee\",get:function(){return this._fee},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"networkPassphrase\",get:function(){return this._networkPassphrase},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"sign\",value:function(){for(var e=this,t=this.hash(),n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];r.forEach(function(n){var r=n.signDecorated(t);e.signatures.push(r)})}},{key:\"getKeypairSignature\",value:function(e){return e.sign(this.hash()).toString(\"base64\")}},{key:\"addSignature\",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";if(!r||\"string\"!=typeof r)throw new Error(\"Invalid signature\");if(!n||\"string\"!=typeof n)throw new Error(\"Invalid publicKey\");var o=Jt.from(r,\"base64\");try{t=(e=Vt.fromPublicKey(n)).signatureHint()}catch(e){throw new Error(\"Invalid publicKey\")}if(!e.verify(this.hash(),o))throw new Error(\"Invalid signature\");this.signatures.push(new i.DecoratedSignature({hint:t,signature:o}))}},{key:\"addDecoratedSignature\",value:function(e){this.signatures.push(e)}},{key:\"signHashX\",value:function(e){if(\"string\"==typeof e&&(e=Jt.from(e,\"hex\")),e.length>64)throw new Error(\"preimage cannnot be longer than 64 bytes\");var t=e,n=c(e),r=n.slice(n.length-4);this.signatures.push(new i.DecoratedSignature({hint:r,signature:t}))}},{key:\"hash\",value:function(){return c(this.signatureBase())}},{key:\"signatureBase\",value:function(){throw new Error(\"Implement in subclass\")}},{key:\"toEnvelope\",value:function(){throw new Error(\"Implement in subclass\")}},{key:\"toXDR\",value:function(){return this.toEnvelope().toXDR().toString(\"base64\")}}]),nn=/^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,rn=Math.ceil,on=Math.floor,an=\"[BigNumber Error] \",sn=an+\"Number primitive has more than 15 significant digits: \",cn=1e14,un=14,ln=9007199254740991,fn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],pn=1e7,dn=1e9;function hn(e){var t=0|e;return e>0||e===t?t:t-1}function yn(e){for(var t,n,r=1,o=e.length,i=e[0]+\"\";r<o;){for(t=e[r++]+\"\",n=un-t.length;n--;t=\"0\"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function gn(e,t){var n,r,o=e.c,i=t.c,a=e.s,s=t.s,c=e.e,u=t.e;if(!a||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=c==u,!o||!i)return r?0:!o^n?1:-1;if(!r)return c>u^n?1:-1;for(s=(c=o.length)<(u=i.length)?c:u,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function mn(e,t,n,r){if(e<t||e>n||e!==on(e))throw Error(an+(r||\"Argument\")+(\"number\"==typeof e?e<t||e>n?\" out of range: \":\" not an integer: \":\" not a primitive number: \")+String(e))}function vn(e){var t=e.c.length-1;return hn(e.e/un)==t&&e.c[t]%2!=0}function bn(e,t){return(e.length>1?e.charAt(0)+\".\"+e.slice(1):e)+(t<0?\"e\":\"e+\")+t}function wn(e,t,n){var r,o;if(t<0){for(o=n+\".\";++t;o+=n);e=o+e}else if(++t>(r=e.length)){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+\".\"+e.slice(t));return e}var Sn=function e(t){var n,r,o,i,a,s,c,u,l,f,p=k.prototype={constructor:k,toString:null,valueOf:null},d=new k(1),h=20,y=4,g=-7,m=21,v=-1e7,b=1e7,w=!1,S=1,A=0,E={prefix:\"\",groupSize:3,secondaryGroupSize:0,groupSeparator:\",\",decimalSeparator:\".\",fractionGroupSize:0,fractionGroupSeparator:\" \",suffix:\"\"},x=\"0123456789abcdefghijklmnopqrstuvwxyz\",T=!0;function k(e,t){var n,i,a,s,c,u,l,f,p=this;if(!(p instanceof k))return new k(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>b?p.c=p.e=null:e.e<v?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((u=\"number\"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>b?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!nn.test(f=String(e)))return o(p,f,u);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf(\".\"))>-1&&(f=f.replace(\".\",\"\")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(mn(t,2,x.length,\"Base\"),10==t&&T)return C(p=new k(e),h+p.e+1,y);if(f=String(e),u=\"number\"==typeof e){if(0*e!=0)return o(p,f,u,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,k.DEBUG&&f.replace(/^0\\.0*|\\./,\"\").length>15)throw Error(sn+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=x.slice(0,t),s=c=0,l=f.length;c<l;c++)if(n.indexOf(i=f.charAt(c))<0){if(\".\"==i){if(c>s){s=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,c=-1,s=0;continue}return o(p,String(e),u,t)}u=!1,(s=(f=r(f,t,10,p.s)).indexOf(\".\"))>-1?f=f.replace(\".\",\"\"):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,u&&k.DEBUG&&l>15&&(e>ln||e!==on(e)))throw Error(sn+p.s*e);if((s=s-c-1)>b)p.c=p.e=null;else if(s<v)p.c=[p.e=0];else{if(p.e=s,p.c=[],c=(s+1)%un,s<0&&(c+=un),c<l){for(c&&p.c.push(+f.slice(0,c)),l-=un;c<l;)p.c.push(+f.slice(c,c+=un));c=un-(f=f.slice(c)).length}else c-=l;for(;c--;f+=\"0\");p.c.push(+f)}}else p.c=[p.e=0]}function O(e,t,n,r){var o,i,a,s,c;if(null==n?n=y:mn(n,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)c=yn(e.c),c=1==r||2==r&&(a<=g||a>=m)?bn(c,a):wn(c,a,\"0\");else if(i=(e=C(new k(e),t,n)).e,s=(c=yn(e.c)).length,1==r||2==r&&(t<=i||i<=g)){for(;s<t;c+=\"0\",s++);c=bn(c,i)}else if(t-=a+(2===r&&i>a),c=wn(c,i,\"0\"),i+1>s){if(--t>0)for(c+=\".\";t--;c+=\"0\");}else if((t+=i-s)>0)for(i+1==s&&(c+=\".\");t--;c+=\"0\");return e.s<0&&o?\"-\"+c:c}function _(e,t){for(var n,r,o=1,i=new k(e[0]);o<e.length;o++)(!(r=new k(e[o])).s||(n=gn(i,r))===t||0===n&&i.s===t)&&(i=r);return i}function I(e,t,n){for(var r=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,r++);return(n=r+n*un-1)>b?e.c=e.e=null:n<v?e.c=[e.e=0]:(e.e=n,e.c=t),e}function C(e,t,n,r){var o,i,a,s,c,u,l,f=e.c,p=fn;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=un,a=t,c=f[u=0],l=on(c/p[o-a-1]%10);else if((u=rn((i+1)/un))>=f.length){if(!r)break e;for(;f.length<=u;f.push(0));c=l=0,o=1,a=(i%=un)-un+1}else{for(c=s=f[u],o=1;s>=10;s/=10,o++);l=(a=(i%=un)-un+o)<0?0:on(c/p[o-a-1]%10)}if(r=r||t<0||null!=f[u+1]||(a<0?c:c%p[o-a-1]),r=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(i>0?a>0?c/p[o-a]:0:f[u-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,r?(t-=e.e+1,f[0]=p[(un-t%un)%un],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=u,s=1,u--):(f.length=u+1,s=p[un-i],f[u]=a>0?on(c/p[o-a]%p[a])*s:0),r)for(;;){if(0==u){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==cn&&(f[0]=1));break}if(f[u]+=s,f[u]!=cn)break;f[u--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>b?e.c=e.e=null:e.e<v&&(e.c=[e.e=0])}return e}function B(e){var t,n=e.e;return null===n?e.toString():(t=yn(e.c),t=n<=g||n>=m?bn(t,n):wn(t,n,\"0\"),e.s<0?\"-\"+t:t)}return k.clone=e,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(e){var t,n;if(null!=e){if(\"object\"!=typeof e)throw Error(an+\"Object expected: \"+e);if(e.hasOwnProperty(t=\"DECIMAL_PLACES\")&&(mn(n=e[t],0,dn,t),h=n),e.hasOwnProperty(t=\"ROUNDING_MODE\")&&(mn(n=e[t],0,8,t),y=n),e.hasOwnProperty(t=\"EXPONENTIAL_AT\")&&((n=e[t])&&n.pop?(mn(n[0],-dn,0,t),mn(n[1],0,dn,t),g=n[0],m=n[1]):(mn(n,-dn,dn,t),g=-(m=n<0?-n:n))),e.hasOwnProperty(t=\"RANGE\"))if((n=e[t])&&n.pop)mn(n[0],-dn,-1,t),mn(n[1],1,dn,t),v=n[0],b=n[1];else{if(mn(n,-dn,dn,t),!n)throw Error(an+t+\" cannot be zero: \"+n);v=-(b=n<0?-n:n)}if(e.hasOwnProperty(t=\"CRYPTO\")){if((n=e[t])!==!!n)throw Error(an+t+\" not true or false: \"+n);if(n){if(\"undefined\"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!n,Error(an+\"crypto unavailable\");w=n}else w=n}if(e.hasOwnProperty(t=\"MODULO_MODE\")&&(mn(n=e[t],0,9,t),S=n),e.hasOwnProperty(t=\"POW_PRECISION\")&&(mn(n=e[t],0,dn,t),A=n),e.hasOwnProperty(t=\"FORMAT\")){if(\"object\"!=typeof(n=e[t]))throw Error(an+t+\" not an object: \"+n);E=n}if(e.hasOwnProperty(t=\"ALPHABET\")){if(\"string\"!=typeof(n=e[t])||/^.?$|[+\\-.\\s]|(.).*\\1/.test(n))throw Error(an+t+\" invalid: \"+n);T=\"0123456789\"==n.slice(0,10),x=n}}return{DECIMAL_PLACES:h,ROUNDING_MODE:y,EXPONENTIAL_AT:[g,m],RANGE:[v,b],CRYPTO:w,MODULO_MODE:S,POW_PRECISION:A,FORMAT:E,ALPHABET:x}},k.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!k.DEBUG)return!0;var t,n,r=e.c,o=e.e,i=e.s;e:if(\"[object Array]\"=={}.toString.call(r)){if((1===i||-1===i)&&o>=-dn&&o<=dn&&o===on(o)){if(0===r[0]){if(0===o&&1===r.length)return!0;break e}if((t=(o+1)%un)<1&&(t+=un),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=cn||n!==on(n))break e;if(0!==n)return!0}}}else if(null===r&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(an+\"Invalid BigNumber: \"+e)},k.maximum=k.max=function(){return _(arguments,-1)},k.minimum=k.min=function(){return _(arguments,1)},k.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return on(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,o,i,s=0,c=[],u=new k(d);if(null==e?e=h:mn(e,0,dn),o=rn(e/un),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[s]=n[0],t[s+1]=n[1]):(c.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw w=!1,Error(an+\"crypto unavailable\");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=o/7}if(!w)for(;s<o;)(i=a())<9e15&&(c[s++]=i%1e14);for(o=c[--s],e%=un,o&&e&&(i=fn[un-e],c[s]=on(o/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[r=0];else{for(r=-1;0===c[0];c.splice(0,1),r-=un);for(s=1,i=c[0];i>=10;i/=10,s++);s<un&&(r-=un-s)}return u.e=r,u.c=c,u}),k.sum=function(){for(var e=1,t=arguments,n=new k(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e=\"0123456789\";function t(e,t,n,r){for(var o,i,a=[0],s=0,c=e.length;s<c;){for(i=a.length;i--;a[i]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>n-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/n|0,a[o]%=n)}return a.reverse()}return function(r,o,i,a,s){var c,u,l,f,p,d,g,m,v=r.indexOf(\".\"),b=h,w=y;for(v>=0&&(f=A,A=0,r=r.replace(\".\",\"\"),d=(m=new k(o)).pow(r.length-v),A=f,m.c=t(wn(yn(d.c),d.e,\"0\"),10,i,e),m.e=m.c.length),l=f=(g=t(r,o,i,s?(c=x,e):(c=e,x))).length;0==g[--f];g.pop());if(!g[0])return c.charAt(0);if(v<0?--l:(d.c=g,d.e=l,d.s=a,g=(d=n(d,m,b,w,i)).c,p=d.r,l=d.e),v=g[u=l+b+1],f=i/2,p=p||u<0||null!=g[u+1],p=w<4?(null!=v||p)&&(0==w||w==(d.s<0?3:2)):v>f||v==f&&(4==w||p||6==w&&1&g[u-1]||w==(d.s<0?8:7)),u<1||!g[0])r=p?wn(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(g.length=u,p)for(--i;++g[--u]>i;)g[u]=0,u||(++l,g=[1].concat(g));for(f=g.length;!g[--f];);for(v=0,r=\"\";v<=f;r+=c.charAt(g[v++]));r=wn(r,l,c.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,o,i,a,s=0,c=e.length,u=t%pn,l=t/pn|0;for(e=e.slice();c--;)s=((o=u*(i=e[c]%pn)+(r=l*i+(a=e[c]/pn|0)*u)%pn*pn+s)/n|0)+(r/pn|0)+l*a,e[c]=o%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;o<n;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function n(e,t,n,r){for(var o=0;n--;)e[n]-=o,o=e[n]<t[n]?1:0,e[n]=o*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,o,i,a,s){var c,u,l,f,p,d,h,y,g,m,v,b,w,S,A,E,x,T=r.s==o.s?1:-1,O=r.c,_=o.c;if(!(O&&O[0]&&_&&_[0]))return new k(r.s&&o.s&&(O?!_||O[0]!=_[0]:_)?O&&0==O[0]||!_?0*T:T/0:NaN);for(g=(y=new k(T)).c=[],T=i+(u=r.e-o.e)+1,s||(s=cn,u=hn(r.e/un)-hn(o.e/un),T=T/un|0),l=0;_[l]==(O[l]||0);l++);if(_[l]>(O[l]||0)&&u--,T<0)g.push(1),f=!0;else{for(S=O.length,E=_.length,l=0,T+=2,(p=on(s/(_[0]+1)))>1&&(_=e(_,p,s),O=e(O,p,s),E=_.length,S=O.length),w=E,v=(m=O.slice(0,E)).length;v<E;m[v++]=0);x=_.slice(),x=[0].concat(x),A=_[0],_[1]>=s/2&&A++;do{if(p=0,(c=t(_,m,E,v))<0){if(b=m[0],E!=v&&(b=b*s+(m[1]||0)),(p=on(b/A))>1)for(p>=s&&(p=s-1),h=(d=e(_,p,s)).length,v=m.length;1==t(d,m,h,v);)p--,n(d,E<h?x:_,h,s),h=d.length,c=1;else 0==p&&(c=p=1),h=(d=_.slice()).length;if(h<v&&(d=[0].concat(d)),n(m,d,v,s),v=m.length,-1==c)for(;t(_,m,E,v)<1;)p++,n(m,E<v?x:_,v,s),v=m.length}else 0===c&&(p++,m=[0]);g[l++]=p,m[0]?m[v++]=O[w]||0:(m=[O[w]],v=1)}while((w++<S||null!=m[0])&&T--);f=null!=m[0],g[0]||g.splice(0,1)}if(s==cn){for(l=1,T=g[0];T>=10;T/=10,l++);C(y,i+(y.e=l+u*un-1)+1,a,f)}else y.e=u,y.r=+f;return y}}(),s=/^(-?)0([xbo])(?=\\w[\\w.]*$)/i,c=/^([^.]+)\\.$/,u=/^\\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g,o=function(e,t,n,r){var o,i=n?t:t.replace(f,\"\");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!n&&(i=i.replace(s,function(e,t,n){return o=\"x\"==(n=n.toLowerCase())?16:\"b\"==n?2:8,r&&r!=o?e:t}),r&&(o=r,i=i.replace(c,\"$1\").replace(u,\"0.$1\")),t!=i))return new k(i,o);if(k.DEBUG)throw Error(an+\"Not a\"+(r?\" base \"+r:\"\")+\" number: \"+t);e.s=null}e.c=e.e=null},p.absoluteValue=p.abs=function(){var e=new k(this);return e.s<0&&(e.s=1),e},p.comparedTo=function(e,t){return gn(this,new k(e,t))},p.decimalPlaces=p.dp=function(e,t){var n,r,o,i=this;if(null!=e)return mn(e,0,dn),null==t?t=y:mn(t,0,8),C(new k(i),e+i.e+1,t);if(!(n=i.c))return null;if(r=((o=n.length-1)-hn(this.e/un))*un,o=n[o])for(;o%10==0;o/=10,r--);return r<0&&(r=0),r},p.dividedBy=p.div=function(e,t){return n(this,new k(e,t),h,y)},p.dividedToIntegerBy=p.idiv=function(e,t){return n(this,new k(e,t),0,1)},p.exponentiatedBy=p.pow=function(e,t){var n,r,o,i,a,s,c,u,l=this;if((e=new k(e)).c&&!e.isInteger())throw Error(an+\"Exponent not an integer: \"+B(e));if(null!=t&&(t=new k(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return u=new k(Math.pow(+B(l),a?e.s*(2-vn(e)):+B(e))),t?u.mod(t):u;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new k(NaN);(r=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&vn(e)?-0:0,l.e>-1&&(i=1/i),new k(s?1/i:i);A&&(i=rn(A/un+2))}for(a?(n=new k(.5),s&&(e.s=1),c=vn(e)):c=(o=Math.abs(+B(e)))%2,u=new k(d);;){if(c){if(!(u=u.times(l)).c)break;i?u.c.length>i&&(u.c.length=i):r&&(u=u.mod(t))}if(o){if(0===(o=on(o/2)))break;c=o%2}else if(C(e=e.times(n),e.e+1,1),e.e>14)c=vn(e);else{if(0===(o=+B(e)))break;c=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):r&&(l=l.mod(t))}return r?u:(s&&(u=d.div(u)),t?u.mod(t):i?C(u,A,y,void 0):u)},p.integerValue=function(e){var t=new k(this);return null==e?e=y:mn(e,0,8),C(t,t.e+1,e)},p.isEqualTo=p.eq=function(e,t){return 0===gn(this,new k(e,t))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(e,t){return gn(this,new k(e,t))>0},p.isGreaterThanOrEqualTo=p.gte=function(e,t){return 1===(t=gn(this,new k(e,t)))||0===t},p.isInteger=function(){return!!this.c&&hn(this.e/un)>this.c.length-2},p.isLessThan=p.lt=function(e,t){return gn(this,new k(e,t))<0},p.isLessThanOrEqualTo=p.lte=function(e,t){return-1===(t=gn(this,new k(e,t)))||0===t},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(e,t){var n,r,o,i,a=this,s=a.s;if(t=(e=new k(e,t)).s,!s||!t)return new k(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/un,u=e.e/un,l=a.c,f=e.c;if(!c||!u){if(!l||!f)return l?(e.s=-t,e):new k(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new k(l[0]?a:3==y?-0:0)}if(c=hn(c),u=hn(u),l=l.slice(),s=c-u){for((i=s<0)?(s=-s,o=l):(u=c,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(r=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t<r;t++)if(l[t]!=f[t]){i=l[t]<f[t];break}if(i&&(o=l,l=f,f=o,e.s=-e.s),(t=(r=f.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=cn-1;r>s;){if(l[--r]<f[r]){for(n=r;n&&!l[--n];l[n]=t);--l[n],l[r]+=cn}l[r]-=f[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?I(e,l,u):(e.s=3==y?-1:1,e.c=[e.e=0],e)},p.modulo=p.mod=function(e,t){var r,o,i=this;return e=new k(e,t),!i.c||!e.s||e.c&&!e.c[0]?new k(NaN):!e.c||i.c&&!i.c[0]?new k(i):(9==S?(o=e.s,e.s=1,r=n(i,e,0,3),e.s=o,r.s*=o):r=n(i,e,0,S),(e=i.minus(r.times(e))).c[0]||1!=S||(e.s=i.s),e)},p.multipliedBy=p.times=function(e,t){var n,r,o,i,a,s,c,u,l,f,p,d,h,y,g,m=this,v=m.c,b=(e=new k(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!m.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=m.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=hn(m.e/un)+hn(e.e/un),e.s*=m.s,(c=v.length)<(f=b.length)&&(h=v,v=b,b=h,o=c,c=f,f=o),o=c+f,h=[];o--;h.push(0));for(y=cn,g=pn,o=f;--o>=0;){for(n=0,p=b[o]%g,d=b[o]/g|0,i=o+(a=c);i>o;)n=((u=p*(u=v[--a]%g)+(s=d*u+(l=v[a]/g|0)*p)%g*g+h[i]+n)/y|0)+(s/g|0)+d*l,h[i--]=u%y;h[i]=n}return n?++r:h.splice(0,1),I(e,h,r)},p.negated=function(){var e=new k(this);return e.s=-e.s||null,e},p.plus=function(e,t){var n,r=this,o=r.s;if(t=(e=new k(e,t)).s,!o||!t)return new k(NaN);if(o!=t)return e.s=-t,r.minus(e);var i=r.e/un,a=e.e/un,s=r.c,c=e.c;if(!i||!a){if(!s||!c)return new k(o/0);if(!s[0]||!c[0])return c[0]?e:new k(s[0]?r:0*o)}if(i=hn(i),a=hn(a),s=s.slice(),o=i-a){for(o>0?(a=i,n=c):(o=-o,n=s),n.reverse();o--;n.push(0));n.reverse()}for((o=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/cn|0,s[t]=cn===s[t]?0:s[t]%cn;return o&&(s=[o].concat(s),++a),I(e,s,a)},p.precision=p.sd=function(e,t){var n,r,o,i=this;if(null!=e&&e!==!!e)return mn(e,1,dn),null==t?t=y:mn(t,0,8),C(new k(i),e,t);if(!(n=i.c))return null;if(r=(o=n.length-1)*un+1,o=n[o]){for(;o%10==0;o/=10,r--);for(o=n[0];o>=10;o/=10,r++);}return e&&i.e+1>r&&(r=i.e+1),r},p.shiftedBy=function(e){return mn(e,-9007199254740991,ln),this.times(\"1e\"+e)},p.squareRoot=p.sqrt=function(){var e,t,r,o,i,a=this,s=a.c,c=a.s,u=a.e,l=h+4,f=new k(\"0.5\");if(1!==c||!s||!s[0])return new k(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+B(a)))||c==1/0?(((t=yn(s)).length+u)%2==0&&(t+=\"0\"),c=Math.sqrt(+t),u=hn((u+1)/2)-(u<0||u%2),r=new k(t=c==1/0?\"5e\"+u:(t=c.toExponential()).slice(0,t.indexOf(\"e\")+1)+u)):r=new k(c+\"\"),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(i=r,r=f.times(i.plus(n(a,i,l,1))),yn(i.c).slice(0,c)===(t=yn(r.c)).slice(0,c)){if(r.e<u&&--c,\"9999\"!=(t=t.slice(c-3,c+1))&&(o||\"4999\"!=t)){+t&&(+t.slice(1)||\"5\"!=t.charAt(0))||(C(r,r.e+h+2,1),e=!r.times(r).eq(a));break}if(!o&&(C(i,i.e+h+2,0),i.times(i).eq(a))){r=i;break}l+=4,c+=4,o=1}return C(r,r.e+h+1,y,e)},p.toExponential=function(e,t){return null!=e&&(mn(e,0,dn),e++),O(this,e,t,1)},p.toFixed=function(e,t){return null!=e&&(mn(e,0,dn),e=e+this.e+1),O(this,e,t)},p.toFormat=function(e,t,n){var r,o=this;if(null==n)null!=e&&t&&\"object\"==typeof t?(n=t,t=null):e&&\"object\"==typeof e?(n=e,e=t=null):n=E;else if(\"object\"!=typeof n)throw Error(an+\"Argument not an object: \"+n);if(r=o.toFixed(e,t),o.c){var i,a=r.split(\".\"),s=+n.groupSize,c=+n.secondaryGroupSize,u=n.groupSeparator||\"\",l=a[0],f=a[1],p=o.s<0,d=p?l.slice(1):l,h=d.length;if(c&&(i=s,s=c,c=i,h-=i),s>0&&h>0){for(i=h%s||s,l=d.substr(0,i);i<h;i+=s)l+=u+d.substr(i,s);c>0&&(l+=u+d.slice(i)),p&&(l=\"-\"+l)}r=f?l+(n.decimalSeparator||\"\")+((c=+n.fractionGroupSize)?f.replace(new RegExp(\"\\\\d{\"+c+\"}\\\\B\",\"g\"),\"$&\"+(n.fractionGroupSeparator||\"\")):f):l}return(n.prefix||\"\")+r+(n.suffix||\"\")},p.toFraction=function(e){var t,r,o,i,a,s,c,u,l,f,p,h,g=this,m=g.c;if(null!=e&&(!(c=new k(e)).isInteger()&&(c.c||1!==c.s)||c.lt(d)))throw Error(an+\"Argument \"+(c.isInteger()?\"out of range: \":\"not an integer: \")+B(c));if(!m)return new k(g);for(t=new k(d),l=r=new k(d),o=u=new k(d),h=yn(m),a=t.e=h.length-g.e-1,t.c[0]=fn[(s=a%un)<0?un+s:s],e=!e||c.comparedTo(t)>0?a>0?t:l:c,s=b,b=1/0,c=new k(h),u.c[0]=0;f=n(c,t,0,1),1!=(i=r.plus(f.times(o))).comparedTo(e);)r=o,o=i,l=u.plus(f.times(i=l)),u=i,t=c.minus(f.times(i=t)),c=i;return i=n(e.minus(r),o,0,1),u=u.plus(i.times(l)),r=r.plus(i.times(o)),u.s=l.s=g.s,p=n(l,o,a*=2,y).minus(g).abs().comparedTo(n(u,r,a,y).minus(g).abs())<1?[l,o]:[u,r],b=s,p},p.toNumber=function(){return+B(this)},p.toPrecision=function(e,t){return null!=e&&mn(e,1,dn),O(this,e,t,2)},p.toString=function(e){var t,n=this,o=n.s,i=n.e;return null===i?o?(t=\"Infinity\",o<0&&(t=\"-\"+t)):t=\"NaN\":(null==e?t=i<=g||i>=m?bn(yn(n.c),i):wn(yn(n.c),i,\"0\"):10===e&&T?t=wn(yn((n=C(new k(n),h+i+1,y)).c),n.e,\"0\"):(mn(e,2,x.length,\"Base\"),t=r(wn(yn(n.c),i,\"0\"),10,e,o,!0)),o<0&&n.c[0]&&(t=\"-\"+t)),t},p.valueOf=p.toJSON=function(){return B(this)},p._isBigNumber=!0,p[Symbol.toStringTag]=\"BigNumber\",p[Symbol.for(\"nodejs.util.inspect.custom\")]=p.valueOf,null!=t&&k.set(t),k}(),An=Sn.clone();An.DEBUG=!0;const En=An;function xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Tn=2147483647;function kn(e){return kn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},kn(e)}function On(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach(function(t){In(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function In(e,t,n){return(t=Bn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Bn(r.key),r)}}function Bn(e){var t=function(e){if(\"object\"!=kn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=kn(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==kn(t)?t:t+\"\"}var Pn=function(e,t,n){return t&&Cn(e.prototype,t),n&&Cn(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),!(t&&t instanceof Gt))throw new Error(\"assetA is invalid\");if(!(n&&n instanceof Gt))throw new Error(\"assetB is invalid\");if(-1!==Gt.compare(t,n))throw new Error(\"Assets are not in lexicographic order\");if(!r||r!==Zt)throw new Error(\"fee is invalid\");this.assetA=t,this.assetB=n,this.fee=r},[{key:\"toXDRObject\",value:function(){var e=new i.LiquidityPoolConstantProductParameters({assetA:this.assetA.toXDRObject(),assetB:this.assetB.toXDRObject(),fee:this.fee}),t=new i.LiquidityPoolParameters(\"liquidityPoolConstantProduct\",e);return new i.ChangeTrustAsset(\"assetTypePoolShare\",t)}},{key:\"getLiquidityPoolParameters\",value:function(){return _n(_n({},this),{},{assetA:this.assetA,assetB:this.assetB,fee:this.fee})}},{key:\"getAssetType\",value:function(){return\"liquidity_pool_shares\"}},{key:\"equals\",value:function(e){return this.assetA.equals(e.assetA)&&this.assetB.equals(e.assetB)&&this.fee===e.fee}},{key:\"toString\",value:function(){var e=Yt(\"constant_product\",this.getLiquidityPoolParameters()).toString(\"hex\");return\"liquidity_pool:\".concat(e)}}],[{key:\"fromOperation\",value:function(e){var t=e.switch();if(t===i.AssetType.assetTypePoolShare()){var n=e.liquidityPool().constantProduct();return new this(Gt.fromOperation(n.assetA()),Gt.fromOperation(n.assetB()),n.fee())}throw new Error(\"Invalid asset type: \".concat(t.name))}}]);function Rn(e){return Rn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Rn(e)}function jn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Un(r.key),r)}}function Un(e){var t=function(e){if(\"object\"!=Rn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Rn(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Rn(t)?t:t+\"\"}var Fn=function(e,t,n){return t&&jn(e.prototype,t),n&&jn(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),t&&!Rt.isValidEd25519PublicKey(t))throw new Error(\"Destination is invalid\");if(this._destination=t,n){if(!(n instanceof i.ClaimPredicate))throw new Error(\"Predicate should be an xdr.ClaimPredicate\");this._predicate=n}else this._predicate=i.ClaimPredicate.claimPredicateUnconditional()},[{key:\"toXDRObject\",value:function(){var e=new i.ClaimantV0({destination:Vt.fromPublicKey(this._destination).xdrAccountId(),predicate:this._predicate});return i.Claimant.claimantTypeV0(e)}},{key:\"destination\",get:function(){return this._destination},set:function(e){throw new Error(\"Claimant is immutable\")}},{key:\"predicate\",get:function(){return this._predicate},set:function(e){throw new Error(\"Claimant is immutable\")}}],[{key:\"predicateUnconditional\",value:function(){return i.ClaimPredicate.claimPredicateUnconditional()}},{key:\"predicateAnd\",value:function(e,t){if(!(e instanceof i.ClaimPredicate))throw new Error(\"left Predicate should be an xdr.ClaimPredicate\");if(!(t instanceof i.ClaimPredicate))throw new Error(\"right Predicate should be an xdr.ClaimPredicate\");return i.ClaimPredicate.claimPredicateAnd([e,t])}},{key:\"predicateOr\",value:function(e,t){if(!(e instanceof i.ClaimPredicate))throw new Error(\"left Predicate should be an xdr.ClaimPredicate\");if(!(t instanceof i.ClaimPredicate))throw new Error(\"right Predicate should be an xdr.ClaimPredicate\");return i.ClaimPredicate.claimPredicateOr([e,t])}},{key:\"predicateNot\",value:function(e){if(!(e instanceof i.ClaimPredicate))throw new Error(\"right Predicate should be an xdr.ClaimPredicate\");return i.ClaimPredicate.claimPredicateNot(e)}},{key:\"predicateBeforeAbsoluteTime\",value:function(e){return i.ClaimPredicate.claimPredicateBeforeAbsoluteTime(i.Int64.fromString(e))}},{key:\"predicateBeforeRelativeTime\",value:function(e){return i.ClaimPredicate.claimPredicateBeforeRelativeTime(i.Int64.fromString(e))}},{key:\"fromXDR\",value:function(e){var t;if(e.switch()===i.ClaimantType.claimantTypeV0())return t=e.v0(),new this(Rt.encodeEd25519PublicKey(t.destination().ed25519()),t.predicate());throw new Error(\"Invalid claimant type: \".concat(e.switch().name))}}]);function Nn(e){return Nn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Nn(e)}function Ln(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Mn(r.key),r)}}function Mn(e){var t=function(e){if(\"object\"!=Nn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Nn(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Nn(t)?t:t+\"\"}var Dn=function(e,t,n){return t&&Ln(e.prototype,t),n&&Ln(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),!t)throw new Error(\"liquidityPoolId cannot be empty\");if(!/^[a-f0-9]{64}$/.test(t))throw new Error(\"Liquidity pool ID is not a valid hash\");this.liquidityPoolId=t},[{key:\"toXDRObject\",value:function(){var e=i.PoolId.fromXDR(this.liquidityPoolId,\"hex\");return new i.TrustLineAsset(\"assetTypePoolShare\",e)}},{key:\"getLiquidityPoolId\",value:function(){return String(this.liquidityPoolId)}},{key:\"getAssetType\",value:function(){return\"liquidity_pool_shares\"}},{key:\"equals\",value:function(e){return this.liquidityPoolId===e.getLiquidityPoolId()}},{key:\"toString\",value:function(){return\"liquidity_pool:\".concat(this.liquidityPoolId)}}],[{key:\"fromOperation\",value:function(e){var t=e.switch();if(t===i.AssetType.assetTypePoolShare())return new this(e.liquidityPoolId().toString(\"hex\"));throw new Error(\"Invalid asset type: \".concat(t.name))}}]),qn=n(8287).Buffer;function Vn(e){return Rt.isValidMed25519PublicKey(e)?function(e){var t=Rt.decodeMed25519PublicKey(e);return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromXDR(t.subarray(-8)),ed25519:t.subarray(0,-8)}))}(e):i.MuxedAccount.keyTypeEd25519(Rt.decodeEd25519PublicKey(e))}function zn(e){return e.switch().value===i.CryptoKeyType.keyTypeMuxedEd25519().value?function(e){if(e.switch()===i.CryptoKeyType.keyTypeEd25519())return zn(e);var t=e.med25519();return Rt.encodeMed25519PublicKey(qn.concat([t.ed25519(),t.id().toXDR(\"raw\")]))}(e):Rt.encodeEd25519PublicKey(e.ed25519())}function Kn(e,t){if(!Rt.isValidEd25519PublicKey(e))throw new Error(\"address should be a Stellar account ID (G...)\");if(\"string\"!=typeof t)throw new Error(\"id should be a string representing a number (uint64)\");return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromString(t),ed25519:Rt.decodeEd25519PublicKey(e)}))}function Hn(e){if(Rt.isValidEd25519PublicKey(e))return e;if(!Rt.isValidMed25519PublicKey(e))throw new TypeError(\"expected muxed account (M...), got \".concat(e));var t=Vn(e);return Rt.encodeEd25519PublicKey(t.med25519().ed25519())}function $n(e){if(\"string\"!=typeof e||72!==e.length)throw new Error(\"must provide a valid claimable balance id\")}var Gn=n(8287).Buffer,Wn=n(8287).Buffer;function Xn(e,t){if(e>=0&&e<=255)return!0;throw new Error(\"\".concat(t,\" value must be between 0 and 255\"))}var Zn=n(8287).Buffer;function Yn(e){return Yn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Yn(e)}var Jn=n(8287).Buffer;function Qn(e){return Qn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Qn(e)}function er(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,tr(r.key),r)}}function tr(e){var t=function(e){if(\"object\"!=Qn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Qn(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Qn(t)?t:t+\"\"}var nr=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Rt.isValidEd25519PublicKey(t))this._type=\"account\",this._key=Rt.decodeEd25519PublicKey(t);else if(Rt.isValidContract(t))this._type=\"contract\",this._key=Rt.decodeContract(t);else if(Rt.isValidMed25519PublicKey(t))this._type=\"muxedAccount\",this._key=Rt.decodeMed25519PublicKey(t);else if(Rt.isValidClaimableBalance(t))this._type=\"claimableBalance\",this._key=Rt.decodeClaimableBalance(t);else{if(!Rt.isValidLiquidityPool(t))throw new Error(\"Unsupported address type: \".concat(t));this._type=\"liquidityPool\",this._key=Rt.decodeLiquidityPool(t)}}return function(e,t,n){return t&&er(e.prototype,t),n&&er(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(e,[{key:\"toString\",value:function(){switch(this._type){case\"account\":return Rt.encodeEd25519PublicKey(this._key);case\"contract\":return Rt.encodeContract(this._key);case\"claimableBalance\":return Rt.encodeClaimableBalance(this._key);case\"liquidityPool\":return Rt.encodeLiquidityPool(this._key);case\"muxedAccount\":return Rt.encodeMed25519PublicKey(this._key);default:throw new Error(\"Unsupported address type\")}}},{key:\"toScVal\",value:function(){return i.ScVal.scvAddress(this.toScAddress())}},{key:\"toScAddress\",value:function(){switch(this._type){case\"account\":return i.ScAddress.scAddressTypeAccount(i.PublicKey.publicKeyTypeEd25519(this._key));case\"contract\":return i.ScAddress.scAddressTypeContract(this._key);case\"liquidityPool\":return i.ScAddress.scAddressTypeLiquidityPool(this._key);case\"claimableBalance\":return i.ScAddress.scAddressTypeClaimableBalance(new i.ClaimableBalanceId(\"claimableBalanceIdTypeV\".concat(this._key.at(0)),this._key.subarray(1)));case\"muxedAccount\":return i.ScAddress.scAddressTypeMuxedAccount(new i.MuxedEd25519Account({ed25519:this._key.subarray(0,32),id:i.Uint64.fromXDR(this._key.subarray(32,40),\"raw\")}));default:throw new Error(\"Unsupported address type: \".concat(this._type))}}},{key:\"toBuffer\",value:function(){return this._key}}],[{key:\"fromString\",value:function(t){return new e(t)}},{key:\"account\",value:function(t){return new e(Rt.encodeEd25519PublicKey(t))}},{key:\"contract\",value:function(t){return new e(Rt.encodeContract(t))}},{key:\"claimableBalance\",value:function(t){return new e(Rt.encodeClaimableBalance(t))}},{key:\"liquidityPool\",value:function(t){return new e(Rt.encodeLiquidityPool(t))}},{key:\"muxedAccount\",value:function(t){return new e(Rt.encodeMed25519PublicKey(t))}},{key:\"fromScVal\",value:function(t){return e.fromScAddress(t.address())}},{key:\"fromScAddress\",value:function(t){switch(t.switch().value){case i.ScAddressType.scAddressTypeAccount().value:return e.account(t.accountId().ed25519());case i.ScAddressType.scAddressTypeContract().value:return e.contract(t.contractId());case i.ScAddressType.scAddressTypeMuxedAccount().value:var n=Jn.concat([t.muxedAccount().ed25519(),t.muxedAccount().id().toXDR(\"raw\")]);return e.muxedAccount(n);case i.ScAddressType.scAddressTypeClaimableBalance().value:var r=t.claimableBalanceId();return e.claimableBalance(Jn.concat([Jn.from([r.switch().value]),r.v0()]));case i.ScAddressType.scAddressTypeLiquidityPool().value:return e.liquidityPool(t.liquidityPoolId());default:throw new Error(\"Unsupported address type: \".concat(t.switch().name))}}}])}(),rr=n(8287).Buffer;function or(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ir(e){return ir=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},ir(e)}function ar(e){var t=function(e){if(\"object\"!=ir(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=ir(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==ir(t)?t:t+\"\"}var sr=1e7,cr=1,ur=2,lr=4,fr=8,pr=function(e,t,n){return n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,ar(r.key),r)}}(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e)},0,[{key:\"setSourceAccount\",value:function(e,t){if(t.source)try{e.sourceAccount=Vn(t.source)}catch(e){throw new Error(\"Source address is invalid\")}}},{key:\"fromXDRObject\",value:function(e){var t={};e.sourceAccount()&&(t.source=zn(e.sourceAccount()));var n=e.body().value(),r=e.body().switch().name;switch(r){case\"createAccount\":t.type=\"createAccount\",t.destination=dr(n.destination()),t.startingBalance=this._fromXDRAmount(n.startingBalance());break;case\"payment\":t.type=\"payment\",t.destination=zn(n.destination()),t.asset=Gt.fromOperation(n.asset()),t.amount=this._fromXDRAmount(n.amount());break;case\"pathPaymentStrictReceive\":t.type=\"pathPaymentStrictReceive\",t.sendAsset=Gt.fromOperation(n.sendAsset()),t.sendMax=this._fromXDRAmount(n.sendMax()),t.destination=zn(n.destination()),t.destAsset=Gt.fromOperation(n.destAsset()),t.destAmount=this._fromXDRAmount(n.destAmount()),t.path=[];var o=n.path();Object.keys(o).forEach(function(e){t.path.push(Gt.fromOperation(o[e]))});break;case\"pathPaymentStrictSend\":t.type=\"pathPaymentStrictSend\",t.sendAsset=Gt.fromOperation(n.sendAsset()),t.sendAmount=this._fromXDRAmount(n.sendAmount()),t.destination=zn(n.destination()),t.destAsset=Gt.fromOperation(n.destAsset()),t.destMin=this._fromXDRAmount(n.destMin()),t.path=[];var a=n.path();Object.keys(a).forEach(function(e){t.path.push(Gt.fromOperation(a[e]))});break;case\"changeTrust\":t.type=\"changeTrust\",n.line().switch()===i.AssetType.assetTypePoolShare()?t.line=Pn.fromOperation(n.line()):t.line=Gt.fromOperation(n.line()),t.limit=this._fromXDRAmount(n.limit());break;case\"allowTrust\":t.type=\"allowTrust\",t.trustor=dr(n.trustor()),t.assetCode=n.asset().value().toString(),t.assetCode=Et(t.assetCode,\"\\0\"),t.authorize=n.authorize();break;case\"setOptions\":if(t.type=\"setOptions\",n.inflationDest()&&(t.inflationDest=dr(n.inflationDest())),t.clearFlags=n.clearFlags(),t.setFlags=n.setFlags(),t.masterWeight=n.masterWeight(),t.lowThreshold=n.lowThreshold(),t.medThreshold=n.medThreshold(),t.highThreshold=n.highThreshold(),t.homeDomain=void 0!==n.homeDomain()?n.homeDomain().toString(\"ascii\"):void 0,n.signer()){var s={},c=n.signer().key().arm();if(\"ed25519\"===c)s.ed25519PublicKey=dr(n.signer().key());else if(\"preAuthTx\"===c)s.preAuthTx=n.signer().key().preAuthTx();else if(\"hashX\"===c)s.sha256Hash=n.signer().key().hashX();else if(\"ed25519SignedPayload\"===c){var u=n.signer().key().ed25519SignedPayload();s.ed25519SignedPayload=Rt.encodeSignedPayload(u.toXDR())}s.weight=n.signer().weight(),t.signer=s}break;case\"manageOffer\":case\"manageSellOffer\":t.type=\"manageSellOffer\",t.selling=Gt.fromOperation(n.selling()),t.buying=Gt.fromOperation(n.buying()),t.amount=this._fromXDRAmount(n.amount()),t.price=this._fromXDRPrice(n.price()),t.offerId=n.offerId().toString();break;case\"manageBuyOffer\":t.type=\"manageBuyOffer\",t.selling=Gt.fromOperation(n.selling()),t.buying=Gt.fromOperation(n.buying()),t.buyAmount=this._fromXDRAmount(n.buyAmount()),t.price=this._fromXDRPrice(n.price()),t.offerId=n.offerId().toString();break;case\"createPassiveOffer\":case\"createPassiveSellOffer\":t.type=\"createPassiveSellOffer\",t.selling=Gt.fromOperation(n.selling()),t.buying=Gt.fromOperation(n.buying()),t.amount=this._fromXDRAmount(n.amount()),t.price=this._fromXDRPrice(n.price());break;case\"accountMerge\":t.type=\"accountMerge\",t.destination=zn(n);break;case\"manageData\":t.type=\"manageData\",t.name=n.dataName().toString(\"ascii\"),t.value=n.dataValue();break;case\"inflation\":t.type=\"inflation\";break;case\"bumpSequence\":t.type=\"bumpSequence\",t.bumpTo=n.bumpTo().toString();break;case\"createClaimableBalance\":t.type=\"createClaimableBalance\",t.asset=Gt.fromOperation(n.asset()),t.amount=this._fromXDRAmount(n.amount()),t.claimants=[],n.claimants().forEach(function(e){t.claimants.push(Fn.fromXDR(e))});break;case\"claimClaimableBalance\":t.type=\"claimClaimableBalance\",t.balanceId=n.toXDR(\"hex\");break;case\"beginSponsoringFutureReserves\":t.type=\"beginSponsoringFutureReserves\",t.sponsoredId=dr(n.sponsoredId());break;case\"endSponsoringFutureReserves\":t.type=\"endSponsoringFutureReserves\";break;case\"revokeSponsorship\":!function(e,t){switch(e.switch().name){case\"revokeSponsorshipLedgerEntry\":var n=e.ledgerKey();switch(n.switch().name){case i.LedgerEntryType.account().name:t.type=\"revokeAccountSponsorship\",t.account=dr(n.account().accountId());break;case i.LedgerEntryType.trustline().name:t.type=\"revokeTrustlineSponsorship\",t.account=dr(n.trustLine().accountId());var r=n.trustLine().asset();r.switch()===i.AssetType.assetTypePoolShare()?t.asset=Dn.fromOperation(r):t.asset=Gt.fromOperation(r);break;case i.LedgerEntryType.offer().name:t.type=\"revokeOfferSponsorship\",t.seller=dr(n.offer().sellerId()),t.offerId=n.offer().offerId().toString();break;case i.LedgerEntryType.data().name:t.type=\"revokeDataSponsorship\",t.account=dr(n.data().accountId()),t.name=n.data().dataName().toString(\"ascii\");break;case i.LedgerEntryType.claimableBalance().name:t.type=\"revokeClaimableBalanceSponsorship\",t.balanceId=n.claimableBalance().balanceId().toXDR(\"hex\");break;case i.LedgerEntryType.liquidityPool().name:t.type=\"revokeLiquidityPoolSponsorship\",t.liquidityPoolId=n.liquidityPool().liquidityPoolId().toString(\"hex\");break;default:throw new Error(\"Unknown ledgerKey: \".concat(e.switch().name))}break;case\"revokeSponsorshipSigner\":t.type=\"revokeSignerSponsorship\",t.account=dr(e.signer().accountId()),t.signer=function(e){var t={};switch(e.switch().name){case i.SignerKeyType.signerKeyTypeEd25519().name:t.ed25519PublicKey=Rt.encodeEd25519PublicKey(e.ed25519());break;case i.SignerKeyType.signerKeyTypePreAuthTx().name:t.preAuthTx=e.preAuthTx().toString(\"hex\");break;case i.SignerKeyType.signerKeyTypeHashX().name:t.sha256Hash=e.hashX().toString(\"hex\");break;default:throw new Error(\"Unknown signerKey: \".concat(e.switch().name))}return t}(e.signer().signerKey());break;default:throw new Error(\"Unknown revokeSponsorship: \".concat(e.switch().name))}}(n,t);break;case\"clawback\":t.type=\"clawback\",t.amount=this._fromXDRAmount(n.amount()),t.from=zn(n.from()),t.asset=Gt.fromOperation(n.asset());break;case\"clawbackClaimableBalance\":t.type=\"clawbackClaimableBalance\",t.balanceId=n.toXDR(\"hex\");break;case\"setTrustLineFlags\":t.type=\"setTrustLineFlags\",t.asset=Gt.fromOperation(n.asset()),t.trustor=dr(n.trustor());var l=n.clearFlags(),f=n.setFlags(),p={authorized:i.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:i.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:i.TrustLineFlags.trustlineClawbackEnabledFlag()};t.flags={},Object.keys(p).forEach(function(e){var n;t.flags[e]=(n=p[e].value,!!(f&n)||!(l&n)&&void 0)});break;case\"liquidityPoolDeposit\":t.type=\"liquidityPoolDeposit\",t.liquidityPoolId=n.liquidityPoolId().toString(\"hex\"),t.maxAmountA=this._fromXDRAmount(n.maxAmountA()),t.maxAmountB=this._fromXDRAmount(n.maxAmountB()),t.minPrice=this._fromXDRPrice(n.minPrice()),t.maxPrice=this._fromXDRPrice(n.maxPrice());break;case\"liquidityPoolWithdraw\":t.type=\"liquidityPoolWithdraw\",t.liquidityPoolId=n.liquidityPoolId().toString(\"hex\"),t.amount=this._fromXDRAmount(n.amount()),t.minAmountA=this._fromXDRAmount(n.minAmountA()),t.minAmountB=this._fromXDRAmount(n.minAmountB());break;case\"invokeHostFunction\":var d;t.type=\"invokeHostFunction\",t.func=n.hostFunction(),t.auth=null!==(d=n.auth())&&void 0!==d?d:[];break;case\"extendFootprintTtl\":t.type=\"extendFootprintTtl\",t.extendTo=n.extendTo();break;case\"restoreFootprint\":t.type=\"restoreFootprint\";break;default:throw new Error(\"Unknown operation: \".concat(r))}return t}},{key:\"isValidAmount\",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(\"string\"!=typeof e)return!1;try{t=new En(e)}catch(e){return!1}return!(!n&&t.isZero()||t.isNegative()||t.times(sr).gt(new En(\"9223372036854775807\").toString())||t.decimalPlaces()>7||t.isNaN()||!t.isFinite())}},{key:\"constructAmountRequirementsError\",value:function(e){return\"\".concat(e,\" argument must be of type String, represent a positive number and have at most 7 digits after the decimal\")}},{key:\"_checkUnsignedIntValue\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0!==t)switch(\"string\"==typeof t&&(t=parseFloat(t)),!0){case\"number\"!=typeof t||!Number.isFinite(t)||t%1!=0:throw new Error(\"\".concat(e,\" value is invalid\"));case t<0:throw new Error(\"\".concat(e,\" value must be unsigned\"));case!n||n&&n(t,e):return t;default:throw new Error(\"\".concat(e,\" value is invalid\"))}}},{key:\"_toXDRAmount\",value:function(e){var t=new En(e).times(sr);return r.Hyper.fromString(t.toString())}},{key:\"_fromXDRAmount\",value:function(e){return new En(e).div(sr).toFixed(7)}},{key:\"_fromXDRPrice\",value:function(e){return new En(e.n()).div(new En(e.d())).toString()}},{key:\"_toXDRPrice\",value:function(e){var t;if(void 0!==e.n&&void 0!==e.d)t=new i.Price(e);else{var n=function(e){for(var t,n,r=new En(e),o=[[new En(0),new En(1)],[new En(1),new En(0)]],i=2;!r.gt(Tn);){t=r.integerValue(En.ROUND_FLOOR),n=r.minus(t);var a=t.times(o[i-1][0]).plus(o[i-2][0]),s=t.times(o[i-1][1]).plus(o[i-2][1]);if(a.gt(Tn)||s.gt(Tn))break;if(o.push([a,s]),n.eq(0))break;r=new En(1).div(n),i+=1}var c=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=t){var n,r,o,i,a=[],s=!0,c=!1;try{for(o=(t=t.call(e)).next;!(s=(n=o.call(t)).done)&&(a.push(n.value),2!==a.length);s=!0);}catch(e){c=!0,r=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw r}}return a}}(e)||function(e){if(e){if(\"string\"==typeof e)return xn(e,2);var t={}.toString.call(e).slice(8,-1);return\"Object\"===t&&e.constructor&&(t=e.constructor.name),\"Map\"===t||\"Set\"===t?Array.from(e):\"Arguments\"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xn(e,2):void 0}}(e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}(o[o.length-1]),u=c[0],l=c[1];if(u.isZero()||l.isZero())throw new Error(\"Couldn't find approximation\");return[u.toNumber(),l.toNumber()]}(e);t=new i.Price({n:parseInt(n[0],10),d:parseInt(n[1],10)})}if(t.n()<0||t.d()<0)throw new Error(\"price must be positive\");return t}}]);function dr(e){return Rt.encodeEd25519PublicKey(e.ed25519())}pr.accountMerge=function(e){var t={};try{t.body=i.OperationBody.accountMerge(Vn(e.destination))}catch(e){throw new Error(\"destination is invalid\")}return this.setSourceAccount(t,e),new i.Operation(t)},pr.allowTrust=function(e){if(!Rt.isValidEd25519PublicKey(e.trustor))throw new Error(\"trustor is invalid\");var t={};if(t.trustor=Vt.fromPublicKey(e.trustor).xdrAccountId(),e.assetCode.length<=4){var n=e.assetCode.padEnd(4,\"\\0\");t.asset=i.AssetCode.assetTypeCreditAlphanum4(n)}else{if(!(e.assetCode.length<=12))throw new Error(\"Asset code must be 12 characters at max.\");var r=e.assetCode.padEnd(12,\"\\0\");t.asset=i.AssetCode.assetTypeCreditAlphanum12(r)}\"boolean\"==typeof e.authorize?e.authorize?t.authorize=i.TrustLineFlags.authorizedFlag().value:t.authorize=0:t.authorize=e.authorize;var o=new i.AllowTrustOp(t),a={};return a.body=i.OperationBody.allowTrust(o),this.setSourceAccount(a,e),new i.Operation(a)},pr.bumpSequence=function(e){var t={};if(\"string\"!=typeof e.bumpTo)throw new Error(\"bumpTo must be a string\");try{new En(e.bumpTo)}catch(e){throw new Error(\"bumpTo must be a stringified number\")}t.bumpTo=r.Hyper.fromString(e.bumpTo);var n=new i.BumpSequenceOp(t),o={};return o.body=i.OperationBody.bumpSequence(n),this.setSourceAccount(o,e),new i.Operation(o)},pr.changeTrust=function(e){var t={};if(e.asset instanceof Gt)t.line=e.asset.toChangeTrustXDRObject();else{if(!(e.asset instanceof Pn))throw new TypeError(\"asset must be Asset or LiquidityPoolAsset\");t.line=e.asset.toXDRObject()}if(void 0!==e.limit&&!this.isValidAmount(e.limit,!0))throw new TypeError(this.constructAmountRequirementsError(\"limit\"));e.limit?t.limit=this._toXDRAmount(e.limit):t.limit=r.Hyper.fromString(new En(\"9223372036854775807\").toString()),e.source&&(t.source=e.source.masterKeypair);var n=new i.ChangeTrustOp(t),o={};return o.body=i.OperationBody.changeTrust(n),this.setSourceAccount(o,e),new i.Operation(o)},pr.createAccount=function(e){if(!Rt.isValidEd25519PublicKey(e.destination))throw new Error(\"destination is invalid\");if(!this.isValidAmount(e.startingBalance,!0))throw new TypeError(this.constructAmountRequirementsError(\"startingBalance\"));var t={};t.destination=Vt.fromPublicKey(e.destination).xdrAccountId(),t.startingBalance=this._toXDRAmount(e.startingBalance);var n=new i.CreateAccountOp(t),r={};return r.body=i.OperationBody.createAccount(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.createClaimableBalance=function(e){if(!(e.asset instanceof Gt))throw new Error(\"must provide an asset for create claimable balance operation\");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError(\"amount\"));if(!Array.isArray(e.claimants)||0===e.claimants.length)throw new Error(\"must provide at least one claimant\");var t={};t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount),t.claimants=Object.values(e.claimants).map(function(e){return e.toXDRObject()});var n=new i.CreateClaimableBalanceOp(t),r={};return r.body=i.OperationBody.createClaimableBalance(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.claimClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$n(e.balanceId);var t={};t.balanceId=i.ClaimableBalanceId.fromXDR(e.balanceId,\"hex\");var n=new i.ClaimClaimableBalanceOp(t),r={};return r.body=i.OperationBody.claimClaimableBalance(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.clawbackClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$n(e.balanceId);var t={balanceId:i.ClaimableBalanceId.fromXDR(e.balanceId,\"hex\")},n={body:i.OperationBody.clawbackClaimableBalance(new i.ClawbackClaimableBalanceOp(t))};return this.setSourceAccount(n,e),new i.Operation(n)},pr.createPassiveSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError(\"amount\"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError(\"price argument is required\");t.price=this._toXDRPrice(e.price);var n=new i.CreatePassiveSellOfferOp(t),r={};return r.body=i.OperationBody.createPassiveSellOffer(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.inflation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=i.OperationBody.inflation(),this.setSourceAccount(t,e),new i.Operation(t)},pr.manageData=function(e){var t={};if(!(\"string\"==typeof e.name&&e.name.length<=64))throw new Error(\"name must be a string, up to 64 characters\");if(t.dataName=e.name,\"string\"!=typeof e.value&&!Gn.isBuffer(e.value)&&null!==e.value)throw new Error(\"value must be a string, Buffer or null\");if(\"string\"==typeof e.value?t.dataValue=Gn.from(e.value):t.dataValue=e.value,null!==t.dataValue&&t.dataValue.length>64)throw new Error(\"value cannot be longer that 64 bytes\");var n=new i.ManageDataOp(t),r={};return r.body=i.OperationBody.manageData(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.manageSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount,!0))throw new TypeError(this.constructAmountRequirementsError(\"amount\"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError(\"price argument is required\");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId=\"0\",t.offerId=r.Hyper.fromString(e.offerId);var n=new i.ManageSellOfferOp(t),o={};return o.body=i.OperationBody.manageSellOffer(n),this.setSourceAccount(o,e),new i.Operation(o)},pr.manageBuyOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.buyAmount,!0))throw new TypeError(this.constructAmountRequirementsError(\"buyAmount\"));if(t.buyAmount=this._toXDRAmount(e.buyAmount),void 0===e.price)throw new TypeError(\"price argument is required\");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId=\"0\",t.offerId=r.Hyper.fromString(e.offerId);var n=new i.ManageBuyOfferOp(t),o={};return o.body=i.OperationBody.manageBuyOffer(n),this.setSourceAccount(o,e),new i.Operation(o)},pr.pathPaymentStrictReceive=function(e){switch(!0){case!e.sendAsset:throw new Error(\"Must specify a send asset\");case!this.isValidAmount(e.sendMax):throw new TypeError(this.constructAmountRequirementsError(\"sendMax\"));case!e.destAsset:throw new Error(\"Must provide a destAsset for a payment operation\");case!this.isValidAmount(e.destAmount):throw new TypeError(this.constructAmountRequirementsError(\"destAmount\"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendMax=this._toXDRAmount(e.sendMax);try{t.destination=Vn(e.destination)}catch(e){throw new Error(\"destination is invalid\")}t.destAsset=e.destAsset.toXDRObject(),t.destAmount=this._toXDRAmount(e.destAmount);var n=e.path?e.path:[];t.path=n.map(function(e){return e.toXDRObject()});var r=new i.PathPaymentStrictReceiveOp(t),o={};return o.body=i.OperationBody.pathPaymentStrictReceive(r),this.setSourceAccount(o,e),new i.Operation(o)},pr.pathPaymentStrictSend=function(e){switch(!0){case!e.sendAsset:throw new Error(\"Must specify a send asset\");case!this.isValidAmount(e.sendAmount):throw new TypeError(this.constructAmountRequirementsError(\"sendAmount\"));case!e.destAsset:throw new Error(\"Must provide a destAsset for a payment operation\");case!this.isValidAmount(e.destMin):throw new TypeError(this.constructAmountRequirementsError(\"destMin\"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendAmount=this._toXDRAmount(e.sendAmount);try{t.destination=Vn(e.destination)}catch(e){throw new Error(\"destination is invalid\")}t.destAsset=e.destAsset.toXDRObject(),t.destMin=this._toXDRAmount(e.destMin);var n=e.path?e.path:[];t.path=n.map(function(e){return e.toXDRObject()});var r=new i.PathPaymentStrictSendOp(t),o={};return o.body=i.OperationBody.pathPaymentStrictSend(r),this.setSourceAccount(o,e),new i.Operation(o)},pr.payment=function(e){if(!e.asset)throw new Error(\"Must provide an asset for a payment operation\");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError(\"amount\"));var t={};try{t.destination=Vn(e.destination)}catch(e){throw new Error(\"destination is invalid\")}t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount);var n=new i.PaymentOp(t),r={};return r.body=i.OperationBody.payment(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.setOptions=function(e){var t={};if(e.inflationDest){if(!Rt.isValidEd25519PublicKey(e.inflationDest))throw new Error(\"inflationDest is invalid\");t.inflationDest=Vt.fromPublicKey(e.inflationDest).xdrAccountId()}if(t.clearFlags=this._checkUnsignedIntValue(\"clearFlags\",e.clearFlags),t.setFlags=this._checkUnsignedIntValue(\"setFlags\",e.setFlags),t.masterWeight=this._checkUnsignedIntValue(\"masterWeight\",e.masterWeight,Xn),t.lowThreshold=this._checkUnsignedIntValue(\"lowThreshold\",e.lowThreshold,Xn),t.medThreshold=this._checkUnsignedIntValue(\"medThreshold\",e.medThreshold,Xn),t.highThreshold=this._checkUnsignedIntValue(\"highThreshold\",e.highThreshold,Xn),void 0!==e.homeDomain&&\"string\"!=typeof e.homeDomain)throw new TypeError(\"homeDomain argument must be of type String\");if(t.homeDomain=e.homeDomain,e.signer){var n,r=this._checkUnsignedIntValue(\"signer.weight\",e.signer.weight,Xn),o=0;if(e.signer.ed25519PublicKey){if(!Rt.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw new Error(\"signer.ed25519PublicKey is invalid.\");var a=Rt.decodeEd25519PublicKey(e.signer.ed25519PublicKey);n=new i.SignerKey.signerKeyTypeEd25519(a),o+=1}if(e.signer.preAuthTx){if(\"string\"==typeof e.signer.preAuthTx&&(e.signer.preAuthTx=Wn.from(e.signer.preAuthTx,\"hex\")),!Wn.isBuffer(e.signer.preAuthTx)||32!==e.signer.preAuthTx.length)throw new Error(\"signer.preAuthTx must be 32 bytes Buffer.\");n=new i.SignerKey.signerKeyTypePreAuthTx(e.signer.preAuthTx),o+=1}if(e.signer.sha256Hash){if(\"string\"==typeof e.signer.sha256Hash&&(e.signer.sha256Hash=Wn.from(e.signer.sha256Hash,\"hex\")),!Wn.isBuffer(e.signer.sha256Hash)||32!==e.signer.sha256Hash.length)throw new Error(\"signer.sha256Hash must be 32 bytes Buffer.\");n=new i.SignerKey.signerKeyTypeHashX(e.signer.sha256Hash),o+=1}if(e.signer.ed25519SignedPayload){if(!Rt.isValidSignedPayload(e.signer.ed25519SignedPayload))throw new Error(\"signer.ed25519SignedPayload is invalid.\");var s=Rt.decodeSignedPayload(e.signer.ed25519SignedPayload),c=i.SignerKeyEd25519SignedPayload.fromXDR(s);n=i.SignerKey.signerKeyTypeEd25519SignedPayload(c),o+=1}if(1!==o)throw new Error(\"Signer object must contain exactly one of signer.ed25519PublicKey, signer.sha256Hash, signer.preAuthTx.\");t.signer=new i.Signer({key:n,weight:r})}var u=new i.SetOptionsOp(t),l={};return l.body=i.OperationBody.setOptions(u),this.setSourceAccount(l,e),new i.Operation(l)},pr.beginSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Rt.isValidEd25519PublicKey(e.sponsoredId))throw new Error(\"sponsoredId is invalid\");var t=new i.BeginSponsoringFutureReservesOp({sponsoredId:Vt.fromPublicKey(e.sponsoredId).xdrAccountId()}),n={};return n.body=i.OperationBody.beginSponsoringFutureReserves(t),this.setSourceAccount(n,e),new i.Operation(n)},pr.endSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=i.OperationBody.endSponsoringFutureReserves(),this.setSourceAccount(t,e),new i.Operation(t)},pr.revokeAccountSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Rt.isValidEd25519PublicKey(e.account))throw new Error(\"account is invalid\");var t=i.LedgerKey.account(new i.LedgerKeyAccount({accountId:Vt.fromPublicKey(e.account).xdrAccountId()})),n=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),r={};return r.body=i.OperationBody.revokeSponsorship(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.revokeTrustlineSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Rt.isValidEd25519PublicKey(t.account))throw new Error(\"account is invalid\");if(t.asset instanceof Gt)e=t.asset.toTrustLineXDRObject();else{if(!(t.asset instanceof Dn))throw new TypeError(\"asset must be an Asset or LiquidityPoolId\");e=t.asset.toXDRObject()}var n=i.LedgerKey.trustline(new i.LedgerKeyTrustLine({accountId:Vt.fromPublicKey(t.account).xdrAccountId(),asset:e})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(n),o={};return o.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(o,t),new i.Operation(o)},pr.revokeOfferSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Rt.isValidEd25519PublicKey(e.seller))throw new Error(\"seller is invalid\");if(\"string\"!=typeof e.offerId)throw new Error(\"offerId is invalid\");var t=i.LedgerKey.offer(new i.LedgerKeyOffer({sellerId:Vt.fromPublicKey(e.seller).xdrAccountId(),offerId:i.Int64.fromString(e.offerId)})),n=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),r={};return r.body=i.OperationBody.revokeSponsorship(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.revokeDataSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Rt.isValidEd25519PublicKey(e.account))throw new Error(\"account is invalid\");if(\"string\"!=typeof e.name||e.name.length>64)throw new Error(\"name must be a string, up to 64 characters\");var t=i.LedgerKey.data(new i.LedgerKeyData({accountId:Vt.fromPublicKey(e.account).xdrAccountId(),dataName:e.name})),n=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),r={};return r.body=i.OperationBody.revokeSponsorship(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.revokeClaimableBalanceSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(\"string\"!=typeof e.balanceId)throw new Error(\"balanceId is invalid\");var t=i.LedgerKey.claimableBalance(new i.LedgerKeyClaimableBalance({balanceId:i.ClaimableBalanceId.fromXDR(e.balanceId,\"hex\")})),n=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),r={};return r.body=i.OperationBody.revokeSponsorship(n),this.setSourceAccount(r,e),new i.Operation(r)},pr.revokeLiquidityPoolSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(\"string\"!=typeof e.liquidityPoolId)throw new Error(\"liquidityPoolId is invalid\");var t=i.LedgerKey.liquidityPool(new i.LedgerKeyLiquidityPool({liquidityPoolId:i.PoolId.fromXDR(e.liquidityPoolId,\"hex\")})),n=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),r={body:i.OperationBody.revokeSponsorship(n)};return this.setSourceAccount(r,e),new i.Operation(r)},pr.revokeSignerSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Rt.isValidEd25519PublicKey(t.account))throw new Error(\"account is invalid\");if(t.signer.ed25519PublicKey){if(!Rt.isValidEd25519PublicKey(t.signer.ed25519PublicKey))throw new Error(\"signer.ed25519PublicKey is invalid.\");var n=Rt.decodeEd25519PublicKey(t.signer.ed25519PublicKey);e=new i.SignerKey.signerKeyTypeEd25519(n)}else if(t.signer.preAuthTx){var r;if(r=\"string\"==typeof t.signer.preAuthTx?Zn.from(t.signer.preAuthTx,\"hex\"):t.signer.preAuthTx,!Zn.isBuffer(r)||32!==r.length)throw new Error(\"signer.preAuthTx must be 32 bytes Buffer.\");e=new i.SignerKey.signerKeyTypePreAuthTx(r)}else{if(!t.signer.sha256Hash)throw new Error(\"signer is invalid\");var o;if(o=\"string\"==typeof t.signer.sha256Hash?Zn.from(t.signer.sha256Hash,\"hex\"):t.signer.sha256Hash,!Zn.isBuffer(o)||32!==o.length)throw new Error(\"signer.sha256Hash must be 32 bytes Buffer.\");e=new i.SignerKey.signerKeyTypeHashX(o)}var a=new i.RevokeSponsorshipOpSigner({accountId:Vt.fromPublicKey(t.account).xdrAccountId(),signerKey:e}),s=i.RevokeSponsorshipOp.revokeSponsorshipSigner(a),c={};return c.body=i.OperationBody.revokeSponsorship(s),this.setSourceAccount(c,t),new i.Operation(c)},pr.clawback=function(e){var t={};if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError(\"amount\"));t.amount=this._toXDRAmount(e.amount),t.asset=e.asset.toXDRObject();try{t.from=Vn(e.from)}catch(e){throw new Error(\"from address is invalid\")}var n={body:i.OperationBody.clawback(new i.ClawbackOp(t))};return this.setSourceAccount(n,e),new i.Operation(n)},pr.setTrustLineFlags=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if(\"object\"!==Yn(e.flags)||0===Object.keys(e.flags).length)throw new Error(\"opts.flags must be a map of boolean flags to modify\");var n={authorized:i.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:i.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:i.TrustLineFlags.trustlineClawbackEnabledFlag()},r=0,o=0;Object.keys(e.flags).forEach(function(t){if(!Object.prototype.hasOwnProperty.call(n,t))throw new Error(\"unsupported flag name specified: \".concat(t));var i=e.flags[t],a=n[t].value;!0===i?o|=a:!1===i&&(r|=a)}),t.trustor=Vt.fromPublicKey(e.trustor).xdrAccountId(),t.asset=e.asset.toXDRObject(),t.clearFlags=r,t.setFlags=o;var a={body:i.OperationBody.setTrustLineFlags(new i.SetTrustLineFlagsOp(t))};return this.setSourceAccount(a,e),new i.Operation(a)},pr.liquidityPoolDeposit=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.liquidityPoolId,n=e.maxAmountA,r=e.maxAmountB,o=e.minPrice,a=e.maxPrice,s={};if(!t)throw new TypeError(\"liquidityPoolId argument is required\");if(s.liquidityPoolId=i.PoolId.fromXDR(t,\"hex\"),!this.isValidAmount(n,!0))throw new TypeError(this.constructAmountRequirementsError(\"maxAmountA\"));if(s.maxAmountA=this._toXDRAmount(n),!this.isValidAmount(r,!0))throw new TypeError(this.constructAmountRequirementsError(\"maxAmountB\"));if(s.maxAmountB=this._toXDRAmount(r),void 0===o)throw new TypeError(\"minPrice argument is required\");if(s.minPrice=this._toXDRPrice(o),void 0===a)throw new TypeError(\"maxPrice argument is required\");s.maxPrice=this._toXDRPrice(a);var c=new i.LiquidityPoolDepositOp(s),u={body:i.OperationBody.liquidityPoolDeposit(c)};return this.setSourceAccount(u,e),new i.Operation(u)},pr.liquidityPoolWithdraw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if(!e.liquidityPoolId)throw new TypeError(\"liquidityPoolId argument is required\");if(t.liquidityPoolId=i.PoolId.fromXDR(e.liquidityPoolId,\"hex\"),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError(\"amount\"));if(t.amount=this._toXDRAmount(e.amount),!this.isValidAmount(e.minAmountA,!0))throw new TypeError(this.constructAmountRequirementsError(\"minAmountA\"));if(t.minAmountA=this._toXDRAmount(e.minAmountA),!this.isValidAmount(e.minAmountB,!0))throw new TypeError(this.constructAmountRequirementsError(\"minAmountB\"));t.minAmountB=this._toXDRAmount(e.minAmountB);var n=new i.LiquidityPoolWithdrawOp(t),r={body:i.OperationBody.liquidityPoolWithdraw(n)};return this.setSourceAccount(r,e),new i.Operation(r)},pr.invokeHostFunction=function(e){if(!e.func)throw new TypeError(\"host function invocation ('func') required (got \".concat(JSON.stringify(e),\")\"));e.func.switch().value===i.HostFunctionType.hostFunctionTypeInvokeContract().value&&e.func.invokeContract().args().forEach(function(e){var t;try{t=nr.fromScVal(e)}catch(e){return}switch(t._type){case\"claimableBalance\":case\"liquidityPool\":throw new TypeError(\"claimable balances and liquidity pools cannot be arguments to invokeHostFunction\")}});var t=new i.InvokeHostFunctionOp({hostFunction:e.func,auth:e.auth||[]}),n={body:i.OperationBody.invokeHostFunction(t)};return this.setSourceAccount(n,e),new i.Operation(n)},pr.extendFootprintTtl=function(e){var t;if((null!==(t=e.extendTo)&&void 0!==t?t:-1)<=0)throw new RangeError(\"extendTo has to be positive\");var n=new i.ExtendFootprintTtlOp({ext:new i.ExtensionPoint(0),extendTo:e.extendTo}),r={body:i.OperationBody.extendFootprintTtl(n)};return this.setSourceAccount(r,e),new i.Operation(r)},pr.restoreFootprint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new i.RestoreFootprintOp({ext:new i.ExtensionPoint(0)}),n={body:i.OperationBody.restoreFootprint(t)};return this.setSourceAccount(n,null!=e?e:{}),new i.Operation(n)},pr.createStellarAssetContract=function(e){var t=e.asset;if(\"string\"==typeof t){var n=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=t){var n,r,o,i,a=[],s=!0,c=!1;try{for(o=(t=t.call(e)).next;!(s=(n=o.call(t)).done)&&(a.push(n.value),2!==a.length);s=!0);}catch(e){c=!0,r=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw r}}return a}}(e)||function(e){if(e){if(\"string\"==typeof e)return or(e,2);var t={}.toString.call(e).slice(8,-1);return\"Object\"===t&&e.constructor&&(t=e.constructor.name),\"Map\"===t||\"Set\"===t?Array.from(e):\"Arguments\"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?or(e,2):void 0}}(e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}(t.split(\":\")),r=n[0],o=n[1];t=new Gt(r,o)}if(!(t instanceof Gt))throw new TypeError(\"expected Asset in 'opts.asset', got \".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeCreateContract(new i.CreateContractArgs({executable:i.ContractExecutable.contractExecutableStellarAsset(),contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAsset(t.toXDRObject())}))})},pr.invokeContractFunction=function(e){var t=new nr(e.contract);if(\"contract\"!==t._type)throw new TypeError(\"expected contract strkey instance, got \".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeInvokeContract(new i.InvokeContractArgs({contractAddress:t.toScAddress(),functionName:e.function,args:e.args}))})},pr.createCustomContract=function(e){var t,n=rr.from(e.salt||Vt.random().xdrPublicKey().value());if(!e.wasmHash||32!==e.wasmHash.length)throw new TypeError(\"expected hash(contract WASM) in 'opts.wasmHash', got \".concat(e.wasmHash));if(32!==n.length)throw new TypeError(\"expected 32-byte salt in 'opts.salt', got \".concat(e.wasmHash));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeCreateContractV2(new i.CreateContractArgsV2({executable:i.ContractExecutable.contractExecutableWasm(rr.from(e.wasmHash)),contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAddress(new i.ContractIdPreimageFromAddress({address:e.address.toScAddress(),salt:n})),constructorArgs:null!==(t=e.constructorArgs)&&void 0!==t?t:[]}))})},pr.uploadContractWasm=function(e){return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeUploadContractWasm(rr.from(e.wasm))})};var hr=n(8287).Buffer;function yr(e){return yr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},yr(e)}function gr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,mr(r.key),r)}}function mr(e){var t=function(e){if(\"object\"!=yr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=yr(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==yr(t)?t:t+\"\"}var vr=\"none\",br=\"id\",wr=\"text\",Sr=\"hash\",Ar=\"return\",Er=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this._type=t,this._value=n,this._type){case vr:break;case br:e._validateIdValue(n);break;case wr:e._validateTextValue(n);break;case Sr:case Ar:e._validateHashValue(n),\"string\"==typeof n&&(this._value=hr.from(n,\"hex\"));break;default:throw new Error(\"Invalid memo type\")}}return function(e,t,n){return t&&gr(e.prototype,t),n&&gr(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(e,[{key:\"type\",get:function(){return this._type},set:function(e){throw new Error(\"Memo is immutable\")}},{key:\"value\",get:function(){switch(this._type){case vr:return null;case br:case wr:return this._value;case Sr:case Ar:return hr.from(this._value);default:throw new Error(\"Invalid memo type\")}},set:function(e){throw new Error(\"Memo is immutable\")}},{key:\"toXDRObject\",value:function(){switch(this._type){case vr:return i.Memo.memoNone();case br:return i.Memo.memoId(r.UnsignedHyper.fromString(this._value));case wr:return i.Memo.memoText(this._value);case Sr:return i.Memo.memoHash(this._value);case Ar:return i.Memo.memoReturn(this._value);default:return null}}}],[{key:\"_validateIdValue\",value:function(e){var t,n=new Error(\"Expects a uint64 as a string. Got \".concat(e));if(\"string\"!=typeof e)throw n;try{t=new En(e)}catch(e){throw n}if(!t.isFinite())throw n;if(t.isNaN())throw n;if(t.isNegative())throw n;if(!t.isInteger())throw n;if(t.isGreaterThan(\"18446744073709551615\"))throw n}},{key:\"_validateTextValue\",value:function(e){if(!i.Memo.armTypeForArm(\"text\").isValid(e))throw new Error(\"Expects string, array or buffer, max 28 bytes\")}},{key:\"_validateHashValue\",value:function(e){var t,n=new Error(\"Expects a 32 byte hash value or hex encoded string. Got \".concat(e));if(null==e)throw n;if(\"string\"==typeof e){if(!/^[0-9A-Fa-f]{64}$/g.test(e))throw n;t=hr.from(e,\"hex\")}else{if(!hr.isBuffer(e))throw n;t=hr.from(e)}if(!t.length||32!==t.length)throw n}},{key:\"none\",value:function(){return new e(vr)}},{key:\"text\",value:function(t){return new e(wr,t)}},{key:\"id\",value:function(t){return new e(br,t)}},{key:\"hash\",value:function(t){return new e(Sr,t)}},{key:\"return\",value:function(t){return new e(Ar,t)}},{key:\"fromXDRObject\",value:function(t){switch(t.arm()){case\"id\":return e.id(t.value().toString());case\"text\":return e.text(t.value());case\"hash\":return e.hash(t.value());case\"retHash\":return e.return(t.value())}if(void 0===t.value())return e.none();throw new Error(\"Unknown type\")}}])}(),xr=n(8287).Buffer;function Tr(e){return Tr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Tr(e)}function kr(e){var t=function(e){if(\"object\"!=Tr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Tr(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Tr(t)?t:t+\"\"}function Or(e,t,n){return t=Ir(t),function(e,t){if(t&&(\"object\"==Tr(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,_r()?Reflect.construct(t,n||[],Ir(e).constructor):t.apply(e,n))}function _r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_r=function(){return!!e})()}function Ir(e){return Ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ir(e)}function Cr(e,t){return Cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cr(e,t)}var Br=function(e){function t(e,n){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),\"string\"==typeof e){var o=xr.from(e,\"base64\");e=i.TransactionEnvelope.fromXDR(o)}var a=e.switch();if(a!==i.EnvelopeType.envelopeTypeTxV0()&&a!==i.EnvelopeType.envelopeTypeTx())throw new Error(\"Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an \".concat(a.name,\".\"));var s=e.value(),c=s.tx(),u=c.fee().toString();(r=Or(this,t,[c,(s.signatures()||[]).slice(),u,n]))._envelopeType=a,r._memo=c.memo(),r._sequence=c.seqNum().toString(),r._envelopeType===i.EnvelopeType.envelopeTypeTxV0()?r._source=Rt.encodeEd25519PublicKey(r.tx.sourceAccountEd25519()):r._source=zn(r.tx.sourceAccount());var l=null,f=null;switch(r._envelopeType){case i.EnvelopeType.envelopeTypeTxV0():f=c.timeBounds();break;case i.EnvelopeType.envelopeTypeTx():switch(c.cond().switch()){case i.PreconditionType.precondTime():f=c.cond().timeBounds();break;case i.PreconditionType.precondV2():f=(l=c.cond().v2()).timeBounds()}}if(f&&(r._timeBounds={minTime:f.minTime().toString(),maxTime:f.maxTime().toString()}),l){var p=l.ledgerBounds();p&&(r._ledgerBounds={minLedger:p.minLedger(),maxLedger:p.maxLedger()});var d=l.minSeqNum();d&&(r._minAccountSequence=d.toString()),r._minAccountSequenceAge=l.minSeqAge(),r._minAccountSequenceLedgerGap=l.minSeqLedgerGap(),r._extraSigners=l.extraSigners()}var h=c.operations()||[];return r._operations=h.map(function(e){return pr.fromXDRObject(e)}),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Cr(e,t)}(t,e),function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,kr(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"timeBounds\",get:function(){return this._timeBounds},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"ledgerBounds\",get:function(){return this._ledgerBounds},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"minAccountSequence\",get:function(){return this._minAccountSequence},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"minAccountSequenceAge\",get:function(){return this._minAccountSequenceAge},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"minAccountSequenceLedgerGap\",get:function(){return this._minAccountSequenceLedgerGap},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"extraSigners\",get:function(){return this._extraSigners},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"sequence\",get:function(){return this._sequence},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"source\",get:function(){return this._source},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"operations\",get:function(){return this._operations},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"memo\",get:function(){return Er.fromXDRObject(this._memo)},set:function(e){throw new Error(\"Transaction is immutable\")}},{key:\"signatureBase\",value:function(){var e=this.tx;this._envelopeType===i.EnvelopeType.envelopeTypeTxV0()&&(e=i.Transaction.fromXDR(xr.concat([i.PublicKeyType.publicKeyTypeEd25519().toXDR(),e.toXDR()])));var t=new i.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTx(e);return new i.TransactionSignaturePayload({networkId:i.Hash.fromXDR(c(this.networkPassphrase)),taggedTransaction:t}).toXDR()}},{key:\"toEnvelope\",value:function(){var e,t=this.tx.toXDR(),n=this.signatures.slice();switch(this._envelopeType){case i.EnvelopeType.envelopeTypeTxV0():e=new i.TransactionEnvelope.envelopeTypeTxV0(new i.TransactionV0Envelope({tx:i.TransactionV0.fromXDR(t),signatures:n}));break;case i.EnvelopeType.envelopeTypeTx():e=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:i.Transaction.fromXDR(t),signatures:n}));break;default:throw new Error(\"Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an \".concat(this._envelopeType.name,\".\"))}return e}},{key:\"getClaimableBalanceId\",value:function(e){if(!Number.isInteger(e)||e<0||e>=this.operations.length)throw new RangeError(\"invalid operation index\");var t=this.operations[e];try{t=pr.createClaimableBalance(t)}catch(e){throw new TypeError(\"expected createClaimableBalance, got \".concat(t.type,\": \").concat(e))}var n=Rt.decodeEd25519PublicKey(Hn(this.source)),r=c(i.HashIdPreimage.envelopeTypeOpId(new i.HashIdPreimageOperationId({sourceAccount:i.AccountId.publicKeyTypeEd25519(n),seqNum:i.SequenceNumber.fromString(this.sequence),opNum:e})).toXDR(\"raw\"));return i.ClaimableBalanceId.claimableBalanceIdTypeV0(r).toXDR(\"hex\")}}])}(tn),Pr=n(8287).Buffer;function Rr(e){return Rr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Rr(e)}function jr(e){var t=function(e){if(\"object\"!=Rr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Rr(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Rr(t)?t:t+\"\"}function Ur(e,t,n){return t=Nr(t),function(e,t){if(t&&(\"object\"==Rr(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,Fr()?Reflect.construct(t,n||[],Nr(e).constructor):t.apply(e,n))}function Fr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Fr=function(){return!!e})()}function Nr(e){return Nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nr(e)}function Lr(e,t){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lr(e,t)}var Mr=function(e){function t(e,n){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),\"string\"==typeof e){var o=Pr.from(e,\"base64\");e=i.TransactionEnvelope.fromXDR(o)}var a=e.switch();if(a!==i.EnvelopeType.envelopeTypeTxFeeBump())throw new Error(\"Invalid TransactionEnvelope: expected an envelopeTypeTxFeeBump but received an \".concat(a.name,\".\"));var s=e.value(),c=s.tx(),u=c.fee().toString();r=Ur(this,t,[c,(s.signatures()||[]).slice(),u,n]);var l=i.TransactionEnvelope.envelopeTypeTx(c.innerTx().v1());return r._feeSource=zn(r.tx.feeSource()),r._innerTransaction=new Br(l,n),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Lr(e,t)}(t,e),function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,jr(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"innerTransaction\",get:function(){return this._innerTransaction}},{key:\"operations\",get:function(){return this._innerTransaction.operations}},{key:\"feeSource\",get:function(){return this._feeSource}},{key:\"signatureBase\",value:function(){var e=new i.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTxFeeBump(this.tx);return new i.TransactionSignaturePayload({networkId:i.Hash.fromXDR(c(this.networkPassphrase)),taggedTransaction:e}).toXDR()}},{key:\"toEnvelope\",value:function(){var e=new i.FeeBumpTransactionEnvelope({tx:i.FeeBumpTransaction.fromXDR(this.tx.toXDR()),signatures:this.signatures.slice()});return new i.TransactionEnvelope.envelopeTypeTxFeeBump(e)}}])}(tn);function Dr(e){return Dr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Dr(e)}function qr(e){var t=function(e){if(\"object\"!=Dr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Dr(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Dr(t)?t:t+\"\"}var Vr=function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,qr(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Rt.isValidMed25519PublicKey(t))throw new Error(\"accountId is an M-address; use MuxedAccount instead\");if(!Rt.isValidEd25519PublicKey(t))throw new Error(\"accountId is invalid\");if(\"string\"!=typeof n)throw new Error(\"sequence must be of type string\");this._accountId=t,this.sequence=new En(n)},[{key:\"accountId\",value:function(){return this._accountId}},{key:\"sequenceNumber\",value:function(){return this.sequence.toString()}},{key:\"incrementSequenceNumber\",value:function(){this.sequence=this.sequence.plus(1)}}]);function zr(e){return zr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},zr(e)}function Kr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Hr(r.key),r)}}function Hr(e){var t=function(e){if(\"object\"!=zr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=zr(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==zr(t)?t:t+\"\"}var $r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=t.accountId();if(!Rt.isValidEd25519PublicKey(r))throw new Error(\"accountId is invalid\");this.account=t,this._muxedXdr=Kn(r,n),this._mAddress=zn(this._muxedXdr),this._id=n}return function(e,t,n){return t&&Kr(e.prototype,t),n&&Kr(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(e,[{key:\"baseAccount\",value:function(){return this.account}},{key:\"accountId\",value:function(){return this._mAddress}},{key:\"id\",value:function(){return this._id}},{key:\"setId\",value:function(e){if(\"string\"!=typeof e)throw new Error(\"id should be a string representing a number (uint64)\");return this._muxedXdr.med25519().id(i.Uint64.fromString(e)),this._mAddress=zn(this._muxedXdr),this._id=e,this}},{key:\"sequenceNumber\",value:function(){return this.account.sequenceNumber()}},{key:\"incrementSequenceNumber\",value:function(){return this.account.incrementSequenceNumber()}},{key:\"toXDRObject\",value:function(){return this._muxedXdr}},{key:\"equals\",value:function(e){return this.accountId()===e.accountId()}}],[{key:\"fromAddress\",value:function(t,n){var r=Vn(t),o=Hn(t),i=r.med25519().id().toString();return new e(new Vr(o,n),i)}}])}();function Gr(e){return Gr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Gr(e)}function Wr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Xr(r.key),r)}}function Xr(e){var t=function(e){if(\"object\"!=Gr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Gr(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Gr(t)?t:t+\"\"}var Zr=function(e,t,n){return t&&Wr(e.prototype,t),n&&Wr(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),function(e,t,n){(t=Xr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,\"_data\",void 0),n=t?\"string\"==typeof t||ArrayBuffer.isView(t)?e.fromXDR(t):e.fromXDR(t.toXDR()):new i.SorobanTransactionData({resources:new i.SorobanResources({footprint:new i.LedgerFootprint({readOnly:[],readWrite:[]}),instructions:0,diskReadBytes:0,writeBytes:0}),ext:new i.SorobanTransactionDataExt(0),resourceFee:new i.Int64(0)}),this._data=n},[{key:\"setResourceFee\",value:function(e){return this._data.resourceFee(new i.Int64(e)),this}},{key:\"setResources\",value:function(e,t,n){return this._data.resources().instructions(e),this._data.resources().diskReadBytes(t),this._data.resources().writeBytes(n),this}},{key:\"appendFootprint\",value:function(e,t){return this.setFootprint(this.getReadOnly().concat(e),this.getReadWrite().concat(t))}},{key:\"setFootprint\",value:function(e,t){return null!==e&&this.setReadOnly(e),null!==t&&this.setReadWrite(t),this}},{key:\"setReadOnly\",value:function(e){return this._data.resources().footprint().readOnly(null!=e?e:[]),this}},{key:\"setReadWrite\",value:function(e){return this._data.resources().footprint().readWrite(null!=e?e:[]),this}},{key:\"build\",value:function(){return i.SorobanTransactionData.fromXDR(this._data.toXDR())}},{key:\"getReadOnly\",value:function(){return this.getFootprint().readOnly()}},{key:\"getReadWrite\",value:function(){return this.getFootprint().readWrite()}},{key:\"getFootprint\",value:function(){return this._data.resources().footprint()}}],[{key:\"fromXDR\",value:function(e){return i.SorobanTransactionData.fromXDR(e,\"string\"==typeof e?\"base64\":\"raw\")}}]);function Yr(e){return Yr=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Yr(e)}function Jr(e){var t=function(e){if(\"object\"!=Yr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Yr(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Yr(t)?t:t+\"\"}var Qr=function(e,t,n){return n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Jr(r.key),r)}}(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e)},0,[{key:\"decodeAddress\",value:function(e){var t={ed25519PublicKey:i.SignerKey.signerKeyTypeEd25519,preAuthTx:i.SignerKey.signerKeyTypePreAuthTx,sha256Hash:i.SignerKey.signerKeyTypeHashX,signedPayload:i.SignerKey.signerKeyTypeEd25519SignedPayload},n=Rt.getVersionByteForPrefix(e),r=t[n];if(!r)throw new Error(\"invalid signer key type (\".concat(n,\")\"));var o=Ut(n,e);return r(\"signedPayload\"===n?new i.SignerKeyEd25519SignedPayload({ed25519:o.slice(0,32),payload:o.slice(36,36+o.readUInt32BE(32))}):o)}},{key:\"encodeSignerKey\",value:function(e){var t,n;switch(e.switch()){case i.SignerKeyType.signerKeyTypeEd25519():t=\"ed25519PublicKey\",n=e.value();break;case i.SignerKeyType.signerKeyTypePreAuthTx():t=\"preAuthTx\",n=e.value();break;case i.SignerKeyType.signerKeyTypeHashX():t=\"sha256Hash\",n=e.value();break;case i.SignerKeyType.signerKeyTypeEd25519SignedPayload():t=\"signedPayload\",n=e.ed25519SignedPayload().toXDR(\"raw\");break;default:throw new Error(\"invalid SignerKey (type: \".concat(e.switch(),\")\"))}return Ft(t,n)}}]);function eo(e){return eo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},eo(e)}function to(e){var t=function(e){if(\"object\"!=eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=eo(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==eo(t)?t:t+\"\"}var no=function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,to(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e);try{this._id=Rt.decodeContract(t)}catch(e){throw new Error(\"Invalid contract ID: \".concat(t))}},[{key:\"contractId\",value:function(){return Rt.encodeContract(this._id)}},{key:\"toString\",value:function(){return this.contractId()}},{key:\"address\",value:function(){return nr.contract(this._id)}},{key:\"call\",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return pr.invokeContractFunction({contract:this.address().toString(),function:e,args:n})}},{key:\"getFootprint\",value:function(){return i.LedgerKey.contractData(new i.LedgerKeyContractData({contract:this.address().toScAddress(),key:i.ScVal.scvLedgerKeyContractInstance(),durability:i.ContractDataDurability.persistent()}))}}]);function ro(e){return ro=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},ro(e)}function oo(e){var t=function(e){if(\"object\"!=ro(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=ro(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==ro(t)?t:t+\"\"}function io(e,t,n){return t=so(t),function(e,t){if(t&&(\"object\"==ro(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,ao()?Reflect.construct(t,n||[],so(e).constructor):t.apply(e,n))}function ao(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ao=function(){return!!e})()}function so(e){return so=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},so(e)}function co(e,t){return co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},co(e,t)}var uo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return io(this,t,[n])}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&co(e,t)}(t,e),function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,oo(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"unsigned\",get:function(){return!0}},{key:\"size\",get:function(){return 128}}])}(r.LargeInt);function lo(e){return lo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},lo(e)}function fo(e){var t=function(e){if(\"object\"!=lo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=lo(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==lo(t)?t:t+\"\"}function po(e,t,n){return t=yo(t),function(e,t){if(t&&(\"object\"==lo(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,ho()?Reflect.construct(t,n||[],yo(e).constructor):t.apply(e,n))}function ho(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ho=function(){return!!e})()}function yo(e){return yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yo(e)}function go(e,t){return go=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},go(e,t)}uo.defineIntBoundaries();var mo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return po(this,t,[n])}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&go(e,t)}(t,e),function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,fo(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"unsigned\",get:function(){return!0}},{key:\"size\",get:function(){return 256}}])}(r.LargeInt);function vo(e){return vo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},vo(e)}function bo(e){var t=function(e){if(\"object\"!=vo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=vo(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==vo(t)?t:t+\"\"}function wo(e,t,n){return t=Ao(t),function(e,t){if(t&&(\"object\"==vo(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,So()?Reflect.construct(t,n||[],Ao(e).constructor):t.apply(e,n))}function So(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(So=function(){return!!e})()}function Ao(e){return Ao=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ao(e)}function Eo(e,t){return Eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Eo(e,t)}mo.defineIntBoundaries();var xo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return wo(this,t,[n])}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Eo(e,t)}(t,e),function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,bo(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"unsigned\",get:function(){return!1}},{key:\"size\",get:function(){return 128}}])}(r.LargeInt);function To(e){return To=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},To(e)}function ko(e){var t=function(e){if(\"object\"!=To(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=To(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==To(t)?t:t+\"\"}function Oo(e,t,n){return t=Io(t),function(e,t){if(t&&(\"object\"==To(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,_o()?Reflect.construct(t,n||[],Io(e).constructor):t.apply(e,n))}function _o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_o=function(){return!!e})()}function Io(e){return Io=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Io(e)}function Co(e,t){return Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Co(e,t)}xo.defineIntBoundaries();var Bo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Oo(this,t,[n])}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Co(e,t)}(t,e),function(e,t){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,ko(r.key),r)}}(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"unsigned\",get:function(){return!1}},{key:\"size\",get:function(){return 256}}])}(r.LargeInt);function Po(e){return Po=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Po(e)}function Ro(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Uo(r.key),r)}}function jo(e,t,n){return(t=Uo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uo(e){var t=function(e){if(\"object\"!=Po(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Po(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Po(t)?t:t+\"\"}Bo.defineIntBoundaries();var Fo=function(e,t,n){return t&&Ro(e.prototype,t),n&&Ro(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t,n){switch(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),jo(this,\"int\",void 0),jo(this,\"type\",void 0),n instanceof Array||(n=[n]),n=n.map(function(e){return\"bigint\"==typeof e?e:\"function\"==typeof e.toBigInt?e.toBigInt():BigInt(e)}),t){case\"i64\":this.int=new r.Hyper(n);break;case\"i128\":this.int=new xo(n);break;case\"i256\":this.int=new Bo(n);break;case\"u64\":case\"timepoint\":case\"duration\":this.int=new r.UnsignedHyper(n);break;case\"u128\":this.int=new uo(n);break;case\"u256\":this.int=new mo(n);break;default:throw TypeError(\"invalid type: \".concat(t))}this.type=t},[{key:\"toNumber\",value:function(){var e=this.int.toBigInt();if(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)throw RangeError(\"value \".concat(e,\" not in range for Number \")+\"[\".concat(Number.MAX_SAFE_INTEGER,\", \").concat(Number.MIN_SAFE_INTEGER,\"]\"));return Number(e)}},{key:\"toBigInt\",value:function(){return this.int.toBigInt()}},{key:\"toI64\",value:function(){this._sizeCheck(64);var e=this.toBigInt();if(BigInt.asIntN(64,e)!==e)throw RangeError(\"value too large for i64: \".concat(e));return i.ScVal.scvI64(new i.Int64(e))}},{key:\"toU64\",value:function(){return this._sizeCheck(64),i.ScVal.scvU64(new i.Uint64(BigInt.asUintN(64,this.toBigInt())))}},{key:\"toTimepoint\",value:function(){return this._sizeCheck(64),i.ScVal.scvTimepoint(new i.Uint64(BigInt.asUintN(64,this.toBigInt())))}},{key:\"toDuration\",value:function(){return this._sizeCheck(64),i.ScVal.scvDuration(new i.Uint64(BigInt.asUintN(64,this.toBigInt())))}},{key:\"toI128\",value:function(){this._sizeCheck(128);var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>64n),n=BigInt.asUintN(64,e);return i.ScVal.scvI128(new i.Int128Parts({hi:new i.Int64(t),lo:new i.Uint64(n)}))}},{key:\"toU128\",value:function(){this._sizeCheck(128);var e=this.int.toBigInt();return i.ScVal.scvU128(new i.UInt128Parts({hi:new i.Uint64(BigInt.asUintN(64,e>>64n)),lo:new i.Uint64(BigInt.asUintN(64,e))}))}},{key:\"toI256\",value:function(){var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>192n),n=BigInt.asUintN(64,e>>128n),r=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return i.ScVal.scvI256(new i.Int256Parts({hiHi:new i.Int64(t),hiLo:new i.Uint64(n),loHi:new i.Uint64(r),loLo:new i.Uint64(o)}))}},{key:\"toU256\",value:function(){var e=this.int.toBigInt(),t=BigInt.asUintN(64,e>>192n),n=BigInt.asUintN(64,e>>128n),r=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return i.ScVal.scvU256(new i.UInt256Parts({hiHi:new i.Uint64(t),hiLo:new i.Uint64(n),loHi:new i.Uint64(r),loLo:new i.Uint64(o)}))}},{key:\"toScVal\",value:function(){switch(this.type){case\"i64\":return this.toI64();case\"i128\":return this.toI128();case\"i256\":return this.toI256();case\"u64\":return this.toU64();case\"u128\":return this.toU128();case\"u256\":return this.toU256();case\"timepoint\":return this.toTimepoint();case\"duration\":return this.toDuration();default:throw TypeError(\"invalid type: \".concat(this.type))}}},{key:\"valueOf\",value:function(){return this.int.valueOf()}},{key:\"toString\",value:function(){return this.int.toString()}},{key:\"toJSON\",value:function(){return{value:this.toBigInt().toString(),type:this.type}}},{key:\"_sizeCheck\",value:function(e){if(this.int.size>e)throw RangeError(\"value too large for \".concat(e,\" bits (\").concat(this.type,\")\"))}}],[{key:\"isType\",value:function(e){switch(e){case\"i64\":case\"i128\":case\"i256\":case\"u64\":case\"u128\":case\"u256\":case\"timepoint\":case\"duration\":return!0;default:return!1}}},{key:\"getType\",value:function(e){return e.slice(3).toLowerCase()}}]);function No(e){return No=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},No(e)}function Lo(e,t,n){return t=Do(t),function(e,t){if(t&&(\"object\"==No(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,Mo()?Reflect.construct(t,n||[],Do(e).constructor):t.apply(e,n))}function Mo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Mo=function(){return!!e})()}function Do(e){return Do=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Do(e)}function qo(e,t){return qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qo(e,t)}var Vo=function(e){function t(e,n){var r;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t);var o=BigInt(e),i=o<0n,a=null!==(r=null==n?void 0:n.type)&&void 0!==r?r:\"\";if(a.startsWith(\"u\")&&i)throw TypeError(\"specified type \".concat(n.type,\" yet negative (\").concat(e,\")\"));if(\"\"===a){a=i?\"i\":\"u\";var s=function(e){var t,n=e.toString(2).length;return null!==(t=[64,128,256].find(function(e){return n<=e}))&&void 0!==t?t:n}(o);switch(s){case 64:case 128:case 256:a+=s.toString();break;default:throw RangeError(\"expected 64/128/256 bits for input (\".concat(e,\"), got \").concat(s))}}return Lo(this,t,[a,o])}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&qo(e,t)}(t,e),function(e){return Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t)}(Fo);function zo(e){var t=Fo.getType(e.switch().name);switch(e.switch().name){case\"scvU32\":case\"scvI32\":return BigInt(e.value());case\"scvU64\":case\"scvI64\":case\"scvTimepoint\":case\"scvDuration\":return new Fo(t,e.value()).toBigInt();case\"scvU128\":case\"scvI128\":return new Fo(t,[e.value().lo(),e.value().hi()]).toBigInt();case\"scvU256\":case\"scvI256\":return new Fo(t,[e.value().loLo(),e.value().loHi(),e.value().hiLo(),e.value().hiHi()]).toBigInt();default:throw TypeError(\"expected integer type, got \".concat(e.switch()))}}var Ko=n(8287).Buffer;function Ho(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if(\"string\"==typeof e)return $o(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$o(e,t):void 0}}(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function $o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wo(e,t,n){return(t=function(e){var t=function(e){if(\"object\"!=Xo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Xo(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Xo(t)?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xo(e){return Xo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Xo(e)}function Zo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(Xo(e)){case\"object\":var n,r,o;if(null===e)return i.ScVal.scvVoid();if(e instanceof i.ScVal)return e;if(e instanceof nr)return e.toScVal();if(e instanceof Vt)return Zo(e.publicKey(),{type:\"address\"});if(e instanceof no)return e.address().toScVal();if(e instanceof Uint8Array||Ko.isBuffer(e)){var a,s=Uint8Array.from(e);switch(null!==(a=null==t?void 0:t.type)&&void 0!==a?a:\"bytes\"){case\"bytes\":return i.ScVal.scvBytes(s);case\"symbol\":return i.ScVal.scvSymbol(s);case\"string\":return i.ScVal.scvString(s);default:throw new TypeError(\"invalid type (\".concat(t.type,\") specified for bytes-like value\"))}}if(Array.isArray(e))return i.ScVal.scvVec(e.map(function(e,n){return Array.isArray(t.type)?Zo(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Go(Object(n),!0).forEach(function(t){Wo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Go(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},t.type.length>n&&{type:t.type[n]})):Zo(e,t)}));if(\"Object\"!==(null!==(n=null===(r=e.constructor)||void 0===r?void 0:r.name)&&void 0!==n?n:\"\"))throw new TypeError(\"cannot interpret \".concat(null===(o=e.constructor)||void 0===o?void 0:o.name,\" value as ScVal (\").concat(JSON.stringify(e),\")\"));return i.ScVal.scvMap(Object.entries(e).sort(function(e,t){var n=Ho(e,1)[0],r=Ho(t,1)[0];return n.localeCompare(r)}).map(function(e){var n,r,o=Ho(e,2),a=o[0],s=o[1],c=Ho(null!==(n=(null!==(r=null==t?void 0:t.type)&&void 0!==r?r:{})[a])&&void 0!==n?n:[null,null],2),u=c[0],l=c[1],f=u?{type:u}:{},p=l?{type:l}:{};return new i.ScMapEntry({key:Zo(a,f),val:Zo(s,p)})}));case\"number\":case\"bigint\":switch(null==t?void 0:t.type){case\"u32\":return i.ScVal.scvU32(e);case\"i32\":return i.ScVal.scvI32(e)}return new Vo(e,{type:null==t?void 0:t.type}).toScVal();case\"string\":var c,u=null!==(c=null==t?void 0:t.type)&&void 0!==c?c:\"string\";switch(u){case\"string\":return i.ScVal.scvString(e);case\"symbol\":return i.ScVal.scvSymbol(e);case\"address\":return new nr(e).toScVal();case\"u32\":return i.ScVal.scvU32(parseInt(e,10));case\"i32\":return i.ScVal.scvI32(parseInt(e,10));default:if(Fo.isType(u))return new Fo(u,e).toScVal();throw new TypeError(\"invalid type (\".concat(t.type,\") specified for string value\"))}case\"boolean\":return i.ScVal.scvBool(e);case\"undefined\":return i.ScVal.scvVoid();case\"function\":return Zo(e());default:throw new TypeError(\"failed to convert typeof \".concat(Xo(e),\" (\").concat(e,\")\"))}}function Yo(e){var t,n;switch(e.switch().value){case i.ScValType.scvVoid().value:return null;case i.ScValType.scvU64().value:case i.ScValType.scvI64().value:return e.value().toBigInt();case i.ScValType.scvU128().value:case i.ScValType.scvI128().value:case i.ScValType.scvU256().value:case i.ScValType.scvI256().value:return zo(e);case i.ScValType.scvVec().value:return(null!==(t=e.vec())&&void 0!==t?t:[]).map(Yo);case i.ScValType.scvAddress().value:return nr.fromScVal(e).toString();case i.ScValType.scvMap().value:return Object.fromEntries((null!==(n=e.map())&&void 0!==n?n:[]).map(function(e){return[Yo(e.key()),Yo(e.val())]}));case i.ScValType.scvBool().value:case i.ScValType.scvU32().value:case i.ScValType.scvI32().value:case i.ScValType.scvBytes().value:return e.value();case i.ScValType.scvSymbol().value:case i.ScValType.scvString().value:var r=e.value();if(Ko.isBuffer(r)||ArrayBuffer.isView(r))try{return(new TextDecoder).decode(r)}catch(e){return new Uint8Array(r.buffer)}return r;case i.ScValType.scvTimepoint().value:case i.ScValType.scvDuration().value:return new i.Uint64(e.value()).toBigInt();case i.ScValType.scvError().value:if(e.error().switch().value===i.ScErrorType.sceContract().value)return{type:\"contract\",code:e.error().contractCode()};var o=e.error();return{type:\"system\",code:o.code().value,value:o.code().name};default:return e.value()}}function Jo(e){return Jo=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Jo(e)}function Qo(e){return function(e){if(Array.isArray(e))return ei(e)}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||function(e,t){if(e){if(\"string\"==typeof e)return ei(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ei(e,t):void 0}}(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ni(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ti(Object(n),!0).forEach(function(t){ri(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ti(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ri(e,t,n){return(t=ii(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,ii(r.key),r)}}function ii(e){var t=function(e){if(\"object\"!=Jo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Jo(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Jo(t)?t:t+\"\"}i.scvSortedMap=function(e){var t=Array.from(e).sort(function(e,t){var n=Yo(e.key()),r=Yo(t.key());switch(Xo(n)){case\"number\":case\"bigint\":return n<r?-1:1;default:return n.toString().localeCompare(r.toString())}});return i.ScVal.scvMap(t)};var ai=\"100\",si=0,ci=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),!t)throw new Error(\"must specify source account for the transaction\");if(void 0===n.fee)throw new Error(\"must specify fee for the transaction (in stroops)\");this.source=t,this.operations=[],this.baseFee=n.fee,this.timebounds=n.timebounds?ni({},n.timebounds):null,this.ledgerbounds=n.ledgerbounds?ni({},n.ledgerbounds):null,this.minAccountSequence=n.minAccountSequence||null,this.minAccountSequenceAge=n.minAccountSequenceAge||null,this.minAccountSequenceLedgerGap=n.minAccountSequenceLedgerGap||null,this.extraSigners=n.extraSigners?Qo(n.extraSigners):null,this.memo=n.memo||Er.none(),this.networkPassphrase=n.networkPassphrase||null,this.sorobanData=n.sorobanData?new Zr(n.sorobanData).build():null}return function(e,t,n){return t&&oi(e.prototype,t),n&&oi(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(e,[{key:\"addOperation\",value:function(e){return this.operations.push(e),this}},{key:\"addOperationAt\",value:function(e,t){return this.operations.splice(t,0,e),this}},{key:\"clearOperations\",value:function(){return this.operations=[],this}},{key:\"clearOperationAt\",value:function(e){return this.operations.splice(e,1),this}},{key:\"addMemo\",value:function(e){return this.memo=e,this}},{key:\"setTimeout\",value:function(e){if(null!==this.timebounds&&this.timebounds.maxTime>0)throw new Error(\"TimeBounds.max_time has been already set - setting timeout would overwrite it.\");if(e<0)throw new Error(\"timeout cannot be negative\");if(e>0){var t=Math.floor(Date.now()/1e3)+e;null===this.timebounds?this.timebounds={minTime:0,maxTime:t}:this.timebounds={minTime:this.timebounds.minTime,maxTime:t}}else this.timebounds={minTime:0,maxTime:0};return this}},{key:\"setTimebounds\",value:function(e,t){if(\"number\"==typeof e&&(e=new Date(1e3*e)),\"number\"==typeof t&&(t=new Date(1e3*t)),null!==this.timebounds)throw new Error(\"TimeBounds has been already set - setting timebounds would overwrite it.\");var n=Math.floor(e.valueOf()/1e3),r=Math.floor(t.valueOf()/1e3);if(n<0)throw new Error(\"min_time cannot be negative\");if(r<0)throw new Error(\"max_time cannot be negative\");if(r>0&&n>r)throw new Error(\"min_time cannot be greater than max_time\");return this.timebounds={minTime:n,maxTime:r},this}},{key:\"setLedgerbounds\",value:function(e,t){if(null!==this.ledgerbounds)throw new Error(\"LedgerBounds has been already set - setting ledgerbounds would overwrite it.\");if(e<0)throw new Error(\"min_ledger cannot be negative\");if(t<0)throw new Error(\"max_ledger cannot be negative\");if(t>0&&e>t)throw new Error(\"min_ledger cannot be greater than max_ledger\");return this.ledgerbounds={minLedger:e,maxLedger:t},this}},{key:\"setMinAccountSequence\",value:function(e){if(null!==this.minAccountSequence)throw new Error(\"min_account_sequence has been already set - setting min_account_sequence would overwrite it.\");return this.minAccountSequence=e,this}},{key:\"setMinAccountSequenceAge\",value:function(e){if(\"number\"!=typeof e)throw new Error(\"min_account_sequence_age must be a number\");if(null!==this.minAccountSequenceAge)throw new Error(\"min_account_sequence_age has been already set - setting min_account_sequence_age would overwrite it.\");if(e<0)throw new Error(\"min_account_sequence_age cannot be negative\");return this.minAccountSequenceAge=e,this}},{key:\"setMinAccountSequenceLedgerGap\",value:function(e){if(null!==this.minAccountSequenceLedgerGap)throw new Error(\"min_account_sequence_ledger_gap has been already set - setting min_account_sequence_ledger_gap would overwrite it.\");if(e<0)throw new Error(\"min_account_sequence_ledger_gap cannot be negative\");return this.minAccountSequenceLedgerGap=e,this}},{key:\"setExtraSigners\",value:function(e){if(!Array.isArray(e))throw new Error(\"extra_signers must be an array of strings.\");if(null!==this.extraSigners)throw new Error(\"extra_signers has been already set - setting extra_signers would overwrite it.\");if(e.length>2)throw new Error(\"extra_signers cannot be longer than 2 elements.\");return this.extraSigners=Qo(e),this}},{key:\"setNetworkPassphrase\",value:function(e){return this.networkPassphrase=e,this}},{key:\"setSorobanData\",value:function(e){return this.sorobanData=new Zr(e).build(),this}},{key:\"addSacTransferOperation\",value:function(e,t,n,o){if(BigInt(n)<=0n)throw new Error(\"Amount must be a positive integer\");if(BigInt(n)>r.Hyper.MAX_VALUE)throw new Error(\"Amount exceeds maximum value for i64\");if(o){var a=o.instructions,s=o.readBytes,c=o.writeBytes,u=o.resourceFee,l=4294967295;if(a<=0||a>l)throw new Error(\"instructions must be greater than 0 and at most \".concat(l));if(s<=0||s>l)throw new Error(\"readBytes must be greater than 0 and at most \".concat(l));if(c<=0||c>l)throw new Error(\"writeBytes must be greater than 0 and at most \".concat(l));if(u<=0n||u>r.Hyper.MAX_VALUE)throw new Error(\"resourceFee must be greater than 0 and at most i64 max\")}var f=Rt.isValidContract(e);if(!f&&!Rt.isValidEd25519PublicKey(e)&&!Rt.isValidMed25519PublicKey(e))throw new Error(\"Invalid destination address. Must be a valid Stellar address or contract ID.\");if(e===this.source.accountId())throw new Error(\"Destination cannot be the same as the source account.\");var p=t.contractId(this.networkPassphrase),d=\"transfer\",h=this.source.accountId(),y=[Zo(h,{type:\"address\"}),Zo(e,{type:\"address\"}),Zo(n,{type:\"i128\"})],g=t.isNative(),m=new i.SorobanAuthorizationEntry({credentials:i.SorobanCredentials.sorobanCredentialsSourceAccount(),rootInvocation:new i.SorobanAuthorizedInvocation({function:i.SorobanAuthorizedFunction.sorobanAuthorizedFunctionTypeContractFn(new i.InvokeContractArgs({contractAddress:nr.fromString(p).toScAddress(),functionName:d,args:y})),subInvocations:[]})}),v=new i.LedgerFootprint({readOnly:[i.LedgerKey.contractData(new i.LedgerKeyContractData({contract:nr.fromString(p).toScAddress(),key:i.ScVal.scvLedgerKeyContractInstance(),durability:i.ContractDataDurability.persistent()}))],readWrite:[]});f?(v.readWrite().push(i.LedgerKey.contractData(new i.LedgerKeyContractData({contract:nr.fromString(p).toScAddress(),key:i.ScVal.scvVec([Zo(\"Balance\",{type:\"symbol\"}),Zo(e,{type:\"address\"})]),durability:i.ContractDataDurability.persistent()}))),g||v.readOnly().push(i.LedgerKey.account(new i.LedgerKeyAccount({accountId:Vt.fromPublicKey(t.getIssuer()).xdrPublicKey()})))):g?v.readWrite().push(i.LedgerKey.account(new i.LedgerKeyAccount({accountId:Vt.fromPublicKey(e).xdrPublicKey()}))):t.getIssuer()!==e&&v.readWrite().push(i.LedgerKey.trustline(new i.LedgerKeyTrustLine({accountId:Vt.fromPublicKey(e).xdrPublicKey(),asset:t.toTrustLineXDRObject()}))),t.isNative()?v.readWrite().push(i.LedgerKey.account(new i.LedgerKeyAccount({accountId:Vt.fromPublicKey(h).xdrPublicKey()}))):t.getIssuer()!==h&&v.readWrite().push(i.LedgerKey.trustline(new i.LedgerKeyTrustLine({accountId:Vt.fromPublicKey(h).xdrPublicKey(),asset:t.toTrustLineXDRObject()})));var b={instructions:4e5,readBytes:1e3,writeBytes:1e3,resourceFee:BigInt(5e6)},w=new i.SorobanTransactionData({resources:new i.SorobanResources({footprint:v,instructions:o?o.instructions:b.instructions,diskReadBytes:o?o.readBytes:b.readBytes,writeBytes:o?o.writeBytes:b.writeBytes}),ext:new i.SorobanTransactionDataExt(0),resourceFee:new i.Int64(o?o.resourceFee:b.resourceFee)}),S=pr.invokeContractFunction({contract:p,function:d,args:y,auth:[m]});return this.setSorobanData(w),this.addOperation(S)}},{key:\"build\",value:function(){var e=new En(this.source.sequenceNumber()).plus(1),t={fee:new En(this.baseFee).times(this.operations.length).toNumber(),seqNum:i.SequenceNumber.fromString(e.toString()),memo:this.memo?this.memo.toXDRObject():null};if(null===this.timebounds||void 0===this.timebounds.minTime||void 0===this.timebounds.maxTime)throw new Error(\"TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).\");ui(this.timebounds.minTime)&&(this.timebounds.minTime=Math.floor(this.timebounds.minTime.getTime()/1e3)),ui(this.timebounds.maxTime)&&(this.timebounds.maxTime=Math.floor(this.timebounds.maxTime.getTime()/1e3)),this.timebounds.minTime=r.UnsignedHyper.fromString(this.timebounds.minTime.toString()),this.timebounds.maxTime=r.UnsignedHyper.fromString(this.timebounds.maxTime.toString());var n=new i.TimeBounds(this.timebounds);if(this.hasV2Preconditions()){var o=null;null!==this.ledgerbounds&&(o=new i.LedgerBounds(this.ledgerbounds));var a=this.minAccountSequence||\"0\";a=i.SequenceNumber.fromString(a);var s=r.UnsignedHyper.fromString(null!==this.minAccountSequenceAge?this.minAccountSequenceAge.toString():\"0\"),c=this.minAccountSequenceLedgerGap||0,u=null!==this.extraSigners?this.extraSigners.map(Qr.decodeAddress):[];t.cond=i.Preconditions.precondV2(new i.PreconditionsV2({timeBounds:n,ledgerBounds:o,minSeqNum:a,minSeqAge:s,minSeqLedgerGap:c,extraSigners:u}))}else t.cond=i.Preconditions.precondTime(n);t.sourceAccount=Vn(this.source.accountId()),this.sorobanData?(t.ext=new i.TransactionExt(1,this.sorobanData),t.fee=new En(t.fee).plus(this.sorobanData.resourceFee()).toNumber()):t.ext=new i.TransactionExt(0,i.Void);var l=new i.Transaction(t);l.operations(this.operations);var f=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:l})),p=new Br(f,this.networkPassphrase);return this.source.incrementSequenceNumber(),p}},{key:\"hasV2Preconditions\",value:function(){return null!==this.ledgerbounds||null!==this.minAccountSequence||null!==this.minAccountSequenceAge||null!==this.minAccountSequenceLedgerGap||null!==this.extraSigners&&this.extraSigners.length>0}}],[{key:\"cloneFrom\",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t instanceof Br))throw new TypeError(\"expected a 'Transaction', got: \".concat(t));var o,i=(BigInt(t.sequence)-1n).toString();if(Rt.isValidMed25519PublicKey(t.source))o=$r.fromAddress(t.source,i);else{if(!Rt.isValidEd25519PublicKey(t.source))throw new TypeError(\"unsupported tx source account: \".concat(t.source));o=new Vr(t.source,i)}var a=new e(o,ni({fee:(Math.floor(parseInt(t.fee,10)/t.operations.length)||ai).toString(),memo:t.memo,networkPassphrase:t.networkPassphrase,timebounds:t.timeBounds,ledgerbounds:t.ledgerBounds,minAccountSequence:t.minAccountSequence,minAccountSequenceAge:t.minAccountSequenceAge,minAccountSequenceLedgerGap:t.minAccountSequenceLedgerGap,extraSigners:null===(n=t.extraSigners)||void 0===n?void 0:n.map(Qr.encodeSignerKey)},r));return t._tx.operations().forEach(function(e){return a.addOperation(e)}),a}},{key:\"buildFeeBumpTransaction\",value:function(e,t,n,r){var o=n.operations.length,a=new En(ai),s=new En(0),c=n.toEnvelope();if(c.switch().value===i.EnvelopeType.envelopeTypeTx().value){var u,l=c.v1().tx().ext().value();s=new En(null!==(u=null==l?void 0:l.resourceFee())&&void 0!==u?u:0)}var f=new En(n.fee).minus(s).div(o),p=new En(t);if(p.lt(f))throw new Error(\"Invalid baseFee, it should be at least \".concat(f,\" stroops.\"));if(p.lt(a))throw new Error(\"Invalid baseFee, it should be at least \".concat(a,\" stroops.\"));var d,h=n.toEnvelope();if(h.switch()===i.EnvelopeType.envelopeTypeTxV0()){var y=h.v0().tx(),g=new i.Transaction({sourceAccount:new i.MuxedAccount.keyTypeEd25519(y.sourceAccountEd25519()),fee:y.fee(),seqNum:y.seqNum(),cond:i.Preconditions.precondTime(y.timeBounds()),memo:y.memo(),operations:y.operations(),ext:new i.TransactionExt(0)});h=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:g,signatures:h.v0().signatures()}))}d=\"string\"==typeof e?Vn(e):e.xdrMuxedAccount();var m=new i.FeeBumpTransaction({feeSource:d,fee:i.Int64.fromString(p.times(o+1).plus(s).toString()),innerTx:i.FeeBumpTransactionInnerTx.envelopeTypeTx(h.v1()),ext:new i.FeeBumpTransactionExt(0)}),v=new i.FeeBumpTransactionEnvelope({tx:m,signatures:[]}),b=new i.TransactionEnvelope.envelopeTypeTxFeeBump(v);return new Mr(b,r)}},{key:\"fromXDR\",value:function(e,t){return\"string\"==typeof e&&(e=i.TransactionEnvelope.fromXDR(e,\"base64\")),e.switch()===i.EnvelopeType.envelopeTypeTxFeeBump()?new Mr(e,t):new Br(e,t)}}])}();function ui(e){return e instanceof Date&&!isNaN(e)}var li={PUBLIC:\"Public Global Stellar Network ; September 2015\",TESTNET:\"Test SDF Network ; September 2015\",FUTURENET:\"Test SDF Future Network ; October 2022\",SANDBOX:\"Local Sandbox Stellar Network ; September 2022\",STANDALONE:\"Standalone Network ; February 2017\"};function fi(e){return fi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},fi(e)}function pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function di(e){var t=function(e){if(\"object\"!=fi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=fi(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==fi(t)?t:t+\"\"}var hi=function(e,t,n){return n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,di(r.key),r)}}(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e)},0,[{key:\"formatTokenAmount\",value:function(e,t){if(e.includes(\".\"))throw new TypeError(\"No decimals are allowed\");var n=e;return t>0&&(n=t>n.length?[\"0\",n.toString().padStart(t,\"0\")].join(\".\"):[n.slice(0,-t),n.slice(-t)].join(\".\")),n.replace(/(\\.\\d*?)0+$/,\"$1\").replace(/\\.$/,\".0\").replace(/^\\./,\"0.\")}},{key:\"parseTokenAmount\",value:function(e,t){var n,r=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||function(e,t){if(e){if(\"string\"==typeof e)return pi(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pi(e,t):void 0}}(e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}(e.split(\".\").slice()),o=r[0],i=r[1];if(pi(r).slice(2).length)throw new Error(\"Invalid decimal value: \".concat(e));if((null==i?void 0:i.length)>t)throw new Error('Too many decimal places in \"'.concat(e,'\": expected at most ').concat(t,\", got \").concat(i.length));return BigInt(o+(null!==(n=null==i?void 0:i.padEnd(t,\"0\"))&&void 0!==n?n:\"0\".repeat(t))).toString()}}]);function yi(e){return yi=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},yi(e)}function gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gi(Object(n),!0).forEach(function(t){vi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vi(e,t,n){return(t=function(e){var t=function(e){if(\"object\"!=yi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=yi(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==yi(t)?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bi(e){return e.map(function(e){return e.inSuccessfulContractCall?wi(e.event()):wi(e)})}function wi(e){return mi(mi({},\"function\"==typeof e.contractId&&null!=e.contractId()&&{contractId:Rt.encodeContract(e.contractId())}),{},{type:e.type().name,topics:e.body().value().topics().map(function(e){return Yo(e)}),data:Yo(e.body().value().data())})}var Si=n(8287).Buffer;function Ai(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return Ei(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Ei(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ei(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,Ei(f,\"constructor\",u),Ei(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",Ei(u,o,\"GeneratorFunction\"),Ei(f),Ei(f,o,\"Generator\"),Ei(f,r,function(){return this}),Ei(f,\"toString\",function(){return\"[object Generator]\"}),(Ai=function(){return{w:i,m:p}})()}function Ei(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}Ei=function(e,t,n,r){function i(t,n){Ei(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},Ei(e,t,n,r)}function xi(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function Ti(e,t,n){return ki.apply(this,arguments)}function ki(){var e;return e=Ai().m(function e(t,n,r){var o,a,s,u,l,f,p,d,h,y,g=arguments;return Ai().w(function(e){for(;;)switch(e.n){case 0:if(o=g.length>3&&void 0!==g[3]?g[3]:li.FUTURENET,t.credentials().switch().value===i.SorobanCredentialsType.sorobanCredentialsAddress().value){e.n=1;break}return e.a(2,t);case 1:if(a=i.SorobanAuthorizationEntry.fromXDR(t.toXDR()),(s=a.credentials().address()).signatureExpirationLedger(r),u=c(Si.from(o)),l=i.HashIdPreimage.envelopeTypeSorobanAuthorization(new i.HashIdPreimageSorobanAuthorization({networkId:u,nonce:s.nonce(),invocation:a.rootInvocation(),signatureExpirationLedger:s.signatureExpirationLedger()})),f=c(l.toXDR()),\"function\"!=typeof n){e.n=3;break}return e.n=2,n(l);case 2:null!=(h=e.v)&&h.signature?(p=Si.from(h.signature),d=h.publicKey):(p=Si.from(h),d=nr.fromScAddress(s.address()).toString()),e.n=4;break;case 3:p=Si.from(n.sign(f)),d=n.publicKey();case 4:if(Vt.fromPublicKey(d).verify(f,p)){e.n=5;break}throw new Error(\"signature doesn't match payload\");case 5:return y=Zo({public_key:Rt.decodeEd25519PublicKey(d),signature:p},{type:{public_key:[\"symbol\",null],signature:[\"symbol\",null]}}),s.signature(i.ScVal.scvVec([y])),e.a(2,a)}},e)}),ki=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){xi(i,r,o,a,s,\"next\",e)}function s(e){xi(i,r,o,a,s,\"throw\",e)}a(void 0)})},ki.apply(this,arguments)}function Oi(e,t,n){var r,o,a,s,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"\",u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:li.FUTURENET,l=Vt.random().rawPublicKey(),f=new i.Int64((o=(r=l.subarray(0,8))[0]<<24|r[1]<<16|r[2]<<8|r[3],a=r[4]<<24|r[5]<<16|r[6]<<8|r[7],s=BigInt(o>>>0)*BigInt(Math.pow(2,32))+BigInt(a>>>0),BigInt.asIntN(64,s))),p=c||e.publicKey();if(!p)throw new Error(\"authorizeInvocation requires publicKey parameter\");return Ti(new i.SorobanAuthorizationEntry({rootInvocation:n,credentials:i.SorobanCredentials.sorobanCredentialsAddress(new i.SorobanAddressCredentials({address:new nr(p).toScAddress(),nonce:f,signatureExpirationLedger:0,signature:i.ScVal.scvVec([])}))}),e,t,u)}function _i(e){return _i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},_i(e)}function Ii(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ci(e,t,n){return(t=function(e){var t=function(e){if(\"object\"!=_i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=_i(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==_i(t)?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bi(e){var t=e.function(),n={},r=t.value();switch(t.switch().value){case 0:n.type=\"execute\",n.args={source:nr.fromScAddress(r.contractAddress()).toString(),function:r.functionName(),args:r.args().map(function(e){return Yo(e)})};break;case 1:case 2:var o=2===t.switch().value;n.type=\"create\",n.args={};var i=[r.executable(),r.contractIdPreimage()],a=i[0],s=i[1];if(!!a.switch().value!=!!s.switch().value)throw new Error(\"creation function appears invalid: \".concat(JSON.stringify(r),\" (should be wasm+address or token+asset)\"));switch(a.switch().value){case 0:var c=s.fromAddress();n.args.type=\"wasm\",n.args.wasm=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(n),!0).forEach(function(t){Ci(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({salt:c.salt().toString(\"hex\"),hash:a.wasmHash().toString(\"hex\"),address:nr.fromScAddress(c.address()).toString()},o&&{constructorArgs:r.constructorArgs().map(function(e){return Yo(e)})});break;case 1:n.args.type=\"sac\",n.args.asset=Gt.fromOperation(s.fromAsset()).toString();break;default:throw new Error(\"unknown creation type: \".concat(JSON.stringify(a)))}break;default:throw new Error(\"unknown invocation type (\".concat(t.switch(),\"): \").concat(JSON.stringify(t)))}return n.invocations=e.subInvocations().map(function(e){return Bi(e)}),n}function Pi(e,t){Ri(e,1,t)}function Ri(e,t,n,r){!1!==n(e,t,r)&&e.subInvocations().forEach(function(r){return Ri(r,t+1,n,e)})}const ji=(e=n.hmd(e)).exports},453(e,t,n){\"use strict\";var r,o=n(9612),i=n(9383),a=n(1237),s=n(9290),c=n(9538),u=n(8068),l=n(9675),f=n(5345),p=n(1514),d=n(8968),h=n(6188),y=n(8002),g=n(5880),m=n(414),v=n(3093),b=Function,w=function(e){try{return b('\"use strict\"; return ('+e+\").constructor;\")()}catch(e){}},S=n(5795),A=n(655),E=function(){throw new l},x=S?function(){try{return E}catch(e){try{return S(arguments,\"callee\").get}catch(e){return E}}}():E,T=n(4039)(),k=n(3628),O=n(1064),_=n(8648),I=n(1002),C=n(76),B={},P=\"undefined\"!=typeof Uint8Array&&k?k(Uint8Array):r,R={__proto__:null,\"%AggregateError%\":\"undefined\"==typeof AggregateError?r:AggregateError,\"%Array%\":Array,\"%ArrayBuffer%\":\"undefined\"==typeof ArrayBuffer?r:ArrayBuffer,\"%ArrayIteratorPrototype%\":T&&k?k([][Symbol.iterator]()):r,\"%AsyncFromSyncIteratorPrototype%\":r,\"%AsyncFunction%\":B,\"%AsyncGenerator%\":B,\"%AsyncGeneratorFunction%\":B,\"%AsyncIteratorPrototype%\":B,\"%Atomics%\":\"undefined\"==typeof Atomics?r:Atomics,\"%BigInt%\":\"undefined\"==typeof BigInt?r:BigInt,\"%BigInt64Array%\":\"undefined\"==typeof BigInt64Array?r:BigInt64Array,\"%BigUint64Array%\":\"undefined\"==typeof BigUint64Array?r:BigUint64Array,\"%Boolean%\":Boolean,\"%DataView%\":\"undefined\"==typeof DataView?r:DataView,\"%Date%\":Date,\"%decodeURI%\":decodeURI,\"%decodeURIComponent%\":decodeURIComponent,\"%encodeURI%\":encodeURI,\"%encodeURIComponent%\":encodeURIComponent,\"%Error%\":i,\"%eval%\":eval,\"%EvalError%\":a,\"%Float16Array%\":\"undefined\"==typeof Float16Array?r:Float16Array,\"%Float32Array%\":\"undefined\"==typeof Float32Array?r:Float32Array,\"%Float64Array%\":\"undefined\"==typeof Float64Array?r:Float64Array,\"%FinalizationRegistry%\":\"undefined\"==typeof FinalizationRegistry?r:FinalizationRegistry,\"%Function%\":b,\"%GeneratorFunction%\":B,\"%Int8Array%\":\"undefined\"==typeof Int8Array?r:Int8Array,\"%Int16Array%\":\"undefined\"==typeof Int16Array?r:Int16Array,\"%Int32Array%\":\"undefined\"==typeof Int32Array?r:Int32Array,\"%isFinite%\":isFinite,\"%isNaN%\":isNaN,\"%IteratorPrototype%\":T&&k?k(k([][Symbol.iterator]())):r,\"%JSON%\":\"object\"==typeof JSON?JSON:r,\"%Map%\":\"undefined\"==typeof Map?r:Map,\"%MapIteratorPrototype%\":\"undefined\"!=typeof Map&&T&&k?k((new Map)[Symbol.iterator]()):r,\"%Math%\":Math,\"%Number%\":Number,\"%Object%\":o,\"%Object.getOwnPropertyDescriptor%\":S,\"%parseFloat%\":parseFloat,\"%parseInt%\":parseInt,\"%Promise%\":\"undefined\"==typeof Promise?r:Promise,\"%Proxy%\":\"undefined\"==typeof Proxy?r:Proxy,\"%RangeError%\":s,\"%ReferenceError%\":c,\"%Reflect%\":\"undefined\"==typeof Reflect?r:Reflect,\"%RegExp%\":RegExp,\"%Set%\":\"undefined\"==typeof Set?r:Set,\"%SetIteratorPrototype%\":\"undefined\"!=typeof Set&&T&&k?k((new Set)[Symbol.iterator]()):r,\"%SharedArrayBuffer%\":\"undefined\"==typeof SharedArrayBuffer?r:SharedArrayBuffer,\"%String%\":String,\"%StringIteratorPrototype%\":T&&k?k(\"\"[Symbol.iterator]()):r,\"%Symbol%\":T?Symbol:r,\"%SyntaxError%\":u,\"%ThrowTypeError%\":x,\"%TypedArray%\":P,\"%TypeError%\":l,\"%Uint8Array%\":\"undefined\"==typeof Uint8Array?r:Uint8Array,\"%Uint8ClampedArray%\":\"undefined\"==typeof Uint8ClampedArray?r:Uint8ClampedArray,\"%Uint16Array%\":\"undefined\"==typeof Uint16Array?r:Uint16Array,\"%Uint32Array%\":\"undefined\"==typeof Uint32Array?r:Uint32Array,\"%URIError%\":f,\"%WeakMap%\":\"undefined\"==typeof WeakMap?r:WeakMap,\"%WeakRef%\":\"undefined\"==typeof WeakRef?r:WeakRef,\"%WeakSet%\":\"undefined\"==typeof WeakSet?r:WeakSet,\"%Function.prototype.call%\":C,\"%Function.prototype.apply%\":I,\"%Object.defineProperty%\":A,\"%Object.getPrototypeOf%\":O,\"%Math.abs%\":p,\"%Math.floor%\":d,\"%Math.max%\":h,\"%Math.min%\":y,\"%Math.pow%\":g,\"%Math.round%\":m,\"%Math.sign%\":v,\"%Reflect.getPrototypeOf%\":_};if(k)try{null.error}catch(e){var j=k(k(e));R[\"%Error.prototype%\"]=j}var U=function e(t){var n;if(\"%AsyncFunction%\"===t)n=w(\"async function () {}\");else if(\"%GeneratorFunction%\"===t)n=w(\"function* () {}\");else if(\"%AsyncGeneratorFunction%\"===t)n=w(\"async function* () {}\");else if(\"%AsyncGenerator%\"===t){var r=e(\"%AsyncGeneratorFunction%\");r&&(n=r.prototype)}else if(\"%AsyncIteratorPrototype%\"===t){var o=e(\"%AsyncGenerator%\");o&&k&&(n=k(o.prototype))}return R[t]=n,n},F={__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\"]},N=n(6743),L=n(9957),M=N.call(C,Array.prototype.concat),D=N.call(I,Array.prototype.splice),q=N.call(C,String.prototype.replace),V=N.call(C,String.prototype.slice),z=N.call(C,RegExp.prototype.exec),K=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,H=/\\\\(\\\\)?/g,$=function(e,t){var n,r=e;if(L(F,r)&&(r=\"%\"+(n=F[r])[0]+\"%\"),L(R,r)){var o=R[r];if(o===B&&(o=U(r)),void 0===o&&!t)throw new l(\"intrinsic \"+e+\" exists, but is not available. Please file an issue!\");return{alias:n,name:r,value:o}}throw new u(\"intrinsic \"+e+\" does not exist!\")};e.exports=function(e,t){if(\"string\"!=typeof e||0===e.length)throw new l(\"intrinsic name must be a non-empty string\");if(arguments.length>1&&\"boolean\"!=typeof t)throw new l('\"allowMissing\" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,e))throw new u(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");var n=function(e){var t=V(e,0,1),n=V(e,-1);if(\"%\"===t&&\"%\"!==n)throw new u(\"invalid intrinsic syntax, expected closing `%`\");if(\"%\"===n&&\"%\"!==t)throw new u(\"invalid intrinsic syntax, expected opening `%`\");var r=[];return q(e,K,function(e,t,n,o){r[r.length]=n?q(o,H,\"$1\"):t||e}),r}(e),r=n.length>0?n[0]:\"\",o=$(\"%\"+r+\"%\",t),i=o.name,a=o.value,s=!1,c=o.alias;c&&(r=c[0],D(n,M([0,1],c)));for(var f=1,p=!0;f<n.length;f+=1){var d=n[f],h=V(d,0,1),y=V(d,-1);if(('\"'===h||\"'\"===h||\"`\"===h||'\"'===y||\"'\"===y||\"`\"===y)&&h!==y)throw new u(\"property names with quotes must have matching quotes\");if(\"constructor\"!==d&&p||(s=!0),L(R,i=\"%\"+(r+=\".\"+d)+\"%\"))a=R[i];else if(null!=a){if(!(d in a)){if(!t)throw new l(\"base intrinsic for \"+e+\" exists, but the property is not available.\");return}if(S&&f+1>=n.length){var g=S(a,d);a=(p=!!g)&&\"get\"in g&&!(\"originalValue\"in g.get)?g.get:a[d]}else p=L(a,d),a=a[d];p&&!s&&(R[i]=a)}}return a}},487(e,t,n){\"use strict\";var r=n(6897),o=n(655),i=n(3126),a=n(2205);e.exports=function(e){var t=i(arguments),n=e.length-(arguments.length-1);return r(t,1+(n>0?n:0),!0)},o?o(e.exports,\"apply\",{value:a}):e.exports.apply=a},537(e,t,n){var r=n(5606),o=n(6763),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},a=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(l(arguments[n]));return t.join(\" \")}n=1;for(var r=arguments,o=r.length,i=String(e).replace(a,function(e){if(\"%%\"===e)return\"%\";if(n>=o)return e;switch(e){case\"%s\":return String(r[n++]);case\"%d\":return Number(r[n++]);case\"%j\":try{return JSON.stringify(r[n++])}catch(e){return\"[Circular]\"}default:return e}}),s=r[n];n<o;s=r[++n])v(s)||!E(s)?i+=\" \"+s:i+=\" \"+l(s);return i},t.deprecate=function(e,n){if(void 0!==r&&!0===r.noDeprecation)return e;if(void 0===r)return function(){return t.deprecate(e,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(r.throwDeprecation)throw new Error(n);r.traceDeprecation?o.trace(n):o.error(n),i=!0}return e.apply(this,arguments)}};var s={},c=/^$/;if(r.env.NODE_DEBUG){var u=r.env.NODE_DEBUG;u=u.replace(/[|\\\\{}()[\\]^$+?.]/g,\"\\\\$&\").replace(/\\*/g,\".*\").replace(/,/g,\"$|^\").toUpperCase(),c=new RegExp(\"^\"+u+\"$\",\"i\")}function l(e,n){var r={seen:[],stylize:p};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),S(r.showHidden)&&(r.showHidden=!1),S(r.depth)&&(r.depth=2),S(r.colors)&&(r.colors=!1),S(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=f),d(r,e,r.depth)}function f(e,t){var n=l.styles[t];return n?\"\u001b[\"+l.colors[n][0]+\"m\"+e+\"\u001b[\"+l.colors[n][1]+\"m\":e}function p(e,t){return e}function d(e,n,r){if(e.customInspect&&n&&k(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return w(o)||(o=d(e,o,r)),o}var i=function(e,t){if(S(t))return e.stylize(\"undefined\",\"undefined\");if(w(t)){var n=\"'\"+JSON.stringify(t).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(n,\"string\")}return b(t)?e.stylize(\"\"+t,\"number\"):m(t)?e.stylize(\"\"+t,\"boolean\"):v(t)?e.stylize(\"null\",\"null\"):void 0}(e,n);if(i)return i;var a=Object.keys(n),s=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),T(n)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return h(n);if(0===a.length){if(k(n)){var c=n.name?\": \"+n.name:\"\";return e.stylize(\"[Function\"+c+\"]\",\"special\")}if(A(n))return e.stylize(RegExp.prototype.toString.call(n),\"regexp\");if(x(n))return e.stylize(Date.prototype.toString.call(n),\"date\");if(T(n))return h(n)}var u,l=\"\",f=!1,p=[\"{\",\"}\"];return g(n)&&(f=!0,p=[\"[\",\"]\"]),k(n)&&(l=\" [Function\"+(n.name?\": \"+n.name:\"\")+\"]\"),A(n)&&(l=\" \"+RegExp.prototype.toString.call(n)),x(n)&&(l=\" \"+Date.prototype.toUTCString.call(n)),T(n)&&(l=\" \"+h(n)),0!==a.length||f&&0!=n.length?r<0?A(n)?e.stylize(RegExp.prototype.toString.call(n),\"regexp\"):e.stylize(\"[Object]\",\"special\"):(e.seen.push(n),u=f?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a<s;++a)C(t,String(a))?i.push(y(e,t,n,r,String(a),!0)):i.push(\"\");return o.forEach(function(o){o.match(/^\\d+$/)||i.push(y(e,t,n,r,o,!0))}),i}(e,n,r,s,a):a.map(function(t){return y(e,n,r,s,t,f)}),e.seen.pop(),function(e,t,n){var r=e.reduce(function(e,t){return t.indexOf(\"\\n\"),e+t.replace(/\\u001b\\[\\d\\d?m/g,\"\").length+1},0);return r>60?n[0]+(\"\"===t?\"\":t+\"\\n \")+\" \"+e.join(\",\\n  \")+\" \"+n[1]:n[0]+t+\" \"+e.join(\", \")+\" \"+n[1]}(u,l,p)):p[0]+l+p[1]}function h(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function y(e,t,n,r,o,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=c.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):c.set&&(s=e.stylize(\"[Setter]\",\"special\")),C(r,o)||(a=\"[\"+o+\"]\"),s||(e.seen.indexOf(c.value)<0?(s=v(n)?d(e,c.value,null):d(e,c.value,n-1)).indexOf(\"\\n\")>-1&&(s=i?s.split(\"\\n\").map(function(e){return\"  \"+e}).join(\"\\n\").slice(2):\"\\n\"+s.split(\"\\n\").map(function(e){return\"   \"+e}).join(\"\\n\")):s=e.stylize(\"[Circular]\",\"special\")),S(a)){if(i&&o.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+o)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.slice(1,-1),a=e.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=e.stylize(a,\"string\"))}return a+\": \"+s}function g(e){return Array.isArray(e)}function m(e){return\"boolean\"==typeof e}function v(e){return null===e}function b(e){return\"number\"==typeof e}function w(e){return\"string\"==typeof e}function S(e){return void 0===e}function A(e){return E(e)&&\"[object RegExp]\"===O(e)}function E(e){return\"object\"==typeof e&&null!==e}function x(e){return E(e)&&\"[object Date]\"===O(e)}function T(e){return E(e)&&(\"[object Error]\"===O(e)||e instanceof Error)}function k(e){return\"function\"==typeof e}function O(e){return Object.prototype.toString.call(e)}function _(e){return e<10?\"0\"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(c.test(e)){var n=r.pid;s[e]=function(){var r=t.format.apply(t,arguments);o.error(\"%s %d: %s\",e,n,r)}}else s[e]=function(){};return s[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},t.types=n(9032),t.isArray=g,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return\"symbol\"==typeof e},t.isUndefined=S,t.isRegExp=A,t.types.isRegExp=A,t.isObject=E,t.isDate=x,t.types.isDate=x,t.isError=T,t.types.isNativeError=T,t.isFunction=k,t.isPrimitive=function(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||void 0===e},t.isBuffer=n(1135);var I=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;o.log(\"%s - %s\",(n=[_((e=new Date).getHours()),_(e.getMinutes()),_(e.getSeconds())].join(\":\"),[e.getDate(),I[e.getMonth()],n].join(\" \")),t.format.apply(t,arguments))},t.inherits=n(6698),t._extend=function(e,t){if(!t||!E(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var B=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function P(e,t){if(!e){var n=new Error(\"Promise was rejected with a falsy value\");n.reason=e,e=n}return t(e)}t.promisify=function(e){if(\"function\"!=typeof e)throw new TypeError('The \"original\" argument must be of type Function');if(B&&e[B]){var t;if(\"function\"!=typeof(t=e[B]))throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');return Object.defineProperty(t,B,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,r){e?n(e):t(r)});try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),B&&Object.defineProperty(t,B,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=B,t.callbackify=function(e){if(\"function\"!=typeof e)throw new TypeError('The \"original\" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var o=t.pop();if(\"function\"!=typeof o)throw new TypeError(\"The last argument must be of type Function\");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then(function(e){r.nextTick(a.bind(null,null,e))},function(e){r.nextTick(P.bind(null,e,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},592(e,t,n){\"use strict\";var r=n(655),o=function(){return!!r};o.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],\"length\",{value:1}).length}catch(e){return!0}},e.exports=o},655(e){\"use strict\";var t=Object.defineProperty||!1;if(t)try{t({},\"a\",{value:1})}catch(e){t=!1}e.exports=t},1002(e){\"use strict\";e.exports=Function.prototype.apply},1064(e,t,n){\"use strict\";var r=n(9612);e.exports=r.getPrototypeOf||null},1093(e){\"use strict\";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r=\"[object Arguments]\"===n;return r||(r=\"[object Array]\"!==n&&null!==e&&\"object\"==typeof e&&\"number\"==typeof e.length&&e.length>=0&&\"[object Function]\"===t.call(e.callee)),r}},1135(e){e.exports=function(e){return e&&\"object\"==typeof e&&\"function\"==typeof e.copy&&\"function\"==typeof e.fill&&\"function\"==typeof e.readUInt8}},1189(e,t,n){\"use strict\";var r=Array.prototype.slice,o=n(1093),i=Object.keys,a=i?function(e){return i(e)}:n(8875),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(r.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1237(e){\"use strict\";e.exports=EvalError},1333(e){\"use strict\";e.exports=function(){if(\"function\"!=typeof Symbol||\"function\"!=typeof Object.getOwnPropertySymbols)return!1;if(\"symbol\"==typeof Symbol.iterator)return!0;var e={},t=Symbol(\"test\"),n=Object(t);if(\"string\"==typeof t)return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(t))return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if(\"function\"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if(\"function\"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(\"function\"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},1514(e){\"use strict\";e.exports=Math.abs},2205(e,t,n){\"use strict\";var r=n(6743),o=n(1002),i=n(3144);e.exports=function(){return i(r,o,arguments)}},2299(e,t,n){\"use strict\";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if(\"string\"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e){return i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},i(e)}var a=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},c=function(e){var t=[];return e.forEach(function(e,n){return t.push([n,e])}),t},u=Object.is?Object.is:n(7653),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:n(4133);function p(e){return e.call.bind(e)}var d=p(Object.prototype.hasOwnProperty),h=p(Object.prototype.propertyIsEnumerable),y=p(Object.prototype.toString),g=n(537).types,m=g.isAnyArrayBuffer,v=g.isArrayBufferView,b=g.isDate,w=g.isMap,S=g.isRegExp,A=g.isSet,E=g.isNativeError,x=g.isBoxedPrimitive,T=g.isNumberObject,k=g.isStringObject,O=g.isBooleanObject,_=g.isBigIntObject,I=g.isSymbolObject,C=g.isFloat32Array,B=g.isFloat64Array;function P(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(n<48||n>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(P).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function j(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function U(e,t,n,r){if(e===t)return 0!==e||!n||u(e,t);if(n){if(\"object\"!==i(e))return\"number\"==typeof e&&f(e)&&f(t);if(\"object\"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||\"object\"!==i(e))return(null===t||\"object\"!==i(t))&&e==t;if(null===t||\"object\"!==i(t))return!1}var o,s,c,l,p=y(e);if(p!==y(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=R(e),h=R(t);return d.length===h.length&&N(e,t,n,r,1,d)}if(\"[object Object]\"===p&&(!w(e)&&w(t)||!A(e)&&A(t)))return!1;if(b(e)){if(!b(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(S(e)){if(!S(t)||(c=e,l=t,!(a?c.source===l.source&&c.flags===l.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(l))))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(n||!C(e)&&!B(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===j(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}(e,t))return!1;var g=R(e),P=R(t);return g.length===P.length&&N(e,t,n,r,0,g)}if(A(e))return!(!A(t)||e.size!==t.size)&&N(e,t,n,r,2);if(w(e))return!(!w(t)||e.size!==t.size)&&N(e,t,n,r,3);if(m(e)){if(s=t,(o=e).byteLength!==s.byteLength||0!==j(new Uint8Array(o),new Uint8Array(s)))return!1}else if(x(e)&&!function(e,t){return T(e)?T(t)&&u(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):k(e)?k(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):O(e)?O(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):_(e)?_(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):I(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return N(e,t,n,r,0)}function F(e,t){return t.filter(function(t){return h(e,t)})}function N(e,t,n,o,a,u){if(5===arguments.length){u=Object.keys(e);var f=Object.keys(t);if(u.length!==f.length)return!1}for(var p=0;p<u.length;p++)if(!d(t,u[p]))return!1;if(n&&5===arguments.length){var y=l(e);if(0!==y.length){var g=0;for(p=0;p<y.length;p++){var m=y[p];if(h(e,m)){if(!h(t,m))return!1;u.push(m),g++}else if(h(t,m))return!1}var v=l(t);if(y.length!==v.length&&F(t,v).length!==g)return!1}else{var b=l(t);if(0!==b.length&&0!==F(t,b).length)return!1}}if(0===u.length&&(0===a||1===a&&0===e.length||0===e.size))return!0;if(void 0===o)o={val1:new Map,val2:new Map,position:0};else{var w=o.val1.get(e);if(void 0!==w){var S=o.val2.get(t);if(void 0!==S)return w===S}o.position++}o.val1.set(e,o.position),o.val2.set(t,o.position);var A=function(e,t,n,o,a,u){var l=0;if(2===u){if(!function(e,t,n,r){for(var o=null,a=s(e),c=0;c<a.length;c++){var u=a[c];if(\"object\"===i(u)&&null!==u)null===o&&(o=new Set),o.add(u);else if(!t.has(u)){if(n)return!1;if(!D(e,t,u))return!1;null===o&&(o=new Set),o.add(u)}}if(null!==o){for(var l=s(t),f=0;f<l.length;f++){var p=l[f];if(\"object\"===i(p)&&null!==p){if(!L(o,p,n,r))return!1}else if(!n&&!e.has(p)&&!L(o,p,n,r))return!1}return 0===o.size}return!0}(e,t,n,a))return!1}else if(3===u){if(!function(e,t,n,o){for(var a=null,s=c(e),u=0;u<s.length;u++){var l=r(s[u],2),f=l[0],p=l[1];if(\"object\"===i(f)&&null!==f)null===a&&(a=new Set),a.add(f);else{var d=t.get(f);if(void 0===d&&!t.has(f)||!U(p,d,n,o)){if(n)return!1;if(!q(e,t,f,p,o))return!1;null===a&&(a=new Set),a.add(f)}}}if(null!==a){for(var h=c(t),y=0;y<h.length;y++){var g=r(h[y],2),m=g[0],v=g[1];if(\"object\"===i(m)&&null!==m){if(!V(a,e,m,v,n,o))return!1}else if(!(n||e.has(m)&&U(e.get(m),v,!1,o)||V(a,e,m,v,!1,o)))return!1}return 0===a.size}return!0}(e,t,n,a))return!1}else if(1===u)for(;l<e.length;l++){if(!d(e,l)){if(d(t,l))return!1;for(var f=Object.keys(e);l<f.length;l++){var p=f[l];if(!d(t,p)||!U(e[p],t[p],n,a))return!1}return f.length===Object.keys(t).length}if(!d(t,l)||!U(e[l],t[l],n,a))return!1}for(l=0;l<o.length;l++){var h=o[l];if(!U(e[h],t[h],n,a))return!1}return!0}(e,t,n,u,o,a);return o.val1.delete(e),o.val2.delete(t),A}function L(e,t,n,r){for(var o=s(e),i=0;i<o.length;i++){var a=o[i];if(U(t,a,n,r))return e.delete(a),!0}return!1}function M(e){switch(i(e)){case\"undefined\":return null;case\"object\":return;case\"symbol\":return!1;case\"string\":e=+e;case\"number\":if(f(e))return!1}return!0}function D(e,t,n){var r=M(n);return null!=r?r:t.has(r)&&!e.has(r)}function q(e,t,n,r,o){var i=M(n);if(null!=i)return i;var a=t.get(i);return!(void 0===a&&!t.has(i)||!U(r,a,!1,o))&&!e.has(i)&&U(r,a,!1,o)}function V(e,t,n,r,o,i){for(var a=s(e),c=0;c<a.length;c++){var u=a[c];if(U(n,u,o,i)&&U(r,t.get(u),o,i))return e.delete(u),!0}return!1}e.exports={isDeepEqual:function(e,t){return U(e,t,!1)},isDeepStrictEqual:function(e,t){return U(e,t,!0)}}},2464(e,t,n){\"use strict\";var r=n(8452),o=n(6642);e.exports=function(){var e=o();return r(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2682(e,t,n){\"use strict\";var r=n(9600),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){if(!r(t))throw new TypeError(\"iterator must be a function\");var a,s;arguments.length>=3&&(a=n),s=e,\"[object Array]\"===o.call(s)?function(e,t,n){for(var r=0,o=e.length;r<o;r++)i.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,a):\"string\"==typeof e?function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)}(e,t,a):function(e,t,n){for(var r in e)i.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,a)}},2802(e,t,n){\"use strict\";e.exports=function(t){var n=t.toLowerCase(),r=e.exports[n];if(!r)throw new Error(n+\" is not supported (we accept pull requests)\");return new r},e.exports.sha=n(7816),e.exports.sha1=n(3737),e.exports.sha224=n(6710),e.exports.sha256=n(4107),e.exports.sha384=n(2827),e.exports.sha512=n(2890)},2827(e,t,n){\"use strict\";var r=n(6698),o=n(2890),i=n(392),a=n(2861).Buffer,s=new Array(160);function c(){this.init(),this._w=s,i.call(this,128,112)}r(c,o),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},2861(e,t,n){var r=n(8287),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,n){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return o(e,t,n)},a.alloc=function(e,t,n){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var r=o(e);return void 0!==t?\"string\"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return o(e)},a.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return r.SlowBuffer(e)}},2890(e,t,n){\"use strict\";var r=n(6698),o=n(392),i=n(2861).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}function u(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function p(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0<t>>>0?1:0}r(c,o),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,o=0|this._ch,i=0|this._dh,s=0|this._eh,c=0|this._fh,v=0|this._gh,b=0|this._hh,w=0|this._al,S=0|this._bl,A=0|this._cl,E=0|this._dl,x=0|this._el,T=0|this._fl,k=0|this._gl,O=0|this._hl,_=0;_<32;_+=2)t[_]=e.readInt32BE(4*_),t[_+1]=e.readInt32BE(4*_+4);for(;_<160;_+=2){var I=t[_-30],C=t[_-30+1],B=d(I,C),P=h(C,I),R=y(I=t[_-4],C=t[_-4+1]),j=g(C,I),U=t[_-14],F=t[_-14+1],N=t[_-32],L=t[_-32+1],M=P+F|0,D=B+U+m(M,P)|0;D=(D=D+R+m(M=M+j|0,j)|0)+N+m(M=M+L|0,L)|0,t[_]=D,t[_+1]=M}for(var q=0;q<160;q+=2){D=t[q],M=t[q+1];var V=l(n,r,o),z=l(w,S,A),K=f(n,w),H=f(w,n),$=p(s,x),G=p(x,s),W=a[q],X=a[q+1],Z=u(s,c,v),Y=u(x,T,k),J=O+G|0,Q=b+$+m(J,O)|0;Q=(Q=(Q=Q+Z+m(J=J+Y|0,Y)|0)+W+m(J=J+X|0,X)|0)+D+m(J=J+M|0,M)|0;var ee=H+z|0,te=K+V+m(ee,H)|0;b=v,O=k,v=c,k=T,c=s,T=x,s=i+Q+m(x=E+J|0,E)|0,i=o,E=A,o=r,A=S,r=n,S=w,n=Q+te+m(w=J+ee|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+S|0,this._cl=this._cl+A|0,this._dl=this._dl+E|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+k|0,this._hl=this._hl+O|0,this._ah=this._ah+n+m(this._al,w)|0,this._bh=this._bh+r+m(this._bl,S)|0,this._ch=this._ch+o+m(this._cl,A)|0,this._dh=this._dh+i+m(this._dl,E)|0,this._eh=this._eh+s+m(this._el,x)|0,this._fh=this._fh+c+m(this._fl,T)|0,this._gh=this._gh+v+m(this._gl,k)|0,this._hh=this._hh+b+m(this._hl,O)|0},c.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},3003(e){\"use strict\";e.exports=function(e){return e!=e}},3093(e,t,n){\"use strict\";var r=n(4459);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},3126(e,t,n){\"use strict\";var r=n(6743),o=n(9675),i=n(76),a=n(3144);e.exports=function(e){if(e.length<1||\"function\"!=typeof e[0])throw new o(\"a function is required\");return a(r,i,e)}},3144(e,t,n){\"use strict\";var r=n(6743),o=n(1002),i=n(76),a=n(7119);e.exports=a||r.call(i,o)},3628(e,t,n){\"use strict\";var r=n(8648),o=n(1064),i=n(7176);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||\"object\"!=typeof e&&\"function\"!=typeof e)throw new TypeError(\"getProto: not an object\");return o(e)}:i?function(e){return i(e)}:null},3737(e,t,n){\"use strict\";var r=n(6698),o=n(392),i=n(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,o.call(this,64,56)}function u(e){return e<<1|e>>>31}function l(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function p(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(c,o),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=u(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var d=0;d<80;++d){var h=~~(d/20),y=l(n)+p(h,r,o,i)+s+t[d]+a[h]|0;s=i,i=o,o=f(r),r=n,n=y}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0},c.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},3740(e,t,n){var r,o=n(6763);r=()=>(()=>{var e={348(e,t,n){const r=n(928);e.exports=r},350(e,t){\"use strict\";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,f=c>0?a-4:a;for(n=0;n<f;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,c=r-o;s<c;s+=a)i.push(u(e,s,s+a>c?c:s+a));return 1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+\"==\")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),i.join(\"\")};for(var n=[],r=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var n=e.indexOf(\"=\");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(c(r));return o.join(\"\")}r[\"-\".charCodeAt(0)]=62,r[\"_\".charCodeAt(0)]=63},686(e,t,n){\"use strict\";const r=n(350),i=n(947),a=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.hp=u,t.IS=50;const s=2147483647;function c(e){if(e>s)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return p(e)}return l(e,t,n)}function l(e,t,n){if(\"string\"==typeof e)return function(e,t){if(\"string\"==typeof t&&\"\"!==t||(t=\"utf8\"),!u.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const n=0|g(e,t);let r=c(n);const o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,n);if(\"undefined\"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const o=function(e){if(u.isBuffer(e)){const t=0|y(e.length),n=c(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?\"number\"!=typeof e.length||Y(e.length)?c(0):d(e):\"Buffer\"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive](\"string\"),t,n);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function f(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function p(e){return f(e),c(e<0?0:0|y(e))}function d(e){const t=e.length<0?0:0|y(e.length),n=c(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('\"length\" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function y(e){if(e>=s)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+s.toString(16)+\" bytes\");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return n;case\"utf8\":case\"utf-8\":return G(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*n;case\"hex\":return n>>>1;case\"base64\":return W(e).length;default:if(o)return r?-1:G(e).length;t=(\"\"+t).toLowerCase(),o=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return\"\";if((n>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return B(this,t,n);case\"utf8\":case\"utf-8\":return O(this,t,n);case\"ascii\":return I(this,t,n);case\"latin1\":case\"binary\":return C(this,t,n);case\"base64\":return k(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return P(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0}}function v(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if(\"string\"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,o);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,o);throw new TypeError(\"val must be string, number or Buffer\")}function w(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&(\"ucs2\"===(r=String(r).toLowerCase())||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===c)return r*a}else-1!==r&&(i-=i-r),r=-1}else for(n+c>s&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;r<c;r++)if(u(e,i+r)!==u(t,r)){n=!1;break}if(n)return i}return-1}function S(e,t,n,r){n=Number(n)||0;const o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(Y(r))return a;e[n+a]=r}return a}function A(e,t,n,r){return X(G(t,e.length-n),e,n,r)}function E(e,t,n,r){return X(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return X(W(t),e,n,r)}function T(e,t,n,r){return X(function(e,t){let n,r,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o<n;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let n=\"\",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=_));return n}(r)}u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||void 0===o||\"function\"!=typeof o.error||o.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(u.prototype,\"parent\",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,\"offset\",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return f(e),e<=0?c(e):void 0!==t?\"string\"==typeof n?c(e).fill(t,n):c(e).fill(t):c(e)}(e,t,n)},u.allocUnsafe=function(e){return p(e)},u.allocUnsafeSlow=function(e){return p(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=u.allocUnsafe(t);let o=0;for(n=0;n<e.length;++n){let t=e[n];if(Z(t,Uint8Array))o+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!u.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?\"\":0===arguments.length?O(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e=\"\";const n=t.IS;return e=this.toString(\"hex\",0,n).replace(/(.{2})/g,\"$1 \").trim(),this.length>n&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,o){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError(\"out of range index\");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n);for(let e=0;e<s;++e)if(c[e]!==l[e]){i=c[e],a=l[e];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r=\"utf8\",n=this.length,t=0;else if(void 0===n&&\"string\"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");let i=!1;for(;;)switch(r){case\"hex\":return S(this,e,t,n);case\"utf8\":case\"utf-8\":return A(this,e,t,n);case\"ascii\":case\"latin1\":case\"binary\":return E(this,e,t,n);case\"base64\":return x(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return T(this,e,t,n);default:if(i)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function I(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function B(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let o=\"\";for(let r=t;r<n;++r)o+=J[e[r]];return o}function P(e,t,n){const r=e.slice(t,n);let o=\"\";for(let e=0;e<r.length-1;e+=2)o+=String.fromCharCode(r[e]+256*r[e+1]);return o}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function j(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('\"value\" argument is out of bounds');if(n+r>e.length)throw new RangeError(\"Index out of range\")}function U(e,t,n,r,o){z(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function F(e,t,n,r,o){z(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function N(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"Index out of range\")}function L(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Q(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),u.prototype.readBigUInt64BE=Q(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Q(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),u.prototype.readBigInt64BE=Q(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||j(this,e,t,n,Math.pow(2,8*n)-1,0);let o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||j(this,e,t,n,Math.pow(2,8*n)-1,0);let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Q(function(e,t=0){return U(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),u.prototype.writeBigUInt64BE=Q(function(e,t=0){return F(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);j(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);j(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Q(function(e,t=0){return U(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),u.prototype.writeBigInt64BE=Q(function(e,t=0){return F(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(n<0||n>=this.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const o=r-n;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},u.prototype.fill=function(e,t,n,r){if(\"string\"==typeof e){if(\"string\"==typeof t?(r=t,t=0,n=this.length):\"string\"==typeof n&&(r=n,n=this.length),void 0!==r&&\"string\"!=typeof r)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof r&&!u.isEncoding(r))throw new TypeError(\"Unknown encoding: \"+r);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===r&&t<128||\"latin1\"===r)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError(\"Out of range index\");if(n<=t)return this;let o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o<n;++o)this[o]=e;else{const i=u.isBuffer(e)?e:u.from(e,r),a=i.length;if(0===a)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(o=0;o<n-t;++o)this[o+t]=i[o%a]}return this};const D={};function q(e,t,n){D[e]=class extends n{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t=\"\",n=e.length;const r=\"-\"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function z(e,t,n,r,o,i){if(e>n||e<t){const r=\"bigint\"==typeof t?\"n\":\"\";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new D.ERR_OUT_OF_RANGE(\"value\",o,e)}!function(e,t,n){K(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,o,i)}function K(e,t){if(\"number\"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function H(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new D.ERR_OUT_OF_RANGE(n||\"offset\",\"an integer\",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(n||\"offset\",`>= ${n?1:0} and <= ${t}`,e)}q(\"ERR_BUFFER_OUT_OF_BOUNDS\",function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"},RangeError),q(\"ERR_INVALID_ARG_TYPE\",function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`},TypeError),q(\"ERR_OUT_OF_RANGE\",function(e,t,n){let r=`The value of \"${e}\" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=V(String(n)):\"bigint\"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=V(o)),o+=\"n\"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const $=/[^+/0-9A-Za-z-_]/g;function G(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function W(e){return r.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace($,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function X(e,t,n,r){let o;for(o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function Q(e){return\"undefined\"==typeof BigInt?ee:e}function ee(){throw new Error(\"BigInt not supported\")}},928(e,t,n){\"use strict\";n.r(t),n.d(t,{Array:()=>V,Bool:()=>U,Double:()=>R,Enum:()=>$,Float:()=>P,Hyper:()=>_,Int:()=>E,LargeInt:()=>O,Opaque:()=>M,Option:()=>K,Quadruple:()=>j,Reference:()=>G,String:()=>N,Struct:()=>W,Union:()=>Z,UnsignedHyper:()=>B,UnsignedInt:()=>C,VarArray:()=>z,VarOpaque:()=>q,Void:()=>H,XdrReader:()=>c,XdrWriter:()=>f,config:()=>ie});class r extends TypeError{constructor(e){super(`XDR Write Error: ${e}`)}}class o extends TypeError{constructor(e){super(`XDR Read Error: ${e}`)}}class i extends TypeError{constructor(e){super(`XDR Type Definition Error: ${e}`)}}class a extends i{constructor(){super(\"method not implemented, it should be overloaded in the descendant class.\")}}var s=n(686).hp;class c{constructor(e){if(!s.isBuffer(e)){if(!(e instanceof Array||Array.isArray(e)||ArrayBuffer.isView(e)))throw new o(`source invalid: ${e}`);e=s.from(e)}this._buffer=e,this._length=e.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(e){const t=this._index;if(this._index+=e,this._length<this._index)throw new o(\"attempt to read outside the boundary of the buffer\");const n=4-(e%4||4);if(n>0){for(let e=0;e<n;e++)if(0!==this._buffer[this._index+e])throw new o(\"invalid padding\");this._index+=n}return t}rewind(){this._index=0}remainingBytes(){return this._length-this._index}read(e){const t=this.advance(e);return this._buffer.subarray(t,t+e)}readInt32BE(){return this._buffer.readInt32BE(this.advance(4))}readUInt32BE(){return this._buffer.readUInt32BE(this.advance(4))}readBigInt64BE(){return this._buffer.readBigInt64BE(this.advance(8))}readBigUInt64BE(){return this._buffer.readBigUInt64BE(this.advance(8))}readFloatBE(){return this._buffer.readFloatBE(this.advance(4))}readDoubleBE(){return this._buffer.readDoubleBE(this.advance(8))}ensureInputConsumed(){if(this._index!==this._length)throw new o(\"invalid XDR contract typecast - source buffer not entirely consumed\")}}var u=n(686).hp;const l=8192;class f{constructor(e){\"number\"==typeof e?e=u.allocUnsafe(e):e instanceof u||(e=u.allocUnsafe(l)),this._buffer=e,this._length=e.length}_buffer;_length;_index=0;alloc(e){const t=this._index;return this._index+=e,this._length<this._index&&this.resize(this._index),t}resize(e){const t=Math.ceil(e/l)*l,n=u.allocUnsafe(t);this._buffer.copy(n,0,0,this._length),this._buffer=n,this._length=t}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(e,t){if(\"string\"==typeof e){const n=this.alloc(t);this._buffer.write(e,n,\"utf8\")}else{e instanceof u||(e=u.from(e));const n=this.alloc(t);e.copy(this._buffer,n,0,t)}const n=4-(t%4||4);if(n>0){const e=this.alloc(n);this._buffer.fill(0,e,this._index)}}writeInt32BE(e){const t=this.alloc(4);this._buffer.writeInt32BE(e,t)}writeUInt32BE(e){const t=this.alloc(4);this._buffer.writeUInt32BE(e,t)}writeBigInt64BE(e){const t=this.alloc(8);this._buffer.writeBigInt64BE(e,t)}writeBigUInt64BE(e){const t=this.alloc(8);this._buffer.writeBigUInt64BE(e,t)}writeFloatBE(e){const t=this.alloc(4);this._buffer.writeFloatBE(e,t)}writeDoubleBE(e){const t=this.alloc(8);this._buffer.writeDoubleBE(e,t)}static bufferChunkSize=l}var p=n(686).hp;class d{toXDR(e=\"raw\"){if(!this.write)return this.constructor.toXDR(this,e);const t=new f;return this.write(this,t),v(t.finalize(),e)}fromXDR(e,t=\"raw\"){if(!this.read)return this.constructor.fromXDR(e,t);const n=new c(b(e,t)),r=this.read(n);return n.ensureInputConsumed(),r}validateXDR(e,t=\"raw\"){try{return this.fromXDR(e,t),!0}catch(e){return!1}}static toXDR(e,t=\"raw\"){const n=new f;return this.write(e,n),v(n.finalize(),t)}static fromXDR(e,t=\"raw\"){const n=new c(b(e,t)),r=this.read(n);return n.ensureInputConsumed(),r}static validateXDR(e,t=\"raw\"){try{return this.fromXDR(e,t),!0}catch(e){return!1}}}class h extends d{static read(e){throw new a}static write(e,t){throw new a}static isValid(e){return!1}}class y extends d{isValid(e){return!1}}class g extends y{constructor(e){super(),this._maxDepth=e??g.DEFAULT_MAX_DEPTH}static checkDepth(e){if(void 0!==e){if(!Number.isFinite(e))throw new TypeError(`remainingDepth (current remaining decoding depth budget) must be a finite number, got ${typeof e}: ${e}`);if(e<0)throw new o(\"exceeded max decoding depth\")}}}g.DEFAULT_MAX_DEPTH=200,g._maxDepth=g.DEFAULT_MAX_DEPTH;class m extends TypeError{constructor(e){super(`Invalid format ${e}, must be one of \"raw\", \"hex\", \"base64\"`)}}function v(e,t){switch(t){case\"raw\":return e;case\"hex\":return e.toString(\"hex\");case\"base64\":return e.toString(\"base64\");default:throw new m(t)}}function b(e,t){switch(t){case\"raw\":return e;case\"hex\":return p.from(e,\"hex\");case\"base64\":return p.from(e,\"base64\");default:throw new m(t)}}function w(e,t){return null!=e&&(e instanceof t||S(e,t)&&\"function\"==typeof e.constructor.read&&\"function\"==typeof e.constructor.write&&S(e,\"XdrType\"))}function S(e,t){do{if(e.constructor.name===t)return!0}while(e=Object.getPrototypeOf(e));return!1}const A=2147483647;class E extends h{static read(e){return e.readInt32BE()}static write(e,t){if(\"number\"!=typeof e)throw new r(\"not a number\");if((0|e)!==e)throw new r(\"invalid i32 value\");t.writeInt32BE(e)}static isValid(e){return\"number\"==typeof e&&(0|e)===e&&e>=-2147483648&&e<=A}}function x(e,t){return`${t?\"u\":\"i\"}${e}`}function T(e,t){if(t)return[0n,(1n<<BigInt(e))-1n];const n=1n<<BigInt(e-1);return[0n-n,n-1n]}function k(e,t){const n=BigInt.asIntN(t,e)===e,r=BigInt.asUintN(t,e)===e;if(!n&&!r)throw new RangeError(`slice value ${e} does not fit in ${t} bits`)}E.MAX_VALUE=A,E.MIN_VALUE=2147483648;class O extends h{constructor(e){super(),this._value=function(e,t,n){e instanceof Array?e.length&&e[0]instanceof Array&&(e=e[0]):e=[e];const r=t/e.length;switch(r){case 32:case 64:case 128:case 256:break;default:throw new RangeError(`expected slices to fit in 32/64/128/256 bits, got ${e}`)}try{for(let t=0;t<e.length;t++)\"bigint\"!=typeof e[t]&&(e[t]=BigInt(e[t].valueOf()))}catch(t){throw new TypeError(`expected bigint-like values, got: ${e} (${t})`)}if(1===e.length){const r=e[0];if(n&&r<0n)throw new RangeError(`expected a positive value, got: ${e}`);const[o,i]=T(t,n);if(r<o||r>i)throw new RangeError(`bigint value ${r} for ${x(t,n)} out of range [${o}, ${i}]`);return r}let o=0n;for(let t=0;t<e.length;t++)k(e[t],r),o|=BigInt.asUintN(r,e[t])<<BigInt(t*r);n||(o=BigInt.asIntN(t,o));const[i,a]=T(t,n);if(o>=i&&o<=a)return o;throw new RangeError(`bigint values [${e}] for ${x(t,n)} out of range [${i}, ${a}]: ${o}`)}(e,this.size,this.unsigned)}get unsigned(){throw new a}get size(){throw new a}slice(e){return function(e,t,n){if(\"bigint\"!=typeof e)throw new TypeError(\"Expected bigint 'value', got \"+typeof e);const r=t/n;if(1===r)return[e];if(n<32||n>128||2!==r&&4!==r&&8!==r)throw new TypeError(`invalid bigint (${e}) and slice size (${t} -> ${n}) combination`);const o=BigInt(n),i=new Array(r);for(let t=0;t<r;t++)i[t]=BigInt.asIntN(n,e),e>>=o;return i}(this._value,this.size,e)}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}toBigInt(){return BigInt(this._value)}static read(e){const{size:t,unsigned:n}=this.prototype;return 64===t?new this(n?e.readBigUInt64BE():e.readBigInt64BE()):new this(...Array.from({length:t/64},()=>e.readBigUInt64BE()).reverse())}static write(e,t){if(e instanceof this)e=e._value;else if(\"bigint\"!=typeof e||e>this.MAX_VALUE||e<this.MIN_VALUE)throw new r(`${e} is not a ${this.name}`);const{unsigned:n,size:o}=this.prototype;if(64===o)n?t.writeBigUInt64BE(e):t.writeBigInt64BE(e);else{const r=n?e:BigInt.asUintN(o,e);for(let e=o/64-1;e>=0;e--)t.writeBigUInt64BE(r>>BigInt(64*e)&0xffffffffffffffffn)}}static isValid(e){return e instanceof this||\"bigint\"==typeof e&&e>=this.MIN_VALUE&&e<=this.MAX_VALUE}static fromString(e){return new this(e)}static MAX_VALUE=0n;static MIN_VALUE=0n;static defineIntBoundaries(){const[e,t]=T(this.prototype.size,this.prototype.unsigned);this.MIN_VALUE=e,this.MAX_VALUE=t}}class _ extends O{constructor(...e){super(e)}get low(){return 0|Number(0xffffffffn&this._value)}get high(){return 0|Number(this._value>>32n)}get size(){return 64}get unsigned(){return!1}static fromBits(e,t){return new this(e,t)}}_.defineIntBoundaries();const I=4294967295;class C extends h{static read(e){return e.readUInt32BE()}static write(e,t){if(\"number\"!=typeof e||!(e>=0&&e<=I)||e%1!=0)throw new r(\"invalid u32 value\");t.writeUInt32BE(e)}static isValid(e){return\"number\"==typeof e&&e%1==0&&e>=0&&e<=I}}C.MAX_VALUE=I,C.MIN_VALUE=0;class B extends O{constructor(...e){super(e)}get low(){return 0|Number(0xffffffffn&this._value)}get high(){return 0|Number(this._value>>32n)}get size(){return 64}get unsigned(){return!0}static fromBits(e,t){return new this(e,t)}}B.defineIntBoundaries();class P extends h{static read(e){return e.readFloatBE()}static write(e,t){if(\"number\"!=typeof e)throw new r(\"not a number\");t.writeFloatBE(e)}static isValid(e){return\"number\"==typeof e}}class R extends h{static read(e){return e.readDoubleBE()}static write(e,t){if(\"number\"!=typeof e)throw new r(\"not a number\");t.writeDoubleBE(e)}static isValid(e){return\"number\"==typeof e}}class j extends h{static read(){throw new i(\"quadruple not supported\")}static write(){throw new i(\"quadruple not supported\")}static isValid(){return!1}}class U extends h{static read(e){const t=E.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new o(`got ${t} when trying to read a bool`)}}static write(e,t){const n=e?1:0;E.write(n,t)}static isValid(e){return\"boolean\"==typeof e}}var F=n(686).hp;class N extends y{constructor(e=C.MAX_VALUE){super(),this._maxLength=e}read(e){const t=C.read(e);if(t>this._maxLength)throw new o(`saw ${t} length String, max allowed is ${this._maxLength}`);return e.read(t)}readString(e){return this.read(e).toString(\"utf8\")}write(e,t){const n=\"string\"==typeof e?F.byteLength(e,\"utf8\"):e.length;if(n>this._maxLength)throw new r(`got ${e.length} bytes, max allowed is ${this._maxLength}`);C.write(n,t),t.write(e,n)}isValid(e){return\"string\"==typeof e?F.byteLength(e,\"utf8\")<=this._maxLength:!!(e instanceof Array||F.isBuffer(e))&&e.length<=this._maxLength}}var L=n(686).hp;class M extends y{constructor(e){super(),this._length=e}read(e){return e.read(this._length)}write(e,t){const{length:n}=e;if(n!==this._length)throw new r(`got ${e.length} bytes, expected ${this._length}`);t.write(e,n)}isValid(e){return L.isBuffer(e)&&e.length===this._length}}var D=n(686).hp;class q extends y{constructor(e=C.MAX_VALUE){super(),this._maxLength=e}read(e){const t=C.read(e);if(t>this._maxLength)throw new o(`saw ${t} length VarOpaque, max allowed is ${this._maxLength}`);return e.read(t)}write(e,t){const{length:n}=e;if(e.length>this._maxLength)throw new r(`got ${e.length} bytes, max allowed is ${this._maxLength}`);C.write(n,t),t.write(e,n)}isValid(e){return D.isBuffer(e)&&e.length<=this._maxLength}}class V extends g{constructor(e,t,n=g.DEFAULT_MAX_DEPTH){super(n),this._childType=e,this._length=t}read(e,t=this._maxDepth){if(this._length>e.remainingBytes())throw new o(`Array length ${this._length} exceeds remaining ${e.remainingBytes()} bytes`);g.checkDepth(t);const n=[];for(let r=0;r<this._length;r++)n.push(this._childType.read(e,t-1));return n}write(e,t){if(!n.g.Array.isArray(e))throw new r(\"value is not array\");if(e.length!==this._length)throw new r(`got array of size ${e.length}, expected ${this._length}`);for(const n of e)this._childType.write(n,t)}isValid(e){if(!(e instanceof n.g.Array)||e.length!==this._length)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class z extends g{constructor(e,t=C.MAX_VALUE,n=g.DEFAULT_MAX_DEPTH){super(n),this._childType=e,this._maxLength=t}read(e,t=this._maxDepth){g.checkDepth(t);const n=C.read(e);if(n>this._maxLength)throw new o(`saw ${n} length VarArray, max allowed is ${this._maxLength}`);if(n>e.remainingBytes())throw new o(`VarArray length ${n} exceeds remaining ${e.remainingBytes()} bytes`);const r=[];for(let o=0;o<n;o++)r.push(this._childType.read(e,t-1));return r}write(e,t){if(!(e instanceof Array))throw new r(\"value is not array\");if(e.length>this._maxLength)throw new r(`got array of size ${e.length}, max allowed is ${this._maxLength}`);C.write(e.length,t);for(const n of e)this._childType.write(n,t)}isValid(e){if(!(e instanceof Array)||e.length>this._maxLength)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class K extends g{constructor(e,t=g.DEFAULT_MAX_DEPTH){super(t),this._childType=e}read(e,t=this._maxDepth){if(g.checkDepth(t),U.read(e))return this._childType.read(e,t-1)}write(e,t){const n=null!=e;U.write(n,t),n&&this._childType.write(e,t)}isValid(e){return null==e||this._childType.isValid(e)}}class H extends h{static read(){}static write(e){if(void 0!==e)throw new r(\"trying to write value to a void slot\")}static isValid(e){return void 0===e}}class $ extends h{constructor(e,t){super(),this.name=e,this.value=t}static read(e){const t=E.read(e),n=this._byValue[t];if(void 0===n)throw new o(`unknown ${this.enumName} member for value ${t}`);return n}static write(e,t){if(!this.isValid(e))throw new r(`${e} has enum name ${e?.enumName}, not ${this.enumName}: ${JSON.stringify(e)}`);E.write(e.value,t)}static isValid(e){return e?.constructor?.enumName===this.enumName||w(e,this)}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(e){const t=this._members[e];if(!t)throw new TypeError(`${e} is not a member of ${this.enumName}`);return t}static fromValue(e){const t=this._byValue[e];if(void 0===t)throw new TypeError(`${e} is not a value of any member of ${this.enumName}`);return t}static create(e,t,n){const r=class extends ${};r.enumName=t,e.results[t]=r,r._members={},r._byValue={};for(const[e,t]of Object.entries(n)){const n=new r(e,t);r._members[e]=n,r._byValue[t]=n,r[e]=()=>n}return r}}class G extends h{resolve(){throw new i('\"resolve\" method should be implemented in the descendant class')}}class W extends g{constructor(e,t){super(t??new.target?._maxDepth),this._attributes=e||{}}static read(e,t=this._maxDepth){g.checkDepth(t);const n={};for(const[r,o]of this._fields)n[r]=o.read(e,t-1);return new this(n,this._maxDepth)}static write(e,t){if(!this.isValid(e))throw new r(`${e} has struct name ${e?.constructor?.structName}, not ${this.structName}: ${JSON.stringify(e)}`);for(const[n,r]of this._fields){const o=e._attributes[n];r.write(o,t)}}static isValid(e){return e?.constructor?.structName===this.structName||w(e,this)}static create(e,t,n,r=g.DEFAULT_MAX_DEPTH){const o=class extends W{};o.structName=t,o._maxDepth=r,e.results[t]=o;const i=new Array(n.length);for(let t=0;t<n.length;t++){const r=n[t],a=r[0];let s=r[1];s instanceof G&&(s=s.resolve(e)),i[t]=[a,s],o.prototype[a]=X(a)}return o._fields=i,o}}function X(e){return function(t){return void 0!==t&&(this._attributes[e]=t),this._attributes[e]}}class Z extends g{constructor(e,t,n){super(n??new.target?._maxDepth),this.set(e,t)}set(e,t){\"string\"==typeof e&&(e=this.constructor._switchOn.fromName(e)),this._switch=e;const n=this.constructor.armForSwitch(this._switch);this._arm=n,this._armType=n===H?H:this.constructor._arms[n],this._value=t}get(e=this._arm){if(this._arm!==H&&this._arm!==e)throw new TypeError(`${e} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(e){const t=this._switches.get(e);if(void 0!==t)return t;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${e}`)}static armTypeForArm(e){return e===H?H:this._arms[e]}static read(e,t=this._maxDepth){g.checkDepth(t);const n=this._switchOn.read(e,t-1),r=this.armForSwitch(n),o=r===H?H:this._arms[r];let i;return i=void 0!==o?o.read(e,t-1):r.read(e,t-1),new this(n,i,this._maxDepth)}static write(e,t){if(!this.isValid(e))throw new r(`${e} has union name ${e?.unionName}, not ${this.unionName}: ${JSON.stringify(e)}`);this._switchOn.write(e.switch(),t),e.armType().write(e.value(),t)}static isValid(e){return e?.constructor?.unionName===this.unionName||w(e,this)}static create(e,t,n,r=g.DEFAULT_MAX_DEPTH){const o=class extends Z{};o.unionName=t,o._maxDepth=r,e.results[t]=o,n.switchOn instanceof G?o._switchOn=n.switchOn.resolve(e):o._switchOn=n.switchOn,o._switches=new Map,o._arms={};let i=n.defaultArm;i instanceof G&&(i=i.resolve(e)),o._defaultArm=i;for(const[e,t]of n.switches){const n=\"string\"==typeof e?o._switchOn.fromName(e):e;o._switches.set(n,t)}if(void 0!==o._switchOn.values)for(const e of o._switchOn.values())o[e.name]=function(t){return new o(e,t)},o.prototype[e.name]=function(t){return this.set(e,t)};if(n.arms)for(const[t,r]of Object.entries(n.arms))o._arms[t]=r instanceof G?r.resolve(e):r,r!==H&&(o.prototype[t]=function(){return this.get(t)});return o}}class Y extends G{constructor(e){super(),this.name=e}resolve(e){return e.definitions[this.name].resolve(e)}}class J extends G{constructor(e,t,n=!1){super(),this.childReference=e,this.length=t,this.variable=n}resolve(e){let t=this.childReference,n=this.length;return t instanceof G&&(t=t.resolve(e)),n instanceof G&&(n=n.resolve(e)),this.variable?new z(t,n):new V(t,n)}}class Q extends G{constructor(e){super(),this.childReference=e,this.name=e.name}resolve(e){let t=this.childReference;return t instanceof G&&(t=t.resolve(e)),new K(t)}}class ee extends G{constructor(e,t){super(),this.sizedType=e,this.length=t}resolve(e){let t=this.length;return t instanceof G&&(t=t.resolve(e)),new this.sizedType(t)}}class te{constructor(e,t,n){this.constructor=e,this.name=t,this.config=n}resolve(e){return this.name in e.results?e.results[this.name]:this.constructor(e,this.name,this.config)}}function ne(e,t,n){return n instanceof G&&(n=n.resolve(e)),e.results[t]=n,n}function re(e,t,n){return e.results[t]=n,n}class oe{constructor(e){this._destination=e,this._definitions={}}enum(e,t){const n=new te($.create,e,t);this.define(e,n)}struct(e,t){const n=new te(W.create,e,t);this.define(e,n)}union(e,t){const n=new te(Z.create,e,t);this.define(e,n)}typedef(e,t){const n=new te(ne,e,t);this.define(e,n)}const(e,t){const n=new te(re,e,t);this.define(e,n)}void(){return H}bool(){return U}int(){return E}hyper(){return _}uint(){return C}uhyper(){return B}float(){return P}double(){return R}quadruple(){return j}string(e){return new ee(N,e)}opaque(e){return new ee(M,e)}varOpaque(e){return new ee(q,e)}array(e,t){return new J(e,t)}varArray(e,t){return new J(e,t,!0)}option(e){return new Q(e)}define(e,t){if(void 0!==this._destination[e])throw new i(`${e} is already defined`);this._definitions[e]=t}lookup(e){return new Y(e)}resolve(){for(const e of Object.values(this._definitions))e.resolve({definitions:this._definitions,results:this._destination})}}function ie(e,t={}){if(e){const n=new oe(t);e(n),n.resolve()}return t}},947(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<<s)-1,u=c>>1,l=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=u}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<<u)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+d]=255&a,d+=h,a/=256,u-=8);e[n+d-h]|=128*y}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n(348)})(),e.exports=r()},3918(e,t,n){\"use strict\";var r=n(5606);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if(\"object\"!==g(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!==g(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"===g(t)?t:String(t)}function u(e,t){if(t&&(\"object\"===g(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return l(e)}function l(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}function f(e){var t=\"function\"==typeof Map?new Map:void 0;return f=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf(\"[native code]\")))return e;var n;if(\"function\"!=typeof e)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return p(e,arguments,y(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,e)},f(e)}function p(e,t,n){return p=d()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&h(o,n.prototype),o},p.apply(null,arguments)}function d(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function g(e){return g=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},g(e)}var m=n(537).inspect,v=n(9597).codes.ERR_INVALID_ARG_TYPE;function b(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}var w=\"\",S=\"\",A=\"\",E=\"\",x={deepStrictEqual:\"Expected values to be strictly deep-equal:\",strictEqual:\"Expected values to be strictly equal:\",strictEqualObject:'Expected \"actual\" to be reference-equal to \"expected\":',deepEqual:\"Expected values to be loosely deep-equal:\",equal:\"Expected values to be loosely equal:\",notDeepStrictEqual:'Expected \"actual\" not to be strictly deep-equal to:',notStrictEqual:'Expected \"actual\" to be strictly unequal to:',notStrictEqualObject:'Expected \"actual\" not to be reference-equal to \"expected\":',notDeepEqual:'Expected \"actual\" not to be loosely deep-equal to:',notEqual:'Expected \"actual\" to be loosely unequal to:',notIdentical:\"Values identical but not reference-equal:\"};function T(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,\"message\",{value:e.message}),n}function k(e){return m(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(e,t,n){var o=\"\",i=\"\",a=0,s=\"\",c=!1,u=k(e),l=u.split(\"\\n\"),f=k(t).split(\"\\n\"),p=0,d=\"\";if(\"strictEqual\"===n&&\"object\"===g(e)&&\"object\"===g(t)&&null!==e&&null!==t&&(n=\"strictEqualObject\"),1===l.length&&1===f.length&&l[0]!==f[0]){var h=l[0].length+f[0].length;if(h<=10){if(!(\"object\"===g(e)&&null!==e||\"object\"===g(t)&&null!==t||0===e&&0===t))return\"\".concat(x[n],\"\\n\\n\")+\"\".concat(l[0],\" !== \").concat(f[0],\"\\n\")}else if(\"strictEqualObject\"!==n&&h<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;l[0][p]===f[0][p];)p++;p>2&&(d=\"\\n  \".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return\"\";var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,n-e.length)}(\" \",p),\"^\"),p=0)}}for(var y=l[l.length-1],m=f[f.length-1];y===m&&(p++<2?s=\"\\n  \".concat(y).concat(s):o=y,l.pop(),f.pop(),0!==l.length&&0!==f.length);)y=l[l.length-1],m=f[f.length-1];var v=Math.max(l.length,f.length);if(0===v){var T=u.split(\"\\n\");if(T.length>30)for(T[26]=\"\".concat(w,\"...\").concat(E);T.length>27;)T.pop();return\"\".concat(x.notIdentical,\"\\n\\n\").concat(T.join(\"\\n\"),\"\\n\")}p>3&&(s=\"\\n\".concat(w,\"...\").concat(E).concat(s),c=!0),\"\"!==o&&(s=\"\\n  \".concat(o).concat(s),o=\"\");var O=0,_=x[n]+\"\\n\".concat(S,\"+ actual\").concat(E,\" \").concat(A,\"- expected\").concat(E),I=\" \".concat(w,\"...\").concat(E,\" Lines skipped\");for(p=0;p<v;p++){var C=p-a;if(l.length<p+1)C>1&&p>2&&(C>4?(i+=\"\\n\".concat(w,\"...\").concat(E),c=!0):C>3&&(i+=\"\\n  \".concat(f[p-2]),O++),i+=\"\\n  \".concat(f[p-1]),O++),a=p,o+=\"\\n\".concat(A,\"-\").concat(E,\" \").concat(f[p]),O++;else if(f.length<p+1)C>1&&p>2&&(C>4?(i+=\"\\n\".concat(w,\"...\").concat(E),c=!0):C>3&&(i+=\"\\n  \".concat(l[p-2]),O++),i+=\"\\n  \".concat(l[p-1]),O++),a=p,i+=\"\\n\".concat(S,\"+\").concat(E,\" \").concat(l[p]),O++;else{var B=f[p],P=l[p],R=P!==B&&(!b(P,\",\")||P.slice(0,-1)!==B);R&&b(B,\",\")&&B.slice(0,-1)===P&&(R=!1,P+=\",\"),R?(C>1&&p>2&&(C>4?(i+=\"\\n\".concat(w,\"...\").concat(E),c=!0):C>3&&(i+=\"\\n  \".concat(l[p-2]),O++),i+=\"\\n  \".concat(l[p-1]),O++),a=p,i+=\"\\n\".concat(S,\"+\").concat(E,\" \").concat(P),o+=\"\\n\".concat(A,\"-\").concat(E,\" \").concat(B),O+=2):(i+=o,o=\"\",1!==C&&0!==p||(i+=\"\\n  \".concat(P),O++))}if(O>20&&p<v-2)return\"\".concat(_).concat(I,\"\\n\").concat(i,\"\\n\").concat(w,\"...\").concat(E).concat(o,\"\\n\")+\"\".concat(w,\"...\").concat(E)}return\"\".concat(_).concat(c?I:\"\",\"\\n\").concat(i).concat(o).concat(s).concat(d)}var _=function(e,t){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&h(e,t)}(p,e);var n,o,a,c,f=(n=p,o=d(),function(){var e,t=y(n);if(o){var r=y(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return u(this,e)});function p(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,p),\"object\"!==g(e)||null===e)throw new v(\"options\",\"Object\",e);var n=e.message,o=e.operator,i=e.stackStartFn,a=e.actual,s=e.expected,c=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)t=f.call(this,String(n));else if(r.stderr&&r.stderr.isTTY&&(r.stderr&&r.stderr.getColorDepth&&1!==r.stderr.getColorDepth()?(w=\"\u001b[34m\",S=\"\u001b[32m\",E=\"\u001b[39m\",A=\"\u001b[31m\"):(w=\"\",S=\"\",E=\"\",A=\"\")),\"object\"===g(a)&&null!==a&&\"object\"===g(s)&&null!==s&&\"stack\"in a&&a instanceof Error&&\"stack\"in s&&s instanceof Error&&(a=T(a),s=T(s)),\"deepStrictEqual\"===o||\"strictEqual\"===o)t=f.call(this,O(a,s,o));else if(\"notDeepStrictEqual\"===o||\"notStrictEqual\"===o){var d=x[o],h=k(a).split(\"\\n\");if(\"notStrictEqual\"===o&&\"object\"===g(a)&&null!==a&&(d=x.notStrictEqualObject),h.length>30)for(h[26]=\"\".concat(w,\"...\").concat(E);h.length>27;)h.pop();t=1===h.length?f.call(this,\"\".concat(d,\" \").concat(h[0])):f.call(this,\"\".concat(d,\"\\n\\n\").concat(h.join(\"\\n\"),\"\\n\"))}else{var y=k(a),m=\"\",b=x[o];\"notDeepEqual\"===o||\"notEqual\"===o?(y=\"\".concat(x[o],\"\\n\\n\").concat(y)).length>1024&&(y=\"\".concat(y.slice(0,1021),\"...\")):(m=\"\".concat(k(s)),y.length>512&&(y=\"\".concat(y.slice(0,509),\"...\")),m.length>512&&(m=\"\".concat(m.slice(0,509),\"...\")),\"deepEqual\"===o||\"equal\"===o?y=\"\".concat(b,\"\\n\\n\").concat(y,\"\\n\\nshould equal\\n\\n\"):m=\" \".concat(o,\" \").concat(m)),t=f.call(this,\"\".concat(y).concat(m))}return Error.stackTraceLimit=c,t.generatedMessage=!n,Object.defineProperty(l(t),\"name\",{value:\"AssertionError [ERR_ASSERTION]\",enumerable:!1,writable:!0,configurable:!0}),t.code=\"ERR_ASSERTION\",t.actual=a,t.expected=s,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(l(t),i),t.stack,t.name=\"AssertionError\",u(t)}return a=p,(c=[{key:\"toString\",value:function(){return\"\".concat(this.name,\" [\").concat(this.code,\"]: \").concat(this.message)}},{key:t,value:function(e,t){return m(this,i(i({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,c),Object.defineProperty(a,\"prototype\",{writable:!1}),p}(f(Error),m.custom);e.exports=_},4035(e,t,n){\"use strict\";var r,o=n(6556),i=n(9092)(),a=n(9957),s=n(5795);if(i){var c=o(\"RegExp.prototype.exec\"),u={},l=function(){throw u},f={toString:l,valueOf:l};\"symbol\"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=l),r=function(e){if(!e||\"object\"!=typeof e)return!1;var t=s(e,\"lastIndex\");if(!t||!a(t,\"value\"))return!1;try{c(e,f)}catch(e){return e===u}}}else{var p=o(\"Object.prototype.toString\");r=function(e){return!(!e||\"object\"!=typeof e&&\"function\"!=typeof e)&&\"[object RegExp]\"===p(e)}}e.exports=r},4039(e,t,n){\"use strict\";var r=\"undefined\"!=typeof Symbol&&Symbol,o=n(1333);e.exports=function(){return\"function\"==typeof r&&\"function\"==typeof Symbol&&\"symbol\"==typeof r(\"foo\")&&\"symbol\"==typeof Symbol(\"bar\")&&o()}},4107(e,t,n){\"use strict\";var r=n(6698),o=n(392),i=n(2861).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}function u(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function p(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function h(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}r(c,o),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,c=0|this._f,y=0|this._g,g=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=h(t[m-2])+t[m-7]+d(t[m-15])+t[m-16]|0;for(var v=0;v<64;++v){var b=g+p(s)+u(s,c,y)+a[v]+t[v]|0,w=f(n)+l(n,r,o)|0;g=y,y=c,c=s,s=i+b|0,i=o,o=r,r=n,n=b+w|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0,this._f=c+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},4133(e,t,n){\"use strict\";var r=n(487),o=n(8452),i=n(3003),a=n(6642),s=n(2464),c=r(a(),Number);o(c,{getPolyfill:a,implementation:i,shim:s}),e.exports=c},4148(e,t,n){\"use strict\";var r=n(5606),o=n(6763);function i(e){return i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},i(e)}var a,s,c=n(9597).codes,u=c.ERR_AMBIGUOUS_ARGUMENT,l=c.ERR_INVALID_ARG_TYPE,f=c.ERR_INVALID_ARG_VALUE,p=c.ERR_INVALID_RETURN_VALUE,d=c.ERR_MISSING_ARGS,h=n(3918),y=n(537).inspect,g=n(537).types,m=g.isPromise,v=g.isRegExp,b=n(9133)(),w=n(9394)(),S=n(8075)(\"RegExp.prototype.test\");function A(){var e=n(2299);a=e.isDeepEqual,s=e.isDeepStrictEqual}new Map;var E=!1,x=e.exports=_,T={};function k(e){if(e.message instanceof Error)throw e.message;throw new h(e)}function O(e,t,n,r){if(!n){var o=!1;if(0===t)o=!0,r=\"No value argument passed to `assert.ok()`\";else if(r instanceof Error)throw r;var i=new h({actual:n,expected:!0,message:r,operator:\"==\",stackStartFn:e});throw i.generatedMessage=o,i}}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];O.apply(void 0,[_,t.length].concat(t))}x.fail=function e(t,n,i,a,s){var c,u=arguments.length;if(0===u?c=\"Failed\":1===u?(i=t,t=void 0):(!1===E&&(E=!0,(r.emitWarning?r.emitWarning:o.warn.bind(o))(\"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.\",\"DeprecationWarning\",\"DEP0094\")),2===u&&(a=\"!=\")),i instanceof Error)throw i;var l={actual:t,expected:n,operator:void 0===a?\"fail\":a,stackStartFn:s||e};void 0!==i&&(l.message=i);var f=new h(l);throw c&&(f.message=c,f.generatedMessage=!0),f},x.AssertionError=h,x.ok=_,x.equal=function e(t,n,r){if(arguments.length<2)throw new d(\"actual\",\"expected\");t!=n&&k({actual:t,expected:n,message:r,operator:\"==\",stackStartFn:e})},x.notEqual=function e(t,n,r){if(arguments.length<2)throw new d(\"actual\",\"expected\");t==n&&k({actual:t,expected:n,message:r,operator:\"!=\",stackStartFn:e})},x.deepEqual=function e(t,n,r){if(arguments.length<2)throw new d(\"actual\",\"expected\");void 0===a&&A(),a(t,n)||k({actual:t,expected:n,message:r,operator:\"deepEqual\",stackStartFn:e})},x.notDeepEqual=function e(t,n,r){if(arguments.length<2)throw new d(\"actual\",\"expected\");void 0===a&&A(),a(t,n)&&k({actual:t,expected:n,message:r,operator:\"notDeepEqual\",stackStartFn:e})},x.deepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new d(\"actual\",\"expected\");void 0===a&&A(),s(t,n)||k({actual:t,expected:n,message:r,operator:\"deepStrictEqual\",stackStartFn:e})},x.notDeepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new d(\"actual\",\"expected\");void 0===a&&A(),s(t,n)&&k({actual:t,expected:n,message:r,operator:\"notDeepStrictEqual\",stackStartFn:e})},x.strictEqual=function e(t,n,r){if(arguments.length<2)throw new d(\"actual\",\"expected\");w(t,n)||k({actual:t,expected:n,message:r,operator:\"strictEqual\",stackStartFn:e})},x.notStrictEqual=function e(t,n,r){if(arguments.length<2)throw new d(\"actual\",\"expected\");w(t,n)&&k({actual:t,expected:n,message:r,operator:\"notStrictEqual\",stackStartFn:e})};var I=function(e){return Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),n.forEach(function(e){e in t&&(void 0!==r&&\"string\"==typeof r[e]&&v(t[e])&&S(t[e],r[e])?o[e]=r[e]:o[e]=t[e])})});function C(e,t,n,r){if(\"function\"!=typeof t){if(v(t))return S(t,e);if(2===arguments.length)throw new l(\"expected\",[\"Function\",\"RegExp\"],t);if(\"object\"!==i(e)||null===e){var o=new h({actual:e,expected:t,message:n,operator:\"deepStrictEqual\",stackStartFn:r});throw o.operator=r.name,o}var c=Object.keys(t);if(t instanceof Error)c.push(\"name\",\"message\");else if(0===c.length)throw new f(\"error\",t,\"may not be an empty object\");return void 0===a&&A(),c.forEach(function(o){\"string\"==typeof e[o]&&v(t[o])&&S(t[o],e[o])||function(e,t,n,r,o,i){if(!(n in e)||!s(e[n],t[n])){if(!r){var a=new I(e,o),c=new I(t,o,e),u=new h({actual:a,expected:c,operator:\"deepStrictEqual\",stackStartFn:i});throw u.actual=e,u.expected=t,u.operator=i.name,u}k({actual:e,expected:t,message:r,operator:i.name,stackStartFn:i})}}(e,t,o,n,c,r)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function B(e){if(\"function\"!=typeof e)throw new l(\"fn\",\"Function\",e);try{e()}catch(e){return e}return T}function P(e){return m(e)||null!==e&&\"object\"===i(e)&&\"function\"==typeof e.then&&\"function\"==typeof e.catch}function R(e){return Promise.resolve().then(function(){var t;if(\"function\"==typeof e){if(!P(t=e()))throw new p(\"instance of Promise\",\"promiseFn\",t)}else{if(!P(e))throw new l(\"promiseFn\",[\"Function\",\"Promise\"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return T}).catch(function(e){return e})})}function j(e,t,n,r){if(\"string\"==typeof n){if(4===arguments.length)throw new l(\"error\",[\"Object\",\"Error\",\"Function\",\"RegExp\"],n);if(\"object\"===i(t)&&null!==t){if(t.message===n)throw new u(\"error/message\",'The error message \"'.concat(t.message,'\" is identical to the message.'))}else if(t===n)throw new u(\"error/message\",'The error \"'.concat(t,'\" is identical to the message.'));r=n,n=void 0}else if(null!=n&&\"object\"!==i(n)&&\"function\"!=typeof n)throw new l(\"error\",[\"Object\",\"Error\",\"Function\",\"RegExp\"],n);if(t===T){var o=\"\";n&&n.name&&(o+=\" (\".concat(n.name,\")\")),o+=r?\": \".concat(r):\".\";var a=\"rejects\"===e.name?\"rejection\":\"exception\";k({actual:void 0,expected:n,operator:e.name,message:\"Missing expected \".concat(a).concat(o),stackStartFn:e})}if(n&&!C(t,n,r,e))throw t}function U(e,t,n,r){if(t!==T){if(\"string\"==typeof n&&(r=n,n=void 0),!n||C(t,n)){var o=r?\": \".concat(r):\".\",i=\"doesNotReject\"===e.name?\"rejection\":\"exception\";k({actual:t,expected:n,operator:e.name,message:\"Got unwanted \".concat(i).concat(o,\"\\n\")+'Actual message: \"'.concat(t&&t.message,'\"'),stackStartFn:e})}throw t}}function F(e,t,n,r,o){if(!v(t))throw new l(\"regexp\",\"RegExp\",t);var a=\"match\"===o;if(\"string\"!=typeof e||S(t,e)!==a){if(n instanceof Error)throw n;var s=!n;n=n||(\"string\"!=typeof e?'The \"string\" argument must be of type string. Received type '+\"\".concat(i(e),\" (\").concat(y(e),\")\"):(a?\"The input did not match the regular expression \":\"The input was expected to not match the regular expression \")+\"\".concat(y(t),\". Input:\\n\\n\").concat(y(e),\"\\n\"));var c=new h({actual:e,expected:t,message:n,operator:o,stackStartFn:r});throw c.generatedMessage=s,c}}function N(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];O.apply(void 0,[N,t.length].concat(t))}x.throws=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];j.apply(void 0,[e,B(t)].concat(r))},x.rejects=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return R(t).then(function(t){return j.apply(void 0,[e,t].concat(r))})},x.doesNotThrow=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];U.apply(void 0,[e,B(t)].concat(r))},x.doesNotReject=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return R(t).then(function(t){return U.apply(void 0,[e,t].concat(r))})},x.ifError=function e(t){if(null!=t){var n=\"ifError got unwanted exception: \";\"object\"===i(t)&&\"string\"==typeof t.message?0===t.message.length&&t.constructor?n+=t.constructor.name:n+=t.message:n+=y(t);var r=new h({actual:t,expected:null,operator:\"ifError\",message:n,stackStartFn:e}),o=t.stack;if(\"string\"==typeof o){var a=o.split(\"\\n\");a.shift();for(var s=r.stack.split(\"\\n\"),c=0;c<a.length;c++){var u=s.indexOf(a[c]);if(-1!==u){s=s.slice(0,u);break}}r.stack=\"\".concat(s.join(\"\\n\"),\"\\n\").concat(a.join(\"\\n\"))}throw r}},x.match=function e(t,n,r){F(t,n,r,e,\"match\")},x.doesNotMatch=function e(t,n,r){F(t,n,r,e,\"doesNotMatch\")},x.strict=b(N,x,{equal:x.strictEqual,deepEqual:x.deepStrictEqual,notEqual:x.notStrictEqual,notDeepEqual:x.notDeepStrictEqual}),x.strict.strict=x.strict},4233(e){\"use strict\";const t=function*(){}.constructor;e.exports=()=>t},4372(e,t,n){\"use strict\";var r=n(9675),o=n(6556)(\"TypedArray.prototype.buffer\",!0),i=n(5680);e.exports=o||function(e){if(!i(e))throw new r(\"Not a Typed Array\");return e.buffer}},4459(e){\"use strict\";e.exports=Number.isNaN||function(e){return e!=e}},4634(e){var t={}.toString;e.exports=Array.isArray||function(e){return\"[object Array]\"==t.call(e)}},5345(e){\"use strict\";e.exports=URIError},5360(e,t){\"use strict\";var n=function(e,t){return t||(t={}),e.split(\"\").forEach(function(e,n){e in t||(t[e]=n)}),t},r={alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\",charmap:{0:14,1:8}};r.charmap=n(r.alphabet,r.charmap);var o={alphabet:\"0123456789ABCDEFGHJKMNPQRSTVWXYZ\",charmap:{O:0,I:1,L:1}};o.charmap=n(o.alphabet,o.charmap);var i={alphabet:\"0123456789ABCDEFGHIJKLMNOPQRSTUV\",charmap:{}};function a(e){if(this.buf=[],this.shift=8,this.carry=0,e){switch(e.type){case\"rfc4648\":this.charmap=t.rfc4648.charmap;break;case\"crockford\":this.charmap=t.crockford.charmap;break;case\"base32hex\":this.charmap=t.base32hex.charmap;break;default:throw new Error(\"invalid type\")}e.charmap&&(this.charmap=e.charmap)}}function s(e){if(this.buf=\"\",this.shift=3,this.carry=0,e){switch(e.type){case\"rfc4648\":this.alphabet=t.rfc4648.alphabet;break;case\"crockford\":this.alphabet=t.crockford.alphabet;break;case\"base32hex\":this.alphabet=t.base32hex.alphabet;break;default:throw new Error(\"invalid type\")}e.alphabet?this.alphabet=e.alphabet:e.lc&&(this.alphabet=this.alphabet.toLowerCase())}}i.charmap=n(i.alphabet,i.charmap),a.prototype.charmap=r.charmap,a.prototype.write=function(e){var t=this.charmap,n=this.buf,r=this.shift,o=this.carry;return e.toUpperCase().split(\"\").forEach(function(e){if(\"=\"!=e){var i=255&t[e];(r-=5)>0?o|=i<<r:r<0?(n.push(o|i>>-r),o=i<<(r+=8)&255):(n.push(o|i),r=8,o=0)}}),this.shift=r,this.carry=o,this},a.prototype.finalize=function(e){return e&&this.write(e),8!==this.shift&&0!==this.carry&&(this.buf.push(this.carry),this.shift=8,this.carry=0),this.buf},s.prototype.alphabet=r.alphabet,s.prototype.write=function(e){var t,n,r,o=this.shift,i=this.carry;for(r=0;r<e.length;r++)t=i|(n=e[r])>>o,this.buf+=this.alphabet[31&t],o>5&&(t=n>>(o-=5),this.buf+=this.alphabet[31&t]),i=n<<(o=5-o),o=8-o;return this.shift=o,this.carry=i,this},s.prototype.finalize=function(e){return e&&this.write(e),3!==this.shift&&(this.buf+=this.alphabet[31&this.carry],this.shift=3,this.carry=0),this.buf},t.encode=function(e,t){return new s(t).finalize(e)},t.decode=function(e,t){return new a(t).finalize(e)},t.Decoder=a,t.Encoder=s,t.charmap=n,t.crockford=o,t.rfc4648=r,t.base32hex=i},5377(e,t,n){\"use strict\";var r=n(2861).Buffer,o=n(4634),i=n(4372),a=ArrayBuffer.isView||function(e){try{return i(e),!0}catch(e){return!1}},s=\"undefined\"!=typeof Uint8Array,c=\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof Uint8Array,u=c&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);e.exports=function(e,t){if(r.isBuffer(e))return e.constructor&&!(\"isBuffer\"in e)?r.from(e):e;if(\"string\"==typeof e)return r.from(e,t);if(c&&a(e)){if(0===e.byteLength)return r.alloc(0);if(u){var n=r.from(e.buffer,e.byteOffset,e.byteLength);if(n.byteLength===e.byteLength)return n}var i=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l=r.from(i);if(l.length===e.byteLength)return l}if(s&&e instanceof Uint8Array)return r.from(e);var f=o(e);if(f)for(var p=0;p<e.length;p+=1){var d=e[p];if(\"number\"!=typeof d||d<0||d>255||~~d!==d)throw new RangeError(\"Array items must be numbers in the range 0-255.\")}if(f||r.isBuffer(e)&&e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return r.from(e);throw new TypeError('The \"data\" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}},5606(e){var t,n,r=e.exports={};function o(){throw new Error(\"setTimeout has not been defined\")}function i(){throw new Error(\"clearTimeout has not been defined\")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t=\"function\"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n=\"function\"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,c=[],u=!1,l=-1;function f(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&p())}function p(){if(!u){var e=a(f);u=!0;for(var t=c.length;t;){for(s=c,c=[];++l<t;)s&&s[l].run();l=-1,t=c.length}s=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||u||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title=\"browser\",r.browser=!0,r.env={},r.argv=[],r.version=\"\",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw new Error(\"process.binding is not supported\")},r.cwd=function(){return\"/\"},r.chdir=function(e){throw new Error(\"process.chdir is not supported\")},r.umask=function(){return 0}},5680(e,t,n){\"use strict\";var r=n(5767);e.exports=function(e){return!!r(e)}},5767(e,t,n){\"use strict\";var r=n(2682),o=n(9209),i=n(487),a=n(6556),s=n(5795),c=n(3628),u=a(\"Object.prototype.toString\"),l=n(9092)(),f=\"undefined\"==typeof globalThis?n.g:globalThis,p=o(),d=a(\"String.prototype.slice\"),h=a(\"Array.prototype.indexOf\",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},y={__proto__:null};r(p,l&&s&&c?function(e){var t=new f[e];if(Symbol.toStringTag in t&&c){var n=c(t),r=s(n,Symbol.toStringTag);if(!r&&n){var o=c(n);r=s(o,Symbol.toStringTag)}y[\"$\"+e]=i(r.get)}}:function(e){var t=new f[e],n=t.slice||t.set;n&&(y[\"$\"+e]=i(n))}),e.exports=function(e){if(!e||\"object\"!=typeof e)return!1;if(!l){var t=d(u(e),8,-1);return h(p,t)>-1?t:\"Object\"===t&&function(e){var t=!1;return r(y,function(n,r){if(!t)try{n(e),t=d(r,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return r(y,function(n,r){if(!t)try{\"$\"+n(e)===r&&(t=d(r,1))}catch(e){}}),t}(e):null}},5795(e,t,n){\"use strict\";var r=n(6549);if(r)try{r([],\"length\")}catch(e){r=null}e.exports=r},5880(e){\"use strict\";e.exports=Math.pow},6188(e){\"use strict\";e.exports=Math.max},6549(e){\"use strict\";e.exports=Object.getOwnPropertyDescriptor},6556(e,t,n){\"use strict\";var r=n(453),o=n(3126),i=o([r(\"%String.prototype.indexOf%\")]);e.exports=function(e,t){var n=r(e,!!t);return\"function\"==typeof n&&i(e,\".prototype.\")>-1?o([n]):n}},6576(e,t,n){\"use strict\";var r=n(9394),o=n(8452);e.exports=function(){var e=r();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6578(e){\"use strict\";e.exports=[\"Float16Array\",\"Float32Array\",\"Float64Array\",\"Int8Array\",\"Int16Array\",\"Int32Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"Uint16Array\",\"Uint32Array\",\"BigInt64Array\",\"BigUint64Array\"]},6642(e,t,n){\"use strict\";var r=n(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN(\"a\")?Number.isNaN:r}},6698(e){\"function\"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},6710(e,t,n){\"use strict\";var r=n(6698),o=n(4107),i=n(392),a=n(2861).Buffer,s=new Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}r(c,o),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},6743(e,t,n){\"use strict\";var r=n(9353);e.exports=Function.prototype.bind||r},6763(e,t,n){var r=n(537),o=n(4148);function i(){return(new Date).getTime()}var a,s=Array.prototype.slice,c={};a=void 0!==n.g&&n.g.console?n.g.console:\"undefined\"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},\"log\"],[function(){a.log.apply(a,arguments)},\"info\"],[function(){a.log.apply(a,arguments)},\"warn\"],[function(){a.warn.apply(a,arguments)},\"error\"],[function(e){c[e]=i()},\"time\"],[function(e){var t=c[e];if(!t)throw new Error(\"No such label: \"+e);delete c[e];var n=i()-t;a.log(e+\": \"+n+\"ms\")},\"timeEnd\"],[function(){var e=new Error;e.name=\"Trace\",e.message=r.format.apply(null,arguments),a.error(e.stack)},\"trace\"],[function(e){a.log(r.inspect(e)+\"\\n\")},\"dir\"],[function(e){if(!e){var t=s.call(arguments,1);o.ok(!1,r.format.apply(null,t))}},\"assert\"]],l=0;l<u.length;l++){var f=u[l],p=f[0],d=f[1];a[d]||(a[d]=p)}e.exports=a},6897(e,t,n){\"use strict\";var r=n(453),o=n(41),i=n(592)(),a=n(5795),s=n(9675),c=r(\"%Math.floor%\");e.exports=function(e,t){if(\"function\"!=typeof e)throw new s(\"`fn` is not a function\");if(\"number\"!=typeof t||t<0||t>4294967295||c(t)!==t)throw new s(\"`length` must be a positive 32-bit integer\");var n=arguments.length>2&&!!arguments[2],r=!0,u=!0;if(\"length\"in e&&a){var l=a(e,\"length\");l&&!l.configurable&&(r=!1),l&&!l.writable&&(u=!1)}return(r||u||!n)&&(i?o(e,\"length\",t,!0,!0):o(e,\"length\",t)),e}},7119(e){\"use strict\";e.exports=\"undefined\"!=typeof Reflect&&Reflect&&Reflect.apply},7176(e,t,n){\"use strict\";var r,o=n(3126),i=n(5795);try{r=[].__proto__===Array.prototype}catch(e){if(!e||\"object\"!=typeof e||!(\"code\"in e)||\"ERR_PROTO_ACCESS\"!==e.code)throw e}var a=!!r&&i&&i(Object.prototype,\"__proto__\"),s=Object,c=s.getPrototypeOf;e.exports=a&&\"function\"==typeof a.get?o([a.get]):\"function\"==typeof c&&function(e){return c(null==e?e:s(e))}},7244(e,t,n){\"use strict\";var r=n(9092)(),o=n(6556)(\"Object.prototype.toString\"),i=function(e){return!(r&&e&&\"object\"==typeof e&&Symbol.toStringTag in e)&&\"[object Arguments]\"===o(e)},a=function(e){return!!i(e)||null!==e&&\"object\"==typeof e&&\"length\"in e&&\"number\"==typeof e.length&&e.length>=0&&\"[object Array]\"!==o(e)&&\"callee\"in e&&\"[object Function]\"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},7526(e,t){\"use strict\";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,f=c>0?a-4:a;for(n=0;n<f;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,c=r-o;s<c;s+=a)i.push(u(e,s,s+a>c?c:s+a));return 1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+\"==\")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),i.join(\"\")};for(var n=[],r=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var n=e.indexOf(\"=\");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(c(r));return o.join(\"\")}r[\"-\".charCodeAt(0)]=62,r[\"_\".charCodeAt(0)]=63},7653(e,t,n){\"use strict\";var r=n(8452),o=n(487),i=n(9211),a=n(9394),s=n(6576),c=o(a(),Object);r(c,{getPolyfill:a,implementation:i,shim:s}),e.exports=c},7816(e,t,n){\"use strict\";var r=n(6698),o=n(392),i=n(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,o.call(this,64,56)}function u(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(c,o),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var p=0;p<80;++p){var d=~~(p/20),h=u(n)+f(d,r,o,i)+s+t[p]+a[d]|0;s=i,i=o,o=l(r),r=n,n=h}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0},c.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},8002(e){\"use strict\";e.exports=Math.min},8068(e){\"use strict\";e.exports=SyntaxError},8075(e,t,n){\"use strict\";var r=n(453),o=n(487),i=o(r(\"String.prototype.indexOf\"));e.exports=function(e,t){var n=r(e,!!t);return\"function\"==typeof n&&i(e,\".prototype.\")>-1?o(n):n}},8184(e,t,n){\"use strict\";var r=n(6556),o=n(9721)(/^\\s*(?:function)?\\*/),i=n(9092)(),a=n(3628),s=r(\"Object.prototype.toString\"),c=r(\"Function.prototype.toString\"),u=n(4233);e.exports=function(e){if(\"function\"!=typeof e)return!1;if(o(c(e)))return!0;if(!i)return\"[object GeneratorFunction]\"===s(e);if(!a)return!1;var t=u();return t&&a(e)===t.prototype}},8287(e,t,n){\"use strict\";var r=n(6763);const o=n(7526),i=n(251),a=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function c(e){if(e>s)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return p(e)}return l(e,t,n)}function l(e,t,n){if(\"string\"==typeof e)return function(e,t){if(\"string\"==typeof t&&\"\"!==t||(t=\"utf8\"),!u.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const n=0|g(e,t);let r=c(n);const o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,n);if(\"undefined\"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const o=function(e){if(u.isBuffer(e)){const t=0|y(e.length),n=c(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?\"number\"!=typeof e.length||Y(e.length)?c(0):d(e):\"Buffer\"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive](\"string\"),t,n);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function f(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function p(e){return f(e),c(e<0?0:0|y(e))}function d(e){const t=e.length<0?0:0|y(e.length),n=c(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('\"length\" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function y(e){if(e>=s)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+s.toString(16)+\" bytes\");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return n;case\"utf8\":case\"utf-8\":return G(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*n;case\"hex\":return n>>>1;case\"base64\":return W(e).length;default:if(o)return r?-1:G(e).length;t=(\"\"+t).toLowerCase(),o=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return\"\";if((n>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return B(this,t,n);case\"utf8\":case\"utf-8\":return O(this,t,n);case\"ascii\":return I(this,t,n);case\"latin1\":case\"binary\":return C(this,t,n);case\"base64\":return k(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return P(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0}}function v(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if(\"string\"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,o);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,o);throw new TypeError(\"val must be string, number or Buffer\")}function w(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&(\"ucs2\"===(r=String(r).toLowerCase())||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===c)return r*a}else-1!==r&&(i-=i-r),r=-1}else for(n+c>s&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;r<c;r++)if(u(e,i+r)!==u(t,r)){n=!1;break}if(n)return i}return-1}function S(e,t,n,r){n=Number(n)||0;const o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(Y(r))return a;e[n+a]=r}return a}function A(e,t,n,r){return X(G(t,e.length-n),e,n,r)}function E(e,t,n,r){return X(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return X(W(t),e,n,r)}function T(e,t,n,r){return X(function(e,t){let n,r,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o<n;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let n=\"\",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=_));return n}(r)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||void 0===r||\"function\"!=typeof r.error||r.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(u.prototype,\"parent\",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,\"offset\",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return f(e),e<=0?c(e):void 0!==t?\"string\"==typeof n?c(e).fill(t,n):c(e).fill(t):c(e)}(e,t,n)},u.allocUnsafe=function(e){return p(e)},u.allocUnsafeSlow=function(e){return p(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=u.allocUnsafe(t);let o=0;for(n=0;n<e.length;++n){let t=e[n];if(Z(t,Uint8Array))o+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!u.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?\"\":0===arguments.length?O(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e=\"\";const n=t.INSPECT_MAX_BYTES;return e=this.toString(\"hex\",0,n).replace(/(.{2})/g,\"$1 \").trim(),this.length>n&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,o){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError(\"out of range index\");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n);for(let e=0;e<s;++e)if(c[e]!==l[e]){i=c[e],a=l[e];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r=\"utf8\",n=this.length,t=0;else if(void 0===n&&\"string\"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");let i=!1;for(;;)switch(r){case\"hex\":return S(this,e,t,n);case\"utf8\":case\"utf-8\":return A(this,e,t,n);case\"ascii\":case\"latin1\":case\"binary\":return E(this,e,t,n);case\"base64\":return x(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return T(this,e,t,n);default:if(i)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function I(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function B(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let o=\"\";for(let r=t;r<n;++r)o+=J[e[r]];return o}function P(e,t,n){const r=e.slice(t,n);let o=\"\";for(let e=0;e<r.length-1;e+=2)o+=String.fromCharCode(r[e]+256*r[e+1]);return o}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function j(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('\"value\" argument is out of bounds');if(n+r>e.length)throw new RangeError(\"Index out of range\")}function U(e,t,n,r,o){z(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function F(e,t,n,r,o){z(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function N(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"Index out of range\")}function L(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Q(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),u.prototype.readBigUInt64BE=Q(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Q(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),u.prototype.readBigInt64BE=Q(function(e){K(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||j(this,e,t,n,Math.pow(2,8*n)-1,0);let o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||j(this,e,t,n,Math.pow(2,8*n)-1,0);let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Q(function(e,t=0){return U(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),u.prototype.writeBigUInt64BE=Q(function(e,t=0){return F(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);j(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);j(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Q(function(e,t=0){return U(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),u.prototype.writeBigInt64BE=Q(function(e,t=0){return F(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(n<0||n>=this.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const o=r-n;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},u.prototype.fill=function(e,t,n,r){if(\"string\"==typeof e){if(\"string\"==typeof t?(r=t,t=0,n=this.length):\"string\"==typeof n&&(r=n,n=this.length),void 0!==r&&\"string\"!=typeof r)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof r&&!u.isEncoding(r))throw new TypeError(\"Unknown encoding: \"+r);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===r&&t<128||\"latin1\"===r)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError(\"Out of range index\");if(n<=t)return this;let o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o<n;++o)this[o]=e;else{const i=u.isBuffer(e)?e:u.from(e,r),a=i.length;if(0===a)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(o=0;o<n-t;++o)this[o+t]=i[o%a]}return this};const D={};function q(e,t,n){D[e]=class extends n{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t=\"\",n=e.length;const r=\"-\"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function z(e,t,n,r,o,i){if(e>n||e<t){const r=\"bigint\"==typeof t?\"n\":\"\";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new D.ERR_OUT_OF_RANGE(\"value\",o,e)}!function(e,t,n){K(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,o,i)}function K(e,t){if(\"number\"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function H(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new D.ERR_OUT_OF_RANGE(n||\"offset\",\"an integer\",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(n||\"offset\",`>= ${n?1:0} and <= ${t}`,e)}q(\"ERR_BUFFER_OUT_OF_BOUNDS\",function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"},RangeError),q(\"ERR_INVALID_ARG_TYPE\",function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`},TypeError),q(\"ERR_OUT_OF_RANGE\",function(e,t,n){let r=`The value of \"${e}\" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=V(String(n)):\"bigint\"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=V(o)),o+=\"n\"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const $=/[^+/0-9A-Za-z-_]/g;function G(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function W(e){return o.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace($,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function X(e,t,n,r){let o;for(o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function Q(e){return\"undefined\"==typeof BigInt?ee:e}function ee(){throw new Error(\"BigInt not supported\")}},8403(e,t,n){\"use strict\";var r=n(1189),o=n(1333)(),i=n(6556),a=n(9612),s=i(\"Array.prototype.push\"),c=i(\"Object.prototype.propertyIsEnumerable\"),u=o?a.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError(\"target must be an object\");var n=a(e);if(1===arguments.length)return n;for(var i=1;i<arguments.length;++i){var l=a(arguments[i]),f=r(l),p=o&&(a.getOwnPropertySymbols||u);if(p)for(var d=p(l),h=0;h<d.length;++h){var y=d[h];c(l,y)&&s(f,y)}for(var g=0;g<f.length;++g){var m=f[g];if(c(l,m)){var v=l[m];n[m]=v}}}return n}},8452(e,t,n){\"use strict\";var r=n(1189),o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol(\"foo\"),i=Object.prototype.toString,a=Array.prototype.concat,s=n(41),c=n(592)(),u=function(e,t,n,r){if(t in e)if(!0===r){if(e[t]===n)return}else if(\"function\"!=typeof(o=r)||\"[object Function]\"!==i.call(o)||!r())return;var o;c?s(e,t,n,!0):s(e,t,n)},l=function(e,t){var n=arguments.length>2?arguments[2]:{},i=r(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)u(e,i[s],t[i[s]],n[i[s]])};l.supportsDescriptors=!!c,e.exports=l},8648(e){\"use strict\";e.exports=\"undefined\"!=typeof Reflect&&Reflect.getPrototypeOf||null},8875(e,t,n){\"use strict\";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=n(1093),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},\"toString\"),u=s.call(function(){},\"prototype\"),l=[\"toString\",\"toLocaleString\",\"valueOf\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"constructor\"],f=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(\"undefined\"==typeof window)return!1;for(var e in window)try{if(!p[\"$\"+e]&&o.call(window,e)&&null!==window[e]&&\"object\"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&\"object\"==typeof e,n=\"[object Function]\"===i.call(e),r=a(e),s=t&&\"[object String]\"===i.call(e),p=[];if(!t&&!n&&!r)throw new TypeError(\"Object.keys called on a non-object\");var h=u&&n;if(s&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)p.push(String(y));if(r&&e.length>0)for(var g=0;g<e.length;++g)p.push(String(g));else for(var m in e)h&&\"prototype\"===m||!o.call(e,m)||p.push(String(m));if(c)for(var v=function(e){if(\"undefined\"==typeof window||!d)return f(e);try{return f(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)v&&\"constructor\"===l[b]||!o.call(e,l[b])||p.push(l[b]);return p}}e.exports=r},8968(e){\"use strict\";e.exports=Math.floor},9032(e,t,n){\"use strict\";var r=n(7244),o=n(8184),i=n(5767),a=n(5680);function s(e){return e.call.bind(e)}var c=\"undefined\"!=typeof BigInt,u=\"undefined\"!=typeof Symbol,l=s(Object.prototype.toString),f=s(Number.prototype.valueOf),p=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(c)var h=s(BigInt.prototype.valueOf);if(u)var y=s(Symbol.prototype.valueOf);function g(e,t){if(\"object\"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return\"[object Map]\"===l(e)}function v(e){return\"[object Set]\"===l(e)}function b(e){return\"[object WeakMap]\"===l(e)}function w(e){return\"[object WeakSet]\"===l(e)}function S(e){return\"[object ArrayBuffer]\"===l(e)}function A(e){return\"undefined\"!=typeof ArrayBuffer&&(S.working?S(e):e instanceof ArrayBuffer)}function E(e){return\"[object DataView]\"===l(e)}function x(e){return\"undefined\"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}t.isArgumentsObject=r,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return\"undefined\"!=typeof Promise&&e instanceof Promise||null!==e&&\"object\"==typeof e&&\"function\"==typeof e.then&&\"function\"==typeof e.catch},t.isArrayBufferView=function(e){return\"undefined\"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||x(e)},t.isUint8Array=function(e){return\"Uint8Array\"===i(e)},t.isUint8ClampedArray=function(e){return\"Uint8ClampedArray\"===i(e)},t.isUint16Array=function(e){return\"Uint16Array\"===i(e)},t.isUint32Array=function(e){return\"Uint32Array\"===i(e)},t.isInt8Array=function(e){return\"Int8Array\"===i(e)},t.isInt16Array=function(e){return\"Int16Array\"===i(e)},t.isInt32Array=function(e){return\"Int32Array\"===i(e)},t.isFloat32Array=function(e){return\"Float32Array\"===i(e)},t.isFloat64Array=function(e){return\"Float64Array\"===i(e)},t.isBigInt64Array=function(e){return\"BigInt64Array\"===i(e)},t.isBigUint64Array=function(e){return\"BigUint64Array\"===i(e)},m.working=\"undefined\"!=typeof Map&&m(new Map),t.isMap=function(e){return\"undefined\"!=typeof Map&&(m.working?m(e):e instanceof Map)},v.working=\"undefined\"!=typeof Set&&v(new Set),t.isSet=function(e){return\"undefined\"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working=\"undefined\"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return\"undefined\"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working=\"undefined\"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},S.working=\"undefined\"!=typeof ArrayBuffer&&S(new ArrayBuffer),t.isArrayBuffer=A,E.working=\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=x;var T=\"undefined\"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function k(e){return\"[object SharedArrayBuffer]\"===l(e)}function O(e){return void 0!==T&&(void 0===k.working&&(k.working=k(new T)),k.working?k(e):e instanceof T)}function _(e){return g(e,f)}function I(e){return g(e,p)}function C(e){return g(e,d)}function B(e){return c&&g(e,h)}function P(e){return u&&g(e,y)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return\"[object AsyncFunction]\"===l(e)},t.isMapIterator=function(e){return\"[object Map Iterator]\"===l(e)},t.isSetIterator=function(e){return\"[object Set Iterator]\"===l(e)},t.isGeneratorObject=function(e){return\"[object Generator]\"===l(e)},t.isWebAssemblyCompiledModule=function(e){return\"[object WebAssembly.Module]\"===l(e)},t.isNumberObject=_,t.isStringObject=I,t.isBooleanObject=C,t.isBigIntObject=B,t.isSymbolObject=P,t.isBoxedPrimitive=function(e){return _(e)||I(e)||C(e)||B(e)||P(e)},t.isAnyArrayBuffer=function(e){return\"undefined\"!=typeof Uint8Array&&(A(e)||O(e))},[\"isProxy\",\"isExternal\",\"isModuleNamespaceObject\"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+\" is not supported in userland\")}})})},9092(e,t,n){\"use strict\";var r=n(1333);e.exports=function(){return r()&&!!Symbol.toStringTag}},9133(e,t,n){\"use strict\";var r=n(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e=\"abcdefghijklmnopqrst\",t=e.split(\"\"),n={},r=0;r<t.length;++r)n[t[r]]=t[r];var o=Object.assign({},n),i=\"\";for(var a in o)i+=a;return e!==i}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,\"xy\")}catch(t){return\"y\"===e[1]}return!1}()?r:Object.assign:r}},9209(e,t,n){\"use strict\";var r=n(6578),o=\"undefined\"==typeof globalThis?n.g:globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)\"function\"==typeof o[r[t]]&&(e[e.length]=r[t]);return e}},9211(e){\"use strict\";var t=function(e){return e!=e};e.exports=function(e,n){return 0===e&&0===n?1/e==1/n:e===n||!(!t(e)||!t(n))}},9290(e){\"use strict\";e.exports=RangeError},9353(e){\"use strict\";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if(\"function\"!=typeof o||\"[object Function]\"!==t.apply(o))throw new TypeError(\"Function.prototype.bind called on incompatible \"+o);for(var i,a=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),s=n(0,o.length-a.length),c=[],u=0;u<s;u++)c[u]=\"$\"+u;if(i=Function(\"binder\",\"return function (\"+function(e){for(var t=\"\",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=\",\");return t}(c)+\"){ return binder.apply(this,arguments); }\")(function(){if(this instanceof i){var t=o.apply(this,r(a,arguments));return Object(t)===t?t:this}return o.apply(e,r(a,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,i.prototype=new l,l.prototype=null}return i}},9383(e){\"use strict\";e.exports=Error},9394(e,t,n){\"use strict\";var r=n(9211);e.exports=function(){return\"function\"==typeof Object.is?Object.is:r}},9538(e){\"use strict\";e.exports=ReferenceError},9597(e,t,n){\"use strict\";function r(e){return r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},r(e)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function i(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,o=a(e);if(t){var i=a(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(e,t){if(t&&(\"object\"===r(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(this,n)}}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}var s,c,u={};function l(e,t,n){n||(n=Error);var r=function(n){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&o(e,t)}(s,n);var r,a=i(s);function s(n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,s),i=a.call(this,function(e,n,r){return\"string\"==typeof t?t:t(e,n,r)}(n,r,o)),i.code=e,i}return r=s,Object.defineProperty(r,\"prototype\",{writable:!1}),r}(n);u[e]=r}function f(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?\"one of \".concat(t,\" \").concat(e.slice(0,n-1).join(\", \"),\", or \")+e[n-1]:2===n?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}l(\"ERR_AMBIGUOUS_ARGUMENT\",'The \"%s\" argument is ambiguous. %s',TypeError),l(\"ERR_INVALID_ARG_TYPE\",function(e,t,o){var i,a;if(void 0===s&&(s=n(4148)),s(\"string\"==typeof e,\"'name' must be a string\"),\"string\"==typeof t&&\"not \"===t.substr(0,4)?(i=\"must not be\",t=t.replace(/^not /,\"\")):i=\"must be\",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),\" argument\"===e.substring(n-9,n)}(e))a=\"The \".concat(e,\" \").concat(i,\" \").concat(f(t,\"type\"));else{var c=function(e,t,n){return\"number\"!=typeof n&&(n=0),!(n+1>e.length)&&-1!==e.indexOf(\".\",n)}(e)?\"property\":\"argument\";a='The \"'.concat(e,'\" ').concat(c,\" \").concat(i,\" \").concat(f(t,\"type\"))}return a+\". Received type \".concat(r(o))},TypeError),l(\"ERR_INVALID_ARG_VALUE\",function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"is invalid\";void 0===c&&(c=n(537));var o=c.inspect(t);return o.length>128&&(o=\"\".concat(o.slice(0,128),\"...\")),\"The argument '\".concat(e,\"' \").concat(r,\". Received \").concat(o)},TypeError,RangeError),l(\"ERR_INVALID_RETURN_VALUE\",function(e,t,n){var o;return o=n&&n.constructor&&n.constructor.name?\"instance of \".concat(n.constructor.name):\"type \".concat(r(n)),\"Expected \".concat(e,' to be returned from the \"').concat(t,'\"')+\" function but got \".concat(o,\".\")},TypeError),l(\"ERR_MISSING_ARGS\",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];void 0===s&&(s=n(4148)),s(t.length>0,\"At least one arg needs to be specified\");var o=\"The \",i=t.length;switch(t=t.map(function(e){return'\"'.concat(e,'\"')}),i){case 1:o+=\"\".concat(t[0],\" argument\");break;case 2:o+=\"\".concat(t[0],\" and \").concat(t[1],\" arguments\");break;default:o+=t.slice(0,i-1).join(\", \"),o+=\", and \".concat(t[i-1],\" arguments\")}return\"\".concat(o,\" must be specified\")},TypeError),e.exports.codes=u},9600(e){\"use strict\";var t,n,r=Function.prototype.toString,o=\"object\"==typeof Reflect&&null!==Reflect&&Reflect.apply;if(\"function\"==typeof o&&\"function\"==typeof Object.defineProperty)try{t=Object.defineProperty({},\"length\",{get:function(){throw n}}),n={},o(function(){throw 42},null,t)}catch(e){e!==n&&(o=null)}else o=null;var i=/^\\s*class\\b/,a=function(e){try{var t=r.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(r.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,u=\"function\"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if(\"object\"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(e){if((l||!e)&&(void 0===e||\"object\"==typeof e))try{var t=c.call(e);return(\"[object HTMLAllCollection]\"===t||\"[object HTML document.all class]\"===t||\"[object HTMLCollection]\"===t||\"[object Object]\"===t)&&null==e(\"\")}catch(e){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if(\"function\"!=typeof e&&\"object\"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==n)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if(\"function\"!=typeof e&&\"object\"!=typeof e)return!1;if(u)return s(e);if(a(e))return!1;var t=c.call(e);return!(\"[object Function]\"!==t&&\"[object GeneratorFunction]\"!==t&&!/^\\[object HTML/.test(t))&&s(e)}},9612(e){\"use strict\";e.exports=Object},9675(e){\"use strict\";e.exports=TypeError},9721(e,t,n){\"use strict\";var r=n(6556),o=n(4035),i=r(\"RegExp.prototype.exec\"),a=n(9675);e.exports=function(e){if(!o(e))throw new a(\"`regex` must be a RegExp\");return function(t){return null!==i(e,t)}}},9957(e,t,n){\"use strict\";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(6743);e.exports=i.call(r,o)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,\"exports\",{enumerable:!0,set:()=>{throw new Error(\"ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: \"+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n(448)})(),e.exports=t()},6682(e,t,n){\"use strict\";n.d(t,{fe:()=>W});var r=n(8250);function o(e){return o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if(\"object\"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=o(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==o(t)?t:t+\"\"}var s,c,u=(s=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e)},(c=[{key:\"generate\",value:function(e){var t=e.contractName;return{packageJson:this.generatePackageJson(t),tsConfig:this.generateTsConfig(),gitignore:this.generateGitignore(),readme:this.generateReadme(t)}}},{key:\"generatePackageJson\",value:function(e){var t={name:e.toLowerCase().replace(/[^a-z0-9-]/g,\"-\"),version:\"0.0.1\",description:\"Generated TypeScript bindings for \".concat(e,\" Stellar contract\"),type:\"module\",main:\"dist/index.js\",types:\"dist/index.d.ts\",scripts:{build:\"tsc\"},dependencies:{\"@stellar/stellar-sdk\":\"^\".concat(\"15.1.0\"),buffer:\"6.0.3\"},devDependencies:{typescript:\"^5.6.3\"}};return JSON.stringify(t,null,2)}},{key:\"generateTsConfig\",value:function(){return JSON.stringify({compilerOptions:{target:\"ESNext\",module:\"NodeNext\",moduleResolution:\"nodenext\",declaration:!0,outDir:\"./dist\",strictNullChecks:!0,skipLibCheck:!0},include:[\"src/*\"]},null,2)}},{key:\"generateGitignore\",value:function(){return[\"# Dependencies\",\"node_modules/\",\"\",\"# Build outputs\",\"dist/\",\"*.tgz\",\"\",\"# IDE\",\".vscode/\",\".idea/\",\"\",\"# OS\",\".DS_Store\",\"Thumbs.db\",\"\",\"# Logs\",\"*.log\",\"npm-debug.log*\",\"\",\"# Runtime data\",\"*.pid\",\"*.seed\"].join(\"\\n\")}},{key:\"generateReadme\",value:function(e){return[\"# \".concat(e,\" Contract Bindings\"),\"\",\"TypeScript bindings for the \".concat(e,\" Stellar smart contract.\"),\"\",\"## Installation\",\"\",\"```bash\",\"npm install\",\"```\",\"\",\"## Build\",\"\",\"```bash\",\"npm run build\",\"```\",\"\",\"## Usage\",\"\",\"```typescript\",'import { Client } from \"./src\";',\"\",\"const client = new Client({\",'  contractId: \"YOUR_CONTRACT_ID\",','  rpcUrl: \"https://soroban-testnet.stellar.org:443\",','  networkPassphrase: \"Test SDF Network ; September 2015\",',\"});\",\"\",\"// Call contract methods\",\"// const result = await client.methodName();\",\"```\",\"\",\"## Generated Files\",\"\",\"- `src/index.ts` - Entry point exporting the Client\",\"- `src/types.ts` - Type definitions for contract structs, enums, and unions\",\"- `src/contract.ts` - Client implementation\",\"- `tsconfig.json` - TypeScript configuration\",\"- `package.json` - NPM package configuration\",\"\",\"This package was generated using the Js-Stellar-SDK contract binding generator.\"].join(\"\\n\")}}])&&i(s.prototype,c),Object.defineProperty(s,\"prototype\",{writable:!1}),s),l=n(8950),f=n(4366);function p(e){return p=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},p(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,h(r.key),r)}}function h(e){var t=function(e){if(\"object\"!=p(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=p(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==p(t)?t:t+\"\"}var y=function(e,t){return t&&d(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.spec=t},[{key:\"generate\",value:function(){var e=this,t=this.spec.entries.map(function(t){return e.generateEntry(t)}).filter(function(e){return e}).join(\"\\n\\n\"),n=this.generateImports();return\"\".concat(n,\"\\n\\n    \").concat(t,\"\\n    \")}},{key:\"generateEntry\",value:function(e){switch(e.switch()){case l.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return(0,f.Q7)(e.udtStructV0())?this.generateTupleStruct(e.udtStructV0()):this.generateStruct(e.udtStructV0());case l.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.generateUnion(e.udtUnionV0());case l.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():return this.generateEnum(e.udtEnumV0());case l.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0():return this.generateErrorEnum(e.udtErrorEnumV0());default:return null}}},{key:\"generateImports\",value:function(){var e=(0,f.ch)(this.spec.entries.flatMap(function(e){switch(e.switch()){case l.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return e.udtStructV0().fields().map(function(e){return e.type()});case l.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return e.udtUnionV0().cases().flatMap(function(e){return e.switch()===l.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0()?e.tupleCase().type():[]});case l.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():case l.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0():default:return[]}}));return(0,f.Sq)(e,{includeTypeFileImports:!1})}},{key:\"generateStruct\",value:function(e){var t=(0,f.ff)(e.name().toString()),n=(0,f.SB)(e.doc().toString()||\"Struct: \".concat(t),0),r=e.fields().map(function(e){var t=(0,f.ff)(e.name().toString()),n=(0,f.z0)(e.type()),r=(0,f.SB)(e.doc().toString(),2);return\"\".concat(r,\"  \").concat(t,\": \").concat(n,\";\")}).join(\"\\n\");return\"\".concat(n,\"export interface \").concat(t,\" {\\n\").concat(r,\"\\n}\")}},{key:\"generateUnion\",value:function(e){var t=this,n=(0,f.ff)(e.name().toString()),r=(0,f.SB)(e.doc().toString()||\"Union: \".concat(n),0),o=e.cases().map(function(e){return t.generateUnionCase(e)}).map(function(e){return e.types.length>0?\"\".concat((0,f.SB)(e.doc,2),'  { tag: \"').concat((0,f.c0)(e.name),'\"; values: readonly [').concat(e.types.join(\", \"),\"] }\"):\"\".concat((0,f.SB)(e.doc,2),'  { tag: \"').concat((0,f.c0)(e.name),'\"; values: void }')}).join(\" |\\n\");return\"\".concat(r,\" export type \").concat(n,\" =\\n\").concat(o,\";\")}},{key:\"generateEnum\",value:function(e){var t=(0,f.ff)(e.name().toString()),n=(0,f.SB)(e.doc().toString()||\"Enum: \".concat(t),0),r=e.cases().map(function(e){var t=(0,f.ff)(e.name().toString()),n=e.value(),r=e.doc().toString()||\"Enum Case: \".concat(t);return\"\".concat((0,f.SB)(r,2),\"  \").concat(t,\" = \").concat(n)}).join(\",\\n\");return\"\".concat(n,\"export enum \").concat(t,\" {\\n\").concat(r,\"\\n}\")}},{key:\"generateErrorEnum\",value:function(e){var t=this,n=(0,f.ff)(e.name().toString()),r=(0,f.SB)(e.doc().toString()||\"Error Enum: \".concat(n),0),o=e.cases().map(function(e){return t.generateEnumCase(e)}).map(function(e){return\"\".concat((0,f.SB)(e.doc,2),\"  \").concat(e.value,' : { message: \"').concat((0,f.c0)(e.name),'\" }')}).join(\",\\n\");return\"\".concat(r,\"export const \").concat(n,\" = {\\n\").concat(o,\"\\n}\")}},{key:\"generateUnionCase\",value:function(e){switch(e.switch()){case l.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0():var t=e.voidCase();return{doc:t.doc().toString(),name:t.name().toString(),types:[]};case l.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0():var n=e.tupleCase();return{doc:n.doc().toString(),name:n.name().toString(),types:n.type().map(function(e){return(0,f.z0)(e)})};default:throw new Error(\"Unknown union case kind: \".concat(e.switch()))}}},{key:\"generateEnumCase\",value:function(e){return{doc:e.doc().toString(),name:e.name().toString(),value:e.value()}}},{key:\"generateTupleStruct\",value:function(e){var t=(0,f.ff)(e.name().toString()),n=(0,f.SB)(e.doc().toString()||\"Tuple Struct: \".concat(t),0),r=e.fields().map(function(e){return(0,f.z0)(e.type())}).join(\", \");return\"\".concat(n,\"export type \").concat(t,\" = readonly [\").concat(r,\"];\")}}]);function g(e){return g=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},g(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function v(e){var t=function(e){if(\"object\"!=g(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=g(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==g(t)?t:t+\"\"}var b=function(e,t){return t&&m(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.spec=t},[{key:\"generate\",value:function(){var e=this,t=\"\";try{var n=this.spec.getFunc(\"__constructor\");t=this.generateDeployMethod(n)}catch(e){t=this.generateDeployMethod(void 0)}var r=this.spec.funcs().filter(function(e){return\"__constructor\"!==e.name().toString()}).map(function(t){return e.generateInterfaceMethod(t)}).join(\"\\n\"),o=this.generateImports(),i=this.spec.entries.map(function(e){return'\"'.concat(e.toXDR(\"base64\"),'\"')}),a=this.spec.funcs().filter(function(e){return\"__constructor\"!==e.name().toString()}).map(function(t){return e.generateFromJSONMethod(t)}).join(\",\");return\"\".concat(o,\"\\n\\nexport interface Client {\\n\").concat(r,\"\\n}\\n\\nexport class Client extends ContractClient {\\n  constructor(public readonly options: ContractClientOptions) {\\n    super(\\n      new Spec([\").concat(i.join(\", \"),\"]),\\n      options\\n    );\\n  }\\n\\n \").concat(t,\"\\n  public readonly fromJSON = {\\n  \").concat(a,\"\\n  };\\n}\")}},{key:\"generateImports\",value:function(){var e=(0,f.ch)(this.spec.funcs().flatMap(function(e){var t=e.inputs(),n=e.outputs();return t.map(function(e){return e.type()}).concat(n)}));return(0,f.Sq)(e,{includeTypeFileImports:!0,additionalStellarContractImports:[\"Spec\",\"AssembledTransaction\",\"Client as ContractClient\",\"ClientOptions as ContractClientOptions\",\"MethodOptions\"]})}},{key:\"generateInterfaceMethod\",value:function(e){var t=(0,f.ff)(e.name().toString()),n=e.inputs().map(function(e){return{name:(0,f.ff)(e.name().toString()),type:(0,f.z0)(e.type(),!0)}}),r=e.outputs().length>0?(0,f.z0)(e.outputs()[0]):\"void\",o=(0,f.SB)(e.doc().toString(),2),i=this.formatMethodParameters(n);return\"\".concat(o,\"  \").concat(t,\"(\").concat(i,\"): Promise<AssembledTransaction<\").concat(r,\">>;\")}},{key:\"generateFromJSONMethod\",value:function(e){var t=(0,f.ff)(e.name().toString()),n=e.outputs().length>0?(0,f.z0)(e.outputs()[0]):\"void\";return\"  \".concat(t,\" : this.txFromJSON<\").concat(n,\">\")}},{key:\"generateDeployMethod\",value:function(e){if(!e){var t=this.formatConstructorParameters([]);return\"  static deploy<T = Client>(\".concat(t,\"): Promise<AssembledTransaction<T>> {\\n    return ContractClient.deploy(null, options);\\n  }\")}var n=e.inputs().map(function(e){return{name:(0,f.ff)(e.name().toString()),type:(0,f.z0)(e.type(),!0)}}),r=this.formatConstructorParameters(n),o=n.length>0?\"{ \".concat(n.map(function(e){return e.name}).join(\", \"),\" }, \"):\"\";return\"  static deploy<T = Client>(\".concat(r,\"): Promise<AssembledTransaction<T>> {\\n    return ContractClient.deploy(\").concat(o,\"options);\\n  }\")}},{key:\"formatMethodParameters\",value:function(e){var t=[];if(e.length>0){var n=\"{ \".concat(e.map(function(e){return\"\".concat(e.name,\": \").concat(e.type)}).join(\"; \"),\" }\");t.push(\"{ \".concat(e.map(function(e){return e.name}).join(\", \"),\" }: \").concat(n))}return t.push(\"options?: MethodOptions\"),t.join(\", \")}},{key:\"formatConstructorParameters\",value:function(e){var t=[];if(e.length>0){var n=\"{ \".concat(e.map(function(e){return\"\".concat(e.name,\": \").concat(e.type)}).join(\"; \"),\" }\");t.push(\"{ \".concat(e.map(function(e){return e.name}).join(\", \"),\" }: \").concat(n))}return t.push('options: MethodOptions & Omit<ContractClientOptions, \\'contractId\\'> & { wasmHash: Buffer | string; salt?: Buffer | Uint8Array; format?: \"hex\" | \"base64\"; address?: string; }'),t.join(\", \")}}]),w=n(8451),S=n(8287).Buffer;function A(e){return A=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},A(e)}function E(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return x(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(x(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,x(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,x(f,\"constructor\",u),x(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",x(u,o,\"GeneratorFunction\"),x(f),x(f,o,\"Generator\"),x(f,r,function(){return this}),x(f,\"toString\",function(){return\"[object Generator]\"}),(E=function(){return{w:i,m:p}})()}function x(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}x=function(e,t,n,r){function i(t,n){x(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},x(e,t,n,r)}function T(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function k(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){T(i,r,o,a,s,\"next\",e)}function s(e){T(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function O(e){var t=\"function\"==typeof Map?new Map:void 0;return O=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf(\"[native code]\")}catch(t){return\"function\"==typeof e}}(e))return e;if(\"function\"!=typeof e)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(_())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&I(o,n.prototype),o}(e,arguments,C(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),I(n,e)},O(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}var B=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=function(e,t,n){return t=C(t),function(e,t){if(t&&(\"object\"==A(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,_()?Reflect.construct(t,n||[],C(e).constructor):t.apply(e,n))}(this,t,[e])).cause=n,r.name=\"WasmFetchError\",r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&I(e,t)}(t,e),function(e){return Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t)}(O(Error));function P(e,t){return R.apply(this,arguments)}function R(){return(R=k(E().m(function e(t,n){var r,o,i,a,s;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,r=l.xdr.LedgerKey.contractCode(new l.xdr.LedgerKeyContractCode({hash:l.xdr.Hash.fromXDR(n,\"raw\")})),e.n=1,t.getLedgerEntries(r);case 1:if((o=e.v).entries&&0!==o.entries.length){e.n=2;break}throw new B(\"WASM not found for the given hash\");case 2:if((i=o.entries[0]).key.switch()===l.xdr.LedgerEntryType.contractCode()){e.n=3;break}throw new B(\"Invalid ledger entry type returned\");case 3:return a=i.val.contractCode(),e.a(2,S.from(a.code()));case 4:if(e.p=4,!((s=e.v)instanceof B)){e.n=5;break}throw s;case 5:throw new B(\"Failed to fetch WASM from hash\",s);case 6:return e.a(2)}},e,null,[[0,4]])}))).apply(this,arguments)}function j(e){return e.executable().switch()===l.xdr.ContractExecutableType.contractExecutableStellarAsset()}function U(e,t){return F.apply(this,arguments)}function F(){return F=k(E().m(function e(t,n){var r,o,i,a,s,c,u,f;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,r=new l.Contract(n.toString()),e.n=1,t.getLedgerEntries(r.getFootprint());case 1:if((o=e.v).entries&&0!==o.entries.length){e.n=2;break}throw new B(\"Contract instance not found\");case 2:if((i=o.entries[0]).key.switch()===l.xdr.LedgerEntryType.contractData()){e.n=3;break}throw new B(\"Invalid ledger entry type returned\");case 3:if(a=i.val.contractData(),!j(s=a.val().instance())){e.n=4;break}return e.a(2,{type:\"stellar-asset-contract\"});case 4:return c=s.executable().wasmHash(),e.n=5,P(t,c);case 5:return u=e.v,e.a(2,{type:\"wasm\",wasmBytes:u});case 6:if(e.p=6,!((f=e.v)instanceof B)){e.n=7;break}throw f;case 7:throw new B(\"Failed to fetch WASM from contract\",f);case 8:return e.a(2)}},e,null,[[0,6]])})),F.apply(this,arguments)}function N(e,t){return L.apply(this,arguments)}function L(){return(L=k(E().m(function e(t,n){var r,o,i;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,32===(r=S.from(t,\"hex\")).length){e.n=1;break}throw new B(\"Invalid WASM hash length: expected 32 bytes, got \".concat(r.length));case 1:return e.n=2,P(n,r);case 2:return o=e.v,e.a(2,{type:\"wasm\",wasmBytes:o});case 3:throw e.p=3,i=e.v,new B(\"Failed to fetch WASM from hash \".concat(t),i);case 4:return e.a(2)}},e,null,[[0,3]])}))).apply(this,arguments)}function M(e,t){return D.apply(this,arguments)}function D(){return(D=k(E().m(function e(t,n){var r,o;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,l.StrKey.isValidContract(t)){e.n=1;break}throw new B(\"Invalid contract ID: \".concat(t));case 1:return r=l.Address.fromString(t),e.n=2,U(n,r);case 2:return e.a(2,e.v);case 3:throw e.p=3,o=e.v,new B(\"Failed to fetch WASM from contract \".concat(t),o);case 4:return e.a(2)}},e,null,[[0,3]])}))).apply(this,arguments)}function q(e){return q=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},q(e)}function V(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return z(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(z(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,z(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,z(f,\"constructor\",u),z(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",z(u,o,\"GeneratorFunction\"),z(f),z(f,o,\"Generator\"),z(f,r,function(){return this}),z(f,\"toString\",function(){return\"[object Generator]\"}),(V=function(){return{w:i,m:p}})()}function z(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}z=function(e,t,n,r){function i(t,n){z(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},z(e,t,n,r)}function K(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function H(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){K(i,r,o,a,s,\"next\",e)}function s(e){K(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function $(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,G(r.key),r)}}function G(e){var t=function(e){if(\"object\"!=q(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=q(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==q(t)?t:t+\"\"}var W=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.spec=t}return function(e,t,n){return t&&$(e.prototype,t),n&&$(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(e,[{key:\"generate\",value:function(e){this.validateOptions(e);var t=new y(this.spec),n=new b(this.spec),r=t.generate(),o=n.generate(),i='export { Client } from \"./client.js\";';\"\"!==r.trim()&&(i=i.concat('\\nexport * from \"./types.js\";'));var a=(new u).generate(e);return{index:i,types:r,client:o,packageJson:a.packageJson,tsConfig:a.tsConfig,readme:a.readme,gitignore:a.gitignore}}},{key:\"validateOptions\",value:function(e){if(!e.contractName||\"\"===e.contractName.trim())throw new Error(\"contractName is required and cannot be empty\")}}],[{key:\"fromSpec\",value:function(t){return new e(t)}},{key:\"fromWasm\",value:function(t){return new e(new r.Spec((0,w.U)(t)))}},{key:\"fromWasmHash\",value:(n=H(V().m(function t(n,r){var o;return V().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,N(n,r);case 1:if(\"wasm\"===(o=t.v).type){t.n=2;break}throw new Error(\"Fetched contract is not of type 'wasm'\");case 2:return t.a(2,e.fromWasm(o.wasmBytes))}},t)})),function(e,t){return n.apply(this,arguments)})},{key:\"fromContractId\",value:(t=H(V().m(function t(n,o){var i,a;return V().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,M(n,o);case 1:if(\"wasm\"!==(i=t.v).type){t.n=2;break}return t.a(2,e.fromWasm(i.wasmBytes));case 2:return a=new r.Spec(\"AAAAAAAAAYpSZXR1cm5zIHRoZSBhbGxvd2FuY2UgZm9yIGBzcGVuZGVyYCB0byB0cmFuc2ZlciBmcm9tIGBmcm9tYC4KClRoZSBhbW91bnQgcmV0dXJuZWQgaXMgdGhlIGFtb3VudCB0aGF0IHNwZW5kZXIgaXMgYWxsb3dlZCB0byB0cmFuc2ZlcgpvdXQgb2YgZnJvbSdzIGJhbGFuY2UuIFdoZW4gdGhlIHNwZW5kZXIgdHJhbnNmZXJzIGFtb3VudHMsIHRoZSBhbGxvd2FuY2UKd2lsbCBiZSByZWR1Y2VkIGJ5IHRoZSBhbW91bnQgdHJhbnNmZXJyZWQuCgojIEFyZ3VtZW50cwoKKiBgZnJvbWAgLSBUaGUgYWRkcmVzcyBob2xkaW5nIHRoZSBiYWxhbmNlIG9mIHRva2VucyB0byBiZSBkcmF3biBmcm9tLgoqIGBzcGVuZGVyYCAtIFRoZSBhZGRyZXNzIHNwZW5kaW5nIHRoZSB0b2tlbnMgaGVsZCBieSBgZnJvbWAuAAAAAAAJYWxsb3dhbmNlAAAAAAAAAgAAAAAAAAAEZnJvbQAAABMAAAAAAAAAB3NwZW5kZXIAAAAAEwAAAAEAAAALAAAAAAAAAIlSZXR1cm5zIHRydWUgaWYgYGlkYCBpcyBhdXRob3JpemVkIHRvIHVzZSBpdHMgYmFsYW5jZS4KCiMgQXJndW1lbnRzCgoqIGBpZGAgLSBUaGUgYWRkcmVzcyBmb3Igd2hpY2ggdG9rZW4gYXV0aG9yaXphdGlvbiBpcyBiZWluZyBjaGVja2VkLgAAAAAAAAphdXRob3JpemVkAAAAAAABAAAAAAAAAAJpZAAAAAAAEwAAAAEAAAABAAAAAAAAA59TZXQgdGhlIGFsbG93YW5jZSBieSBgYW1vdW50YCBmb3IgYHNwZW5kZXJgIHRvIHRyYW5zZmVyL2J1cm4gZnJvbQpgZnJvbWAuCgpUaGUgYW1vdW50IHNldCBpcyB0aGUgYW1vdW50IHRoYXQgc3BlbmRlciBpcyBhcHByb3ZlZCB0byB0cmFuc2ZlciBvdXQgb2YKZnJvbSdzIGJhbGFuY2UuIFRoZSBzcGVuZGVyIHdpbGwgYmUgYWxsb3dlZCB0byB0cmFuc2ZlciBhbW91bnRzLCBhbmQKd2hlbiBhbiBhbW91bnQgaXMgdHJhbnNmZXJyZWQgdGhlIGFsbG93YW5jZSB3aWxsIGJlIHJlZHVjZWQgYnkgdGhlCmFtb3VudCB0cmFuc2ZlcnJlZC4KCiMgQXJndW1lbnRzCgoqIGBmcm9tYCAtIFRoZSBhZGRyZXNzIGhvbGRpbmcgdGhlIGJhbGFuY2Ugb2YgdG9rZW5zIHRvIGJlIGRyYXduIGZyb20uCiogYHNwZW5kZXJgIC0gVGhlIGFkZHJlc3MgYmVpbmcgYXV0aG9yaXplZCB0byBzcGVuZCB0aGUgdG9rZW5zIGhlbGQgYnkKYGZyb21gLgoqIGBhbW91bnRgIC0gVGhlIHRva2VucyB0byBiZSBtYWRlIGF2YWlsYWJsZSB0byBgc3BlbmRlcmAuCiogYGV4cGlyYXRpb25fbGVkZ2VyYCAtIFRoZSBsZWRnZXIgbnVtYmVyIHdoZXJlIHRoaXMgYWxsb3dhbmNlIGV4cGlyZXMuIENhbm5vdApiZSBsZXNzIHRoYW4gdGhlIGN1cnJlbnQgbGVkZ2VyIG51bWJlciB1bmxlc3MgdGhlIGFtb3VudCBpcyBiZWluZyBzZXQgdG8gMC4KQW4gZXhwaXJlZCBlbnRyeSAod2hlcmUgZXhwaXJhdGlvbl9sZWRnZXIgPCB0aGUgY3VycmVudCBsZWRnZXIgbnVtYmVyKQpzaG91bGQgYmUgdHJlYXRlZCBhcyBhIDAgYW1vdW50IGFsbG93YW5jZS4KCiMgRXZlbnRzCgpFbWl0cyBhbiBldmVudCB3aXRoIHRvcGljcyBgWyJhcHByb3ZlIiwgZnJvbTogQWRkcmVzcywKc3BlbmRlcjogQWRkcmVzc10sIGRhdGEgPSBbYW1vdW50OiBpMTI4LCBleHBpcmF0aW9uX2xlZGdlcjogdTMyXWAAAAAAB2FwcHJvdmUAAAAABAAAAAAAAAAEZnJvbQAAABMAAAAAAAAAB3NwZW5kZXIAAAAAEwAAAAAAAAAGYW1vdW50AAAAAAALAAAAAAAAABFleHBpcmF0aW9uX2xlZGdlcgAAAAAAAAQAAAAAAAAAAAAAAJhSZXR1cm5zIHRoZSBiYWxhbmNlIG9mIGBpZGAuCgojIEFyZ3VtZW50cwoKKiBgaWRgIC0gVGhlIGFkZHJlc3MgZm9yIHdoaWNoIGEgYmFsYW5jZSBpcyBiZWluZyBxdWVyaWVkLiBJZiB0aGUKYWRkcmVzcyBoYXMgbm8gZXhpc3RpbmcgYmFsYW5jZSwgcmV0dXJucyAwLgAAAAdiYWxhbmNlAAAAAAEAAAAAAAAAAmlkAAAAAAATAAAAAQAAAAsAAAAAAAABYkJ1cm4gYGFtb3VudGAgZnJvbSBgZnJvbWAuCgpSZWR1Y2VzIGZyb20ncyBiYWxhbmNlIGJ5IHRoZSBhbW91bnQsIHdpdGhvdXQgdHJhbnNmZXJyaW5nIHRoZSBiYWxhbmNlCnRvIGFub3RoZXIgaG9sZGVyJ3MgYmFsYW5jZS4KCiMgQXJndW1lbnRzCgoqIGBmcm9tYCAtIFRoZSBhZGRyZXNzIGhvbGRpbmcgdGhlIGJhbGFuY2Ugb2YgdG9rZW5zIHdoaWNoIHdpbGwgYmUKYnVybmVkIGZyb20uCiogYGFtb3VudGAgLSBUaGUgYW1vdW50IG9mIHRva2VucyB0byBiZSBidXJuZWQuCgojIEV2ZW50cwoKRW1pdHMgYW4gZXZlbnQgd2l0aCB0b3BpY3MgYFsiYnVybiIsIGZyb206IEFkZHJlc3NdLCBkYXRhID0gYW1vdW50OgppMTI4YAAAAAAABGJ1cm4AAAACAAAAAAAAAARmcm9tAAAAEwAAAAAAAAAGYW1vdW50AAAAAAALAAAAAAAAAAAAAALaQnVybiBgYW1vdW50YCBmcm9tIGBmcm9tYCwgY29uc3VtaW5nIHRoZSBhbGxvd2FuY2Ugb2YgYHNwZW5kZXJgLgoKUmVkdWNlcyBmcm9tJ3MgYmFsYW5jZSBieSB0aGUgYW1vdW50LCB3aXRob3V0IHRyYW5zZmVycmluZyB0aGUgYmFsYW5jZQp0byBhbm90aGVyIGhvbGRlcidzIGJhbGFuY2UuCgpUaGUgc3BlbmRlciB3aWxsIGJlIGFsbG93ZWQgdG8gYnVybiB0aGUgYW1vdW50IGZyb20gZnJvbSdzIGJhbGFuY2UsIGlmCnRoZSBhbW91bnQgaXMgbGVzcyB0aGFuIG9yIGVxdWFsIHRvIHRoZSBhbGxvd2FuY2UgdGhhdCB0aGUgc3BlbmRlciBoYXMKb24gdGhlIGZyb20ncyBiYWxhbmNlLiBUaGUgc3BlbmRlcidzIGFsbG93YW5jZSBvbiBmcm9tJ3MgYmFsYW5jZSB3aWxsIGJlCnJlZHVjZWQgYnkgdGhlIGFtb3VudC4KCiMgQXJndW1lbnRzCgoqIGBzcGVuZGVyYCAtIFRoZSBhZGRyZXNzIGF1dGhvcml6aW5nIHRoZSBidXJuLCBhbmQgaGF2aW5nIGl0cyBhbGxvd2FuY2UKY29uc3VtZWQgZHVyaW5nIHRoZSBidXJuLgoqIGBmcm9tYCAtIFRoZSBhZGRyZXNzIGhvbGRpbmcgdGhlIGJhbGFuY2Ugb2YgdG9rZW5zIHdoaWNoIHdpbGwgYmUKYnVybmVkIGZyb20uCiogYGFtb3VudGAgLSBUaGUgYW1vdW50IG9mIHRva2VucyB0byBiZSBidXJuZWQuCgojIEV2ZW50cwoKRW1pdHMgYW4gZXZlbnQgd2l0aCB0b3BpY3MgYFsiYnVybiIsIGZyb206IEFkZHJlc3NdLCBkYXRhID0gYW1vdW50OgppMTI4YAAAAAAACWJ1cm5fZnJvbQAAAAAAAAMAAAAAAAAAB3NwZW5kZXIAAAAAEwAAAAAAAAAEZnJvbQAAABMAAAAAAAAABmFtb3VudAAAAAAACwAAAAAAAAAAAAABUUNsYXdiYWNrIGBhbW91bnRgIGZyb20gYGZyb21gIGFjY291bnQuIGBhbW91bnRgIGlzIGJ1cm5lZCBpbiB0aGUKY2xhd2JhY2sgcHJvY2Vzcy4KCiMgQXJndW1lbnRzCgoqIGBmcm9tYCAtIFRoZSBhZGRyZXNzIGhvbGRpbmcgdGhlIGJhbGFuY2UgZnJvbSB3aGljaCB0aGUgY2xhd2JhY2sgd2lsbAp0YWtlIHRva2Vucy4KKiBgYW1vdW50YCAtIFRoZSBhbW91bnQgb2YgdG9rZW5zIHRvIGJlIGNsYXdlZCBiYWNrLgoKIyBFdmVudHMKCkVtaXRzIGFuIGV2ZW50IHdpdGggdG9waWNzIGBbImNsYXdiYWNrIiwgYWRtaW46IEFkZHJlc3MsIHRvOiBBZGRyZXNzXSwKZGF0YSA9IGFtb3VudDogaTEyOGAAAAAAAAAIY2xhd2JhY2sAAAACAAAAAAAAAARmcm9tAAAAEwAAAAAAAAAGYW1vdW50AAAAAAALAAAAAAAAAAAAAACAUmV0dXJucyB0aGUgbnVtYmVyIG9mIGRlY2ltYWxzIHVzZWQgdG8gcmVwcmVzZW50IGFtb3VudHMgb2YgdGhpcyB0b2tlbi4KCiMgUGFuaWNzCgpJZiB0aGUgY29udHJhY3QgaGFzIG5vdCB5ZXQgYmVlbiBpbml0aWFsaXplZC4AAAAIZGVjaW1hbHMAAAAAAAAAAQAAAAQAAAAAAAAA801pbnRzIGBhbW91bnRgIHRvIGB0b2AuCgojIEFyZ3VtZW50cwoKKiBgdG9gIC0gVGhlIGFkZHJlc3Mgd2hpY2ggd2lsbCByZWNlaXZlIHRoZSBtaW50ZWQgdG9rZW5zLgoqIGBhbW91bnRgIC0gVGhlIGFtb3VudCBvZiB0b2tlbnMgdG8gYmUgbWludGVkLgoKIyBFdmVudHMKCkVtaXRzIGFuIGV2ZW50IHdpdGggdG9waWNzIGBbIm1pbnQiLCBhZG1pbjogQWRkcmVzcywgdG86IEFkZHJlc3NdLCBkYXRhCj0gYW1vdW50OiBpMTI4YAAAAAAEbWludAAAAAIAAAAAAAAAAnRvAAAAAAATAAAAAAAAAAZhbW91bnQAAAAAAAsAAAAAAAAAAAAAAFlSZXR1cm5zIHRoZSBuYW1lIGZvciB0aGlzIHRva2VuLgoKIyBQYW5pY3MKCklmIHRoZSBjb250cmFjdCBoYXMgbm90IHlldCBiZWVuIGluaXRpYWxpemVkLgAAAAAAAARuYW1lAAAAAAAAAAEAAAAQAAAAAAAAAQxTZXRzIHRoZSBhZG1pbmlzdHJhdG9yIHRvIHRoZSBzcGVjaWZpZWQgYWRkcmVzcyBgbmV3X2FkbWluYC4KCiMgQXJndW1lbnRzCgoqIGBuZXdfYWRtaW5gIC0gVGhlIGFkZHJlc3Mgd2hpY2ggd2lsbCBoZW5jZWZvcnRoIGJlIHRoZSBhZG1pbmlzdHJhdG9yCm9mIHRoaXMgdG9rZW4gY29udHJhY3QuCgojIEV2ZW50cwoKRW1pdHMgYW4gZXZlbnQgd2l0aCB0b3BpY3MgYFsic2V0X2FkbWluIiwgYWRtaW46IEFkZHJlc3NdLCBkYXRhID0KW25ld19hZG1pbjogQWRkcmVzc11gAAAACXNldF9hZG1pbgAAAAAAAAEAAAAAAAAACW5ld19hZG1pbgAAAAAAABMAAAAAAAAAAAAAAEZSZXR1cm5zIHRoZSBhZG1pbiBvZiB0aGUgY29udHJhY3QuCgojIFBhbmljcwoKSWYgdGhlIGFkbWluIGlzIG5vdCBzZXQuAAAAAAAFYWRtaW4AAAAAAAAAAAAAAQAAABMAAAAAAAABUFNldHMgd2hldGhlciB0aGUgYWNjb3VudCBpcyBhdXRob3JpemVkIHRvIHVzZSBpdHMgYmFsYW5jZS4gSWYKYGF1dGhvcml6ZWRgIGlzIHRydWUsIGBpZGAgc2hvdWxkIGJlIGFibGUgdG8gdXNlIGl0cyBiYWxhbmNlLgoKIyBBcmd1bWVudHMKCiogYGlkYCAtIFRoZSBhZGRyZXNzIGJlaW5nIChkZS0pYXV0aG9yaXplZC4KKiBgYXV0aG9yaXplYCAtIFdoZXRoZXIgb3Igbm90IGBpZGAgY2FuIHVzZSBpdHMgYmFsYW5jZS4KCiMgRXZlbnRzCgpFbWl0cyBhbiBldmVudCB3aXRoIHRvcGljcyBgWyJzZXRfYXV0aG9yaXplZCIsIGlkOiBBZGRyZXNzXSwgZGF0YSA9ClthdXRob3JpemU6IGJvb2xdYAAAAA5zZXRfYXV0aG9yaXplZAAAAAAAAgAAAAAAAAACaWQAAAAAABMAAAAAAAAACWF1dGhvcml6ZQAAAAAAAAEAAAAAAAAAAAAAAFtSZXR1cm5zIHRoZSBzeW1ib2wgZm9yIHRoaXMgdG9rZW4uCgojIFBhbmljcwoKSWYgdGhlIGNvbnRyYWN0IGhhcyBub3QgeWV0IGJlZW4gaW5pdGlhbGl6ZWQuAAAAAAZzeW1ib2wAAAAAAAAAAAABAAAAEAAAAAAAAAFiVHJhbnNmZXIgYGFtb3VudGAgZnJvbSBgZnJvbWAgdG8gYHRvYC4KCiMgQXJndW1lbnRzCgoqIGBmcm9tYCAtIFRoZSBhZGRyZXNzIGhvbGRpbmcgdGhlIGJhbGFuY2Ugb2YgdG9rZW5zIHdoaWNoIHdpbGwgYmUKd2l0aGRyYXduIGZyb20uCiogYHRvYCAtIFRoZSBhZGRyZXNzIHdoaWNoIHdpbGwgcmVjZWl2ZSB0aGUgdHJhbnNmZXJyZWQgdG9rZW5zLgoqIGBhbW91bnRgIC0gVGhlIGFtb3VudCBvZiB0b2tlbnMgdG8gYmUgdHJhbnNmZXJyZWQuCgojIEV2ZW50cwoKRW1pdHMgYW4gZXZlbnQgd2l0aCB0b3BpY3MgYFsidHJhbnNmZXIiLCBmcm9tOiBBZGRyZXNzLCB0bzogQWRkcmVzc10sCmRhdGEgPSBhbW91bnQ6IGkxMjhgAAAAAAAIdHJhbnNmZXIAAAADAAAAAAAAAARmcm9tAAAAEwAAAAAAAAACdG8AAAAAABMAAAAAAAAABmFtb3VudAAAAAAACwAAAAAAAAAAAAADMVRyYW5zZmVyIGBhbW91bnRgIGZyb20gYGZyb21gIHRvIGB0b2AsIGNvbnN1bWluZyB0aGUgYWxsb3dhbmNlIHRoYXQKYHNwZW5kZXJgIGhhcyBvbiBgZnJvbWAncyBiYWxhbmNlLiBBdXRob3JpemVkIGJ5IHNwZW5kZXIKKGBzcGVuZGVyLnJlcXVpcmVfYXV0aCgpYCkuCgpUaGUgc3BlbmRlciB3aWxsIGJlIGFsbG93ZWQgdG8gdHJhbnNmZXIgdGhlIGFtb3VudCBmcm9tIGZyb20ncyBiYWxhbmNlCmlmIHRoZSBhbW91bnQgaXMgbGVzcyB0aGFuIG9yIGVxdWFsIHRvIHRoZSBhbGxvd2FuY2UgdGhhdCB0aGUgc3BlbmRlcgpoYXMgb24gdGhlIGZyb20ncyBiYWxhbmNlLiBUaGUgc3BlbmRlcidzIGFsbG93YW5jZSBvbiBmcm9tJ3MgYmFsYW5jZQp3aWxsIGJlIHJlZHVjZWQgYnkgdGhlIGFtb3VudC4KCiMgQXJndW1lbnRzCgoqIGBzcGVuZGVyYCAtIFRoZSBhZGRyZXNzIGF1dGhvcml6aW5nIHRoZSB0cmFuc2ZlciwgYW5kIGhhdmluZyBpdHMKYWxsb3dhbmNlIGNvbnN1bWVkIGR1cmluZyB0aGUgdHJhbnNmZXIuCiogYGZyb21gIC0gVGhlIGFkZHJlc3MgaG9sZGluZyB0aGUgYmFsYW5jZSBvZiB0b2tlbnMgd2hpY2ggd2lsbCBiZQp3aXRoZHJhd24gZnJvbS4KKiBgdG9gIC0gVGhlIGFkZHJlc3Mgd2hpY2ggd2lsbCByZWNlaXZlIHRoZSB0cmFuc2ZlcnJlZCB0b2tlbnMuCiogYGFtb3VudGAgLSBUaGUgYW1vdW50IG9mIHRva2VucyB0byBiZSB0cmFuc2ZlcnJlZC4KCiMgRXZlbnRzCgpFbWl0cyBhbiBldmVudCB3aXRoIHRvcGljcyBgWyJ0cmFuc2ZlciIsIGZyb206IEFkZHJlc3MsIHRvOiBBZGRyZXNzXSwKZGF0YSA9IGFtb3VudDogaTEyOGAAAAAAAAANdHJhbnNmZXJfZnJvbQAAAAAAAAQAAAAAAAAAB3NwZW5kZXIAAAAAEwAAAAAAAAAEZnJvbQAAABMAAAAAAAAAAnRvAAAAAAATAAAAAAAAAAZhbW91bnQAAAAAAAsAAAAAAAAABQAAAAAAAAAAAAAAB0FwcHJvdmUAAAAAAQAAAAdhcHByb3ZlAAAAAAQAAAAAAAAABGZyb20AAAATAAAAAQAAAAAAAAAHc3BlbmRlcgAAAAATAAAAAQAAAAAAAAAGYW1vdW50AAAAAAALAAAAAAAAAAAAAAARZXhwaXJhdGlvbl9sZWRnZXIAAAAAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAIVHJhbnNmZXIAAAABAAAACHRyYW5zZmVyAAAAAwAAAAAAAAAEZnJvbQAAABMAAAABAAAAAAAAAAJ0bwAAAAAAEwAAAAEAAAAAAAAABmFtb3VudAAAAAAACwAAAAAAAAAAAAAABQAAAAAAAAAAAAAADVRyYW5zZmVyTXV4ZWQAAAAAAAABAAAACHRyYW5zZmVyAAAABAAAAAAAAAAEZnJvbQAAABMAAAABAAAAAAAAAAJ0bwAAAAAAEwAAAAEAAAAAAAAAC3RvX211eGVkX2lkAAAAAAQAAAAAAAAAAAAAAAZhbW91bnQAAAAAAAsAAAAAAAAAAgAAAAUAAAAAAAAAAAAAAARCdXJuAAAAAQAAAARidXJuAAAAAgAAAAAAAAAEZnJvbQAAABMAAAABAAAAAAAAAAZhbW91bnQAAAAAAAsAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAARNaW50AAAAAQAAAARtaW50AAAAAgAAAAAAAAACdG8AAAAAABMAAAABAAAAAAAAAAZhbW91bnQAAAAAAAsAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAhDbGF3YmFjawAAAAEAAAAIY2xhd2JhY2sAAAACAAAAAAAAAARmcm9tAAAAEwAAAAEAAAAAAAAABmFtb3VudAAAAAAACwAAAAAAAAAAAAAABQAAAAAAAAAAAAAACFNldEFkbWluAAAAAQAAAAlzZXRfYWRtaW4AAAAAAAABAAAAAAAAAAluZXdfYWRtaW4AAAAAAAATAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAANU2V0QXV0aG9yaXplZAAAAAAAAAEAAAAOc2V0X2F1dGhvcml6ZWQAAAAAAAIAAAAAAAAAAmlkAAAAAAATAAAAAQAAAAAAAAAJYXV0aG9yaXplAAAAAAAAAQAAAAAAAAAA\"),t.a(2,e.fromSpec(a))}},t)})),function(e,n){return t.apply(this,arguments)})}]);var t,n}()},4366(e,t,n){\"use strict\";n.d(t,{Q7:()=>d,SB:()=>p,Sq:()=>f,c0:()=>s,ch:()=>l,ff:()=>a,z0:()=>c});var r=n(8950);function o(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||function(e,t){if(e){if(\"string\"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e){var t=e.replace(/[^a-zA-Z0-9_$]/g,\"_\");return[\"break\",\"case\",\"catch\",\"class\",\"const\",\"continue\",\"debugger\",\"default\",\"delete\",\"do\",\"else\",\"export\",\"extends\",\"finally\",\"for\",\"function\",\"if\",\"import\",\"in\",\"instanceof\",\"new\",\"return\",\"super\",\"switch\",\"this\",\"throw\",\"try\",\"typeof\",\"var\",\"void\",\"while\",\"with\",\"yield\",\"enum\",\"implements\",\"interface\",\"let\",\"package\",\"private\",\"protected\",\"public\",\"static\",\"async\",\"await\",\"constructor\",\"null\",\"true\",\"false\"].includes(t)?t+\"_\":/^\\d/.test(t)?\"_\"+t:\"\"===t||/^_+$/.test(t)?\"_unnamed\":t}function s(e){return e.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\")}function c(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e.switch()){case r.xdr.ScSpecType.scSpecTypeVal():return\"any\";case r.xdr.ScSpecType.scSpecTypeBool():return\"boolean\";case r.xdr.ScSpecType.scSpecTypeVoid():return\"null\";case r.xdr.ScSpecType.scSpecTypeError():return\"Error\";case r.xdr.ScSpecType.scSpecTypeU32():case r.xdr.ScSpecType.scSpecTypeI32():return\"number\";case r.xdr.ScSpecType.scSpecTypeU64():case r.xdr.ScSpecType.scSpecTypeI64():case r.xdr.ScSpecType.scSpecTypeTimepoint():case r.xdr.ScSpecType.scSpecTypeDuration():case r.xdr.ScSpecType.scSpecTypeU128():case r.xdr.ScSpecType.scSpecTypeI128():case r.xdr.ScSpecType.scSpecTypeU256():case r.xdr.ScSpecType.scSpecTypeI256():return\"bigint\";case r.xdr.ScSpecType.scSpecTypeBytes():case r.xdr.ScSpecType.scSpecTypeBytesN():return\"Buffer\";case r.xdr.ScSpecType.scSpecTypeString():case r.xdr.ScSpecType.scSpecTypeSymbol():return\"string\";case r.xdr.ScSpecType.scSpecTypeAddress():case r.xdr.ScSpecType.scSpecTypeMuxedAddress():return t?\"string | Address\":\"string\";case r.xdr.ScSpecType.scSpecTypeVec():var n=c(e.vec().elementType(),t);return\"Array<\".concat(n,\">\");case r.xdr.ScSpecType.scSpecTypeMap():var o=c(e.map().keyType(),t),i=c(e.map().valueType(),t);return\"Map<\".concat(o,\", \").concat(i,\">\");case r.xdr.ScSpecType.scSpecTypeTuple():var s=e.tuple().valueTypes().map(function(e){return c(e,t)});return\"[\".concat(s.join(\", \"),\"]\");case r.xdr.ScSpecType.scSpecTypeOption():for(;e.option().valueType().switch()===r.xdr.ScSpecType.scSpecTypeOption();)e=e.option().valueType();var u=c(e.option().valueType(),t);return\"\".concat(u,\" | null\");case r.xdr.ScSpecType.scSpecTypeResult():var l=c(e.result().okType(),t),f=c(e.result().errorType(),t);return\"Result<\".concat(l,\", \").concat(f,\">\");case r.xdr.ScSpecType.scSpecTypeUdt():return a(e.udt().name().toString());default:return\"unknown\"}}function u(e,t){switch(e.switch()){case r.xdr.ScSpecType.scSpecTypeUdt():return void t.typeFileImports.add(a(e.udt().name().toString()));case r.xdr.ScSpecType.scSpecTypeAddress():case r.xdr.ScSpecType.scSpecTypeMuxedAddress():return void t.stellarImports.add(\"Address\");case r.xdr.ScSpecType.scSpecTypeBytes():case r.xdr.ScSpecType.scSpecTypeBytesN():return void(t.needsBufferImport=!0);case r.xdr.ScSpecType.scSpecTypeVal():return void t.stellarImports.add(\"xdr\");case r.xdr.ScSpecType.scSpecTypeResult():t.stellarContractImports.add(\"Result\");break;case r.xdr.ScSpecType.scSpecTypeBool():case r.xdr.ScSpecType.scSpecTypeVoid():case r.xdr.ScSpecType.scSpecTypeError():case r.xdr.ScSpecType.scSpecTypeU32():case r.xdr.ScSpecType.scSpecTypeI32():case r.xdr.ScSpecType.scSpecTypeU64():case r.xdr.ScSpecType.scSpecTypeI64():case r.xdr.ScSpecType.scSpecTypeTimepoint():case r.xdr.ScSpecType.scSpecTypeDuration():case r.xdr.ScSpecType.scSpecTypeU128():case r.xdr.ScSpecType.scSpecTypeI128():case r.xdr.ScSpecType.scSpecTypeU256():case r.xdr.ScSpecType.scSpecTypeI256():case r.xdr.ScSpecType.scSpecTypeString():case r.xdr.ScSpecType.scSpecTypeSymbol():return}var n=function(e){switch(e.switch()){case r.xdr.ScSpecType.scSpecTypeVec():return[e.vec().elementType()];case r.xdr.ScSpecType.scSpecTypeMap():return[e.map().keyType(),e.map().valueType()];case r.xdr.ScSpecType.scSpecTypeTuple():return e.tuple().valueTypes();case r.xdr.ScSpecType.scSpecTypeOption():return[e.option().valueType()];case r.xdr.ScSpecType.scSpecTypeResult():return[e.result().okType(),e.result().errorType()];default:return[]}}(e);n.forEach(function(e){return u(e,t)})}function l(e){var t={typeFileImports:new Set,stellarContractImports:new Set,stellarImports:new Set,needsBufferImport:!1};return e.forEach(function(e){return u(e,t)}),t}function f(e,t){var n=[],r=e.typeFileImports,i=[].concat(o(e.stellarContractImports),o((null==t?void 0:t.additionalStellarContractImports)||[])),a=[].concat(o(e.stellarImports),o((null==t?void 0:t.additionalStellarImports)||[]));if(null!=t&&t.includeTypeFileImports&&r.size>0&&n.push(\"import {\".concat(Array.from(r).join(\", \"),\"} from './types.js';\")),i.length>0){var s=Array.from(new Set(i));n.push(\"import {\".concat(s.join(\", \"),\"} from '@stellar/stellar-sdk/contract';\"))}if(a.length>0){var c=Array.from(new Set(a));n.push(\"import {\".concat(c.join(\", \"),\"} from '@stellar/stellar-sdk';\"))}return e.needsBufferImport&&n.push(\"import { Buffer } from 'buffer';\"),n.join(\"\\n\")}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(\"\"===e.trim())return\"\";var n=\" \".repeat(t),r=e.replace(/\\*\\//g,\"* /\").replace(/@(?!(param|returns?|type|throws?|example|deprecated|see|link|since|author|version|description|summary)\\b)/g,\"\\\\@\").split(\"\\n\").map(function(e){return\"\".concat(n,\" * \").concat(e).trimEnd()});return\"\".concat(n,\"/**\\n\").concat(r.join(\"\\n\"),\"\\n\").concat(n,\" */\\n\")}function d(e){return e.fields().every(function(e,t){return e.name().toString().trim()===t.toString()})}},1924(e,t,n){\"use strict\";n.r(t),n.d(t,{StellarBase:()=>a,default:()=>s,httpClient:()=>r.ok});var r=n(9983),o=n(4356),i={};for(const e in o)[\"default\",\"StellarBase\",\"httpClient\"].indexOf(e)<0&&(i[e]=()=>o[e]);n.d(t,i);var a=n(8950);const s=(e=n.hmd(e)).exports},8732(e,t,n){\"use strict\";function r(e){return r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){var t=function(e){if(\"object\"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=r(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==r(t)?t:t+\"\"}n.d(t,{T:()=>d});var u,l,f={allowHttp:!1,timeout:0},p=a({},f),d=(u=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e)},l=[{key:\"setAllowHttp\",value:function(e){p.allowHttp=e}},{key:\"setTimeout\",value:function(e){p.timeout=e}},{key:\"isAllowHttp\",value:function(){return p.allowHttp}},{key:\"getTimeout\",value:function(){return p.timeout}},{key:\"setDefault\",value:function(){p=a({},f)}}],l&&o(u,l),Object.defineProperty(u,\"prototype\",{writable:!1}),u)},8250(e,t,n){\"use strict\";n.r(t),n.d(t,{AssembledTransaction:()=>Ee,Client:()=>ut,DEFAULT_TIMEOUT:()=>g.c,Err:()=>h,NULL_ACCOUNT:()=>g.u,Ok:()=>d,SentTransaction:()=>j,Spec:()=>Ke,Watcher:()=>U,basicNodeSigner:()=>Ie});var r=n(8950),o=n(3496),i=n(4076),a=n(8680);function s(e){return s=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},s(e)}function c(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}function f(e){var t=function(e){if(\"object\"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=s(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==s(t)?t:t+\"\"}var p,d=l(function e(t){c(this,e),this.value=t},[{key:\"unwrapErr\",value:function(){throw new Error(\"No error\")}},{key:\"unwrap\",value:function(){return this.value}},{key:\"isOk\",value:function(){return!0}},{key:\"isErr\",value:function(){return!1}}]),h=l(function e(t){c(this,e),this.error=t},[{key:\"unwrapErr\",value:function(){return this.error}},{key:\"unwrap\",value:function(){throw new Error(this.error.message)}},{key:\"isOk\",value:function(){return!1}},{key:\"isErr\",value:function(){return!0}}]),y=n(8302),g=n(9138);function m(e,t,n){return t=A(t),function(e,t){if(t&&(\"object\"==E(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,w()?Reflect.construct(t,n||[],A(e).constructor):t.apply(e,n))}function v(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&S(e,t)}function b(e){var t=\"function\"==typeof Map?new Map:void 0;return b=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf(\"[native code]\")}catch(t){return\"function\"==typeof e}}(e))return e;if(\"function\"!=typeof e)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(w())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&S(o,n.prototype),o}(e,arguments,A(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),S(n,e)},b(e)}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function E(e){return E=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},E(e)}function x(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return T(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(T(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,T(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,T(f,\"constructor\",u),T(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",T(u,o,\"GeneratorFunction\"),T(f),T(f,o,\"Generator\"),T(f,r,function(){return this}),T(f,\"toString\",function(){return\"[object Generator]\"}),(x=function(){return{w:i,m:p}})()}function T(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}T=function(e,t,n,r){function i(t,n){T(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},T(e,t,n,r)}function k(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function O(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){k(i,r,o,a,s,\"next\",e)}function s(e){k(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function _(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}function C(e,t,n){return t&&I(e.prototype,t),n&&I(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}function B(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e){if(\"object\"!=E(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=E(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==E(t)?t:t+\"\"}var R,j=function(){function e(t){var n,r=this;_(this,e),B(this,\"send\",(n=O(x().m(function t(n){var o,a,s;return x().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.server.sendTransaction(r.assembled.signed);case 1:if(r.sendTransactionResponse=t.v,\"PENDING\"===r.sendTransactionResponse.status){t.n=2;break}throw new e.Errors.SendFailed(\"Sending the transaction to the network failed!\\n\".concat(JSON.stringify(r.sendTransactionResponse,null,2)));case 2:return null!=n&&n.onSubmitted&&n.onSubmitted(r.sendTransactionResponse),a=r.sendTransactionResponse.hash,s=null!==(o=r.assembled.options.timeoutInSeconds)&&void 0!==o?o:g.c,t.n=3,(0,y.cF)(O(x().m(function e(){var t;return x().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.server.getTransaction(a);case 1:return t=e.v,null!=n&&n.onProgress&&n.onProgress(t),e.a(2,t)}},e)})),function(e){return e.status===i.j.GetTransactionStatus.NOT_FOUND},s);case 3:if(r.getTransactionResponseAll=t.v,r.getTransactionResponse=r.getTransactionResponseAll[r.getTransactionResponseAll.length-1],r.getTransactionResponse.status!==i.j.GetTransactionStatus.NOT_FOUND){t.n=4;break}throw new e.Errors.TransactionStillPending(\"Waited \".concat(s,\" seconds for transaction to complete, but it did not. \")+\"Returning anyway. Check the transaction status manually. \"+\"Sent transaction: \".concat(JSON.stringify(r.sendTransactionResponse,null,2),\"\\n\")+\"All attempts to get the result: \".concat(JSON.stringify(r.getTransactionResponseAll,null,2)));case 4:return t.a(2,r)}},t)})),function(e){return n.apply(this,arguments)})),this.assembled=t;var a=this.assembled.options,s=a.server,c=a.allowHttp,u=a.headers,l=a.rpcUrl;this.server=null!=s?s:new o.Server(l,{allowHttp:c,headers:u})}return C(e,[{key:\"result\",get:function(){if(\"getTransactionResponse\"in this&&this.getTransactionResponse){if(\"returnValue\"in this.getTransactionResponse)return this.assembled.options.parseResultXdr(this.getTransactionResponse.returnValue);throw new Error(\"Transaction failed! Cannot parse result.\")}if(this.sendTransactionResponse){var t,n=null===(t=this.sendTransactionResponse.errorResult)||void 0===t?void 0:t.result();if(n)throw new e.Errors.SendFailed(\"Transaction simulation looked correct, but attempting to send the transaction failed. Check `simulation` and `sendTransactionResponseAll` to troubleshoot. Decoded `sendTransactionResponse.errorResultXdr`: \".concat(n));throw new e.Errors.SendResultOnly(\"Transaction was sent to the network, but not yet awaited. No result to show. Await transaction completion with `getTransaction(sendTransactionResponse.hash)`\")}throw new Error(\"Sending transaction failed: \".concat(JSON.stringify(this.assembled.signed)))}}])}();p=j,B(j,\"Errors\",{SendFailed:function(e){function t(){return _(this,t),m(this,t,arguments)}return v(t,e),C(t)}(b(Error)),SendResultOnly:function(e){function t(){return _(this,t),m(this,t,arguments)}return v(t,e),C(t)}(b(Error)),TransactionStillPending:function(e){function t(){return _(this,t),m(this,t,arguments)}return v(t,e),C(t)}(b(Error))}),B(j,\"init\",(R=O(x().m(function e(t,n){var r,o;return x().w(function(e){for(;;)switch(e.n){case 0:return r=new p(t),e.n=1,r.send(n);case 1:return o=e.v,e.a(2,o)}},e)})),function(e,t){return R.apply(this,arguments)}));var U=C(function e(){_(this,e)});function F(e){return F=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},F(e)}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,M(r.key),r)}}function L(e,t,n){return t&&N(e.prototype,t),n&&N(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),e}function M(e){var t=function(e){if(\"object\"!=F(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=F(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==F(t)?t:t+\"\"}function D(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function q(e,t,n){return t=$(t),function(e,t){if(t&&(\"object\"==F(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,K()?Reflect.construct(t,n||[],$(e).constructor):t.apply(e,n))}function V(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&H(e,t)}function z(e){var t=\"function\"==typeof Map?new Map:void 0;return z=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf(\"[native code]\")}catch(t){return\"function\"==typeof e}}(e))return e;if(\"function\"!=typeof e)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(K())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&H(o,n.prototype),o}(e,arguments,$(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),H(n,e)},z(e)}function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(K=function(){return!!e})()}function H(e,t){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},H(e,t)}function $(e){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$(e)}var G=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),W=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),X=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),Z=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),Y=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),J=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),Q=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),ee=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),te=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),ne=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),re=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),oe=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),ie=function(e){function t(){return D(this,t),q(this,t,arguments)}return V(t,e),L(t)}(z(Error)),ae=n(8287).Buffer;function se(e){return se=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},se(e)}function ce(e){if(null!=e){var t=e[\"function\"==typeof Symbol&&Symbol.iterator||\"@@iterator\"],n=0;if(t)return t.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(se(e)+\" is not iterable\")}function ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||ge(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function le(e,t){var n=\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(!n){if(Array.isArray(e)||(n=ge(e))||t&&e&&\"number\"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach(function(t){Se(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function de(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return he(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(he(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,he(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,he(f,\"constructor\",u),he(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",he(u,o,\"GeneratorFunction\"),he(f),he(f,o,\"Generator\"),he(f,r,function(){return this}),he(f,\"toString\",function(){return\"[object Generator]\"}),(de=function(){return{w:i,m:p}})()}function he(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}he=function(e,t,n,r){function i(t,n){he(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},he(e,t,n,r)}function ye(e){return function(e){if(Array.isArray(e))return me(e)}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||ge(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function ge(e,t){if(e){if(\"string\"==typeof e)return me(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(e,t):void 0}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ve(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function be(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ve(i,r,o,a,s,\"next\",e)}function s(e){ve(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function we(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Ae(r.key),r)}}function Se(e,t,n){return(t=Ae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ae(e){var t=function(e){if(\"object\"!=se(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=se(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==se(t)?t:t+\"\"}var Ee=function(){function e(t){var n,s=this;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Se(this,\"simulate\",be(de().m(function t(){var n,o,c,u,l,f,p,d,h=arguments;return de().w(function(t){for(;;)switch(t.n){case 0:if(n=(h.length>0&&void 0!==h[0]?h[0]:{}).restore,s.built){t.n=2;break}if(s.raw){t.n=1;break}throw new Error(\"Transaction has not yet been assembled; call `AssembledTransaction.build` first.\");case 1:s.built=s.raw.build();case 2:return n=null!=n?n:s.options.restore,delete s.simulationResult,delete s.simulationTransactionData,t.n=3,s.server.simulateTransaction(s.built);case 3:if(s.simulation=t.v,!n||!i.j.isSimulationRestore(s.simulation)){t.n=8;break}return t.n=4,(0,y.sU)(s.options,s.server);case 4:return o=t.v,t.n=5,s.restoreFootprint(s.simulation.restorePreamble,o);case 5:if((c=t.v).status!==i.j.GetTransactionStatus.SUCCESS){t.n=7;break}return d=s.originalOp?s.originalOp:(u=new r.Contract(s.options.contractId)).call.apply(u,[s.options.method].concat(ye(null!==(l=s.options.args)&&void 0!==l?l:[]))),s.raw=new r.TransactionBuilder(o,{fee:null!==(f=s.options.fee)&&void 0!==f?f:r.BASE_FEE,networkPassphrase:s.options.networkPassphrase}).addOperation(d).setTimeout(null!==(p=s.options.timeoutInSeconds)&&void 0!==p?p:g.c),delete s.built,t.n=6,s.simulate();case 6:return t.a(2,s);case 7:throw new e.Errors.RestorationFailure(\"Automatic restore failed! You set 'restore: true' but the attempted restore did not work. Result:\\n\".concat(JSON.stringify(c)));case 8:return i.j.isSimulationSuccess(s.simulation)&&(s.built=(0,a.X)(s.built,s.simulation).build()),t.a(2,s)}},t)}))),Se(this,\"sign\",be(de().m(function t(){var n,o,i,a,c,u,l,f,p,d,h,y,m=arguments;return de().w(function(t){for(;;)switch(t.n){case 0:if(i=(o=m.length>0&&void 0!==m[0]?m[0]:{}).force,a=void 0!==i&&i,c=o.signTransaction,u=void 0===c?s.options.signTransaction:c,s.built){t.n=1;break}throw new Error(\"Transaction has not yet been simulated\");case 1:if(a||!s.isReadCall){t.n=2;break}throw new e.Errors.NoSignatureNeeded(\"This is a read call. It requires no signature or sending. Use `force: true` to sign and send anyway.\");case 2:if(u){t.n=3;break}throw new e.Errors.NoSigner(\"You must provide a signTransaction function, either when calling `signAndSend` or when initializing your Client\");case 3:if(s.options.publicKey){t.n=4;break}throw new e.Errors.FakeAccount(\"This transaction was constructed using a default account. Provide a valid publicKey in the AssembledTransactionOptions.\");case 4:if(!(l=s.needsNonInvokerSigningBy().filter(function(e){return!e.startsWith(\"C\")})).length){t.n=5;break}throw new e.Errors.NeedsMoreSignatures(\"Transaction requires signatures from \".concat(l,\". \")+\"See `needsNonInvokerSigningBy` for details.\");case 5:return f=null!==(n=s.options.timeoutInSeconds)&&void 0!==n?n:g.c,s.built=r.TransactionBuilder.cloneFrom(s.built,{fee:s.built.fee,timebounds:void 0,sorobanData:s.simulationData.transactionData}).setTimeout(f).build(),p={networkPassphrase:s.options.networkPassphrase},s.options.address&&(p.address=s.options.address),void 0!==s.options.submit&&(p.submit=s.options.submit),s.options.submitUrl&&(p.submitUrl=s.options.submitUrl),t.n=6,u(s.built.toXDR(),p);case 6:d=t.v,h=d.signedTxXdr,y=d.error,s.handleWalletError(y),s.signed=r.TransactionBuilder.fromXDR(h,s.options.networkPassphrase);case 7:return t.a(2)}},t)}))),Se(this,\"signAndSend\",be(de().m(function e(){var t,n,r,o,i,a,c,u,l=arguments;return de().w(function(e){for(;;)switch(e.n){case 0:if(n=(t=l.length>0&&void 0!==l[0]?l[0]:{}).force,r=void 0!==n&&n,o=t.signTransaction,i=void 0===o?s.options.signTransaction:o,a=t.watcher,s.signed){e.n=1;break}return c=i||s.options.signTransaction,u=s.options.submit&&c?function(e,t){return c(e,pe(pe({},t),{},{submit:!1}))}:i,e.n=1,s.sign({force:r,signTransaction:u});case 1:return e.a(2,s.send(a))}},e)}))),Se(this,\"needsNonInvokerSigningBy\",function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeAlreadySigned,n=void 0!==t&&t;if(!s.built)throw new Error(\"Transaction has not yet been simulated\");if(!(\"operations\"in s.built))throw new Error(\"Unexpected Transaction type; no operations: \".concat(JSON.stringify(s.built)));var o=s.built.operations[0];return ye(new Set((null!==(e=o.auth)&&void 0!==e?e:[]).filter(function(e){return e.credentials().switch()===r.xdr.SorobanCredentialsType.sorobanCredentialsAddress()&&(n||\"scvVoid\"===e.credentials().address().signature().switch().name)}).map(function(e){return r.Address.fromScAddress(e.credentials().address().address()).toString()})))}),Se(this,\"signAuthEntries\",be(de().m(function t(){var n,o,i,a,c,u,l,f,p,d,h,y,g,m,v,b,w,S=arguments;return de().w(function(t){for(;;)switch(t.p=t.n){case 0:if(i=(o=S.length>0&&void 0!==S[0]?S[0]:{}).expiration,a=void 0===i?be(de().m(function e(){var t;return de().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,s.server.getLatestLedger();case 1:return t=e.v.sequence,e.a(2,t+100)}},e)}))():i,c=o.signAuthEntry,u=void 0===c?s.options.signAuthEntry:c,l=o.address,f=void 0===l?s.options.publicKey:l,p=o.authorizeEntry,d=void 0===p?r.authorizeEntry:p,s.built){t.n=1;break}throw new Error(\"Transaction has not yet been assembled or simulated\");case 1:if(d!==r.authorizeEntry){t.n=4;break}if(0!==(h=s.needsNonInvokerSigningBy()).length){t.n=2;break}throw new e.Errors.NoUnsignedNonInvokerAuthEntries(\"No unsigned non-invoker auth entries; maybe you already signed?\");case 2:if(-1!==h.indexOf(null!=f?f:\"\")){t.n=3;break}throw new e.Errors.NoSignatureNeeded('No auth entries for public key \"'.concat(f,'\"'));case 3:if(u){t.n=4;break}throw new e.Errors.NoSigner(\"You must provide `signAuthEntry` or a custom `authorizeEntry`\");case 4:y=s.built.operations[0],g=null!==(n=y.auth)&&void 0!==n?n:[],m=le(g.entries()),t.p=5,b=de().m(function e(){var t,n,o,i,c,l,p,h;return de().w(function(e){for(;;)switch(e.n){case 0:if(t=ue(v.value,2),n=t[0],o=t[1],(i=r.xdr.SorobanCredentials.fromXDR(o.credentials().toXDR())).switch()===r.xdr.SorobanCredentialsType.sorobanCredentialsAddress()){e.n=1;break}return e.a(2,0);case 1:if(r.Address.fromScAddress(i.address().address()).toString()===f){e.n=2;break}return e.a(2,0);case 2:return c=null!=u?u:Promise.resolve,l=d,p=o,h=function(){var e=be(de().m(function e(t){var n,r,o;return de().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c(t.toXDR(\"base64\"),{address:f});case 1:return n=e.v,r=n.signedAuthEntry,o=n.error,s.handleWalletError(o),e.a(2,ae.from(r,\"base64\"))}},e)}));return function(t){return e.apply(this,arguments)}}(),e.n=3,a;case 3:return e.n=4,l(p,h,e.v,s.options.networkPassphrase);case 4:g[n]=e.v;case 5:return e.a(2)}},e)}),m.s();case 6:if((v=m.n()).done){t.n=9;break}return t.d(ce(b()),7);case 7:if(0!==t.v){t.n=8;break}return t.a(3,8);case 8:t.n=6;break;case 9:t.n=11;break;case 10:t.p=10,w=t.v,m.e(w);case 11:return t.p=11,m.f(),t.f(11);case 12:return t.a(2)}},t,null,[[5,10,11,12]])}))),this.options=t,this.options.simulate=null===(n=this.options.simulate)||void 0===n||n;var c=this.options,u=c.server,l=c.allowHttp,f=c.headers,p=c.rpcUrl;this.server=null!=u?u:new o.Server(p,{allowHttp:l,headers:f})}return t=e,n=[{key:\"toJSON\",value:function(){var e;return JSON.stringify({method:this.options.method,tx:null===(e=this.built)||void 0===e?void 0:e.toXDR(),simulationResult:{auth:this.simulationData.result.auth.map(function(e){return e.toXDR(\"base64\")}),retval:this.simulationData.result.retval.toXDR(\"base64\")},simulationTransactionData:this.simulationData.transactionData.toXDR(\"base64\")})}},{key:\"toXDR\",value:function(){var e;if(!this.built)throw new Error(\"Transaction has not yet been simulated; call `AssembledTransaction.simulate` first.\");return null===(e=this.built)||void 0===e?void 0:e.toEnvelope().toXDR(\"base64\")}},{key:\"handleWalletError\",value:function(t){if(t){var n=t.message,r=t.code,o=\"\".concat(n).concat(t.ext?\" (\".concat(t.ext.join(\", \"),\")\"):\"\");switch(r){case-1:throw new e.Errors.InternalWalletError(o);case-2:throw new e.Errors.ExternalServiceError(o);case-3:throw new e.Errors.InvalidClientRequest(o);case-4:throw new e.Errors.UserRejected(o);default:throw new Error(\"Unhandled error: \".concat(o))}}}},{key:\"simulationData\",get:function(){var t;if(this.simulationResult&&this.simulationTransactionData)return{result:this.simulationResult,transactionData:this.simulationTransactionData};var n=this.simulation;if(!n)throw new e.Errors.NotYetSimulated(\"Transaction has not yet been simulated\");if(i.j.isSimulationError(n))throw new e.Errors.SimulationFailed('Transaction simulation failed: \"'.concat(n.error,'\"'));if(i.j.isSimulationRestore(n))throw new e.Errors.ExpiredState(\"You need to restore some contract state before you can invoke this method.\\nYou can set `restore` to true in the method options in order to automatically restore the contract state when needed.\");return this.simulationResult=null!==(t=n.result)&&void 0!==t?t:{auth:[],retval:r.xdr.ScVal.scvVoid()},this.simulationTransactionData=n.transactionData.build(),{result:this.simulationResult,transactionData:this.simulationTransactionData}}},{key:\"result\",get:function(){try{if(!this.simulationData.result)throw new Error(\"No simulation result!\");return this.options.parseResultXdr(this.simulationData.result.retval)}catch(t){if(!(0,y.pp)(t))throw t;var e=this.parseError(t.toString());if(e)return e;throw t}}},{key:\"parseError\",value:function(e){if(this.options.errorTypes){var t=e.match(y.X8);if(t){var n=parseInt(t[1],10),r=this.options.errorTypes[n];if(r)return new h(r)}}}},{key:\"send\",value:(f=be(de().m(function e(t){var n;return de().w(function(e){for(;;)switch(e.n){case 0:if(this.signed){e.n=1;break}throw new Error(\"The transaction has not yet been signed. Run `sign` first, or use `signAndSend` instead.\");case 1:return e.n=2,j.init(this,t);case 2:return n=e.v,e.a(2,n)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:\"isReadCall\",get:function(){var e=this.simulationData.result.auth.length,t=this.simulationData.transactionData.resources().footprint().readWrite().length;return 0===e&&0===t}},{key:\"restoreFootprint\",value:(l=be(de().m(function t(n,r){var o,i,a;return de().w(function(t){for(;;)switch(t.n){case 0:if(this.options.signTransaction){t.n=1;break}throw new Error(\"For automatic restore to work you must provide a signTransaction function when initializing your Client\");case 1:if(null==r){t.n=2;break}a=r,t.n=4;break;case 2:return t.n=3,(0,y.sU)(this.options,this.server);case 3:a=t.v;case 4:return r=a,t.n=5,e.buildFootprintRestoreTransaction(pe({},this.options),n.transactionData,r,n.minResourceFee);case 5:return o=t.v,t.n=6,o.signAndSend();case 6:if((i=t.v).getTransactionResponse){t.n=7;break}throw new e.Errors.RestorationFailure(\"The attempt at automatic restore failed. \\n\".concat(JSON.stringify(i)));case 7:return t.a(2,i.getTransactionResponse)}},t,this)})),function(e,t){return l.apply(this,arguments)})}],s=[{key:\"validateInvokeContractOp\",value:function(e,t){if(1!==e.operations.length)throw new Error(\"Transaction envelope must contain exactly one operation.\");var n=e.operations[0];if(\"invokeHostFunction\"!==n.type)throw new Error(\"Transaction envelope does not contain an invokeHostFunction operation.\");var o=n;if(\"hostFunctionTypeInvokeContract\"!==o.func.switch().name)throw new Error(\"Transaction envelope does not contain an invokeContract host function.\");var i,a,s=o.func.value();try{i=s.contractAddress(),a=s.functionName().toString(\"utf-8\")}catch(e){throw new Error(\"Could not extract contract address or method name from the transaction envelope.\")}if(!i||!a)throw new Error(\"Could not extract contract address or method name from the transaction envelope.\");var c=r.Address.fromScAddress(i).toString();if(c!==t)throw new Error(\"Transaction envelope targets contract \".concat(c,\", but this Client is configured for \").concat(t,\".\"));return s}},{key:\"fromJSON\",value:function(t,n){var o=n.tx,i=n.simulationResult,a=n.simulationTransactionData,s=new e(t);s.built=r.TransactionBuilder.fromXDR(o,t.networkPassphrase);var c=e.validateInvokeContractOp(s.built,t.contractId).functionName().toString(\"utf-8\");if(c!==t.method)throw new Error(\"Transaction envelope calls method '\".concat(c,\"', but the provided method is '\").concat(t.method,\"'.\"));return s.simulationResult={auth:i.auth.map(function(e){return r.xdr.SorobanAuthorizationEntry.fromXDR(e,\"base64\")}),retval:r.xdr.ScVal.fromXDR(i.retval,\"base64\")},s.simulationTransactionData=r.xdr.SorobanTransactionData.fromXDR(a,\"base64\"),s}},{key:\"fromXDR\",value:function(t,n,o){var i=r.xdr.TransactionEnvelope.fromXDR(n,\"base64\"),a=r.TransactionBuilder.fromXDR(i,t.networkPassphrase),s=e.validateInvokeContractOp(a,t.contractId).functionName().toString(\"utf-8\"),c=new e(pe(pe({},t),{},{method:s,parseResultXdr:function(e){return o.funcResToNative(s,e)}}));return c.built=a,c}},{key:\"build\",value:function(t){var n,o=new r.Contract(t.contractId);return e.buildWithOp(o.call.apply(o,[t.method].concat(ye(null!==(n=t.args)&&void 0!==n?n:[]))),t)}},{key:\"buildWithOp\",value:(u=be(de().m(function t(n,o){var i,a,s,c;return de().w(function(t){for(;;)switch(t.n){case 0:return(s=new e(o)).originalOp=n,t.n=1,(0,y.sU)(o,s.server);case 1:if(c=t.v,s.raw=new r.TransactionBuilder(c,{fee:null!==(i=o.fee)&&void 0!==i?i:r.BASE_FEE,networkPassphrase:o.networkPassphrase}).setTimeout(null!==(a=o.timeoutInSeconds)&&void 0!==a?a:g.c).addOperation(n),!o.simulate){t.n=2;break}return t.n=2,s.simulate();case 2:return t.a(2,s)}},t)})),function(e,t){return u.apply(this,arguments)})},{key:\"buildFootprintRestoreTransaction\",value:(c=be(de().m(function t(n,o,i,a){var s,c;return de().w(function(t){for(;;)switch(t.n){case 0:return(c=new e(n)).raw=new r.TransactionBuilder(i,{fee:a,networkPassphrase:n.networkPassphrase}).setSorobanData(o instanceof r.SorobanDataBuilder?o.build():o).addOperation(r.Operation.restoreFootprint({})).setTimeout(null!==(s=n.timeoutInSeconds)&&void 0!==s?s:g.c),t.n=1,c.simulate({restore:!1});case 1:return t.a(2,c)}},t)})),function(e,t,n,r){return c.apply(this,arguments)})}],n&&we(t.prototype,n),s&&we(t,s),Object.defineProperty(t,\"prototype\",{writable:!1}),t;var t,n,s,c,u,l,f}();Se(Ee,\"Errors\",{ExpiredState:G,RestorationFailure:W,NeedsMoreSignatures:X,NoSignatureNeeded:Z,NoUnsignedNonInvokerAuthEntries:Y,NoSigner:J,NotYetSimulated:Q,FakeAccount:ee,SimulationFailed:te,InternalWalletError:ne,ExternalServiceError:re,InvalidClientRequest:oe,UserRejected:ie});var xe=n(8287).Buffer;function Te(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return ke(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(ke(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,ke(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,ke(f,\"constructor\",u),ke(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",ke(u,o,\"GeneratorFunction\"),ke(f),ke(f,o,\"Generator\"),ke(f,r,function(){return this}),ke(f,\"toString\",function(){return\"[object Generator]\"}),(Te=function(){return{w:i,m:p}})()}function ke(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}ke=function(e,t,n,r){function i(t,n){ke(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},ke(e,t,n,r)}function Oe(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function _e(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Oe(i,r,o,a,s,\"next\",e)}function s(e){Oe(i,r,o,a,s,\"throw\",e)}a(void 0)})}}var Ie=function(e,t){return{signTransaction:(o=_e(Te().m(function n(o,i){var a;return Te().w(function(n){for(;;)if(0===n.n)return(a=r.TransactionBuilder.fromXDR(o,(null==i?void 0:i.networkPassphrase)||t)).sign(e),n.a(2,{signedTxXdr:a.toXDR(),signerAddress:e.publicKey()})},n)})),function(e,t){return o.apply(this,arguments)}),signAuthEntry:(n=_e(Te().m(function t(n){var o;return Te().w(function(t){for(;;)if(0===t.n)return o=e.sign((0,r.hash)(xe.from(n,\"base64\"))).toString(\"base64\"),t.a(2,{signedAuthEntry:o,signerAddress:e.publicKey()})},t)})),function(e){return n.apply(this,arguments)})};var n,o},Ce=n(8451),Be=n(8287).Buffer;function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach(function(t){Fe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function je(e){return je=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},je(e)}function Ue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Ne(r.key),r)}}function Fe(e,t,n){return(t=Ne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ne(e){var t=function(e){if(\"object\"!=je(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=je(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==je(t)?t:t+\"\"}function Le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if(\"string\"==typeof e)return Me(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(e,t):void 0}}(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function De(e){return/^\\d+$/.test(e.name().toString())}var qe={U32:{type:\"integer\",minimum:0,maximum:4294967295},I32:{type:\"integer\",minimum:-2147483648,maximum:2147483647},U64:{type:\"string\",pattern:\"^([1-9][0-9]*|0)$\",minLength:1,maxLength:20},Timepoint:{type:\"string\",pattern:\"^([1-9][0-9]*|0)$\",minLength:1,maxLength:20},Duration:{type:\"string\",pattern:\"^([1-9][0-9]*|0)$\",minLength:1,maxLength:20},I64:{type:\"string\",pattern:\"^(-?[1-9][0-9]*|0)$\",minLength:1,maxLength:21},U128:{type:\"string\",pattern:\"^([1-9][0-9]*|0)$\",minLength:1,maxLength:39},I128:{type:\"string\",pattern:\"^(-?[1-9][0-9]*|0)$\",minLength:1,maxLength:40},U256:{type:\"string\",pattern:\"^([1-9][0-9]*|0)$\",minLength:1,maxLength:78},I256:{type:\"string\",pattern:\"^(-?[1-9][0-9]*|0)$\",minLength:1,maxLength:79},Address:{type:\"string\",format:\"address\",description:\"Address can be a public key or contract id\"},MuxedAddress:{type:\"string\",format:\"address\",description:\"Stellar public key with M prefix combining a G address and unique ID\"},ScString:{type:\"string\",description:\"ScString is a string\"},ScSymbol:{type:\"string\",description:\"ScSymbol is a string\"},DataUrl:{type:\"string\",pattern:\"^(?:[A-Za-z0-9+\\\\/]{4})*(?:[A-Za-z0-9+\\\\/]{2}==|[A-Za-z0-9+\\\\/]{3}=)?$\"}};function Ve(e){var t;switch(e.switch().value){case r.xdr.ScSpecType.scSpecTypeVal().value:t=\"Val\";break;case r.xdr.ScSpecType.scSpecTypeBool().value:return{type:\"boolean\"};case r.xdr.ScSpecType.scSpecTypeVoid().value:return{type:\"null\"};case r.xdr.ScSpecType.scSpecTypeError().value:t=\"Error\";break;case r.xdr.ScSpecType.scSpecTypeU32().value:t=\"U32\";break;case r.xdr.ScSpecType.scSpecTypeI32().value:t=\"I32\";break;case r.xdr.ScSpecType.scSpecTypeU64().value:t=\"U64\";break;case r.xdr.ScSpecType.scSpecTypeI64().value:t=\"I64\";break;case r.xdr.ScSpecType.scSpecTypeTimepoint().value:t=\"Timepoint\";break;case r.xdr.ScSpecType.scSpecTypeDuration().value:t=\"Duration\";break;case r.xdr.ScSpecType.scSpecTypeU128().value:t=\"U128\";break;case r.xdr.ScSpecType.scSpecTypeI128().value:t=\"I128\";break;case r.xdr.ScSpecType.scSpecTypeU256().value:t=\"U256\";break;case r.xdr.ScSpecType.scSpecTypeI256().value:t=\"I256\";break;case r.xdr.ScSpecType.scSpecTypeBytes().value:t=\"DataUrl\";break;case r.xdr.ScSpecType.scSpecTypeString().value:t=\"ScString\";break;case r.xdr.ScSpecType.scSpecTypeSymbol().value:t=\"ScSymbol\";break;case r.xdr.ScSpecType.scSpecTypeAddress().value:t=\"Address\";break;case r.xdr.ScSpecType.scSpecTypeMuxedAddress().value:t=\"MuxedAddress\";break;case r.xdr.ScSpecType.scSpecTypeOption().value:return Ve(e.option().valueType());case r.xdr.ScSpecType.scSpecTypeResult().value:return Ve(e.result().okType());case r.xdr.ScSpecType.scSpecTypeVec().value:return{type:\"array\",items:Ve(e.vec().elementType())};case r.xdr.ScSpecType.scSpecTypeMap().value:var n=e.map();return{type:\"array\",items:{type:\"array\",items:[Ve(n.keyType()),Ve(n.valueType())],minItems:2,maxItems:2}};case r.xdr.ScSpecType.scSpecTypeTuple().value:var o=e.tuple(),i=o.valueTypes().length,a=i;return{type:\"array\",items:o.valueTypes().map(Ve),minItems:i,maxItems:a};case r.xdr.ScSpecType.scSpecTypeBytesN().value:return{$ref:\"#/definitions/DataUrl\",maxLength:e.bytesN().n()};case r.xdr.ScSpecType.scSpecTypeUdt().value:t=e.udt().name().toString()}return{$ref:\"#/definitions/\".concat(t)}}function ze(e){var t={},n=[];e.forEach(function(e){var o=e.type(),i=e.name().toString();t[i]=Ve(o),o.switch().value!==r.xdr.ScSpecType.scSpecTypeOption().value&&n.push(i)});var o={properties:t};return n.length>0&&(o.required=n),o}var Ke=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),Fe(this,\"entries\",[]),Be.isBuffer(t))this.entries=(0,y.ns)(t);else if(\"string\"==typeof t)this.entries=(0,y.ns)(Be.from(t,\"base64\"));else{if(0===t.length)throw new Error(\"Contract spec must have at least one entry\");var n=t[0];this.entries=\"string\"==typeof n?t.map(function(e){return r.xdr.ScSpecEntry.fromXDR(e,\"base64\")}):t}}return t=e,n=[{key:\"funcs\",value:function(){return this.entries.filter(function(e){return e.switch().value===r.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value}).map(function(e){return e.functionV0()})}},{key:\"getFunc\",value:function(e){var t=this.findEntry(e);if(t.switch().value!==r.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value)throw new Error(\"\".concat(e,\" is not a function\"));return t.functionV0()}},{key:\"funcArgsToScVals\",value:function(e,t){var n=this;return this.getFunc(e).inputs().map(function(e){return n.nativeToScVal(function(e,t){var n=t.name().toString(),r=Object.entries(e).find(function(e){return Le(e,1)[0]===n});if(!r)throw new Error(\"Missing field \".concat(n));return r[1]}(t,e),e.type())})}},{key:\"funcResToNative\",value:function(e,t){var n=\"string\"==typeof t?r.xdr.ScVal.fromXDR(t,\"base64\"):t,o=this.getFunc(e).outputs();if(0===o.length){var i=n.switch();if(i.value!==r.xdr.ScValType.scvVoid().value)throw new Error(\"Expected void, got \".concat(i.name));return null}if(o.length>1)throw new Error(\"Multiple outputs not supported\");var a=o[0];return a.switch().value===r.xdr.ScSpecType.scSpecTypeResult().value?n.switch().value===r.xdr.ScValType.scvError().value?new h({message:n.error().toXDR(\"base64\")}):new d(this.scValToNative(n,a.result().okType())):this.scValToNative(n,a)}},{key:\"findEntry\",value:function(e){var t=this.entries.find(function(t){return t.value().name().toString()===e});if(!t)throw new Error(\"no such entry: \".concat(e));return t}},{key:\"nativeToScVal\",value:function(e,t){var n=this,o=t.switch(),i=o.value;if(o.value===r.xdr.ScSpecType.scSpecTypeUdt().value){var a=t.udt();return this.nativeToUdt(e,a.name().toString())}if(i===r.xdr.ScSpecType.scSpecTypeOption().value){var s=t.option();return null==e?r.xdr.ScVal.scvVoid():this.nativeToScVal(e,s.valueType())}switch(je(e)){case\"object\":var c,u,l;if(null===e){if(i===r.xdr.ScSpecType.scSpecTypeVoid().value)return r.xdr.ScVal.scvVoid();throw new TypeError(\"Type \".concat(t,\" was not void, but value was null\"))}if(e instanceof r.xdr.ScVal)return e;if(e instanceof r.Address){if(t.switch().value!==r.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError(\"Type \".concat(t,\" was not address, but value was Address\"));return e.toScVal()}if(e instanceof r.Contract){if(t.switch().value!==r.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError(\"Type \".concat(t,\" was not address, but value was Address\"));return e.address().toScVal()}if(e instanceof Uint8Array||Be.isBuffer(e)){var f=Uint8Array.from(e);switch(i){case r.xdr.ScSpecType.scSpecTypeBytesN().value:var p=t.bytesN();if(f.length!==p.n())throw new TypeError(\"expected \".concat(p.n(),\" bytes, but got \").concat(f.length));return r.xdr.ScVal.scvBytes(f);case r.xdr.ScSpecType.scSpecTypeBytes().value:return r.xdr.ScVal.scvBytes(f);default:throw new TypeError(\"invalid type (\".concat(t,\") specified for Bytes and BytesN\"))}}if(Array.isArray(e))switch(i){case r.xdr.ScSpecType.scSpecTypeVec().value:var d=t.vec().elementType();return r.xdr.ScVal.scvVec(e.map(function(e){return n.nativeToScVal(e,d)}));case r.xdr.ScSpecType.scSpecTypeTuple().value:var h=t.tuple().valueTypes();if(e.length!==h.length)throw new TypeError(\"Tuple expects \".concat(h.length,\" values, but \").concat(e.length,\" were provided\"));return r.xdr.ScVal.scvVec(e.map(function(e,t){return n.nativeToScVal(e,h[t])}));case r.xdr.ScSpecType.scSpecTypeMap().value:var y=t.map(),g=y.keyType(),m=y.valueType();return r.xdr.ScVal.scvMap(e.map(function(e){var t=n.nativeToScVal(e[0],g),o=n.nativeToScVal(e[1],m);return new r.xdr.ScMapEntry({key:t,val:o})}));default:throw new TypeError(\"Type \".concat(t,\" was not vec, but value was Array\"))}if(e.constructor===Map){if(i!==r.xdr.ScSpecType.scSpecTypeMap().value)throw new TypeError(\"Type \".concat(t,\" was not map, but value was Map\"));for(var v=t.map(),b=[],w=e.entries(),S=w.next();!S.done;){var A=Le(S.value,2),E=A[0],x=A[1],T=this.nativeToScVal(E,v.keyType()),k=this.nativeToScVal(x,v.valueType());b.push(new r.xdr.ScMapEntry({key:T,val:k})),S=w.next()}return r.xdr.ScVal.scvMap(b)}if(\"Object\"!==(null!==(c=null===(u=e.constructor)||void 0===u?void 0:u.name)&&void 0!==c?c:\"\"))throw new TypeError(\"cannot interpret \".concat(null===(l=e.constructor)||void 0===l?void 0:l.name,\" value as ScVal (\").concat(JSON.stringify(e),\")\"));throw new TypeError(\"Received object \".concat(e,\"  did not match the provided type \").concat(t));case\"number\":case\"bigint\":switch(i){case r.xdr.ScSpecType.scSpecTypeU32().value:if(BigInt(e)<BigInt(r.xdr.Uint32.MIN_VALUE)||BigInt(e)>BigInt(r.xdr.Uint32.MAX_VALUE))throw new RangeError(\"Value \".concat(e,\" is out of range for U32\"));return r.xdr.ScVal.scvU32(Number(e));case r.xdr.ScSpecType.scSpecTypeI32().value:if(BigInt(e)<-BigInt(r.xdr.Int32.MIN_VALUE)||BigInt(e)>BigInt(r.xdr.Int32.MAX_VALUE))throw new RangeError(\"Value \".concat(e,\" is out of range for I32\"));return r.xdr.ScVal.scvI32(Number(e));case r.xdr.ScSpecType.scSpecTypeU64().value:case r.xdr.ScSpecType.scSpecTypeI64().value:case r.xdr.ScSpecType.scSpecTypeU128().value:case r.xdr.ScSpecType.scSpecTypeI128().value:case r.xdr.ScSpecType.scSpecTypeU256().value:case r.xdr.ScSpecType.scSpecTypeI256().value:case r.xdr.ScSpecType.scSpecTypeTimepoint().value:case r.xdr.ScSpecType.scSpecTypeDuration().value:var O=o.name.substring(10).toLowerCase();return new r.XdrLargeInt(O,e).toScVal();default:throw new TypeError(\"invalid type (\".concat(t,\") specified for integer\"))}case\"string\":return function(e,t){switch(t.value){case r.xdr.ScSpecType.scSpecTypeString().value:return r.xdr.ScVal.scvString(e);case r.xdr.ScSpecType.scSpecTypeSymbol().value:return r.xdr.ScVal.scvSymbol(e);case r.xdr.ScSpecType.scSpecTypeAddress().value:case r.xdr.ScSpecType.scSpecTypeMuxedAddress().value:return r.Address.fromString(e).toScVal();case r.xdr.ScSpecType.scSpecTypeU64().value:return new r.XdrLargeInt(\"u64\",e).toScVal();case r.xdr.ScSpecType.scSpecTypeI64().value:return new r.XdrLargeInt(\"i64\",e).toScVal();case r.xdr.ScSpecType.scSpecTypeU128().value:return new r.XdrLargeInt(\"u128\",e).toScVal();case r.xdr.ScSpecType.scSpecTypeI128().value:return new r.XdrLargeInt(\"i128\",e).toScVal();case r.xdr.ScSpecType.scSpecTypeU256().value:return new r.XdrLargeInt(\"u256\",e).toScVal();case r.xdr.ScSpecType.scSpecTypeI256().value:return new r.XdrLargeInt(\"i256\",e).toScVal();case r.xdr.ScSpecType.scSpecTypeBytes().value:case r.xdr.ScSpecType.scSpecTypeBytesN().value:return r.xdr.ScVal.scvBytes(Be.from(e,\"base64\"));case r.xdr.ScSpecType.scSpecTypeTimepoint().value:return r.xdr.ScVal.scvTimepoint(new r.xdr.Uint64(e));case r.xdr.ScSpecType.scSpecTypeDuration().value:return r.xdr.ScVal.scvDuration(new r.xdr.Uint64(e));default:throw new TypeError(\"invalid type \".concat(t.name,\" specified for string value\"))}}(e,o);case\"boolean\":if(i!==r.xdr.ScSpecType.scSpecTypeBool().value)throw TypeError(\"Type \".concat(t,\" was not bool, but value was bool\"));return r.xdr.ScVal.scvBool(e);case\"undefined\":if(!t)return r.xdr.ScVal.scvVoid();switch(i){case r.xdr.ScSpecType.scSpecTypeVoid().value:case r.xdr.ScSpecType.scSpecTypeOption().value:return r.xdr.ScVal.scvVoid();default:throw new TypeError(\"Type \".concat(t,\" was not void, but value was undefined\"))}case\"function\":return this.nativeToScVal(e(),t);default:throw new TypeError(\"failed to convert typeof \".concat(je(e),\" (\").concat(e,\")\"))}}},{key:\"nativeToUdt\",value:function(e,t){var n=this.findEntry(t);switch(n.switch()){case r.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():if(\"number\"!=typeof e)throw new TypeError(\"expected number for enum \".concat(t,\", but got \").concat(je(e)));return this.nativeToEnum(e,n.udtEnumV0());case r.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.nativeToStruct(e,n.udtStructV0());case r.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.nativeToUnion(e,n.udtUnionV0());default:throw new Error(\"failed to parse udt \".concat(t))}}},{key:\"nativeToUnion\",value:function(e,t){var n=this,o=e.tag,i=t.cases().find(function(e){return e.value().name().toString()===o});if(!i)throw new TypeError(\"no such enum entry: \".concat(o,\" in \").concat(t));var a=r.xdr.ScVal.scvSymbol(o);switch(i.switch()){case r.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0():return r.xdr.ScVal.scvVec([a]);case r.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0():var s=i.tupleCase().type();if(Array.isArray(e.values)){if(e.values.length!==s.length)throw new TypeError(\"union \".concat(t,\" expects \").concat(s.length,\" values, but got \").concat(e.values.length));var c=e.values.map(function(e,t){return n.nativeToScVal(e,s[t])});return c.unshift(a),r.xdr.ScVal.scvVec(c)}throw new Error(\"failed to parse union case \".concat(i,\" with \").concat(e));default:throw new Error(\"failed to parse union \".concat(t,\" with \").concat(e))}}},{key:\"nativeToStruct\",value:function(e,t){var n=this,o=t.fields();if(o.some(De)){if(!o.every(De))throw new Error(\"mixed numeric and non-numeric field names are not allowed\");return r.xdr.ScVal.scvVec(o.map(function(t,r){return n.nativeToScVal(e[r],o[r].type())}))}return r.xdr.ScVal.scvMap(o.map(function(t){var o=t.name().toString();return new r.xdr.ScMapEntry({key:n.nativeToScVal(o,r.xdr.ScSpecTypeDef.scSpecTypeSymbol()),val:n.nativeToScVal(e[o],t.type())})}))}},{key:\"nativeToEnum\",value:function(e,t){if(t.cases().some(function(t){return t.value()===e}))return r.xdr.ScVal.scvU32(e);throw new TypeError(\"no such enum entry: \".concat(e,\" in \").concat(t))}},{key:\"scValStrToNative\",value:function(e,t){return this.scValToNative(r.xdr.ScVal.fromXDR(e,\"base64\"),t)}},{key:\"scValToNative\",value:function(e,t){var n=this,o=t.switch(),i=o.value;if(i===r.xdr.ScSpecType.scSpecTypeOption().value)return e.switch().value===r.xdr.ScValType.scvVoid().value?null:this.scValToNative(e,t.option().valueType());if(i===r.xdr.ScSpecType.scSpecTypeUdt().value)return this.scValUdtToNative(e,t.udt());switch(e.switch().value){case r.xdr.ScValType.scvVoid().value:return null;case r.xdr.ScValType.scvU64().value:case r.xdr.ScValType.scvI64().value:case r.xdr.ScValType.scvTimepoint().value:case r.xdr.ScValType.scvDuration().value:case r.xdr.ScValType.scvU128().value:case r.xdr.ScValType.scvI128().value:case r.xdr.ScValType.scvU256().value:case r.xdr.ScValType.scvI256().value:return(0,r.scValToBigInt)(e);case r.xdr.ScValType.scvVec().value:if(i===r.xdr.ScSpecType.scSpecTypeVec().value){var a,s=t.vec();return(null!==(a=e.vec())&&void 0!==a?a:[]).map(function(e){return n.scValToNative(e,s.elementType())})}if(i===r.xdr.ScSpecType.scSpecTypeTuple().value){var c,u=t.tuple().valueTypes();return(null!==(c=e.vec())&&void 0!==c?c:[]).map(function(e,t){return n.scValToNative(e,u[t])})}throw new TypeError(\"Type \".concat(t,\" was not vec, but \").concat(e,\" is\"));case r.xdr.ScValType.scvAddress().value:return r.Address.fromScVal(e).toString();case r.xdr.ScValType.scvMap().value:var l,f=null!==(l=e.map())&&void 0!==l?l:[];if(i===r.xdr.ScSpecType.scSpecTypeMap().value){var p=t.map(),d=p.keyType(),h=p.valueType();return f.map(function(e){return[n.scValToNative(e.key(),d),n.scValToNative(e.val(),h)]})}throw new TypeError(\"ScSpecType \".concat(o.name,\" was not map, but \").concat(JSON.stringify(e,null,2),\" is\"));case r.xdr.ScValType.scvBool().value:case r.xdr.ScValType.scvU32().value:case r.xdr.ScValType.scvI32().value:case r.xdr.ScValType.scvBytes().value:return e.value();case r.xdr.ScValType.scvString().value:case r.xdr.ScValType.scvSymbol().value:var y;if(i!==r.xdr.ScSpecType.scSpecTypeString().value&&i!==r.xdr.ScSpecType.scSpecTypeSymbol().value)throw new Error(\"ScSpecType \".concat(o.name,\" was not string or symbol, but \").concat(JSON.stringify(e,null,2),\" is\"));return null===(y=e.value())||void 0===y?void 0:y.toString();default:throw new TypeError(\"failed to convert \".concat(JSON.stringify(e,null,2),\" to native type from type \").concat(o.name))}}},{key:\"scValUdtToNative\",value:function(e,t){var n=this.findEntry(t.name().toString());switch(n.switch()){case r.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():return this.enumToNative(e);case r.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.structToNative(e,n.udtStructV0());case r.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.unionToNative(e,n.udtUnionV0());default:throw new Error(\"failed to parse udt \".concat(t.name().toString(),\": \").concat(n))}}},{key:\"unionToNative\",value:function(e,t){var n=this,o=e.vec();if(!o)throw new Error(\"\".concat(JSON.stringify(e,null,2),\" is not a vec\"));if(0===o.length&&0!==t.cases.length)throw new Error(\"\".concat(e,\" has length 0, but the there are at least one case in the union\"));var i=o[0].sym().toString();if(o[0].switch().value!==r.xdr.ScValType.scvSymbol().value)throw new Error(\"\".concat(o[0],\" is not a symbol\"));var a=t.cases().find(function(e){return function(t){switch(t.switch().value){case r.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:return t.tupleCase().name().toString()===e;case r.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:return t.voidCase().name().toString()===e;default:return!1}}}(i));if(!a)throw new Error(\"failed to find entry \".concat(i,\" in union \").concat(t.name().toString()));var s={tag:i};if(a.switch().value===r.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value){var c=a.tupleCase().type().map(function(e,t){return n.scValToNative(o[t+1],e)});s.values=c}return s}},{key:\"structToNative\",value:function(e,t){var n,r,o=this,i={},a=t.fields();return a.some(De)?null===(r=e.vec())||void 0===r?void 0:r.map(function(e,t){return o.scValToNative(e,a[t].type())}):(null===(n=e.map())||void 0===n||n.forEach(function(e,t){var n=a[t];i[n.name().toString()]=o.scValToNative(e.val(),n.type())}),i)}},{key:\"enumToNative\",value:function(e){if(e.switch().value!==r.xdr.ScValType.scvU32().value)throw new Error(\"Enum must have a u32 value\");return e.u32()}},{key:\"errorCases\",value:function(){return this.entries.filter(function(e){return e.switch().value===r.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value}).flatMap(function(e){return e.value().cases()})}},{key:\"jsonSchema\",value:function(e){var t={};this.entries.forEach(function(e){switch(e.switch().value){case r.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0().value:var n=e.udtEnumV0();t[n.name().toString()]=function(e){var t=e.doc().toString(),n=e.cases(),r=[];n.forEach(function(e){var t=e.name().toString(),n=e.doc().toString();r.push({description:n,title:t,enum:[e.value()],type:\"number\"})});var o={oneOf:r};return t.length>0&&(o.description=t),o}(n);break;case r.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0().value:var o=e.udtStructV0();t[o.name().toString()]=function(e){var t=e.fields();if(t.some(De)){if(!t.every(De))throw new Error(\"mixed numeric and non-numeric field names are not allowed\");return{type:\"array\",items:t.map(function(e,n){return Ve(t[n].type())}),minItems:t.length,maxItems:t.length}}var n=e.doc().toString(),r=ze(t);return{description:n,properties:r.properties,required:r.required,additionalProperties:!1,type:\"object\"}}(o);break;case r.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0().value:var i=e.udtUnionV0();t[i.name().toString()]=function(e){var t=e.doc().toString(),n=e.cases(),o=[];n.forEach(function(e){switch(e.switch().value){case r.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:var t=e.voidCase().name().toString();o.push({type:\"object\",title:t,properties:{tag:t},additionalProperties:!1,required:[\"tag\"]});break;case r.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:var n=e.tupleCase(),i=n.name().toString();o.push({type:\"object\",title:i,properties:{tag:i,values:{type:\"array\",items:n.type().map(Ve)}},required:[\"tag\",\"values\"],additionalProperties:!1})}});var i={oneOf:o};return t.length>0&&(i.description=t),i}(i);break;case r.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value:var a=e.functionV0(),s=a.name().toString(),c=function(e){var t=ze(e.inputs()),n=t.properties,o=t.required,i={additionalProperties:!1,properties:n,type:\"object\"};(null==o?void 0:o.length)>0&&(i.required=o);var a={properties:{args:i}},s=e.outputs(),c=s.length>0?Ve(s[0]):Ve(r.xdr.ScSpecTypeDef.scSpecTypeVoid()),u=e.doc().toString();return u.length>0&&(a.description=u),a.additionalProperties=!1,c.additionalProperties=!1,{input:a,output:c}}(a),u=c.input;t[s]=u;case r.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value:}});var n={$schema:\"http://json-schema.org/draft-07/schema#\",definitions:Re(Re({},qe),t)};return e&&(n.$ref=\"#/definitions/\".concat(e)),n}}],o=[{key:\"fromWasm\",value:function(t){return new e((0,Ce.U)(t))}}],n&&Ue(t.prototype,n),o&&Ue(t,o),Object.defineProperty(t,\"prototype\",{writable:!1}),t;var t,n,o}(),He=n(4366),$e=n(8287).Buffer;function Ge(e){return Ge=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Ge(e)}var We=[\"method\"],Xe=[\"wasmHash\",\"salt\",\"format\",\"fee\",\"timeoutInSeconds\",\"simulate\"];function Ze(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return Ye(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Ye(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ye(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,Ye(f,\"constructor\",u),Ye(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",Ye(u,o,\"GeneratorFunction\"),Ye(f),Ye(f,o,\"Generator\"),Ye(f,r,function(){return this}),Ye(f,\"toString\",function(){return\"[object Generator]\"}),(Ze=function(){return{w:i,m:p}})()}function Ye(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}Ye=function(e,t,n,r){function i(t,n){Ye(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},Ye(e,t,n,r)}function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(n),!0).forEach(function(t){nt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function et(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function tt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,rt(r.key),r)}}function nt(e,t,n){return(t=rt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rt(e){var t=function(e){if(\"object\"!=Ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Ge(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Ge(t)?t:t+\"\"}function ot(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function it(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ot(i,r,o,a,s,\"next\",e)}function s(e){ot(i,r,o,a,s,\"throw\",e)}a(void 0)})}}var at=\"__constructor\";function st(e,t){return ct.apply(this,arguments)}function ct(){return ct=it(Ze().m(function e(t,n){var r,i,a,s,c,u,l,f=arguments;return Ze().w(function(e){for(;;)switch(e.n){case 0:if(r=f.length>2&&void 0!==f[2]?f[2]:\"hex\",n&&n.rpcUrl){e.n=1;break}throw new TypeError(\"options must contain rpcUrl\");case 1:return i=n.rpcUrl,a=n.allowHttp,s=n.headers,c={allowHttp:a,headers:s},u=new o.Server(i,c),e.n=2,u.getContractWasmByHash(t,r);case 2:return l=e.v,e.a(2,Ke.fromWasm(l))}},e)})),ct.apply(this,arguments)}var ut=function(){function e(t,n){var r=this;if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),nt(this,\"txFromJSON\",function(e){var t=JSON.parse(e),n=t.method,o=et(t,We);return Ee.fromJSON(Qe(Qe({},r.options),{},{method:n,parseResultXdr:function(e){return r.spec.funcResToNative(n,e)}}),o)}),nt(this,\"txFromXDR\",function(e){return Ee.fromXDR(r.options,e,r.spec)}),this.spec=t,this.options=n,void 0===n.server){var i=n.allowHttp,a=n.headers;n.server=new o.Server(n.rpcUrl,{allowHttp:i,headers:a})}this.spec.funcs().forEach(function(e){var o=e.name().toString();if(o!==at){var i=function(e,r){return Ee.build(Qe(Qe(Qe({method:o,args:e&&t.funcArgsToScVals(o,e)},n),r),{},{errorTypes:t.errorCases().reduce(function(e,t){return Qe(Qe({},e),{},nt({},t.value(),{message:t.doc().toString()}))},{}),parseResultXdr:function(e){return t.funcResToNative(o,e)}}))};r[(0,He.ff)(o)]=0===t.getFunc(o).inputs().length?function(e){return i(void 0,e)}:i}})}return t=e,n=[{key:\"deploy\",value:(c=it(Ze().m(function t(n,o){var i,a,s,c,u,l,f,p,d;return Ze().w(function(t){for(;;)switch(t.n){case 0:return i=o.wasmHash,a=o.salt,s=o.format,c=o.fee,u=o.timeoutInSeconds,l=o.simulate,f=et(o,Xe),t.n=1,st(i,f,s);case 1:return p=t.v,d=r.Operation.createCustomContract({address:new r.Address(o.address||o.publicKey),wasmHash:\"string\"==typeof i?$e.from(i,null!=s?s:\"hex\"):i,salt:a,constructorArgs:n?p.funcArgsToScVals(at,n):[]}),t.a(2,Ee.buildWithOp(d,Qe(Qe({fee:c,timeoutInSeconds:u,simulate:l},f),{},{contractId:\"ignored\",method:at,parseResultXdr:function(t){return new e(p,Qe(Qe({},f),{},{contractId:r.Address.fromScVal(t).toString()}))}})))}},t)})),function(e,t){return c.apply(this,arguments)})},{key:\"fromWasmHash\",value:(s=it(Ze().m(function t(n,r){var i,a,s,c,u,l,f,p=arguments;return Ze().w(function(t){for(;;)switch(t.n){case 0:if(a=p.length>2&&void 0!==p[2]?p[2]:\"hex\",r&&r.rpcUrl){t.n=1;break}throw new TypeError(\"options must contain rpcUrl\");case 1:return s=r.rpcUrl,c=r.allowHttp,u=r.headers,l=null!==(i=r.server)&&void 0!==i?i:new o.Server(s,{allowHttp:c,headers:u}),t.n=2,l.getContractWasmByHash(n,a);case 2:return f=t.v,t.a(2,e.fromWasm(f,r))}},t)})),function(e,t){return s.apply(this,arguments)})},{key:\"fromWasm\",value:(a=it(Ze().m(function t(n,r){var o;return Ze().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Ke.fromWasm(n);case 1:return o=t.v,t.a(2,new e(o,r))}},t)})),function(e,t){return a.apply(this,arguments)})},{key:\"from\",value:(i=it(Ze().m(function t(n){var r,i,a,s,c,u;return Ze().w(function(t){for(;;)switch(t.n){case 0:if(n&&n.rpcUrl&&n.contractId){t.n=1;break}throw new TypeError(\"options must contain rpcUrl and contractId\");case 1:return r=n.rpcUrl,i=n.contractId,a=n.allowHttp,s=n.headers,c=new o.Server(r,{allowHttp:a,headers:s}),t.n=2,c.getContractWasmByContractId(i);case 2:return u=t.v,t.a(2,e.fromWasm(u,n))}},t)})),function(e){return i.apply(this,arguments)})}],n&&tt(t,n),Object.defineProperty(t,\"prototype\",{writable:!1}),t;var t,n,i,a,s,c}()},9138(e,t,n){\"use strict\";n.d(t,{c:()=>r,u:()=>o}),n(8950);var r=300,o=\"GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF\"},8302(e,t,n){\"use strict\";n.d(t,{X8:()=>h,cF:()=>p,ns:()=>m,ph:()=>g,pp:()=>y,sU:()=>v});var r=n(8950),o=n(9138);function i(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function s(n,r,o,i){var s=r&&r.prototype instanceof u?r:u,l=Object.create(s.prototype);return a(l,\"_invoke\",function(n,r,o){var i,a,s,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,a=0,s=e,p.n=n,c}};function d(n,r){for(a=n,s=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(a=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,a=0))}if(o||n>1)return c;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),a=l,s=h;(t=a<2?e:s)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,s)):p.n=s:p.v=s);try{if(u=2,i){if(a||(o=\"next\"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(s=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),a=1);i=e}else if((t=(f=p.n<0)?s:n.call(r,p))!==c)break}catch(t){i=e,a=1,s=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),l}var c={};function u(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(a(t={},r,function(){return this}),t),d=f.prototype=u.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,o,\"GeneratorFunction\")),e.prototype=Object.create(d),e}return l.prototype=f,a(d,\"constructor\",f),a(f,\"constructor\",l),l.displayName=\"GeneratorFunction\",a(f,o,\"GeneratorFunction\"),a(d),a(d,o,\"Generator\"),a(d,r,function(){return this}),a(d,\"toString\",function(){return\"[object Generator]\"}),(i=function(){return{w:s,m:h}})()}function a(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}a=function(e,t,n,r){function i(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},a(e,t,n,r)}function s(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||function(e,t){if(e){if(\"string\"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e){return u=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},u(e)}function l(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function f(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){l(i,r,o,a,s,\"next\",e)}function s(e){l(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function p(e,t,n){return d.apply(this,arguments)}function d(){return d=f(i().m(function e(t,n,r){var o,a,s,c,u,l,f,p,d,h=arguments;return i().w(function(e){for(;;)switch(e.n){case 0:return o=h.length>3&&void 0!==h[3]?h[3]:1.5,a=h.length>4&&void 0!==h[4]&&h[4],c=0,p=s=[],e.n=1,t();case 1:if(p.push.call(p,e.v),n(s[s.length-1])){e.n=2;break}return e.a(2,s);case 2:u=new Date(Date.now()+1e3*r).valueOf(),f=l=1e3;case 3:if(!(Date.now()<u&&n(s[s.length-1]))){e.n=6;break}return c+=1,a&&console.info(\"Waiting \".concat(l,\"ms before trying again (bringing the total wait time to \").concat(f,\"ms so far, of total \").concat(1e3*r,\"ms)\")),e.n=4,new Promise(function(e){return setTimeout(e,l)});case 4:return l*=o,new Date(Date.now()+l).valueOf()>u&&(l=u-Date.now(),a&&console.info(\"was gonna wait too long; new waitTime: \".concat(l,\"ms\"))),f=l+f,d=s,e.n=5,t(s[s.length-1]);case 5:d.push.call(d,e.v),a&&n(s[s.length-1])&&console.info(\"\".concat(c,\". Called \").concat(t,\"; \").concat(s.length,\" prev attempts. Most recent: \").concat(JSON.stringify(s[s.length-1],null,2))),e.n=3;break;case 6:return e.a(2,s)}},e)})),d.apply(this,arguments)}var h=/Error\\(Contract, #(\\d+)\\)/;function y(e){return\"object\"===u(e)&&null!==e&&\"toString\"in e}function g(e){var t=new Map,n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),r=0,o=function(t){if(r+t>e.byteLength)throw new Error(\"Buffer overflow\");var o=new Uint8Array(n,r,t);return r+=t,o};function i(){for(var e=0,t=0;;){var n=o(1)[0];if(e|=(127&n)<<t,!(128&n))break;if((t+=7)>=32)throw new Error(\"Invalid WASM value\")}return e>>>0}if(\"0,97,115,109\"!==s(o(4)).join())throw new Error(\"Invalid WASM magic\");if(\"1,0,0,0\"!==s(o(4)).join())throw new Error(\"Invalid WASM version\");for(;r<e.byteLength;){var a=o(1)[0],c=i(),u=r;if(0===a){var l=i();if(l>0&&r+l<=u+c){var f=o(l),p=o(c-(r-u));try{var d=new TextDecoder(\"utf-8\",{fatal:!0}).decode(f);p.length>0&&t.set(d,(t.get(d)||[]).concat(p))}catch(e){}}}r=u+c}return t}function m(e){for(var t=new r.cereal.XdrReader(e),n=[];!t.eof;)n.push(r.xdr.ScSpecEntry.read(t));return n}function v(e,t){return b.apply(this,arguments)}function b(){return(b=f(i().m(function e(t,n){return i().w(function(e){for(;;)if(0===e.n)return e.a(2,t.publicKey?n.getAccount(t.publicKey):new r.Account(o.u,\"0\"))},e)}))).apply(this,arguments)}},8451(e,t,n){\"use strict\";n.d(t,{U:()=>i});var r=n(8302),o=n(8287).Buffer;function i(e){var t=(0,r.ph)(e).get(\"contractspecv0\");if(!t||0===t.length)throw new Error(\"Could not obtain contract spec from wasm\");return o.from(t[0])}},5976(e,t,n){\"use strict\";function r(e){return r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if(\"object\"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=r(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==r(t)?t:t+\"\"}function a(e,t,n){return t=l(t),function(e,t){if(t&&(\"object\"==r(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,c()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function s(e){var t=\"function\"==typeof Map?new Map:void 0;return s=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf(\"[native code]\")}catch(t){return\"function\"==typeof e}}(e))return e;if(\"function\"!=typeof e)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(c())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&u(o,n.prototype),o}(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)},s(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}n.d(t,{Cu:()=>U,v7:()=>E,nS:()=>I,Dr:()=>f,m_:()=>m});var f=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=a(this,t,[e])).response=n,r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&u(e,t)}(t,e),n=t,(r=[{key:\"getResponse\",value:function(){return this.response}}])&&o(n.prototype,r),Object.defineProperty(n,\"prototype\",{writable:!1}),n;var n,r}(s(Error));function p(e){return p=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},p(e)}function d(e,t,n){return t=y(t),function(e,t){if(t&&(\"object\"==p(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,h()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}var m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),d(this,t,arguments)}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&g(e,t)}(t,e),n=t,Object.defineProperty(n,\"prototype\",{writable:!1}),n;var n}(f);function v(e){return v=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},v(e)}function b(e,t,n){return t=S(t),function(e,t){if(t&&(\"object\"==v(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,w()?Reflect.construct(t,n||[],S(e).constructor):t.apply(e,n))}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}var E=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),b(this,t,arguments)}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&A(e,t)}(t,e),n=t,Object.defineProperty(n,\"prototype\",{writable:!1}),n;var n}(f);function x(e){return x=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},x(e)}function T(e,t,n){return t=O(t),function(e,t){if(t&&(\"object\"==x(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,k()?Reflect.construct(t,n||[],O(e).constructor):t.apply(e,n))}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}var I=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),T(this,t,arguments)}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&_(e,t)}(t,e),n=t,Object.defineProperty(n,\"prototype\",{writable:!1}),n;var n}(f);function C(e){return C=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},C(e)}function B(e){var t=\"function\"==typeof Map?new Map:void 0;return B=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf(\"[native code]\")}catch(t){return\"function\"==typeof e}}(e))return e;if(\"function\"!=typeof e)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(P())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&R(o,n.prototype),o}(e,arguments,j(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),R(n,e)},B(e)}function P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(P=function(){return!!e})()}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}var U=function(e){function t(e,n,r){var o;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(o=function(e,t,n){return t=j(t),function(e,t){if(t&&(\"object\"==C(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,P()?Reflect.construct(t,n||[],j(e).constructor):t.apply(e,n))}(this,t,[e])).accountId=n,o.operationIndex=r,o}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&R(e,t)}(t,e),n=t,Object.defineProperty(n,\"prototype\",{writable:!1}),n;var n}(B(Error))},6602(e,t,n){\"use strict\";n.r(t),n.d(t,{Api:()=>{},FEDERATION_RESPONSE_MAX_SIZE:()=>w,Server:()=>S});var r=n(8950),o=n(4193),i=n.n(o),a=n(8732),s=n(5976),c=n(3898),u=n(9983);function l(e){if(!/^(?:[A-Za-z](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\.)*[A-Za-z](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?::\\d+)?$/.test(e))throw new Error(\"The provided domain is invalid. Ensure that the domain adheres to RFC 1035\")}function f(e){return f=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},f(e)}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if(\"string\"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return y(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(y(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,y(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,y(f,\"constructor\",u),y(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",y(u,o,\"GeneratorFunction\"),y(f),y(f,o,\"Generator\"),y(f,r,function(){return this}),y(f,\"toString\",function(){return\"[object Generator]\"}),(h=function(){return{w:i,m:p}})()}function y(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}y=function(e,t,n,r){function i(t,n){y(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},y(e,t,n,r)}function g(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){g(i,r,o,a,s,\"next\",e)}function s(e){g(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,b(r.key),r)}}function b(e){var t=function(e){if(\"object\"!=f(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=f(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==f(t)?t:t+\"\"}var w=102400,S=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.serverURL=i()(t),this.domain=n,l(n);var o=void 0===r.allowHttp?a.T.isAllowHttp():r.allowHttp;if(this.timeout=void 0===r.timeout?a.T.getTimeout():r.timeout,\"https\"!==this.serverURL.protocol()&&!o)throw new Error(\"Cannot connect to insecure federation server\")}return t=e,n=[{key:\"resolveAddress\",value:(S=m(h().m(function e(t){var n,r;return h().w(function(e){for(;;)switch(e.n){case 0:if(n=t,!(t.indexOf(\"*\")<0)){e.n=2;break}if(this.domain){e.n=1;break}return e.a(2,Promise.reject(new Error(\"Unknown domain. Make sure `address` contains a domain (ex. `bob*stellar.org`) or pass `domain` parameter when instantiating the server object.\")));case 1:n=\"\".concat(t,\"*\").concat(this.domain);case 2:return r=this.serverURL.clone().query({type:\"name\",q:n}),e.a(2,this._sendRequest(r))}},e,this)})),function(e){return S.apply(this,arguments)})},{key:\"resolveAccountId\",value:(b=m(h().m(function e(t){var n;return h().w(function(e){for(;;)if(0===e.n)return n=this.serverURL.clone().query({type:\"id\",q:t}),e.a(2,this._sendRequest(n))},e,this)})),function(e){return b.apply(this,arguments)})},{key:\"resolveTransactionId\",value:(g=m(h().m(function e(t){var n;return h().w(function(e){for(;;)if(0===e.n)return n=this.serverURL.clone().query({type:\"txid\",q:t}),e.a(2,this._sendRequest(n))},e,this)})),function(e){return g.apply(this,arguments)})},{key:\"_sendRequest\",value:(y=m(h().m(function e(t){var n;return h().w(function(e){for(;;)if(0===e.n)return n=this.timeout,e.a(2,u.ok.get(t.toString(),{maxContentLength:w,timeout:n}).then(function(e){if(void 0!==e.data.memo&&\"string\"!=typeof e.data.memo)throw new Error(\"memo value should be of type string\");return e.data}).catch(function(e){if(e instanceof Error){if(e.message.match(/^maxContentLength size/))throw new Error(\"federation response exceeds allowed size of \".concat(w));return Promise.reject(e)}return Promise.reject(new s.nS(\"Server query failed. Server responded: \".concat(e.status,\" \").concat(e.statusText),e.data))}))},e,this)})),function(e){return y.apply(this,arguments)})}],o=[{key:\"resolve\",value:(d=m(h().m(function t(n){var o,i,a,s,c,u=arguments;return h().w(function(t){for(;;)switch(t.n){case 0:if(o=u.length>1&&void 0!==u[1]?u[1]:{},!(n.indexOf(\"*\")<0)){t.n=2;break}if(r.StrKey.isValidEd25519PublicKey(n)){t.n=1;break}return t.a(2,Promise.reject(new Error(\"Invalid Account ID\")));case 1:return t.a(2,Promise.resolve({account_id:n}));case 2:if(i=n.split(\"*\"),a=p(i,2),s=a[1],2===i.length&&s){t.n=3;break}return t.a(2,Promise.reject(new Error(\"Invalid Stellar address\")));case 3:return t.n=4,e.createForDomain(s,o);case 4:return c=t.v,t.a(2,c.resolveAddress(n))}},t)})),function(e){return d.apply(this,arguments)})},{key:\"createForDomain\",value:(f=m(h().m(function t(n){var r,o,i=arguments;return h().w(function(t){for(;;)switch(t.n){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},l(n),t.n=1,c.Resolver.resolve(n,r);case 1:if((o=t.v).FEDERATION_SERVER){t.n=2;break}return t.a(2,Promise.reject(new Error(\"stellar.toml does not contain FEDERATION_SERVER field\")));case 2:return t.a(2,new e(o.FEDERATION_SERVER,n,r))}},t)})),function(e){return f.apply(this,arguments)})}],n&&v(t.prototype,n),o&&v(t,o),Object.defineProperty(t,\"prototype\",{writable:!1}),t;var t,n,o,f,d,y,g,b,S}()},8242(e,t,n){\"use strict\";n.r(t),n.d(t,{Api:()=>{}})},8733(e,t,n){\"use strict\";var r;n.r(t),n.d(t,{AccountResponse:()=>d,HorizonApi:()=>r,SERVER_TIME_MAP:()=>H,Server:()=>Hn,ServerApi:()=>i,default:()=>$n,getCurrentServerTime:()=>G}),function(e){var t=function(e){return e.constantProduct=\"constant_product\",e}({});e.LiquidityPoolType=t;var n=function(e){return e.createAccount=\"create_account\",e.payment=\"payment\",e.pathPayment=\"path_payment_strict_receive\",e.createPassiveOffer=\"create_passive_sell_offer\",e.manageOffer=\"manage_sell_offer\",e.setOptions=\"set_options\",e.changeTrust=\"change_trust\",e.allowTrust=\"allow_trust\",e.accountMerge=\"account_merge\",e.inflation=\"inflation\",e.manageData=\"manage_data\",e.bumpSequence=\"bump_sequence\",e.manageBuyOffer=\"manage_buy_offer\",e.pathPaymentStrictSend=\"path_payment_strict_send\",e.createClaimableBalance=\"create_claimable_balance\",e.claimClaimableBalance=\"claim_claimable_balance\",e.beginSponsoringFutureReserves=\"begin_sponsoring_future_reserves\",e.endSponsoringFutureReserves=\"end_sponsoring_future_reserves\",e.revokeSponsorship=\"revoke_sponsorship\",e.clawback=\"clawback\",e.clawbackClaimableBalance=\"clawback_claimable_balance\",e.setTrustLineFlags=\"set_trust_line_flags\",e.liquidityPoolDeposit=\"liquidity_pool_deposit\",e.liquidityPoolWithdraw=\"liquidity_pool_withdraw\",e.invokeHostFunction=\"invoke_host_function\",e.bumpFootprintExpiration=\"bump_footprint_expiration\",e.restoreFootprint=\"restore_footprint\",e}({});e.OperationResponseType=n;var r=function(e){return e[e.createAccount=0]=\"createAccount\",e[e.payment=1]=\"payment\",e[e.pathPayment=2]=\"pathPayment\",e[e.createPassiveOffer=3]=\"createPassiveOffer\",e[e.manageOffer=4]=\"manageOffer\",e[e.setOptions=5]=\"setOptions\",e[e.changeTrust=6]=\"changeTrust\",e[e.allowTrust=7]=\"allowTrust\",e[e.accountMerge=8]=\"accountMerge\",e[e.inflation=9]=\"inflation\",e[e.manageData=10]=\"manageData\",e[e.bumpSequence=11]=\"bumpSequence\",e[e.manageBuyOffer=12]=\"manageBuyOffer\",e[e.pathPaymentStrictSend=13]=\"pathPaymentStrictSend\",e[e.createClaimableBalance=14]=\"createClaimableBalance\",e[e.claimClaimableBalance=15]=\"claimClaimableBalance\",e[e.beginSponsoringFutureReserves=16]=\"beginSponsoringFutureReserves\",e[e.endSponsoringFutureReserves=17]=\"endSponsoringFutureReserves\",e[e.revokeSponsorship=18]=\"revokeSponsorship\",e[e.clawback=19]=\"clawback\",e[e.clawbackClaimableBalance=20]=\"clawbackClaimableBalance\",e[e.setTrustLineFlags=21]=\"setTrustLineFlags\",e[e.liquidityPoolDeposit=22]=\"liquidityPoolDeposit\",e[e.liquidityPoolWithdraw=23]=\"liquidityPoolWithdraw\",e[e.invokeHostFunction=24]=\"invokeHostFunction\",e[e.bumpFootprintExpiration=25]=\"bumpFootprintExpiration\",e[e.restoreFootprint=26]=\"restoreFootprint\",e}({});e.OperationResponseTypeI=r;var o=function(e){return e.TX_FAILED=\"tx_failed\",e.TX_BAD_SEQ=\"tx_bad_seq\",e.TX_BAD_AUTH=\"tx_bad_auth\",e.TX_BAD_AUTH_EXTRA=\"tx_bad_auth_extra\",e.TX_FEE_BUMP_INNER_SUCCESS=\"tx_fee_bump_inner_success\",e.TX_FEE_BUMP_INNER_FAILED=\"tx_fee_bump_inner_failed\",e.TX_NOT_SUPPORTED=\"tx_not_supported\",e.TX_SUCCESS=\"tx_success\",e.TX_TOO_EARLY=\"tx_too_early\",e.TX_TOO_LATE=\"tx_too_late\",e.TX_MISSING_OPERATION=\"tx_missing_operation\",e.TX_INSUFFICIENT_BALANCE=\"tx_insufficient_balance\",e.TX_NO_SOURCE_ACCOUNT=\"tx_no_source_account\",e.TX_INSUFFICIENT_FEE=\"tx_insufficient_fee\",e.TX_INTERNAL_ERROR=\"tx_internal_error\",e}({});e.TransactionFailedResultCodes=o}(r||(r={}));var o,i,a=((o={})[o.account_created=0]=\"account_created\",o[o.account_removed=1]=\"account_removed\",o[o.account_credited=2]=\"account_credited\",o[o.account_debited=3]=\"account_debited\",o[o.account_thresholds_updated=4]=\"account_thresholds_updated\",o[o.account_home_domain_updated=5]=\"account_home_domain_updated\",o[o.account_flags_updated=6]=\"account_flags_updated\",o[o.account_inflation_destination_updated=7]=\"account_inflation_destination_updated\",o[o.signer_created=10]=\"signer_created\",o[o.signer_removed=11]=\"signer_removed\",o[o.signer_updated=12]=\"signer_updated\",o[o.trustline_created=20]=\"trustline_created\",o[o.trustline_removed=21]=\"trustline_removed\",o[o.trustline_updated=22]=\"trustline_updated\",o[o.trustline_authorized=23]=\"trustline_authorized\",o[o.trustline_deauthorized=24]=\"trustline_deauthorized\",o[o.trustline_authorized_to_maintain_liabilities=25]=\"trustline_authorized_to_maintain_liabilities\",o[o.trustline_flags_updated=26]=\"trustline_flags_updated\",o[o.offer_created=30]=\"offer_created\",o[o.offer_removed=31]=\"offer_removed\",o[o.offer_updated=32]=\"offer_updated\",o[o.trade=33]=\"trade\",o[o.data_created=40]=\"data_created\",o[o.data_removed=41]=\"data_removed\",o[o.data_updated=42]=\"data_updated\",o[o.sequence_bumped=43]=\"sequence_bumped\",o[o.claimable_balance_created=50]=\"claimable_balance_created\",o[o.claimable_balance_claimant_created=51]=\"claimable_balance_claimant_created\",o[o.claimable_balance_claimed=52]=\"claimable_balance_claimed\",o[o.account_sponsorship_created=60]=\"account_sponsorship_created\",o[o.account_sponsorship_updated=61]=\"account_sponsorship_updated\",o[o.account_sponsorship_removed=62]=\"account_sponsorship_removed\",o[o.trustline_sponsorship_created=63]=\"trustline_sponsorship_created\",o[o.trustline_sponsorship_updated=64]=\"trustline_sponsorship_updated\",o[o.trustline_sponsorship_removed=65]=\"trustline_sponsorship_removed\",o[o.data_sponsorship_created=66]=\"data_sponsorship_created\",o[o.data_sponsorship_updated=67]=\"data_sponsorship_updated\",o[o.data_sponsorship_removed=68]=\"data_sponsorship_removed\",o[o.claimable_balance_sponsorship_created=69]=\"claimable_balance_sponsorship_created\",o[o.claimable_balance_sponsorship_updated=70]=\"claimable_balance_sponsorship_updated\",o[o.claimable_balance_sponsorship_removed=71]=\"claimable_balance_sponsorship_removed\",o[o.signer_sponsorship_created=72]=\"signer_sponsorship_created\",o[o.signer_sponsorship_updated=73]=\"signer_sponsorship_updated\",o[o.signer_sponsorship_removed=74]=\"signer_sponsorship_removed\",o[o.claimable_balance_clawed_back=80]=\"claimable_balance_clawed_back\",o[o.liquidity_pool_deposited=90]=\"liquidity_pool_deposited\",o[o.liquidity_pool_withdrew=91]=\"liquidity_pool_withdrew\",o[o.liquidity_pool_trade=92]=\"liquidity_pool_trade\",o[o.liquidity_pool_created=93]=\"liquidity_pool_created\",o[o.liquidity_pool_removed=94]=\"liquidity_pool_removed\",o[o.liquidity_pool_revoked=95]=\"liquidity_pool_revoked\",o[o.contract_credited=96]=\"contract_credited\",o[o.contract_debited=97]=\"contract_debited\",o);!function(e){e.EffectType=a;var t=function(e){return e.all=\"all\",e.liquidityPools=\"liquidity_pool\",e.orderbook=\"orderbook\",e}({});e.TradeType=t,r.OperationResponseType,r.OperationResponseTypeI}(i||(i={}));var s=n(8950);function c(e){return c=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},c(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function l(e){var t=function(e){if(\"object\"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=c(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==c(t)?t:t+\"\"}var f,p,d=(f=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this._baseAccount=new s.Account(t.account_id,t.sequence),this.effects=t.effects,this.offers=t.offers,this.operations=t.operations,this.payments=t.payments,this.trades=t.trades,this.data=t.data,this.transactions=t.transactions,this.id=t.id,this.paging_token=t.paging_token,this.account_id=t.account_id,this.sequence=t.sequence,this.sequence_ledger=t.sequence_ledger,this.sequence_time=t.sequence_time,this.subentry_count=t.subentry_count,this.home_domain=t.home_domain,this.inflation_destination=t.inflation_destination,this.last_modified_ledger=t.last_modified_ledger,this.last_modified_time=t.last_modified_time,this.thresholds=t.thresholds,this.flags=t.flags,this.balances=t.balances,this.signers=t.signers,this.data_attr=t.data_attr,this.sponsor=t.sponsor,this.num_sponsoring=t.num_sponsoring,this.num_sponsored=t.num_sponsored},(p=[{key:\"accountId\",value:function(){return this._baseAccount.accountId()}},{key:\"sequenceNumber\",value:function(){return this._baseAccount.sequenceNumber()}},{key:\"incrementSequenceNumber\",value:function(){this._baseAccount.incrementSequenceNumber(),this.sequence=this._baseAccount.sequenceNumber()}}])&&u(f.prototype,p),Object.defineProperty(f,\"prototype\",{writable:!1}),f),h=/^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,y=Math.ceil,g=Math.floor,m=\"[BigNumber Error] \",v=m+\"Number primitive has more than 15 significant digits: \",b=1e14,w=14,S=9007199254740991,A=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],E=1e7,x=1e9;function T(e){var t=0|e;return e>0||e===t?t:t-1}function k(e){for(var t,n,r=1,o=e.length,i=e[0]+\"\";r<o;){for(t=e[r++]+\"\",n=w-t.length;n--;t=\"0\"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function O(e,t){var n,r,o=e.c,i=t.c,a=e.s,s=t.s,c=e.e,u=t.e;if(!a||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=c==u,!o||!i)return r?0:!o^n?1:-1;if(!r)return c>u^n?1:-1;for(s=(c=o.length)<(u=i.length)?c:u,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function _(e,t,n,r){if(e<t||e>n||e!==g(e))throw Error(m+(r||\"Argument\")+(\"number\"==typeof e?e<t||e>n?\" out of range: \":\" not an integer: \":\" not a primitive number: \")+String(e))}function I(e){var t=e.c.length-1;return T(e.e/w)==t&&e.c[t]%2!=0}function C(e,t){return(e.length>1?e.charAt(0)+\".\"+e.slice(1):e)+(t<0?\"e\":\"e+\")+t}function B(e,t,n){var r,o;if(t<0){for(o=n+\".\";++t;o+=n);e=o+e}else if(++t>(r=e.length)){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+\".\"+e.slice(t));return e}var P=function e(t){var n,r,o,i,a,s,c,u,l,f,p=K.prototype={constructor:K,toString:null,valueOf:null},d=new K(1),P=20,R=4,j=-7,U=21,F=-1e7,N=1e7,L=!1,M=1,D=0,q={prefix:\"\",groupSize:3,secondaryGroupSize:0,groupSeparator:\",\",decimalSeparator:\".\",fractionGroupSize:0,fractionGroupSeparator:\" \",suffix:\"\"},V=\"0123456789abcdefghijklmnopqrstuvwxyz\",z=!0;function K(e,t){var n,i,a,s,c,u,l,f,p=this;if(!(p instanceof K))return new K(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>N?p.c=p.e=null:e.e<F?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((u=\"number\"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>N?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!h.test(f=String(e)))return o(p,f,u);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf(\".\"))>-1&&(f=f.replace(\".\",\"\")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(_(t,2,V.length,\"Base\"),10==t&&z)return W(p=new K(e),P+p.e+1,R);if(f=String(e),u=\"number\"==typeof e){if(0*e!=0)return o(p,f,u,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,K.DEBUG&&f.replace(/^0\\.0*|\\./,\"\").length>15)throw Error(v+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=V.slice(0,t),s=c=0,l=f.length;c<l;c++)if(n.indexOf(i=f.charAt(c))<0){if(\".\"==i){if(c>s){s=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,c=-1,s=0;continue}return o(p,String(e),u,t)}u=!1,(s=(f=r(f,t,10,p.s)).indexOf(\".\"))>-1?f=f.replace(\".\",\"\"):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,u&&K.DEBUG&&l>15&&(e>S||e!==g(e)))throw Error(v+p.s*e);if((s=s-c-1)>N)p.c=p.e=null;else if(s<F)p.c=[p.e=0];else{if(p.e=s,p.c=[],c=(s+1)%w,s<0&&(c+=w),c<l){for(c&&p.c.push(+f.slice(0,c)),l-=w;c<l;)p.c.push(+f.slice(c,c+=w));c=w-(f=f.slice(c)).length}else c-=l;for(;c--;f+=\"0\");p.c.push(+f)}}else p.c=[p.e=0]}function H(e,t,n,r){var o,i,a,s,c;if(null==n?n=R:_(n,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)c=k(e.c),c=1==r||2==r&&(a<=j||a>=U)?C(c,a):B(c,a,\"0\");else if(i=(e=W(new K(e),t,n)).e,s=(c=k(e.c)).length,1==r||2==r&&(t<=i||i<=j)){for(;s<t;c+=\"0\",s++);c=C(c,i)}else if(t-=a+(2===r&&i>a),c=B(c,i,\"0\"),i+1>s){if(--t>0)for(c+=\".\";t--;c+=\"0\");}else if((t+=i-s)>0)for(i+1==s&&(c+=\".\");t--;c+=\"0\");return e.s<0&&o?\"-\"+c:c}function $(e,t){for(var n,r,o=1,i=new K(e[0]);o<e.length;o++)(!(r=new K(e[o])).s||(n=O(i,r))===t||0===n&&i.s===t)&&(i=r);return i}function G(e,t,n){for(var r=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,r++);return(n=r+n*w-1)>N?e.c=e.e=null:n<F?e.c=[e.e=0]:(e.e=n,e.c=t),e}function W(e,t,n,r){var o,i,a,s,c,u,l,f=e.c,p=A;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=w,a=t,c=f[u=0],l=g(c/p[o-a-1]%10);else if((u=y((i+1)/w))>=f.length){if(!r)break e;for(;f.length<=u;f.push(0));c=l=0,o=1,a=(i%=w)-w+1}else{for(c=s=f[u],o=1;s>=10;s/=10,o++);l=(a=(i%=w)-w+o)<0?0:g(c/p[o-a-1]%10)}if(r=r||t<0||null!=f[u+1]||(a<0?c:c%p[o-a-1]),r=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(i>0?a>0?c/p[o-a]:0:f[u-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,r?(t-=e.e+1,f[0]=p[(w-t%w)%w],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=u,s=1,u--):(f.length=u+1,s=p[w-i],f[u]=a>0?g(c/p[o-a]%p[a])*s:0),r)for(;;){if(0==u){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==b&&(f[0]=1));break}if(f[u]+=s,f[u]!=b)break;f[u--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>N?e.c=e.e=null:e.e<F&&(e.c=[e.e=0])}return e}function X(e){var t,n=e.e;return null===n?e.toString():(t=k(e.c),t=n<=j||n>=U?C(t,n):B(t,n,\"0\"),e.s<0?\"-\"+t:t)}return K.clone=e,K.ROUND_UP=0,K.ROUND_DOWN=1,K.ROUND_CEIL=2,K.ROUND_FLOOR=3,K.ROUND_HALF_UP=4,K.ROUND_HALF_DOWN=5,K.ROUND_HALF_EVEN=6,K.ROUND_HALF_CEIL=7,K.ROUND_HALF_FLOOR=8,K.EUCLID=9,K.config=K.set=function(e){var t,n;if(null!=e){if(\"object\"!=typeof e)throw Error(m+\"Object expected: \"+e);if(e.hasOwnProperty(t=\"DECIMAL_PLACES\")&&(_(n=e[t],0,x,t),P=n),e.hasOwnProperty(t=\"ROUNDING_MODE\")&&(_(n=e[t],0,8,t),R=n),e.hasOwnProperty(t=\"EXPONENTIAL_AT\")&&((n=e[t])&&n.pop?(_(n[0],-x,0,t),_(n[1],0,x,t),j=n[0],U=n[1]):(_(n,-x,x,t),j=-(U=n<0?-n:n))),e.hasOwnProperty(t=\"RANGE\"))if((n=e[t])&&n.pop)_(n[0],-x,-1,t),_(n[1],1,x,t),F=n[0],N=n[1];else{if(_(n,-x,x,t),!n)throw Error(m+t+\" cannot be zero: \"+n);F=-(N=n<0?-n:n)}if(e.hasOwnProperty(t=\"CRYPTO\")){if((n=e[t])!==!!n)throw Error(m+t+\" not true or false: \"+n);if(n){if(\"undefined\"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw L=!n,Error(m+\"crypto unavailable\");L=n}else L=n}if(e.hasOwnProperty(t=\"MODULO_MODE\")&&(_(n=e[t],0,9,t),M=n),e.hasOwnProperty(t=\"POW_PRECISION\")&&(_(n=e[t],0,x,t),D=n),e.hasOwnProperty(t=\"FORMAT\")){if(\"object\"!=typeof(n=e[t]))throw Error(m+t+\" not an object: \"+n);q=n}if(e.hasOwnProperty(t=\"ALPHABET\")){if(\"string\"!=typeof(n=e[t])||/^.?$|[+\\-.\\s]|(.).*\\1/.test(n))throw Error(m+t+\" invalid: \"+n);z=\"0123456789\"==n.slice(0,10),V=n}}return{DECIMAL_PLACES:P,ROUNDING_MODE:R,EXPONENTIAL_AT:[j,U],RANGE:[F,N],CRYPTO:L,MODULO_MODE:M,POW_PRECISION:D,FORMAT:q,ALPHABET:V}},K.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!K.DEBUG)return!0;var t,n,r=e.c,o=e.e,i=e.s;e:if(\"[object Array]\"=={}.toString.call(r)){if((1===i||-1===i)&&o>=-x&&o<=x&&o===g(o)){if(0===r[0]){if(0===o&&1===r.length)return!0;break e}if((t=(o+1)%w)<1&&(t+=w),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=b||n!==g(n))break e;if(0!==n)return!0}}}else if(null===r&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(m+\"Invalid BigNumber: \"+e)},K.maximum=K.max=function(){return $(arguments,-1)},K.minimum=K.min=function(){return $(arguments,1)},K.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return g(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,o,i,s=0,c=[],u=new K(d);if(null==e?e=P:_(e,0,x),o=y(e/w),L)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[s]=n[0],t[s+1]=n[1]):(c.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw L=!1,Error(m+\"crypto unavailable\");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=o/7}if(!L)for(;s<o;)(i=a())<9e15&&(c[s++]=i%1e14);for(o=c[--s],e%=w,o&&e&&(i=A[w-e],c[s]=g(o/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[r=0];else{for(r=-1;0===c[0];c.splice(0,1),r-=w);for(s=1,i=c[0];i>=10;i/=10,s++);s<w&&(r-=w-s)}return u.e=r,u.c=c,u}),K.sum=function(){for(var e=1,t=arguments,n=new K(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e=\"0123456789\";function t(e,t,n,r){for(var o,i,a=[0],s=0,c=e.length;s<c;){for(i=a.length;i--;a[i]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>n-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/n|0,a[o]%=n)}return a.reverse()}return function(r,o,i,a,s){var c,u,l,f,p,d,h,y,g=r.indexOf(\".\"),m=P,v=R;for(g>=0&&(f=D,D=0,r=r.replace(\".\",\"\"),d=(y=new K(o)).pow(r.length-g),D=f,y.c=t(B(k(d.c),d.e,\"0\"),10,i,e),y.e=y.c.length),l=f=(h=t(r,o,i,s?(c=V,e):(c=e,V))).length;0==h[--f];h.pop());if(!h[0])return c.charAt(0);if(g<0?--l:(d.c=h,d.e=l,d.s=a,h=(d=n(d,y,m,v,i)).c,p=d.r,l=d.e),g=h[u=l+m+1],f=i/2,p=p||u<0||null!=h[u+1],p=v<4?(null!=g||p)&&(0==v||v==(d.s<0?3:2)):g>f||g==f&&(4==v||p||6==v&&1&h[u-1]||v==(d.s<0?8:7)),u<1||!h[0])r=p?B(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(h.length=u,p)for(--i;++h[--u]>i;)h[u]=0,u||(++l,h=[1].concat(h));for(f=h.length;!h[--f];);for(g=0,r=\"\";g<=f;r+=c.charAt(h[g++]));r=B(r,l,c.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,o,i,a,s=0,c=e.length,u=t%E,l=t/E|0;for(e=e.slice();c--;)s=((o=u*(i=e[c]%E)+(r=l*i+(a=e[c]/E|0)*u)%E*E+s)/n|0)+(r/E|0)+l*a,e[c]=o%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;o<n;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function n(e,t,n,r){for(var o=0;n--;)e[n]-=o,o=e[n]<t[n]?1:0,e[n]=o*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,o,i,a,s){var c,u,l,f,p,d,h,y,m,v,S,A,E,x,k,O,_,I=r.s==o.s?1:-1,C=r.c,B=o.c;if(!(C&&C[0]&&B&&B[0]))return new K(r.s&&o.s&&(C?!B||C[0]!=B[0]:B)?C&&0==C[0]||!B?0*I:I/0:NaN);for(m=(y=new K(I)).c=[],I=i+(u=r.e-o.e)+1,s||(s=b,u=T(r.e/w)-T(o.e/w),I=I/w|0),l=0;B[l]==(C[l]||0);l++);if(B[l]>(C[l]||0)&&u--,I<0)m.push(1),f=!0;else{for(x=C.length,O=B.length,l=0,I+=2,(p=g(s/(B[0]+1)))>1&&(B=e(B,p,s),C=e(C,p,s),O=B.length,x=C.length),E=O,S=(v=C.slice(0,O)).length;S<O;v[S++]=0);_=B.slice(),_=[0].concat(_),k=B[0],B[1]>=s/2&&k++;do{if(p=0,(c=t(B,v,O,S))<0){if(A=v[0],O!=S&&(A=A*s+(v[1]||0)),(p=g(A/k))>1)for(p>=s&&(p=s-1),h=(d=e(B,p,s)).length,S=v.length;1==t(d,v,h,S);)p--,n(d,O<h?_:B,h,s),h=d.length,c=1;else 0==p&&(c=p=1),h=(d=B.slice()).length;if(h<S&&(d=[0].concat(d)),n(v,d,S,s),S=v.length,-1==c)for(;t(B,v,O,S)<1;)p++,n(v,O<S?_:B,S,s),S=v.length}else 0===c&&(p++,v=[0]);m[l++]=p,v[0]?v[S++]=C[E]||0:(v=[C[E]],S=1)}while((E++<x||null!=v[0])&&I--);f=null!=v[0],m[0]||m.splice(0,1)}if(s==b){for(l=1,I=m[0];I>=10;I/=10,l++);W(y,i+(y.e=l+u*w-1)+1,a,f)}else y.e=u,y.r=+f;return y}}(),s=/^(-?)0([xbo])(?=\\w[\\w.]*$)/i,c=/^([^.]+)\\.$/,u=/^\\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g,o=function(e,t,n,r){var o,i=n?t:t.replace(f,\"\");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!n&&(i=i.replace(s,function(e,t,n){return o=\"x\"==(n=n.toLowerCase())?16:\"b\"==n?2:8,r&&r!=o?e:t}),r&&(o=r,i=i.replace(c,\"$1\").replace(u,\"0.$1\")),t!=i))return new K(i,o);if(K.DEBUG)throw Error(m+\"Not a\"+(r?\" base \"+r:\"\")+\" number: \"+t);e.s=null}e.c=e.e=null},p.absoluteValue=p.abs=function(){var e=new K(this);return e.s<0&&(e.s=1),e},p.comparedTo=function(e,t){return O(this,new K(e,t))},p.decimalPlaces=p.dp=function(e,t){var n,r,o,i=this;if(null!=e)return _(e,0,x),null==t?t=R:_(t,0,8),W(new K(i),e+i.e+1,t);if(!(n=i.c))return null;if(r=((o=n.length-1)-T(this.e/w))*w,o=n[o])for(;o%10==0;o/=10,r--);return r<0&&(r=0),r},p.dividedBy=p.div=function(e,t){return n(this,new K(e,t),P,R)},p.dividedToIntegerBy=p.idiv=function(e,t){return n(this,new K(e,t),0,1)},p.exponentiatedBy=p.pow=function(e,t){var n,r,o,i,a,s,c,u,l=this;if((e=new K(e)).c&&!e.isInteger())throw Error(m+\"Exponent not an integer: \"+X(e));if(null!=t&&(t=new K(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return u=new K(Math.pow(+X(l),a?e.s*(2-I(e)):+X(e))),t?u.mod(t):u;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new K(NaN);(r=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&I(e)?-0:0,l.e>-1&&(i=1/i),new K(s?1/i:i);D&&(i=y(D/w+2))}for(a?(n=new K(.5),s&&(e.s=1),c=I(e)):c=(o=Math.abs(+X(e)))%2,u=new K(d);;){if(c){if(!(u=u.times(l)).c)break;i?u.c.length>i&&(u.c.length=i):r&&(u=u.mod(t))}if(o){if(0===(o=g(o/2)))break;c=o%2}else if(W(e=e.times(n),e.e+1,1),e.e>14)c=I(e);else{if(0===(o=+X(e)))break;c=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):r&&(l=l.mod(t))}return r?u:(s&&(u=d.div(u)),t?u.mod(t):i?W(u,D,R,void 0):u)},p.integerValue=function(e){var t=new K(this);return null==e?e=R:_(e,0,8),W(t,t.e+1,e)},p.isEqualTo=p.eq=function(e,t){return 0===O(this,new K(e,t))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(e,t){return O(this,new K(e,t))>0},p.isGreaterThanOrEqualTo=p.gte=function(e,t){return 1===(t=O(this,new K(e,t)))||0===t},p.isInteger=function(){return!!this.c&&T(this.e/w)>this.c.length-2},p.isLessThan=p.lt=function(e,t){return O(this,new K(e,t))<0},p.isLessThanOrEqualTo=p.lte=function(e,t){return-1===(t=O(this,new K(e,t)))||0===t},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(e,t){var n,r,o,i,a=this,s=a.s;if(t=(e=new K(e,t)).s,!s||!t)return new K(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/w,u=e.e/w,l=a.c,f=e.c;if(!c||!u){if(!l||!f)return l?(e.s=-t,e):new K(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new K(l[0]?a:3==R?-0:0)}if(c=T(c),u=T(u),l=l.slice(),s=c-u){for((i=s<0)?(s=-s,o=l):(u=c,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(r=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t<r;t++)if(l[t]!=f[t]){i=l[t]<f[t];break}if(i&&(o=l,l=f,f=o,e.s=-e.s),(t=(r=f.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=b-1;r>s;){if(l[--r]<f[r]){for(n=r;n&&!l[--n];l[n]=t);--l[n],l[r]+=b}l[r]-=f[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?G(e,l,u):(e.s=3==R?-1:1,e.c=[e.e=0],e)},p.modulo=p.mod=function(e,t){var r,o,i=this;return e=new K(e,t),!i.c||!e.s||e.c&&!e.c[0]?new K(NaN):!e.c||i.c&&!i.c[0]?new K(i):(9==M?(o=e.s,e.s=1,r=n(i,e,0,3),e.s=o,r.s*=o):r=n(i,e,0,M),(e=i.minus(r.times(e))).c[0]||1!=M||(e.s=i.s),e)},p.multipliedBy=p.times=function(e,t){var n,r,o,i,a,s,c,u,l,f,p,d,h,y,g,m=this,v=m.c,S=(e=new K(e,t)).c;if(!(v&&S&&v[0]&&S[0]))return!m.s||!e.s||v&&!v[0]&&!S||S&&!S[0]&&!v?e.c=e.e=e.s=null:(e.s*=m.s,v&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=T(m.e/w)+T(e.e/w),e.s*=m.s,(c=v.length)<(f=S.length)&&(h=v,v=S,S=h,o=c,c=f,f=o),o=c+f,h=[];o--;h.push(0));for(y=b,g=E,o=f;--o>=0;){for(n=0,p=S[o]%g,d=S[o]/g|0,i=o+(a=c);i>o;)n=((u=p*(u=v[--a]%g)+(s=d*u+(l=v[a]/g|0)*p)%g*g+h[i]+n)/y|0)+(s/g|0)+d*l,h[i--]=u%y;h[i]=n}return n?++r:h.splice(0,1),G(e,h,r)},p.negated=function(){var e=new K(this);return e.s=-e.s||null,e},p.plus=function(e,t){var n,r=this,o=r.s;if(t=(e=new K(e,t)).s,!o||!t)return new K(NaN);if(o!=t)return e.s=-t,r.minus(e);var i=r.e/w,a=e.e/w,s=r.c,c=e.c;if(!i||!a){if(!s||!c)return new K(o/0);if(!s[0]||!c[0])return c[0]?e:new K(s[0]?r:0*o)}if(i=T(i),a=T(a),s=s.slice(),o=i-a){for(o>0?(a=i,n=c):(o=-o,n=s),n.reverse();o--;n.push(0));n.reverse()}for((o=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/b|0,s[t]=b===s[t]?0:s[t]%b;return o&&(s=[o].concat(s),++a),G(e,s,a)},p.precision=p.sd=function(e,t){var n,r,o,i=this;if(null!=e&&e!==!!e)return _(e,1,x),null==t?t=R:_(t,0,8),W(new K(i),e,t);if(!(n=i.c))return null;if(r=(o=n.length-1)*w+1,o=n[o]){for(;o%10==0;o/=10,r--);for(o=n[0];o>=10;o/=10,r++);}return e&&i.e+1>r&&(r=i.e+1),r},p.shiftedBy=function(e){return _(e,-9007199254740991,S),this.times(\"1e\"+e)},p.squareRoot=p.sqrt=function(){var e,t,r,o,i,a=this,s=a.c,c=a.s,u=a.e,l=P+4,f=new K(\"0.5\");if(1!==c||!s||!s[0])return new K(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+X(a)))||c==1/0?(((t=k(s)).length+u)%2==0&&(t+=\"0\"),c=Math.sqrt(+t),u=T((u+1)/2)-(u<0||u%2),r=new K(t=c==1/0?\"5e\"+u:(t=c.toExponential()).slice(0,t.indexOf(\"e\")+1)+u)):r=new K(c+\"\"),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(i=r,r=f.times(i.plus(n(a,i,l,1))),k(i.c).slice(0,c)===(t=k(r.c)).slice(0,c)){if(r.e<u&&--c,\"9999\"!=(t=t.slice(c-3,c+1))&&(o||\"4999\"!=t)){+t&&(+t.slice(1)||\"5\"!=t.charAt(0))||(W(r,r.e+P+2,1),e=!r.times(r).eq(a));break}if(!o&&(W(i,i.e+P+2,0),i.times(i).eq(a))){r=i;break}l+=4,c+=4,o=1}return W(r,r.e+P+1,R,e)},p.toExponential=function(e,t){return null!=e&&(_(e,0,x),e++),H(this,e,t,1)},p.toFixed=function(e,t){return null!=e&&(_(e,0,x),e=e+this.e+1),H(this,e,t)},p.toFormat=function(e,t,n){var r,o=this;if(null==n)null!=e&&t&&\"object\"==typeof t?(n=t,t=null):e&&\"object\"==typeof e?(n=e,e=t=null):n=q;else if(\"object\"!=typeof n)throw Error(m+\"Argument not an object: \"+n);if(r=o.toFixed(e,t),o.c){var i,a=r.split(\".\"),s=+n.groupSize,c=+n.secondaryGroupSize,u=n.groupSeparator||\"\",l=a[0],f=a[1],p=o.s<0,d=p?l.slice(1):l,h=d.length;if(c&&(i=s,s=c,c=i,h-=i),s>0&&h>0){for(i=h%s||s,l=d.substr(0,i);i<h;i+=s)l+=u+d.substr(i,s);c>0&&(l+=u+d.slice(i)),p&&(l=\"-\"+l)}r=f?l+(n.decimalSeparator||\"\")+((c=+n.fractionGroupSize)?f.replace(new RegExp(\"\\\\d{\"+c+\"}\\\\B\",\"g\"),\"$&\"+(n.fractionGroupSeparator||\"\")):f):l}return(n.prefix||\"\")+r+(n.suffix||\"\")},p.toFraction=function(e){var t,r,o,i,a,s,c,u,l,f,p,h,y=this,g=y.c;if(null!=e&&(!(c=new K(e)).isInteger()&&(c.c||1!==c.s)||c.lt(d)))throw Error(m+\"Argument \"+(c.isInteger()?\"out of range: \":\"not an integer: \")+X(c));if(!g)return new K(y);for(t=new K(d),l=r=new K(d),o=u=new K(d),h=k(g),a=t.e=h.length-y.e-1,t.c[0]=A[(s=a%w)<0?w+s:s],e=!e||c.comparedTo(t)>0?a>0?t:l:c,s=N,N=1/0,c=new K(h),u.c[0]=0;f=n(c,t,0,1),1!=(i=r.plus(f.times(o))).comparedTo(e);)r=o,o=i,l=u.plus(f.times(i=l)),u=i,t=c.minus(f.times(i=t)),c=i;return i=n(e.minus(r),o,0,1),u=u.plus(i.times(l)),r=r.plus(i.times(o)),u.s=l.s=y.s,p=n(l,o,a*=2,R).minus(y).abs().comparedTo(n(u,r,a,R).minus(y).abs())<1?[l,o]:[u,r],N=s,p},p.toNumber=function(){return+X(this)},p.toPrecision=function(e,t){return null!=e&&_(e,1,x),H(this,e,t,2)},p.toString=function(e){var t,n=this,o=n.s,i=n.e;return null===i?o?(t=\"Infinity\",o<0&&(t=\"-\"+t)):t=\"NaN\":(null==e?t=i<=j||i>=U?C(k(n.c),i):B(k(n.c),i,\"0\"):10===e&&z?t=B(k((n=W(new K(n),P+i+1,R)).c),n.e,\"0\"):(_(e,2,V.length,\"Base\"),t=r(B(k(n.c),i,\"0\"),10,e,o,!0)),o<0&&n.c[0]&&(t=\"-\"+t)),t},p.valueOf=p.toJSON=function(){return X(this)},p._isBigNumber=!0,p[Symbol.toStringTag]=\"BigNumber\",p[Symbol.for(\"nodejs.util.inspect.custom\")]=p.valueOf,null!=t&&K.set(t),K}();const R=P;var j=n(4193),U=n.n(j),F=n(9127),N=n.n(F),L=n(5976),M=n(9983);function D(e){return D=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},D(e)}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z(e,t,n){return(t=function(e){var t=function(e){if(\"object\"!=D(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=D(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==D(t)?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var K=\"15.1.0\",H={};function $(e){return Math.floor(e/1e3)}function G(e){var t=H[e];if(!t||!t.localTimeRecorded||!t.serverTime)return null;var n=t.serverTime,r=t.localTimeRecorded,o=$((new Date).getTime());return o-r>300?null:o-r+n}function W(e){return W=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},W(e)}function X(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return Z(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Z(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Z(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,Z(f,\"constructor\",u),Z(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",Z(u,o,\"GeneratorFunction\"),Z(f),Z(f,o,\"Generator\"),Z(f,r,function(){return this}),Z(f,\"toString\",function(){return\"[object Generator]\"}),(X=function(){return{w:i,m:p}})()}function Z(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}Z=function(e,t,n,r){function i(t,n){Z(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},Z(e,t,n,r)}function Y(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function J(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Y(i,r,o,a,s,\"next\",e)}function s(e){Y(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,te(r.key),r)}}function te(e){var t=function(e){if(\"object\"!=W(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=W(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==W(t)?t:t+\"\"}var ne,re,oe,ie,ae=[\"transaction\"],se=n.g;ne=null!==(re=null!==(oe=se.EventSource)&&void 0!==oe?oe:null===(ie=se.window)||void 0===ie?void 0:ie.EventSource)&&void 0!==re?re:n(1731);var ce,ue,le=function(e,t){return t&&ee(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"\";!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.url=t.clone(),this.filter=[],this.originalSegments=this.url.segment()||[],this.neighborRoot=r,this.httpClient=n},[{key:\"call\",value:function(){var e=this;return this.checkFilter(),this._sendNormalRequest(this.url).then(function(t){return e._parseResponse(t)})}},{key:\"stream\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0===ne)throw new Error(\"Streaming requires eventsource to be enabled. If you need this functionality, compile with USE_EVENTSOURCE=true.\");this.checkFilter();var n=this.url.clone();n.setQuery(\"X-Client-Name\",\"js-stellar-sdk\"),n.setQuery(\"X-Client-Version\",K);var r,o,i=this.httpClient.defaults.headers;i&&[\"X-App-Name\",\"X-App-Version\"].forEach(function(e){var t,r;if(i instanceof Headers)t=null!==(r=i.get(e))&&void 0!==r?r:void 0;else if(Array.isArray(i)){var o=i.find(function(t){return function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if(\"string\"==typeof e)return Q(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(e,t):void 0}}(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}(t,1)[0]===e});t=null==o?void 0:o[1]}else t=i[e];t&&n.setQuery(e,t)});var a=function(){o=setTimeout(function(){var e;null===(e=r)||void 0===e||e.close(),r=s()},t.reconnectTimeout||15e3)},s=function(){try{r=new ne(n.toString())}catch(e){t.onerror&&t.onerror(e)}if(a(),!r)return r;var i=!1,c=function(){i||(clearTimeout(o),r.close(),s(),i=!0)},u=function(r){if(\"close\"!==r.type){var i=r.data?e._parseRecord(JSON.parse(r.data)):r;i.paging_token&&n.setQuery(\"cursor\",i.paging_token),clearTimeout(o),a(),void 0!==t.onmessage&&t.onmessage(i)}else c()},l=function(e){t.onerror&&t.onerror(e)};return r.addEventListener?(r.addEventListener(\"message\",u.bind(e)),r.addEventListener(\"error\",l.bind(e)),r.addEventListener(\"close\",c.bind(e))):(r.onmessage=u.bind(e),r.onerror=l.bind(e)),r};return s(),function(){var e;clearTimeout(o),null===(e=r)||void 0===e||e.close()}}},{key:\"cursor\",value:function(e){return this.url.setQuery(\"cursor\",e),this}},{key:\"limit\",value:function(e){return this.url.setQuery(\"limit\",e.toString()),this}},{key:\"order\",value:function(e){return this.url.setQuery(\"order\",e),this}},{key:\"join\",value:function(e){return this.url.setQuery(\"join\",e),this}},{key:\"forEndpoint\",value:function(e,t){if(\"\"===this.neighborRoot)throw new Error(\"Invalid usage: neighborRoot not set in constructor\");return this.filter.push([e,t,this.neighborRoot]),this}},{key:\"checkFilter\",value:function(){if(this.filter.length>=2)throw new L.v7(\"Too many filters specified\",this.filter);if(1===this.filter.length){var e=this.originalSegments.concat(this.filter[0]);this.url.segment(e)}}},{key:\"_requestFnForLink\",value:function(e){var t=this;return J(X().m(function n(){var r,o,i,a,s=arguments;return X().w(function(n){for(;;)switch(n.n){case 0:return r=s.length>0&&void 0!==s[0]?s[0]:{},e.templated?(i=N()(e.href),o=U()(i.expand(r))):o=U()(e.href),n.n=1,t._sendNormalRequest(o);case 1:return a=n.v,n.a(2,t._parseResponse(a))}},n)}))}},{key:\"_parseRecord\",value:function(e){var t=this;return e._links?(Object.keys(e._links).forEach(function(n){var r=e._links[n],o=!1;if(void 0!==e[n]&&(e[\"\".concat(n,\"_attr\")]=e[n],o=!0),o&&ae.indexOf(n)>=0){var i=t._parseRecord(e[n]);e[n]=J(X().m(function e(){return X().w(function(e){for(;;)if(0===e.n)return e.a(2,i)},e)}))}else e[n]=t._requestFnForLink(r)}),e):e}},{key:\"_sendNormalRequest\",value:(ue=J(X().m(function e(t){var n;return X().w(function(e){for(;;)if(0===e.n)return n=(n=t).authority(this.url.authority()).protocol(this.url.protocol()),e.a(2,this.httpClient.get(n.toString()).then(function(e){return e.data}).catch(this._handleNetworkError))},e,this)})),function(e){return ue.apply(this,arguments)})},{key:\"_parseResponse\",value:function(e){return e._embedded&&e._embedded.records?this._toCollectionPage(e):this._parseRecord(e)}},{key:\"_toCollectionPage\",value:function(e){for(var t,n,r=this,o=0;o<e._embedded.records.length;o+=1)e._embedded.records[o]=this._parseRecord(e._embedded.records[o]);return{records:e._embedded.records,next:(n=J(X().m(function t(){var n;return X().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r._sendNormalRequest(U()(e._links.next.href));case 1:return n=t.v,t.a(2,r._toCollectionPage(n))}},t)})),function(){return n.apply(this,arguments)}),prev:(t=J(X().m(function t(){var n;return X().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r._sendNormalRequest(U()(e._links.prev.href));case 1:return n=t.v,t.a(2,r._toCollectionPage(n))}},t)})),function(){return t.apply(this,arguments)})}}},{key:\"_handleNetworkError\",value:(ce=J(X().m(function e(t){var n,r,o;return X().w(function(e){for(;;)switch(e.n){case 0:if(!t.response||!t.response.status){e.n=4;break}o=t.response.status,e.n=404===o?1:2;break;case 1:return e.a(2,Promise.reject(new L.m_(null!==(n=t.response.statusText)&&void 0!==n?n:\"Not Found\",t.response.data)));case 2:return e.a(2,Promise.reject(new L.Dr(null!==(r=t.response.statusText)&&void 0!==r?r:\"Unknown\",t.response.data)));case 3:e.n=5;break;case 4:return e.a(2,Promise.reject(new Error(t.message)));case 5:return e.a(2)}},e)})),function(e){return ce.apply(this,arguments)})}]),fe=n(8732);function pe(e){return pe=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},pe(e)}function de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,he(r.key),r)}}function he(e){var t=function(e){if(\"object\"!=pe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=pe(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==pe(t)?t:t+\"\"}function ye(e,t,n){return t=me(t),function(e,t){if(t&&(\"object\"==pe(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,ge()?Reflect.construct(t,n||[],me(e).constructor):t.apply(e,n))}function ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ge=function(){return!!e})()}function me(e){return me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},me(e)}function ve(e,t){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ve(e,t)}var be=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=ye(this,t,[e,n])).url.segment(\"accounts\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&ve(e,t)}(t,e),function(e,t){return t&&de(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"accountId\",value:function(e){var t=new le(this.url.clone(),this.httpClient);return t.filter.push([e]),t}},{key:\"forSigner\",value:function(e){return this.url.setQuery(\"signer\",e),this}},{key:\"forAsset\",value:function(e){return this.url.setQuery(\"asset\",\"\".concat(e)),this}},{key:\"sponsor\",value:function(e){return this.url.setQuery(\"sponsor\",e),this}},{key:\"forLiquidityPool\",value:function(e){return this.url.setQuery(\"liquidity_pool\",e),this}}])}(le);function we(e){return we=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},we(e)}function Se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Ae(r.key),r)}}function Ae(e){var t=function(e){if(\"object\"!=we(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=we(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==we(t)?t:t+\"\"}function Ee(e,t,n){return t=Te(t),function(e,t){if(t&&(\"object\"==we(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,xe()?Reflect.construct(t,n||[],Te(e).constructor):t.apply(e,n))}function xe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xe=function(){return!!e})()}function Te(e){return Te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Te(e)}function ke(e,t){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ke(e,t)}var Oe=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=Ee(this,t,[e,n])).url.segment(\"assets\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&ke(e,t)}(t,e),function(e,t){return t&&Se(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"forCode\",value:function(e){return this.url.setQuery(\"asset_code\",e),this}},{key:\"forIssuer\",value:function(e){return this.url.setQuery(\"asset_issuer\",e),this}}])}(le);function _e(e){return _e=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},_e(e)}function Ie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Ce(r.key),r)}}function Ce(e){var t=function(e){if(\"object\"!=_e(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=_e(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==_e(t)?t:t+\"\"}function Be(e,t,n){return t=Re(t),function(e,t){if(t&&(\"object\"==_e(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,Pe()?Reflect.construct(t,n||[],Re(e).constructor):t.apply(e,n))}function Pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Pe=function(){return!!e})()}function Re(e){return Re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Re(e)}function je(e,t){return je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},je(e,t)}var Ue=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=Be(this,t,[e,n])).url.segment(\"claimable_balances\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&je(e,t)}(t,e),function(e,t){return t&&Ie(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"claimableBalance\",value:function(e){var t=new le(this.url.clone(),this.httpClient);return t.filter.push([e]),t}},{key:\"sponsor\",value:function(e){return this.url.setQuery(\"sponsor\",e),this}},{key:\"claimant\",value:function(e){return this.url.setQuery(\"claimant\",e),this}},{key:\"asset\",value:function(e){return this.url.setQuery(\"asset\",e.toString()),this}}])}(le);function Fe(e){return Fe=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Fe(e)}function Ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Le(r.key),r)}}function Le(e){var t=function(e){if(\"object\"!=Fe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Fe(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Fe(t)?t:t+\"\"}function Me(e,t,n){return t=qe(t),function(e,t){if(t&&(\"object\"==Fe(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,De()?Reflect.construct(t,n||[],qe(e).constructor):t.apply(e,n))}function De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(De=function(){return!!e})()}function qe(e){return qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qe(e)}function Ve(e,t){return Ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ve(e,t)}var ze=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=Me(this,t,[e,n,\"effects\"])).url.segment(\"effects\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Ve(e,t)}(t,e),function(e,t){return t&&Ne(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"forAccount\",value:function(e){return this.forEndpoint(\"accounts\",e)}},{key:\"forLedger\",value:function(e){return this.forEndpoint(\"ledgers\",e.toString())}},{key:\"forTransaction\",value:function(e){return this.forEndpoint(\"transactions\",e)}},{key:\"forOperation\",value:function(e){return this.forEndpoint(\"operations\",e)}},{key:\"forLiquidityPool\",value:function(e){return this.forEndpoint(\"liquidity_pools\",e)}}])}(le);function Ke(e){return Ke=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Ke(e)}function He(e,t,n){return t=Ge(t),function(e,t){if(t&&(\"object\"==Ke(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,$e()?Reflect.construct(t,n||[],Ge(e).constructor):t.apply(e,n))}function $e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($e=function(){return!!e})()}function Ge(e){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ge(e)}function We(e,t){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},We(e,t)}var Xe=function(e){function t(e,n,r){var o;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(o=He(this,t,[e,n])).url.segment(\"friendbot\"),o.url.setQuery(\"addr\",r),o}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&We(e,t)}(t,e),function(e){return Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t)}(le);function Ze(e){return Ze=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Ze(e)}function Ye(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Je(r.key),r)}}function Je(e){var t=function(e){if(\"object\"!=Ze(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=Ze(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==Ze(t)?t:t+\"\"}function Qe(e,t,n){return t=tt(t),function(e,t){if(t&&(\"object\"==Ze(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,et()?Reflect.construct(t,n||[],tt(e).constructor):t.apply(e,n))}function et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(et=function(){return!!e})()}function tt(e){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tt(e)}function nt(e,t){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nt(e,t)}var rt=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=Qe(this,t,[e,n])).url.segment(\"ledgers\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&nt(e,t)}(t,e),function(e,t){return t&&Ye(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"ledger\",value:function(e){return this.filter.push([\"ledgers\",e.toString()]),this}}])}(le);function ot(e){return ot=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},ot(e)}function it(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,at(r.key),r)}}function at(e){var t=function(e){if(\"object\"!=ot(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=ot(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==ot(t)?t:t+\"\"}function st(e,t,n){return t=ut(t),function(e,t){if(t&&(\"object\"==ot(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,ct()?Reflect.construct(t,n||[],ut(e).constructor):t.apply(e,n))}function ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ct=function(){return!!e})()}function ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ut(e)}function lt(e,t){return lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lt(e,t)}var ft=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=st(this,t,[e,n])).url.segment(\"liquidity_pools\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&lt(e,t)}(t,e),function(e,t){return t&&it(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"forAssets\",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map(function(e){return e.toString()}).join(\",\");return this.url.setQuery(\"reserves\",r),this}},{key:\"forAccount\",value:function(e){return this.url.setQuery(\"account\",e),this}},{key:\"liquidityPoolId\",value:function(e){if(!e.match(/[a-fA-F0-9]{64}/))throw new TypeError(\"\".concat(e,\" does not look like a liquidity pool ID\"));var t=new le(this.url.clone(),this.httpClient);return t.filter.push([e.toLowerCase()]),t}}])}(le);function pt(e){return pt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},pt(e)}function dt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,ht(r.key),r)}}function ht(e){var t=function(e){if(\"object\"!=pt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=pt(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==pt(t)?t:t+\"\"}function yt(e,t,n){return t=mt(t),function(e,t){if(t&&(\"object\"==pt(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,gt()?Reflect.construct(t,n||[],mt(e).constructor):t.apply(e,n))}function gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gt=function(){return!!e})()}function mt(e){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mt(e)}function vt(e,t){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vt(e,t)}var bt=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=yt(this,t,[e,n,\"offers\"])).url.segment(\"offers\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&vt(e,t)}(t,e),function(e,t){return t&&dt(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"offer\",value:function(e){var t=new le(this.url.clone(),this.httpClient);return t.filter.push([e]),t}},{key:\"forAccount\",value:function(e){return this.forEndpoint(\"accounts\",e)}},{key:\"buying\",value:function(e){return e.isNative()?this.url.setQuery(\"buying_asset_type\",\"native\"):(this.url.setQuery(\"buying_asset_type\",e.getAssetType()),this.url.setQuery(\"buying_asset_code\",e.getCode()),this.url.setQuery(\"buying_asset_issuer\",e.getIssuer())),this}},{key:\"selling\",value:function(e){return e.isNative()?this.url.setQuery(\"selling_asset_type\",\"native\"):(this.url.setQuery(\"selling_asset_type\",e.getAssetType()),this.url.setQuery(\"selling_asset_code\",e.getCode()),this.url.setQuery(\"selling_asset_issuer\",e.getIssuer())),this}},{key:\"sponsor\",value:function(e){return this.url.setQuery(\"sponsor\",e),this}},{key:\"seller\",value:function(e){return this.url.setQuery(\"seller\",e),this}}])}(le);function wt(e){return wt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},wt(e)}function St(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,At(r.key),r)}}function At(e){var t=function(e){if(\"object\"!=wt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=wt(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==wt(t)?t:t+\"\"}function Et(e,t,n){return t=Tt(t),function(e,t){if(t&&(\"object\"==wt(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,xt()?Reflect.construct(t,n||[],Tt(e).constructor):t.apply(e,n))}function xt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xt=function(){return!!e})()}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tt(e)}function kt(e,t){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kt(e,t)}var Ot=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=Et(this,t,[e,n,\"operations\"])).url.segment(\"operations\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&kt(e,t)}(t,e),function(e,t){return t&&St(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"operation\",value:function(e){var t=new le(this.url.clone(),this.httpClient);return t.filter.push([e]),t}},{key:\"forAccount\",value:function(e){return this.forEndpoint(\"accounts\",e)}},{key:\"forClaimableBalance\",value:function(e){return this.forEndpoint(\"claimable_balances\",e)}},{key:\"forLedger\",value:function(e){return this.forEndpoint(\"ledgers\",e.toString())}},{key:\"forTransaction\",value:function(e){return this.forEndpoint(\"transactions\",e)}},{key:\"forLiquidityPool\",value:function(e){return this.forEndpoint(\"liquidity_pools\",e)}},{key:\"includeFailed\",value:function(e){return this.url.setQuery(\"include_failed\",e.toString()),this}}])}(le);function _t(e){return _t=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},_t(e)}function It(e,t,n){return t=Bt(t),function(e,t){if(t&&(\"object\"==_t(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,Ct()?Reflect.construct(t,n||[],Bt(e).constructor):t.apply(e,n))}function Ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ct=function(){return!!e})()}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bt(e)}function Pt(e,t){return Pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pt(e,t)}var Rt=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(i=It(this,t,[e,n])).url.segment(\"order_book\"),r.isNative()?i.url.setQuery(\"selling_asset_type\",\"native\"):(i.url.setQuery(\"selling_asset_type\",r.getAssetType()),i.url.setQuery(\"selling_asset_code\",r.getCode()),i.url.setQuery(\"selling_asset_issuer\",r.getIssuer())),o.isNative()?i.url.setQuery(\"buying_asset_type\",\"native\"):(i.url.setQuery(\"buying_asset_type\",o.getAssetType()),i.url.setQuery(\"buying_asset_code\",o.getCode()),i.url.setQuery(\"buying_asset_issuer\",o.getIssuer())),i}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Pt(e,t)}(t,e),function(e){return Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t)}(le);function jt(e){return jt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},jt(e)}function Ut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Ft(r.key),r)}}function Ft(e){var t=function(e){if(\"object\"!=jt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=jt(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==jt(t)?t:t+\"\"}function Nt(e,t,n){return t=Mt(t),function(e,t){if(t&&(\"object\"==jt(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,Lt()?Reflect.construct(t,n||[],Mt(e).constructor):t.apply(e,n))}function Lt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Lt=function(){return!!e})()}function Mt(e){return Mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mt(e)}function Dt(e,t){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dt(e,t)}var qt=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=Nt(this,t,[e,n,\"payments\"])).url.segment(\"payments\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Dt(e,t)}(t,e),function(e,t){return t&&Ut(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"forAccount\",value:function(e){return this.forEndpoint(\"accounts\",e)}},{key:\"forLedger\",value:function(e){return this.forEndpoint(\"ledgers\",e.toString())}},{key:\"forTransaction\",value:function(e){return this.forEndpoint(\"transactions\",e)}},{key:\"includeFailed\",value:function(e){return this.url.setQuery(\"include_failed\",e.toString()),this}}])}(le);function Vt(e){return Vt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Vt(e)}function zt(e,t,n){return t=Ht(t),function(e,t){if(t&&(\"object\"==Vt(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,Kt()?Reflect.construct(t,n||[],Ht(e).constructor):t.apply(e,n))}function Kt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Kt=function(){return!!e})()}function Ht(e){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ht(e)}function $t(e,t){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$t(e,t)}var Gt=function(e){function t(e,n,r,o,i){var a;if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(a=zt(this,t,[e,n])).url.segment(\"paths/strict-receive\"),\"string\"==typeof r)a.url.setQuery(\"source_account\",r);else{var s=r.map(function(e){return e.isNative()?\"native\":\"\".concat(e.getCode(),\":\").concat(e.getIssuer())}).join(\",\");a.url.setQuery(\"source_assets\",s)}return a.url.setQuery(\"destination_amount\",i),o.isNative()?a.url.setQuery(\"destination_asset_type\",\"native\"):(a.url.setQuery(\"destination_asset_type\",o.getAssetType()),a.url.setQuery(\"destination_asset_code\",o.getCode()),a.url.setQuery(\"destination_asset_issuer\",o.getIssuer())),a}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&$t(e,t)}(t,e),function(e){return Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t)}(le);function Wt(e){return Wt=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},Wt(e)}function Xt(e,t,n){return t=Yt(t),function(e,t){if(t&&(\"object\"==Wt(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,Zt()?Reflect.construct(t,n||[],Yt(e).constructor):t.apply(e,n))}function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Zt=function(){return!!e})()}function Yt(e){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yt(e)}function Jt(e,t){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jt(e,t)}var Qt=function(e){function t(e,n,r,o,i){var a;if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(a=Xt(this,t,[e,n])).url.segment(\"paths/strict-send\"),r.isNative()?a.url.setQuery(\"source_asset_type\",\"native\"):(a.url.setQuery(\"source_asset_type\",r.getAssetType()),a.url.setQuery(\"source_asset_code\",r.getCode()),a.url.setQuery(\"source_asset_issuer\",r.getIssuer())),a.url.setQuery(\"source_amount\",o),\"string\"==typeof i)a.url.setQuery(\"destination_account\",i);else{var s=i.map(function(e){return e.isNative()?\"native\":\"\".concat(e.getCode(),\":\").concat(e.getIssuer())}).join(\",\");a.url.setQuery(\"destination_assets\",s)}return a}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&Jt(e,t)}(t,e),function(e){return Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t)}(le);function en(e){return en=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},en(e)}function tn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,nn(r.key),r)}}function nn(e){var t=function(e){if(\"object\"!=en(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=en(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==en(t)?t:t+\"\"}function rn(e,t,n){return t=an(t),function(e,t){if(t&&(\"object\"==en(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,on()?Reflect.construct(t,n||[],an(e).constructor):t.apply(e,n))}function on(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(on=function(){return!!e})()}function an(e){return an=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},an(e)}function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sn(e,t)}var cn=[6e4,3e5,9e5,36e5,864e5,6048e5],un=function(e){function t(e,n,r,o,i,a,s,c){var u;if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(u=rn(this,t,[e,n])).url.segment(\"trade_aggregations\"),r.isNative()?u.url.setQuery(\"base_asset_type\",\"native\"):(u.url.setQuery(\"base_asset_type\",r.getAssetType()),u.url.setQuery(\"base_asset_code\",r.getCode()),u.url.setQuery(\"base_asset_issuer\",r.getIssuer())),o.isNative()?u.url.setQuery(\"counter_asset_type\",\"native\"):(u.url.setQuery(\"counter_asset_type\",o.getAssetType()),u.url.setQuery(\"counter_asset_code\",o.getCode()),u.url.setQuery(\"counter_asset_issuer\",o.getIssuer())),\"number\"!=typeof i||\"number\"!=typeof a)throw new L.v7(\"Invalid time bounds\",[i,a]);if(u.url.setQuery(\"start_time\",i.toString()),u.url.setQuery(\"end_time\",a.toString()),!u.isValidResolution(s))throw new L.v7(\"Invalid resolution\",s);if(u.url.setQuery(\"resolution\",s.toString()),!u.isValidOffset(c,s))throw new L.v7(\"Invalid offset\",c);return u.url.setQuery(\"offset\",c.toString()),u}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&sn(e,t)}(t,e),function(e,t){return t&&tn(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"isValidResolution\",value:function(e){return cn.some(function(t){return t===e})}},{key:\"isValidOffset\",value:function(e,t){var n=36e5;return!(e>t||e>=24*n||e%n!==0)}}])}(le);function ln(e){return ln=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},ln(e)}function fn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,pn(r.key),r)}}function pn(e){var t=function(e){if(\"object\"!=ln(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=ln(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==ln(t)?t:t+\"\"}function dn(e,t,n){return t=yn(t),function(e,t){if(t&&(\"object\"==ln(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,hn()?Reflect.construct(t,n||[],yn(e).constructor):t.apply(e,n))}function hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(hn=function(){return!!e})()}function yn(e){return yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yn(e)}function gn(e,t){return gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gn(e,t)}var mn=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=dn(this,t,[e,n,\"trades\"])).url.segment(\"trades\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&gn(e,t)}(t,e),function(e,t){return t&&fn(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"forAssetPair\",value:function(e,t){return e.isNative()?this.url.setQuery(\"base_asset_type\",\"native\"):(this.url.setQuery(\"base_asset_type\",e.getAssetType()),this.url.setQuery(\"base_asset_code\",e.getCode()),this.url.setQuery(\"base_asset_issuer\",e.getIssuer())),t.isNative()?this.url.setQuery(\"counter_asset_type\",\"native\"):(this.url.setQuery(\"counter_asset_type\",t.getAssetType()),this.url.setQuery(\"counter_asset_code\",t.getCode()),this.url.setQuery(\"counter_asset_issuer\",t.getIssuer())),this}},{key:\"forOffer\",value:function(e){return this.url.setQuery(\"offer_id\",e),this}},{key:\"forType\",value:function(e){return this.url.setQuery(\"trade_type\",e),this}},{key:\"forAccount\",value:function(e){return this.forEndpoint(\"accounts\",e)}},{key:\"forLiquidityPool\",value:function(e){return this.forEndpoint(\"liquidity_pools\",e)}}])}(le);function vn(e){return vn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},vn(e)}function bn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,wn(r.key),r)}}function wn(e){var t=function(e){if(\"object\"!=vn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=vn(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==vn(t)?t:t+\"\"}function Sn(e,t,n){return t=En(t),function(e,t){if(t&&(\"object\"==vn(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,An()?Reflect.construct(t,n||[],En(e).constructor):t.apply(e,n))}function An(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(An=function(){return!!e})()}function En(e){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},En(e)}function xn(e,t){return xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xn(e,t)}var Tn=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),(r=Sn(this,t,[e,n,\"transactions\"])).url.segment(\"transactions\"),r}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&xn(e,t)}(t,e),function(e,t){return t&&bn(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(t,[{key:\"transaction\",value:function(e){var t=new le(this.url.clone(),this.httpClient);return t.filter.push([e]),t}},{key:\"forAccount\",value:function(e){return this.forEndpoint(\"accounts\",e)}},{key:\"forClaimableBalance\",value:function(e){return this.forEndpoint(\"claimable_balances\",e)}},{key:\"forLedger\",value:function(e){return this.forEndpoint(\"ledgers\",e.toString())}},{key:\"forLiquidityPool\",value:function(e){return this.forEndpoint(\"liquidity_pools\",e)}},{key:\"includeFailed\",value:function(e){return this.url.setQuery(\"include_failed\",e.toString()),this}}])}(le);function kn(e){return kn=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},kn(e)}function On(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach(function(t){In(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function In(e,t,n){return(t=Un(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cn(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return Bn(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Bn(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Bn(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,Bn(f,\"constructor\",u),Bn(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",Bn(u,o,\"GeneratorFunction\"),Bn(f),Bn(f,o,\"Generator\"),Bn(f,r,function(){return this}),Bn(f,\"toString\",function(){return\"[object Generator]\"}),(Cn=function(){return{w:i,m:p}})()}function Bn(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}Bn=function(e,t,n,r){function i(t,n){Bn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},Bn(e,t,n,r)}function Pn(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function Rn(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Pn(i,r,o,a,s,\"next\",e)}function s(e){Pn(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function jn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,Un(r.key),r)}}function Un(e){var t=function(e){if(\"object\"!=kn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=kn(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==kn(t)?t:t+\"\"}function Fn(e){return new R(e).div(1e7).toString()}var Nn,Ln,Mn,Dn,qn,Vn,zn,Kn,Hn=function(e,t){return t&&jn(e.prototype,t),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.serverURL=U()(t);var r,o,i=void 0===n.allowHttp?fe.T.isAllowHttp():n.allowHttp,a={};if(n.appName&&(a[\"X-App-Name\"]=n.appName),n.appVersion&&(a[\"X-App-Version\"]=n.appVersion),n.authToken&&(a[\"X-Auth-Token\"]=n.authToken),n.headers&&Object.assign(a,n.headers),this.httpClient=(r=a,(o=(0,M.vt)({headers:V(V({},r),{},{\"X-Client-Name\":\"js-stellar-sdk\",\"X-Client-Version\":K})})).interceptors.response.use(function(e){var t=U()(e.config.url),n=t.port()?\"\".concat(t.hostname(),\":\").concat(t.port()):t.hostname(),r=0;if(e.headers instanceof Headers){var o=e.headers.get(\"date\");o&&(r=$(Date.parse(o)))}else if(\"object\"===D(e.headers)&&\"date\"in e.headers){var i=e.headers;\"string\"==typeof i.date&&(r=$(Date.parse(i.date)))}var a=$((new Date).getTime());return Number.isNaN(r)||(H[n]={serverTime:r,localTimeRecorded:a}),e}),o),\"https\"!==this.serverURL.protocol()&&!i)throw new Error(\"Cannot connect to insecure horizon server\")},[{key:\"fetchTimebounds\",value:(Kn=Rn(Cn().m(function e(t){var n,r,o,i=arguments;return Cn().w(function(e){for(;;)switch(e.n){case 0:if(n=i.length>1&&void 0!==i[1]&&i[1],r=this.serverURL.port()?\"\".concat(this.serverURL.hostname(),\":\").concat(this.serverURL.port()):this.serverURL.hostname(),!(o=G(r))){e.n=1;break}return e.a(2,{minTime:0,maxTime:o+t});case 1:if(!n){e.n=2;break}return e.a(2,{minTime:0,maxTime:Math.floor((new Date).getTime()/1e3)+t});case 2:return e.n=3,this.httpClient.get(this.serverURL.toString());case 3:return e.a(2,this.fetchTimebounds(t,!0))}},e,this)})),function(e){return Kn.apply(this,arguments)})},{key:\"fetchBaseFee\",value:(zn=Rn(Cn().m(function e(){var t;return Cn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.feeStats();case 1:return t=e.v,e.a(2,parseInt(t.last_ledger_base_fee,10)||100)}},e,this)})),function(){return zn.apply(this,arguments)})},{key:\"feeStats\",value:(Vn=Rn(Cn().m(function e(){var t;return Cn().w(function(e){for(;;)if(0===e.n)return(t=new le(this.serverURL,this.httpClient)).filter.push([\"fee_stats\"]),e.a(2,t.call())},e,this)})),function(){return Vn.apply(this,arguments)})},{key:\"root\",value:(qn=Rn(Cn().m(function e(){var t;return Cn().w(function(e){for(;;)if(0===e.n)return t=new le(this.serverURL,this.httpClient),e.a(2,t.call())},e,this)})),function(){return qn.apply(this,arguments)})},{key:\"submitTransaction\",value:(Dn=Rn(Cn().m(function e(t){var n,r=arguments;return Cn().w(function(e){for(;;)switch(e.n){case 0:if((r.length>1&&void 0!==r[1]?r[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.n=1;break}return e.n=1,this.checkMemoRequired(t);case 1:return n=encodeURIComponent(t.toEnvelope().toXDR().toString(\"base64\")),e.a(2,this.httpClient.post(this.serverURL.clone().segment(\"transactions\").toString(),\"tx=\".concat(n),{timeout:6e4,headers:{\"Content-Type\":\"application/x-www-form-urlencoded\"}}).then(function(e){if(!e.data.result_xdr)return e.data;var t,n,r=s.xdr.TransactionResult.fromXDR(e.data.result_xdr,\"base64\").result().value();return r.length&&(t=r.map(function(e,t){if(\"manageBuyOffer\"!==e.value().switch().name&&\"manageSellOffer\"!==e.value().switch().name)return null;n=!0;var r,o=new R(0),i=new R(0),a=e.value().value().success(),c=a.offersClaimed().map(function(e){var t=e.value(),n=\"\";switch(e.switch()){case s.xdr.ClaimAtomType.claimAtomTypeV0():n=s.StrKey.encodeEd25519PublicKey(t.sellerEd25519());break;case s.xdr.ClaimAtomType.claimAtomTypeOrderBook():n=s.StrKey.encodeEd25519PublicKey(t.sellerId().ed25519());break;default:throw new Error(\"Invalid offer result type: \".concat(e.switch()))}var r=new R(t.amountBought().toString()),a=new R(t.amountSold().toString());o=o.plus(a),i=i.plus(r);var c=s.Asset.fromOperation(t.assetSold()),u=s.Asset.fromOperation(t.assetBought()),l={type:c.getAssetType(),assetCode:c.getCode(),issuer:c.getIssuer()},f={type:u.getAssetType(),assetCode:u.getCode(),issuer:u.getIssuer()};return{sellerId:n,offerId:t.offerId().toString(),assetSold:l,amountSold:Fn(a),assetBought:f,amountBought:Fn(r)}}),u=a.offer().switch().name;if(\"function\"==typeof a.offer().value&&a.offer().value()){var l=a.offer().value();r={offerId:l.offerId().toString(),selling:{},buying:{},amount:Fn(l.amount().toString()),price:{n:l.price().n(),d:l.price().d()}};var f=s.Asset.fromOperation(l.selling());r.selling={type:f.getAssetType(),assetCode:f.getCode(),issuer:f.getIssuer()};var p=s.Asset.fromOperation(l.buying());r.buying={type:p.getAssetType(),assetCode:p.getCode(),issuer:p.getIssuer()}}return{offersClaimed:c,effect:u,operationIndex:t,currentOffer:r,amountBought:Fn(o),amountSold:Fn(i),isFullyOpen:!c.length&&\"manageOfferDeleted\"!==u,wasPartiallyFilled:!!c.length&&\"manageOfferDeleted\"!==u,wasImmediatelyFilled:!!c.length&&\"manageOfferDeleted\"===u,wasImmediatelyDeleted:!c.length&&\"manageOfferDeleted\"===u}}).filter(function(e){return!!e})),_n(_n({},e.data),{},{offerResults:n?t:void 0})}).catch(function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new L.nS(\"Transaction submission failed. Server responded: \".concat(e.status,\" \").concat(e.statusText),e.data))}))}},e,this)})),function(e){return Dn.apply(this,arguments)})},{key:\"submitAsyncTransaction\",value:(Mn=Rn(Cn().m(function e(t){var n,r=arguments;return Cn().w(function(e){for(;;)switch(e.n){case 0:if((r.length>1&&void 0!==r[1]?r[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.n=1;break}return e.n=1,this.checkMemoRequired(t);case 1:return n=encodeURIComponent(t.toEnvelope().toXDR().toString(\"base64\")),e.a(2,this.httpClient.post(this.serverURL.clone().segment(\"transactions_async\").toString(),\"tx=\".concat(n),{headers:{\"Content-Type\":\"application/x-www-form-urlencoded\"}}).then(function(e){return e.data}).catch(function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new L.nS(\"Transaction submission failed. Server responded: \".concat(e.status,\" \").concat(e.statusText),e.data))}))}},e,this)})),function(e){return Mn.apply(this,arguments)})},{key:\"accounts\",value:function(){return new be(this.serverURL,this.httpClient)}},{key:\"claimableBalances\",value:function(){return new Ue(this.serverURL,this.httpClient)}},{key:\"ledgers\",value:function(){return new rt(this.serverURL,this.httpClient)}},{key:\"transactions\",value:function(){return new Tn(this.serverURL,this.httpClient)}},{key:\"offers\",value:function(){return new bt(this.serverURL,this.httpClient)}},{key:\"orderbook\",value:function(e,t){return new Rt(this.serverURL,this.httpClient,e,t)}},{key:\"trades\",value:function(){return new mn(this.serverURL,this.httpClient)}},{key:\"operations\",value:function(){return new Ot(this.serverURL,this.httpClient)}},{key:\"liquidityPools\",value:function(){return new ft(this.serverURL,this.httpClient)}},{key:\"strictReceivePaths\",value:function(e,t,n){return new Gt(this.serverURL,this.httpClient,e,t,n)}},{key:\"strictSendPaths\",value:function(e,t,n){return new Qt(this.serverURL,this.httpClient,e,t,n)}},{key:\"payments\",value:function(){return new qt(this.serverURL,this.httpClient)}},{key:\"effects\",value:function(){return new ze(this.serverURL,this.httpClient)}},{key:\"friendbot\",value:function(e){return new Xe(this.serverURL,this.httpClient,e)}},{key:\"assets\",value:function(){return new Oe(this.serverURL,this.httpClient)}},{key:\"loadAccount\",value:(Ln=Rn(Cn().m(function e(t){var n;return Cn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.accounts().accountId(t).call();case 1:return n=e.v,e.a(2,new d(n))}},e,this)})),function(e){return Ln.apply(this,arguments)})},{key:\"tradeAggregation\",value:function(e,t,n,r,o,i){return new un(this.serverURL,this.httpClient,e,t,n,r,o,i)}},{key:\"checkMemoRequired\",value:(Nn=Rn(Cn().m(function e(t){var n,r,o,i,a,c;return Cn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t instanceof s.FeeBumpTransaction&&(t=t.innerTransaction),\"none\"===t.memo.type){e.n=1;break}return e.a(2);case 1:n=new Set,r=0;case 2:if(!(r<t.operations.length)){e.n=14;break}o=t.operations[r],a=o.type,e.n=\"payment\"===a||\"pathPaymentStrictReceive\"===a||\"pathPaymentStrictSend\"===a||\"accountMerge\"===a?3:4;break;case 3:return e.a(3,5);case 4:return e.a(3,13);case 5:if(i=o.destination,!n.has(i)){e.n=6;break}return e.a(3,13);case 6:if(n.add(i),!i.startsWith(\"M\")){e.n=7;break}return e.a(3,13);case 7:return e.p=7,e.n=8,this.loadAccount(i);case 8:if(\"MQ==\"!==e.v.data_attr[\"config.memo_required\"]){e.n=9;break}throw new L.Cu(\"account requires memo\",i,r);case 9:e.n=13;break;case 10:if(e.p=10,!((c=e.v)instanceof L.Cu)){e.n=11;break}throw c;case 11:if(c instanceof L.m_){e.n=12;break}throw c;case 12:return e.a(3,13);case 13:r+=1,e.n=2;break;case 14:return e.a(2)}},e,this,[[7,10]])})),function(e){return Nn.apply(this,arguments)})}]);const $n=(e=n.hmd(e)).exports},6121(e,t,n){\"use strict\";n.r(t),n.d(t,{axiosClient:()=>wt,create:()=>St});var r={};function o(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>he,hasStandardBrowserEnv:()=>ge,hasStandardBrowserWebWorkerEnv:()=>me,navigator:()=>ye,origin:()=>ve});const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:s,toStringTag:c}=Symbol,u=(l=Object.create(null),e=>{const t=i.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const f=e=>(e=e.toLowerCase(),t=>u(t)===e),p=e=>t=>typeof t===e,{isArray:d}=Array,h=p(\"undefined\");function y(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&v(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const g=f(\"ArrayBuffer\"),m=p(\"string\"),v=p(\"function\"),b=p(\"number\"),w=e=>null!==e&&\"object\"==typeof e,S=e=>{if(\"object\"!==u(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||c in e||s in e)},A=f(\"Date\"),E=f(\"File\"),x=f(\"Blob\"),T=f(\"FileList\"),k=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:void 0!==n.g?n.g:{},O=void 0!==k.FormData?k.FormData:void 0,_=f(\"URLSearchParams\"),[I,C,B,P]=[\"ReadableStream\",\"Request\",\"Response\",\"Headers\"].map(f);function R(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if(\"object\"!=typeof e&&(e=[e]),d(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(y(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function j(e,t){if(y(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const U=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:n.g,F=e=>!h(e)&&e!==U,N=(L=\"undefined\"!=typeof Uint8Array&&a(Uint8Array),e=>L&&e instanceof L);var L;const M=f(\"HTMLFormElement\"),D=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),q=f(\"RegExp\"),V=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};R(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)},z=f(\"AsyncFunction\"),K=(H=\"function\"==typeof setImmediate,$=v(U.postMessage),H?setImmediate:$?(G=`axios@${Math.random()}`,W=[],U.addEventListener(\"message\",({source:e,data:t})=>{e===U&&t===G&&W.length&&W.shift()()},!1),e=>{W.push(e),U.postMessage(G,\"*\")}):e=>setTimeout(e));var H,$,G,W;const X=\"undefined\"!=typeof queueMicrotask?queueMicrotask.bind(U):\"undefined\"!=typeof process&&process.nextTick||K,Z={isArray:d,isArrayBuffer:g,isBuffer:y,isFormData:e=>{let t;return e&&(O&&e instanceof O||v(e.append)&&(\"formdata\"===(t=u(e))||\"object\"===t&&v(e.toString)&&\"[object FormData]\"===e.toString()))},isArrayBufferView:function(e){let t;return t=\"undefined\"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t},isString:m,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:S,isEmptyObject:e=>{if(!w(e)||y(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:I,isRequest:C,isResponse:B,isHeaders:P,isUndefined:h,isDate:A,isFile:E,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:x,isRegExp:q,isFunction:v,isStream:e=>w(e)&&v(e.pipe),isURLSearchParams:_,isTypedArray:N,isFileList:T,forEach:R,merge:function e(){const{caseless:t,skipUndefined:n}=F(this)&&this||{},r={},o=(o,i)=>{if(\"__proto__\"===i||\"constructor\"===i||\"prototype\"===i)return;const a=t&&j(r,i)||i;S(r[a])&&S(o)?r[a]=e(r[a],o):S(o)?r[a]=e({},o):d(o)?r[a]=o.slice():n&&h(o)||(r[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&R(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(R(t,(t,r)=>{n&&v(t)?Object.defineProperty(e,r,{value:o(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\"\"),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,\"constructor\",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,\"super\",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==n&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:f,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[s]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:M,hasOwnProperty:D,hasOwnProp:D,reduceDescriptors:V,freezeMethods:e=>{V(e,(t,n)=>{if(v(e)&&-1!==[\"arguments\",\"caller\",\"callee\"].indexOf(n))return!1;const r=e[n];v(r)&&(t.enumerable=!1,\"writable\"in t?t.writable=!1:t.set||(t.set=()=>{throw Error(\"Can not rewrite read-only method '\"+n+\"'\")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:j,global:U,isContextDefined:F,isSpecCompliantForm:function(e){return!!(e&&v(e.append)&&\"FormData\"===e[c]&&e[s])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(y(e))return e;if(!(\"toJSON\"in e)){t[r]=e;const o=d(e)?[]:{};return R(e,(e,t)=>{const i=n(e,r+1);!h(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:z,isThenable:e=>e&&(w(e)||v(e))&&v(e.then)&&v(e.catch),setImmediate:K,asap:X,isIterable:e=>null!=e&&v(e[s])};class Y extends Error{static from(e,t,n,r,o,i){const a=new Y(e.message,t||e.code,n,r,o);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,\"message\",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=\"AxiosError\",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.status}}}Y.ERR_BAD_OPTION_VALUE=\"ERR_BAD_OPTION_VALUE\",Y.ERR_BAD_OPTION=\"ERR_BAD_OPTION\",Y.ECONNABORTED=\"ECONNABORTED\",Y.ETIMEDOUT=\"ETIMEDOUT\",Y.ERR_NETWORK=\"ERR_NETWORK\",Y.ERR_FR_TOO_MANY_REDIRECTS=\"ERR_FR_TOO_MANY_REDIRECTS\",Y.ERR_DEPRECATED=\"ERR_DEPRECATED\",Y.ERR_BAD_RESPONSE=\"ERR_BAD_RESPONSE\",Y.ERR_BAD_REQUEST=\"ERR_BAD_REQUEST\",Y.ERR_CANCELED=\"ERR_CANCELED\",Y.ERR_NOT_SUPPORT=\"ERR_NOT_SUPPORT\",Y.ERR_INVALID_URL=\"ERR_INVALID_URL\";const J=Y;var Q=n(8287).Buffer;function ee(e){return Z.isPlainObject(e)||Z.isArray(e)}function te(e){return Z.endsWith(e,\"[]\")?e.slice(0,-2):e}function ne(e,t,n){return e?e.concat(t).map(function(e,t){return e=te(e),!n&&t?\"[\"+e+\"]\":e}).join(n?\".\":\"\"):t}const re=Z.toFlatObject(Z,{},null,function(e){return/^is[A-Z]/.test(e)}),oe=function(e,t,n){if(!Z.isObject(e))throw new TypeError(\"target must be an object\");t=t||new FormData;const r=(n=Z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Z.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||\"undefined\"!=typeof Blob&&Blob)&&Z.isSpecCompliantForm(t);if(!Z.isFunction(o))throw new TypeError(\"visitor must be a function\");function c(e){if(null===e)return\"\";if(Z.isDate(e))return e.toISOString();if(Z.isBoolean(e))return e.toString();if(!s&&Z.isBlob(e))throw new J(\"Blob is not supported. Use a Buffer instead.\");return Z.isArrayBuffer(e)||Z.isTypedArray(e)?s&&\"function\"==typeof Blob?new Blob([e]):Q.from(e):e}function u(e,n,o){let s=e;if(Z.isReactNative(t)&&Z.isReactNativeBlob(e))return t.append(ne(o,n,i),c(e)),!1;if(e&&!o&&\"object\"==typeof e)if(Z.endsWith(n,\"{}\"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Z.isArray(e)&&function(e){return Z.isArray(e)&&!e.some(ee)}(e)||(Z.isFileList(e)||Z.endsWith(n,\"[]\"))&&(s=Z.toArray(e)))return n=te(n),s.forEach(function(e,r){!Z.isUndefined(e)&&null!==e&&t.append(!0===a?ne([n],r,i):null===a?n:n+\"[]\",c(e))}),!1;return!!ee(e)||(t.append(ne(o,n,i),c(e)),!1)}const l=[],f=Object.assign(re,{defaultVisitor:u,convertValue:c,isVisitable:ee});if(!Z.isObject(e))throw new TypeError(\"data must be an object\");return function e(n,r){if(!Z.isUndefined(n)){if(-1!==l.indexOf(n))throw Error(\"Circular reference detected in \"+r.join(\".\"));l.push(n),Z.forEach(n,function(n,i){!0===(!(Z.isUndefined(n)||null===n)&&o.call(t,n,Z.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function ie(e){const t={\"!\":\"%21\",\"'\":\"%27\",\"(\":\"%28\",\")\":\"%29\",\"~\":\"%7E\",\"%20\":\"+\",\"%00\":\"\\0\"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ae(e,t){this._pairs=[],e&&oe(e,this,t)}const se=ae.prototype;se.append=function(e,t){this._pairs.push([e,t])},se.toString=function(e){const t=e?function(t){return e.call(this,t,ie)}:ie;return this._pairs.map(function(e){return t(e[0])+\"=\"+t(e[1])},\"\").join(\"&\")};const ce=ae;function ue(e){return encodeURIComponent(e).replace(/%3A/gi,\":\").replace(/%24/g,\"$\").replace(/%2C/gi,\",\").replace(/%20/g,\"+\")}function le(e,t,n){if(!t)return e;const r=n&&n.encode||ue,o=Z.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(t,o):Z.isURLSearchParams(t)?t.toString():new ce(t,o).toString(r),a){const t=e.indexOf(\"#\");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf(\"?\")?\"?\":\"&\")+a}return e}const fe=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Z.forEach(this.handlers,function(t){null!==t&&e(t)})}},pe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},de={isBrowser:!0,classes:{URLSearchParams:\"undefined\"!=typeof URLSearchParams?URLSearchParams:ce,FormData:\"undefined\"!=typeof FormData?FormData:null,Blob:\"undefined\"!=typeof Blob?Blob:null},protocols:[\"http\",\"https\",\"file\",\"blob\",\"url\",\"data\"]},he=\"undefined\"!=typeof window&&\"undefined\"!=typeof document,ye=\"object\"==typeof navigator&&navigator||void 0,ge=he&&(!ye||[\"ReactNative\",\"NativeScript\",\"NS\"].indexOf(ye.product)<0),me=\"undefined\"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&\"function\"==typeof self.importScripts,ve=he&&window.location.href||\"http://localhost\",be={...r,...de},we=function(e){function t(e,n,r,o){let i=e[o++];if(\"__proto__\"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;return i=!i&&Z.isArray(r)?r.length:i,s?(Z.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&Z.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Z.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a)}if(Z.isFormData(e)&&Z.isFunction(e.entries)){const n={};return Z.forEachEntry(e,(e,r)=>{t(function(e){return Z.matchAll(/\\w+|\\[(\\w*)]/g,e).map(e=>\"[]\"===e[0]?\"\":e[1]||e[0])}(e),r,n,0)}),n}return null},Se={transitional:pe,adapter:[\"xhr\",\"http\",\"fetch\"],transformRequest:[function(e,t){const n=t.getContentType()||\"\",r=n.indexOf(\"application/json\")>-1,o=Z.isObject(e);if(o&&Z.isHTMLForm(e)&&(e=new FormData(e)),Z.isFormData(e))return r?JSON.stringify(we(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return t.setContentType(\"application/x-www-form-urlencoded;charset=utf-8\",!1),e.toString();let i;if(o){if(n.indexOf(\"application/x-www-form-urlencoded\")>-1)return function(e,t){return oe(e,new be.classes.URLSearchParams,{visitor:function(e,t,n,r){return be.isNode&&Z.isBuffer(e)?(this.append(t,e.toString(\"base64\")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Z.isFileList(e))||n.indexOf(\"multipart/form-data\")>-1){const t=this.env&&this.env.FormData;return oe(i?{\"files[]\":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType(\"application/json\",!1),function(e){if(Z.isString(e))try{return(0,JSON.parse)(e),Z.trim(e)}catch(e){if(\"SyntaxError\"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Se.transitional,n=t&&t.forcedJSONParsing,r=\"json\"===this.responseType;if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if(\"SyntaxError\"===e.name)throw J.from(e,J.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:\"XSRF-TOKEN\",xsrfHeaderName:\"X-XSRF-TOKEN\",maxContentLength:-1,maxBodyLength:-1,env:{FormData:be.classes.FormData,Blob:be.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:\"application/json, text/plain, */*\",\"Content-Type\":void 0}}};Z.forEach([\"delete\",\"get\",\"head\",\"post\",\"put\",\"patch\"],e=>{Se.headers[e]={}});const Ae=Se,Ee=Z.toObjectSet([\"age\",\"authorization\",\"content-length\",\"content-type\",\"etag\",\"expires\",\"from\",\"host\",\"if-modified-since\",\"if-unmodified-since\",\"last-modified\",\"location\",\"max-forwards\",\"proxy-authorization\",\"referer\",\"retry-after\",\"user-agent\"]),xe=Symbol(\"internals\");function Te(e,t){if(!1!==e&&null!=e)if(Z.isArray(e))e.forEach(e=>Te(e,t));else if(!(e=>!/[\\r\\n]/.test(e))(String(e)))throw new Error(`Invalid character in header content [\"${t}\"]`)}function ke(e){return e&&String(e).trim().toLowerCase()}function Oe(e){return!1===e||null==e?e:Z.isArray(e)?e.map(Oe):function(e){let t=e.length;for(;t>0;){const n=e.charCodeAt(t-1);if(10!==n&&13!==n)break;t-=1}return t===e.length?e:e.slice(0,t)}(String(e))}function _e(e,t,n,r,o){return Z.isFunction(r)?r.call(this,t,n):(o&&(t=n),Z.isString(t)?Z.isString(r)?-1!==t.indexOf(r):Z.isRegExp(r)?r.test(t):void 0:void 0)}class Ie{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ke(t);if(!o)throw new Error(\"header name must be a non-empty string\");const i=Z.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(Te(e,t),r[i||t]=Oe(e))}const i=(e,t)=>Z.forEach(e,(e,n)=>o(e,n,t));if(Z.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split(\"\\n\").forEach(function(e){o=e.indexOf(\":\"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ee[n]||(\"set-cookie\"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+\", \"+r:r)}),t})(e),t);else if(Z.isObject(e)&&Z.isIterable(e)){let n,r,o={};for(const t of e){if(!Z.isArray(t))throw TypeError(\"Object iterator must return a key-value pair\");o[r=t[0]]=(n=o[r])?Z.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ke(e)){const n=Z.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Z.isFunction(t))return t.call(this,e,n);if(Z.isRegExp(t))return t.exec(e);throw new TypeError(\"parser must be boolean|regexp|function\")}}}has(e,t){if(e=ke(e)){const n=Z.findKey(this,e);return!(!n||void 0===this[n]||t&&!_e(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ke(e)){const o=Z.findKey(n,e);!o||t&&!_e(0,n[o],o,t)||(delete n[o],r=!0)}}return Z.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!_e(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Z.forEach(this,(r,o)=>{const i=Z.findKey(n,o);if(i)return t[i]=Oe(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\\d])(\\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete t[o],t[a]=Oe(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Z.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Z.isArray(n)?n.join(\", \"):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+\": \"+t).join(\"\\n\")}getSetCookie(){return this.get(\"set-cookie\")||[]}get[Symbol.toStringTag](){return\"AxiosHeaders\"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[xe]=this[xe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ke(e);t[r]||(function(e,t){const n=Z.toCamelCase(\" \"+t);[\"get\",\"set\",\"has\"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Z.isArray(e)?e.forEach(r):r(e),this}}Ie.accessor([\"Content-Type\",\"Content-Length\",\"Accept\",\"Accept-Encoding\",\"User-Agent\",\"Authorization\"]),Z.reduceDescriptors(Ie.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Z.freezeMethods(Ie);const Ce=Ie;function Be(e,t){const n=this||Ae,r=t||n,o=Ce.from(r.headers);let i=r.data;return Z.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Pe(e){return!(!e||!e.__CANCEL__)}const Re=class extends J{constructor(e,t,n){super(e??\"canceled\",J.ERR_CANCELED,t,n),this.name=\"CanceledError\",this.__CANCEL__=!0}};function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new J(\"Request failed with status code \"+n.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ue=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[a];o||(o=c),n[i]=s,r[i]=c;let l=a,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;const p=u&&c-u;return p?Math.round(1e3*f/p):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]}(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,c=o(s);r=i,e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[t?\"download\":\"upload\"]:!0})},n)},Fe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ne=e=>(...t)=>Z.asap(()=>e(...t)),Le=be.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,be.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(be.origin),be.navigator&&/(msie|trident)/i.test(be.navigator.userAgent)):()=>!0,Me=be.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if(\"undefined\"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Z.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Z.isString(r)&&s.push(`path=${r}`),Z.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push(\"secure\"),Z.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join(\"; \")},read(e){if(\"undefined\"==typeof document)return null;const t=document.cookie.match(new RegExp(\"(?:^|; )\"+e+\"=([^;]*)\"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,\"\",Date.now()-864e5,\"/\")}}:{write(){},read:()=>null,remove(){}};function De(e,t,n){let r=!(\"string\"==typeof(o=t)&&/^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\\/?\\/$/,\"\")+\"/\"+t.replace(/^\\/+/,\"\"):e}(e,t):t}const qe=e=>e instanceof Ce?{...e}:e;function Ve(e,t){t=t||{};const n={};function r(e,t,n,r){return Z.isPlainObject(e)&&Z.isPlainObject(t)?Z.merge.call({caseless:r},e,t):Z.isPlainObject(t)?Z.merge({},t):Z.isArray(t)?t.slice():t}function o(e,t,n,o){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Z.isUndefined(t))return r(void 0,t)}function a(e,t){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(qe(e),qe(t),0,!0)};return Z.forEach(Object.keys({...e,...t}),function(r){if(\"__proto__\"===r||\"constructor\"===r||\"prototype\"===r)return;const i=Z.hasOwnProp(c,r)?c[r]:o,a=i(e[r],t[r],r);Z.isUndefined(a)&&i!==s||(n[r]=a)}),n}const ze=e=>{const t=Ve({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Ce.from(a),t.url=le(De(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set(\"Authorization\",\"Basic \"+btoa((s.username||\"\")+\":\"+(s.password?unescape(encodeURIComponent(s.password)):\"\"))),Z.isFormData(n))if(be.hasStandardBrowserEnv||be.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Z.isFunction(n.getHeaders)){const e=n.getHeaders(),t=[\"content-type\",\"content-length\"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}if(be.hasStandardBrowserEnv&&(r&&Z.isFunction(r)&&(r=r(t)),r||!1!==r&&Le(t.url))){const e=o&&i&&Me.read(i);e&&a.set(o,e)}return t},Ke=\"undefined\"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ze(e);let o=r.data;const i=Ce.from(r.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:p,onDownloadProgress:d}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener(\"abort\",a)}let y=new XMLHttpRequest;function g(){if(!y)return;const r=Ce.from(\"getAllResponseHeaders\"in y&&y.getAllResponseHeaders());je(function(e){t(e),h()},function(e){n(e),h()},{data:f&&\"text\"!==f&&\"json\"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,\"onloadend\"in y?y.onloadend=g:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf(\"file:\"))&&setTimeout(g)},y.onabort=function(){y&&(n(new J(\"Request aborted\",J.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:\"Network Error\",o=new J(r,J.ERR_NETWORK,e,y);o.event=t||null,n(o),y=null},y.ontimeout=function(){let t=r.timeout?\"timeout of \"+r.timeout+\"ms exceeded\":\"timeout exceeded\";const o=r.transitional||pe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new J(t,o.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),\"setRequestHeader\"in y&&Z.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Z.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),f&&\"json\"!==f&&(y.responseType=r.responseType),d&&([c,l]=Ue(d,!0),y.addEventListener(\"progress\",c)),p&&y.upload&&([s,u]=Ue(p),y.upload.addEventListener(\"progress\",s),y.upload.addEventListener(\"loadend\",u)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new Re(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener(\"abort\",a)));const m=function(e){const t=/^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(e);return t&&t[1]||\"\"}(r.url);m&&-1===be.protocols.indexOf(m)?n(new J(\"Unsupported protocol \"+m+\":\",J.ERR_BAD_REQUEST,e)):y.send(o||null)})},He=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof J?t:new Re(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new J(`timeout of ${t}ms exceeded`,J.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener(\"abort\",o)}),e=null)};e.forEach(e=>e.addEventListener(\"abort\",o));const{signal:s}=r;return s.unsubscribe=()=>Z.asap(a),s}},$e=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ge=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*$e(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:We}=Z,Xe=(({Request:e,Response:t})=>({Request:e,Response:t}))(Z.global),{ReadableStream:Ze,TextEncoder:Ye}=Z.global,Je=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Qe=e=>{e=Z.merge.call({skipUndefined:!0},Xe,e);const{fetch:t,Request:n,Response:r}=e,o=t?We(t):\"function\"==typeof fetch,i=We(n),a=We(r);if(!o)return!1;const s=o&&We(Ze),c=o&&(\"function\"==typeof Ye?(u=new Ye,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&Je(()=>{let e=!1;const t=new Ze,r=new n(be.origin,{body:t,method:\"POST\",get duplex(){return e=!0,\"half\"}}).headers.has(\"Content-Type\");return t.cancel(),e&&!r}),f=a&&s&&Je(()=>Z.isReadableStream(new r(\"\").body)),p={stream:f&&(e=>e.body)};o&&[\"text\",\"arrayBuffer\",\"blob\",\"formData\",\"stream\"].forEach(e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new J(`Response type '${e}' is not supported`,J.ERR_NOT_SUPPORT,n)})});const d=async(e,t)=>{const r=Z.toFiniteNumber(e.getContentLength());return r??(async e=>{if(null==e)return 0;if(Z.isBlob(e))return e.size;if(Z.isSpecCompliantForm(e)){const t=new n(be.origin,{method:\"POST\",body:e});return(await t.arrayBuffer()).byteLength}return Z.isArrayBufferView(e)||Z.isArrayBuffer(e)?e.byteLength:(Z.isURLSearchParams(e)&&(e+=\"\"),Z.isString(e)?(await c(e)).byteLength:void 0)})(t)};return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:u,timeout:h,onDownloadProgress:y,onUploadProgress:g,responseType:m,headers:v,withCredentials:b=\"same-origin\",fetchOptions:w}=ze(e),S=t||fetch;m=m?(m+\"\").toLowerCase():\"text\";let A=He([c,u&&u.toAbortSignal()],h),E=null;const x=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let T;try{if(g&&l&&\"get\"!==a&&\"head\"!==a&&0!==(T=await d(v,s))){let e,t=new n(o,{method:\"POST\",body:s,duplex:\"half\"});if(Z.isFormData(s)&&(e=t.headers.get(\"content-type\"))&&v.setContentType(e),t.body){const[e,n]=Fe(T,Ue(Ne(g)));s=Ge(t.body,65536,e,n)}}Z.isString(b)||(b=b?\"include\":\"omit\");const t=i&&\"credentials\"in n.prototype,c={...w,signal:A,method:a.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:\"half\",credentials:t?b:void 0};E=i&&new n(o,c);let u=await(i?S(E,w):S(o,c));const h=f&&(\"stream\"===m||\"response\"===m);if(f&&(y||h&&x)){const e={};[\"status\",\"statusText\",\"headers\"].forEach(t=>{e[t]=u[t]});const t=Z.toFiniteNumber(u.headers.get(\"content-length\")),[n,o]=y&&Fe(t,Ue(Ne(y),!0))||[];u=new r(Ge(u.body,65536,n,()=>{o&&o(),x&&x()}),e)}m=m||\"text\";let k=await p[Z.findKey(p,m)||\"text\"](u,e);return!h&&x&&x(),await new Promise((t,n)=>{je(t,n,{data:k,headers:Ce.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:E})})}catch(t){if(x&&x(),t&&\"TypeError\"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new J(\"Network Error\",J.ERR_NETWORK,e,E,t&&t.response),{cause:t.cause||t});throw J.from(t,t&&t.code,e,E,t&&t.response)}}},et=new Map,tt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,c=i.length,u=et;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:Qe(t)),u=s;return s},nt=(tt(),{http:null,xhr:Ke,fetch:{get:tt}});Z.forEach(nt,(e,t)=>{if(e){try{Object.defineProperty(e,\"name\",{value:t})}catch(e){}Object.defineProperty(e,\"adapterName\",{value:t})}});const rt=e=>`- ${e}`,ot=e=>Z.isFunction(e)||null===e||!1===e,it=function(e,t){e=Z.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let a=0;a<n;a++){let n;if(r=e[a],o=r,!ot(r)&&(o=nt[(n=String(r)).toLowerCase()],void 0===o))throw new J(`Unknown adapter '${n}'`);if(o&&(Z.isFunction(o)||(o=o.get(t))))break;i[n||\"#\"+a]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?\"is not supported by the environment\":\"is not available in the build\"));let t=n?e.length>1?\"since :\\n\"+e.map(rt).join(\"\\n\"):\" \"+rt(e[0]):\"as no adapter specified\";throw new J(\"There is no suitable adapter to dispatch the request \"+t,\"ERR_NOT_SUPPORT\")}return o};function at(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Re(null,e)}function st(e){return at(e),e.headers=Ce.from(e.headers),e.data=Be.call(e,e.transformRequest),-1!==[\"post\",\"put\",\"patch\"].indexOf(e.method)&&e.headers.setContentType(\"application/x-www-form-urlencoded\",!1),it(e.adapter||Ae.adapter,e)(e).then(function(t){return at(e),t.data=Be.call(e,e.transformResponse,t),t.headers=Ce.from(t.headers),t},function(t){return Pe(t)||(at(e),t&&t.response&&(t.response.data=Be.call(e,e.transformResponse,t.response),t.response.headers=Ce.from(t.response.headers))),Promise.reject(t)})}const ct=\"1.15.0\",ut={};[\"object\",\"boolean\",\"number\",\"function\",\"string\",\"symbol\"].forEach((e,t)=>{ut[e]=function(n){return typeof n===e||\"a\"+(t<1?\"n \":\" \")+e}});const lt={};ut.transitional=function(e,t,n){function r(e,t){return\"[Axios v\"+ct+\"] Transitional option '\"+e+\"'\"+t+(n?\". \"+n:\"\")}return(n,o,i)=>{if(!1===e)throw new J(r(o,\" has been removed\"+(t?\" in \"+t:\"\")),J.ERR_DEPRECATED);return t&&!lt[o]&&(lt[o]=!0,console.warn(r(o,\" has been deprecated since v\"+t+\" and will be removed in the near future\"))),!e||e(n,o,i)}},ut.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const ft={assertOptions:function(e,t,n){if(\"object\"!=typeof e)throw new J(\"options must be an object\",J.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new J(\"option \"+i+\" must be \"+n,J.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new J(\"Unknown option \"+i,J.ERR_BAD_OPTION)}},validators:ut},pt=ft.validators;class dt{constructor(e){this.defaults=e||{},this.interceptors={request:new fe,response:new fe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return\"\";const e=t.stack.indexOf(\"\\n\");return-1===e?\"\":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf(\"\\n\"),r=-1===t?-1:n.indexOf(\"\\n\",t+1),o=-1===r?\"\":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+=\"\\n\"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){\"string\"==typeof e?(t=t||{}).url=e:t=e||{},t=Ve(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ft.assertOptions(n,{silentJSONParsing:pt.transitional(pt.boolean),forcedJSONParsing:pt.transitional(pt.boolean),clarifyTimeoutError:pt.transitional(pt.boolean),legacyInterceptorReqResOrdering:pt.transitional(pt.boolean)},!1),null!=r&&(Z.isFunction(r)?t.paramsSerializer={serialize:r}:ft.assertOptions(r,{encode:pt.function,serialize:pt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ft.assertOptions(t,{baseUrl:pt.spelling(\"baseURL\"),withXsrfToken:pt.spelling(\"withXSRFToken\")},!0),t.method=(t.method||this.defaults.method||\"get\").toLowerCase();let i=o&&Z.merge(o.common,o[t.method]);o&&Z.forEach([\"delete\",\"get\",\"head\",\"post\",\"put\",\"patch\",\"common\"],e=>{delete o[e]}),t.headers=Ce.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){if(\"function\"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||pe;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,f=0;if(!s){const e=[st.bind(this),void 0];for(e.unshift(...a),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=a.length;let p=t;for(;f<l;){const t=a[f++],n=a[f++];try{p=t(p)}catch(e){n.call(this,e);break}}try{u=st.call(this,p)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return le(De((e=Ve(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Z.forEach([\"delete\",\"get\",\"head\",\"options\"],function(e){dt.prototype[e]=function(t,n){return this.request(Ve(n||{},{method:e,url:t,data:(n||{}).data}))}}),Z.forEach([\"post\",\"put\",\"patch\"],function(e){function t(t){return function(n,r,o){return this.request(Ve(o||{},{method:e,headers:t?{\"Content-Type\":\"multipart/form-data\"}:{},url:n,data:r}))}}dt.prototype[e]=t(),dt.prototype[e+\"Form\"]=t(!0)});const ht=dt;class yt{constructor(e){if(\"function\"!=typeof e)throw new TypeError(\"executor must be a function.\");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Re(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new yt(function(t){e=t}),cancel:e}}}const gt=yt,mt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(mt).forEach(([e,t])=>{mt[t]=e});const vt=mt,bt=function e(t){const n=new ht(t),r=o(ht.prototype.request,n);return Z.extend(r,ht.prototype,n,{allOwnKeys:!0}),Z.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ve(t,n))},r}(Ae);bt.Axios=ht,bt.CanceledError=Re,bt.CancelToken=gt,bt.isCancel=Pe,bt.VERSION=ct,bt.toFormData=oe,bt.AxiosError=J,bt.Cancel=bt.CanceledError,bt.all=function(e){return Promise.all(e)},bt.spread=function(e){return function(t){return e.apply(null,t)}},bt.isAxiosError=function(e){return Z.isObject(e)&&!0===e.isAxiosError},bt.mergeConfig=Ve,bt.AxiosHeaders=Ce,bt.formToJSON=e=>we(Z.isHTMLForm(e)?new FormData(e):e),bt.getAdapter=it,bt.HttpStatusCode=vt,bt.default=bt;var wt=bt,St=bt.create},9983(e,t,n){\"use strict\";function r(e){return r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if(\"object\"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=r(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==r(t)?t:t+\"\"}n.d(t,{vt:()=>u,ok:()=>c}),a=function e(t){var n,r=this;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.promise=new Promise(function(e){n=e}),t(function(e){r.reason=e,n()})},(s=[{key:\"throwIfRequested\",value:function(){if(this.reason)throw new Error(this.reason)}}])&&o(a.prototype,s),Object.defineProperty(a,\"prototype\",{writable:!1});var a,s,c,u,l=n(6121);c=l.axiosClient,u=l.create},4356(e,t,n){\"use strict\";n.r(t),n.d(t,{AccountRequiresMemoError:()=>r.Cu,BadRequestError:()=>r.v7,BadResponseError:()=>r.nS,BindingGenerator:()=>d.fe,Config:()=>o.T,Federation:()=>s,Friendbot:()=>u,Horizon:()=>l,NetworkError:()=>r.Dr,NotFoundError:()=>r.m_,StellarToml:()=>a,Utils:()=>i.A,WebAuth:()=>c,contract:()=>p,default:()=>g,rpc:()=>f});var r=n(5976),o=n(8732),i=n(3121),a=n(3898),s=n(6602),c=n(7504),u=n(8242),l=n(8733),f=n(3496),p=n(8250),d=n(6682),h=n(8950),y={};for(const e in h)[\"default\",\"Config\",\"Utils\",\"BindingGenerator\",\"StellarToml\",\"Federation\",\"WebAuth\",\"Friendbot\",\"Horizon\",\"rpc\",\"contract\",\"AccountRequiresMemoError\",\"BadRequestError\",\"BadResponseError\",\"NetworkError\",\"NotFoundError\"].indexOf(e)<0&&(y[e]=()=>h[e]);n.d(t,y);const g=(e=n.hmd(e)).exports;void 0===n.g.__USE_AXIOS__&&(n.g.__USE_AXIOS__=!0),void 0===n.g.__USE_EVENTSOURCE__&&(n.g.__USE_EVENTSOURCE__=!1)},4076(e,t,n){\"use strict\";var r;n.d(t,{j:()=>r}),function(e){var t=function(e){return e.SUCCESS=\"SUCCESS\",e.NOT_FOUND=\"NOT_FOUND\",e.FAILED=\"FAILED\",e}({});function n(e){return\"transactionData\"in e}e.GetTransactionStatus=t,e.isSimulationError=function(e){return\"error\"in e},e.isSimulationSuccess=n,e.isSimulationRestore=function(e){return n(e)&&\"restorePreamble\"in e&&!!e.restorePreamble.transactionData},e.isSimulationRaw=function(e){return!e._parsed}}(r||(r={}))},3496(e,t,n){\"use strict\";n.r(t),n.d(t,{Api:()=>r.j,BasicSleepStrategy:()=>U,Durability:()=>j,LinearSleepStrategy:()=>F,Server:()=>ve,assembleTransaction:()=>v.X,default:()=>be,parseRawEvents:()=>b.fG,parseRawSimulation:()=>b.jr});var r=n(4076),o=n(4193),i=n.n(o),a=n(8950),s=n(9983);function c(e){return c=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},c(e)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(e,t,n){return(t=function(e){var t=function(e){if(\"object\"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=c(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==c(t)?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return d(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(d(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,d(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,d(f,\"constructor\",u),d(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",d(u,o,\"GeneratorFunction\"),d(f),d(f,o,\"Generator\"),d(f,r,function(){return this}),d(f,\"toString\",function(){return\"[object Generator]\"}),(p=function(){return{w:i,m:h}})()}function d(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}d=function(e,t,n,r){function i(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},d(e,t,n,r)}function h(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function g(e,t,n){return m.apply(this,arguments)}function m(){var e;return e=p().m(function e(t,n,r){var o,i,a,s=arguments;return p().w(function(e){for(;;)switch(e.n){case 0:return o=s.length>3&&void 0!==s[3]?s[3]:null,e.n=1,t.post(n,{jsonrpc:\"2.0\",id:1,method:r,params:o});case 1:if(!y((i=e.v).data,\"error\")){e.n=2;break}throw i.data.error;case 2:return e.a(2,null===(a=i.data)||void 0===a?void 0:a.result);case 3:return e.a(2)}},e)}),m=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){h(i,r,o,a,s,\"next\",e)}function s(e){h(i,r,o,a,s,\"throw\",e)}a(void 0)})},m.apply(this,arguments)}var v=n(8680),b=n(784),w=n(3121),S=n(8287).Buffer;function A(e){return A=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},A(e)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach(function(t){T(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if(\"string\"==typeof e)return O(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return I(u,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(I(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,I(e,o,\"GeneratorFunction\")),e.prototype=Object.create(f),e}return c.prototype=u,I(f,\"constructor\",u),I(u,\"constructor\",c),c.displayName=\"GeneratorFunction\",I(u,o,\"GeneratorFunction\"),I(f),I(f,o,\"Generator\"),I(f,r,function(){return this}),I(f,\"toString\",function(){return\"[object Generator]\"}),(_=function(){return{w:i,m:p}})()}function I(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}I=function(e,t,n,r){function i(t,n){I(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},I(e,t,n,r)}function C(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function B(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){C(i,r,o,a,s,\"next\",e)}function s(e){C(i,r,o,a,s,\"throw\",e)}a(void 0)})}}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,R(r.key),r)}}function R(e){var t=function(e){if(\"object\"!=A(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=A(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==A(t)?t:t+\"\"}var j=function(e){return e.Temporary=\"temporary\",e.Persistent=\"persistent\",e}({}),U=function(e){return 1e3},F=function(e){return 1e3*e};function N(e){var t,n=[];switch(e.switch()){case 0:n=e.operations();break;case 1:case 2:case 3:case 4:n=e.value().operations();break;default:throw new Error(\"Unexpected transaction meta switch value\")}var r=null===(t=n.flatMap(function(e){return e.changes()}).find(function(e){return e.switch()===a.xdr.LedgerEntryChangeType.ledgerEntryCreated()&&e.created().data().switch()===a.xdr.LedgerEntryType.account()}))||void 0===t||null===(t=t.created())||void 0===t||null===(t=t.data())||void 0===t||null===(t=t.account())||void 0===t||null===(t=t.seqNum())||void 0===t?void 0:t.toString();if(r)return r;throw new Error(\"No account created in transaction\")}var L,M,D,q,V,z,K,H,$,G,W,X,Z,Y,J,Q,ee,te,ne,re,oe,ie,ae,se,ce,ue,le,fe,pe,de,he,ye,ge,me,ve=(L=function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.serverURL=i()(t),this.httpClient=(n=r.headers,(0,s.vt)({headers:l(l({},n),{},{\"X-Client-Name\":\"js-stellar-sdk\",\"X-Client-Version\":\"15.1.0\"})})),\"https\"!==this.serverURL.protocol()&&!r.allowHttp)throw new Error(\"Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set\")},M=[{key:\"getAccount\",value:(me=B(_().m(function e(t){var n;return _().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getAccountEntry(t);case 1:return n=e.v,e.a(2,new a.Account(t,n.seqNum().toString()))}},e,this)})),function(e){return me.apply(this,arguments)})},{key:\"getAccountEntry\",value:(ge=B(_().m(function e(t){var n,r;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=a.xdr.LedgerKey.account(new a.xdr.LedgerKeyAccount({accountId:a.Keypair.fromPublicKey(t).xdrPublicKey()})),e.p=1,e.n=2,this.getLedgerEntry(n);case 2:return r=e.v,e.a(2,r.val.account());case 3:throw e.p=3,e.v,new Error(\"Account not found: \".concat(t));case 4:return e.a(2)}},e,this,[[1,3]])})),function(e){return ge.apply(this,arguments)})},{key:\"getTrustline\",value:(ye=B(_().m(function e(t,n){var r,o;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=a.xdr.LedgerKey.trustline(new a.xdr.LedgerKeyTrustLine({accountId:a.Keypair.fromPublicKey(t).xdrAccountId(),asset:n.toTrustLineXDRObject()})),e.p=1,e.n=2,this.getLedgerEntry(r);case 2:return o=e.v,e.a(2,o.val.trustLine());case 3:throw e.p=3,e.v,new Error(\"Trustline for \".concat(n.getCode(),\":\").concat(n.getIssuer(),\" not found for \").concat(t));case 4:return e.a(2)}},e,this,[[1,3]])})),function(e,t){return ye.apply(this,arguments)})},{key:\"getClaimableBalance\",value:(he=B(_().m(function e(t){var n,r,o,i,s;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!a.StrKey.isValidClaimableBalance(t)){e.n=1;break}r=a.StrKey.decodeClaimableBalance(t),o=S.concat([S.from(\"\\0\\0\\0\"),r.subarray(0,1)]),n=a.xdr.ClaimableBalanceId.fromXDR(S.concat([o,r.subarray(1)])),e.n=4;break;case 1:if(!t.match(/[a-f0-9]{72}/i)){e.n=2;break}n=a.xdr.ClaimableBalanceId.fromXDR(t,\"hex\"),e.n=4;break;case 2:if(!t.match(/[a-f0-9]{64}/i)){e.n=3;break}n=a.xdr.ClaimableBalanceId.fromXDR(t.padStart(72,\"0\"),\"hex\"),e.n=4;break;case 3:throw new TypeError(\"expected 72-char hex ID or strkey, not \".concat(t));case 4:return i=a.xdr.LedgerKey.claimableBalance(new a.xdr.LedgerKeyClaimableBalance({balanceId:n})),e.p=5,e.n=6,this.getLedgerEntry(i);case 6:return s=e.v,e.a(2,s.val.claimableBalance());case 7:throw e.p=7,e.v,new Error(\"Claimable balance \".concat(t,\" not found\"));case 8:return e.a(2)}},e,this,[[5,7]])})),function(e){return he.apply(this,arguments)})},{key:\"getAssetBalance\",value:(de=B(_().m(function e(t,n,r){var o,i,s,c,u;return _().w(function(e){for(;;)switch(e.n){case 0:if(o=t,\"string\"!=typeof t){e.n=1;break}o=t,e.n=4;break;case 1:if(!(t instanceof a.Address)){e.n=2;break}o=t.toString(),e.n=4;break;case 2:if(!(t instanceof a.Contract)){e.n=3;break}o=t.toString(),e.n=4;break;case 3:throw new TypeError(\"invalid address: \".concat(t));case 4:if(!a.StrKey.isValidEd25519PublicKey(o)){e.n=6;break}return e.n=5,Promise.all([this.getTrustline(o,n),this.getLatestLedger()]);case 5:return i=e.v,s=k(i,2),c=s[0],u=s[1],e.a(2,{latestLedger:u.sequence,balanceEntry:{amount:c.balance().toString(),authorized:Boolean(1&c.flags()),clawback:Boolean(4&c.flags()),authorizedToMaintainLiabilities:Boolean(2&c.flags()),revocable:Boolean(2&c.flags())}});case 6:if(!a.StrKey.isValidContract(o)){e.n=7;break}return e.a(2,this.getSACBalance(o,n,r));case 7:throw new Error(\"invalid address: \".concat(t));case 8:return e.a(2)}},e,this)})),function(e,t,n){return de.apply(this,arguments)})},{key:\"getHealth\",value:(pe=B(_().m(function e(){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getHealth\"))},e,this)})),function(){return pe.apply(this,arguments)})},{key:\"getContractData\",value:(fe=B(_().m(function e(t,n){var r,o,i,s,c,u=arguments;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=u.length>2&&void 0!==u[2]?u[2]:j.Persistent,\"string\"!=typeof t){e.n=1;break}o=new a.Contract(t).address().toScAddress(),e.n=4;break;case 1:if(!(t instanceof a.Address)){e.n=2;break}o=t.toScAddress(),e.n=4;break;case 2:if(!(t instanceof a.Contract)){e.n=3;break}o=t.address().toScAddress(),e.n=4;break;case 3:throw new TypeError(\"unknown contract type: \".concat(t));case 4:c=r,e.n=c===j.Temporary?5:c===j.Persistent?6:7;break;case 5:return i=a.xdr.ContractDataDurability.temporary(),e.a(3,8);case 6:return i=a.xdr.ContractDataDurability.persistent(),e.a(3,8);case 7:throw new TypeError(\"invalid durability: \".concat(r));case 8:return s=a.xdr.LedgerKey.contractData(new a.xdr.LedgerKeyContractData({key:n,contract:o,durability:i})),e.p=9,e.n=10,this.getLedgerEntry(s);case 10:return e.a(2,e.v);case 11:throw e.p=11,e.v,{code:404,message:\"Contract data not found for \".concat(a.Address.fromScAddress(o).toString(),\" with key \").concat(n.toXDR(\"base64\"),\" and durability: \").concat(r)};case 12:return e.a(2)}},e,this,[[9,11]])})),function(e,t){return fe.apply(this,arguments)})},{key:\"getContractWasmByContractId\",value:(le=B(_().m(function e(t){var n,r,o,i;return _().w(function(e){for(;;)switch(e.n){case 0:return r=new a.Contract(t).getFootprint(),e.n=1,this.getLedgerEntries(r);case 1:if((o=e.v).entries.length&&null!==(n=o.entries[0])&&void 0!==n&&n.val){e.n=2;break}return e.a(2,Promise.reject({code:404,message:\"Could not obtain contract hash from server\"}));case 2:return i=o.entries[0].val.contractData().val().instance().executable().wasmHash(),e.a(2,this.getContractWasmByHash(i))}},e,this)})),function(e){return le.apply(this,arguments)})},{key:\"getContractWasmByHash\",value:(ue=B(_().m(function e(t){var n,r,o,i,s,c,u=arguments;return _().w(function(e){for(;;)switch(e.n){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:void 0,o=\"string\"==typeof t?S.from(t,r):t,i=a.xdr.LedgerKey.contractCode(new a.xdr.LedgerKeyContractCode({hash:o})),e.n=1,this.getLedgerEntries(i);case 1:if((s=e.v).entries.length&&null!==(n=s.entries[0])&&void 0!==n&&n.val){e.n=2;break}return e.a(2,Promise.reject({code:404,message:\"Could not obtain contract wasm from server\"}));case 2:return c=s.entries[0].val.contractCode().code(),e.a(2,c)}},e,this)})),function(e){return ue.apply(this,arguments)})},{key:\"getLedgerEntries\",value:function(){return this._getLedgerEntries.apply(this,arguments).then(b.$D)}},{key:\"_getLedgerEntries\",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(this.httpClient,this.serverURL.toString(),\"getLedgerEntries\",{keys:t.map(function(e){return e.toXDR(\"base64\")})})}},{key:\"getLedgerEntry\",value:(ce=B(_().m(function e(t){var n;return _().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._getLedgerEntries(t).then(b.$D);case 1:if(1===(n=e.v).entries.length){e.n=2;break}throw new Error(\"failed to find an entry for key \".concat(t.toXDR(\"base64\")));case 2:return e.a(2,n.entries[0])}},e,this)})),function(e){return ce.apply(this,arguments)})},{key:\"pollTransaction\",value:(se=B(_().m(function e(t,n){var o,i,a,s,c,u;return _().w(function(e){for(;;)switch(e.n){case 0:a=(null!==(o=null==n?void 0:n.attempts)&&void 0!==o?o:0)<1?30:null!==(i=null==n?void 0:n.attempts)&&void 0!==i?i:30,c=1;case 1:if(!(c<=a)){e.n=5;break}return e.n=2,this.getTransaction(t);case 2:if((s=e.v).status===r.j.GetTransactionStatus.NOT_FOUND){e.n=3;break}return e.a(2,s);case 3:return e.n=4,w.A.sleep((null!==(u=null==n?void 0:n.sleepStrategy)&&void 0!==u?u:U)(c));case 4:c++,e.n=1;break;case 5:return e.a(2,s)}},e,this)})),function(e,t){return se.apply(this,arguments)})},{key:\"getTransaction\",value:(ae=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getTransaction(t).then(function(e){var n={};return e.status!==r.j.GetTransactionStatus.NOT_FOUND&&Object.assign(n,(0,b.WC)(e)),x({status:e.status,txHash:t,latestLedger:e.latestLedger,latestLedgerCloseTime:e.latestLedgerCloseTime,oldestLedger:e.oldestLedger,oldestLedgerCloseTime:e.oldestLedgerCloseTime},n)}))},e,this)})),function(e){return ae.apply(this,arguments)})},{key:\"_getTransaction\",value:(ie=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getTransaction\",{hash:t}))},e,this)})),function(e){return ie.apply(this,arguments)})},{key:\"getTransactions\",value:(oe=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getTransactions(t).then(function(e){return{transactions:(e.transactions||[]).map(b.tR),latestLedger:e.latestLedger,latestLedgerCloseTimestamp:e.latestLedgerCloseTimestamp,oldestLedger:e.oldestLedger,oldestLedgerCloseTimestamp:e.oldestLedgerCloseTimestamp,cursor:e.cursor}}))},e,this)})),function(e){return oe.apply(this,arguments)})},{key:\"_getTransactions\",value:(re=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getTransactions\",t))},e,this)})),function(e){return re.apply(this,arguments)})},{key:\"getEvents\",value:(ne=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getEvents(t).then(b.fG))},e,this)})),function(e){return ne.apply(this,arguments)})},{key:\"_getEvents\",value:(te=B(_().m(function e(t){var n;return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getEvents\",x(x({filters:null!==(n=t.filters)&&void 0!==n?n:[],pagination:x(x({},t.cursor&&{cursor:t.cursor}),t.limit&&{limit:t.limit})},t.startLedger&&{startLedger:t.startLedger}),t.endLedger&&{endLedger:t.endLedger})))},e,this)})),function(e){return te.apply(this,arguments)})},{key:\"getNetwork\",value:(ee=B(_().m(function e(){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getNetwork\"))},e,this)})),function(){return ee.apply(this,arguments)})},{key:\"getLatestLedger\",value:(Q=B(_().m(function e(){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getLatestLedger().then(b.CA))},e,this)})),function(){return Q.apply(this,arguments)})},{key:\"_getLatestLedger\",value:(J=B(_().m(function e(){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getLatestLedger\"))},e,this)})),function(){return J.apply(this,arguments)})},{key:\"simulateTransaction\",value:(Y=B(_().m(function e(t,n,r){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,this._simulateTransaction(t,n,r).then(b.jr))},e,this)})),function(e,t,n){return Y.apply(this,arguments)})},{key:\"_simulateTransaction\",value:(Z=B(_().m(function e(t,n,r){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"simulateTransaction\",x({transaction:t.toXDR(),authMode:r},void 0!==n&&{resourceConfig:{instructionLeeway:n.cpuInstructions}})))},e,this)})),function(e,t,n){return Z.apply(this,arguments)})},{key:\"prepareTransaction\",value:(X=B(_().m(function e(t){var n;return _().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.simulateTransaction(t);case 1:if(n=e.v,!r.j.isSimulationError(n)){e.n=2;break}throw new Error(n.error);case 2:return e.a(2,(0,v.X)(t,n).build())}},e,this)})),function(e){return X.apply(this,arguments)})},{key:\"sendTransaction\",value:(W=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,this._sendTransaction(t).then(b.Af))},e,this)})),function(e){return W.apply(this,arguments)})},{key:\"_sendTransaction\",value:(G=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"sendTransaction\",{transaction:t.toXDR()}))},e,this)})),function(e){return G.apply(this,arguments)})},{key:\"requestAirdrop\",value:($=B(_().m(function e(t,n){var o,i,s,c,u,l,f,p,d;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=\"string\"==typeof t?t:t.accountId(),p=n){e.n=2;break}return e.n=1,this.getNetwork();case 1:p=e.v.friendbotUrl;case 2:if(n=p){e.n=3;break}throw new Error(\"No friendbot URL configured for current network\");case 3:return e.p=3,e.n=4,this.httpClient.post(\"\".concat(n,\"?addr=\").concat(encodeURIComponent(o)));case 4:if((i=e.v).data.result_meta_xdr){e.n=7;break}return e.n=5,this.getTransaction(i.data.hash);case 5:if((c=e.v).status===r.j.GetTransactionStatus.SUCCESS){e.n=6;break}throw new Error(\"Funding account \".concat(t,\" failed\"));case 6:s=c.resultMetaXdr,e.n=8;break;case 7:s=a.xdr.TransactionMeta.fromXDR(i.data.result_meta_xdr,\"base64\");case 8:return u=N(s),e.a(2,new a.Account(o,u));case 9:if(e.p=9,d=e.v,400!==(null===(l=d.response)||void 0===l?void 0:l.status)){e.n=10;break}if(null===(f=d.response.data)||void 0===f||null===(f=f.detail)||void 0===f||!f.includes(\"createAccountAlreadyExist\")){e.n=10;break}return e.a(2,this.getAccount(o));case 10:throw d;case 11:return e.a(2)}},e,this,[[3,9]])})),function(e,t){return $.apply(this,arguments)})},{key:\"fundAddress\",value:(H=B(_().m(function e(t,n){var o,i,s,c,u,l,f;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(a.StrKey.isValidEd25519PublicKey(t)||a.StrKey.isValidContract(t)){e.n=1;break}throw new Error(\"Invalid address: \".concat(t,\". Expected a Stellar account (G...) or contract (C...) address.\"));case 1:if(l=n){e.n=3;break}return e.n=2,this.getNetwork();case 2:l=e.v.friendbotUrl;case 3:if(n=l){e.n=4;break}throw new Error(\"No friendbot URL configured for current network\");case 4:return e.p=4,e.n=5,this.httpClient.post(\"\".concat(n,\"?addr=\").concat(encodeURIComponent(t)));case 5:return o=e.v,e.n=6,this.getTransaction(o.data.hash);case 6:if((i=e.v).status===r.j.GetTransactionStatus.SUCCESS){e.n=7;break}throw new Error(\"Funding address \".concat(t,\" failed: transaction status \").concat(i.status));case 7:return e.a(2,i);case 8:if(e.p=8,f=e.v,400!==(null===(s=f.response)||void 0===s?void 0:s.status)){e.n=9;break}throw new Error(null!==(c=null===(u=f.response.data)||void 0===u?void 0:u.detail)&&void 0!==c?c:\"Bad Request\");case 9:throw f;case 10:return e.a(2)}},e,this,[[4,8]])})),function(e,t){return H.apply(this,arguments)})},{key:\"getFeeStats\",value:(K=B(_().m(function e(){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getFeeStats\"))},e,this)})),function(){return K.apply(this,arguments)})},{key:\"getVersionInfo\",value:(z=B(_().m(function e(){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getVersionInfo\"))},e,this)})),function(){return z.apply(this,arguments)})},{key:\"getSACBalance\",value:(V=B(_().m(function e(t,n,r){var o,i,s,c,u,l,f,p,d,h,y,g;return _().w(function(e){for(;;)switch(e.n){case 0:if(o=t instanceof a.Address?t.toString():t,a.StrKey.isValidContract(o)){e.n=1;break}throw new TypeError(\"expected contract ID, got \".concat(o));case 1:if(null==r){e.n=2;break}g=r,e.n=4;break;case 2:return e.n=3,this.getNetwork().then(function(e){return e.passphrase});case 3:g=e.v;case 4:return i=g,s=n.contractId(i),c=(0,a.nativeToScVal)([\"Balance\",o],{type:[\"symbol\",\"address\"]}),u=a.xdr.LedgerKey.contractData(new a.xdr.LedgerKeyContractData({contract:new a.Address(s).toScAddress(),durability:a.xdr.ContractDataDurability.persistent(),key:c})),e.n=5,this.getLedgerEntries(u);case 5:if(0!==(l=e.v).entries.length){e.n=6;break}return e.a(2,{latestLedger:l.latestLedger});case 6:if(f=l.entries[0],p=f.lastModifiedLedgerSeq,d=f.liveUntilLedgerSeq,(h=f.val).switch().value===a.xdr.LedgerEntryType.contractData().value){e.n=7;break}return e.a(2,{latestLedger:l.latestLedger});case 7:return y=(0,a.scValToNative)(h.contractData().val()),e.a(2,{latestLedger:l.latestLedger,balanceEntry:{liveUntilLedgerSeq:d,lastModifiedLedgerSeq:p,amount:y.amount.toString(),authorized:y.authorized,clawback:y.clawback}})}},e,this)})),function(e,t,n){return V.apply(this,arguments)})},{key:\"getLedgers\",value:(q=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getLedgers(t).then(function(e){return{ledgers:(e.ledgers||[]).map(b.$E),latestLedger:e.latestLedger,latestLedgerCloseTime:e.latestLedgerCloseTime,oldestLedger:e.oldestLedger,oldestLedgerCloseTime:e.oldestLedgerCloseTime,cursor:e.cursor}}))},e,this)})),function(e){return q.apply(this,arguments)})},{key:\"_getLedgers\",value:(D=B(_().m(function e(t){return _().w(function(e){for(;;)if(0===e.n)return e.a(2,g(this.httpClient,this.serverURL.toString(),\"getLedgers\",t))},e,this)})),function(e){return D.apply(this,arguments)})}],M&&P(L.prototype,M),Object.defineProperty(L,\"prototype\",{writable:!1}),L);const be=(e=n.hmd(e)).exports},784(e,t,n){\"use strict\";n.d(t,{$D:()=>d,$E:()=>y,Af:()=>u,CA:()=>g,WC:()=>l,fG:()=>p,jr:()=>h,tR:()=>f});var r=n(8950),o=n(4076);function i(e){return i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},i(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e){if(\"object\"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=i(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==i(t)?t:t+\"\"}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t=e.errorResultXdr,n=e.diagnosticEventsXdr;return delete e.errorResultXdr,delete e.diagnosticEventsXdr,t?s(s(s({},e),void 0!==n&&n.length>0&&{diagnosticEvents:n.map(function(e){return r.xdr.DiagnosticEvent.fromXDR(e,\"base64\")})}),{},{errorResult:r.xdr.TransactionResult.fromXDR(t,\"base64\")}):s({},e)}function l(e){var t,n,o,i,a=r.xdr.TransactionMeta.fromXDR(e.resultMetaXdr,\"base64\"),s={ledger:e.ledger,createdAt:e.createdAt,applicationOrder:e.applicationOrder,feeBump:e.feeBump,envelopeXdr:r.xdr.TransactionEnvelope.fromXDR(e.envelopeXdr,\"base64\"),resultXdr:r.xdr.TransactionResult.fromXDR(e.resultXdr,\"base64\"),resultMetaXdr:a,events:{contractEventsXdr:(null!==(t=null===(n=e.events)||void 0===n?void 0:n.contractEventsXdr)&&void 0!==t?t:[]).map(function(e){return e.map(function(e){return r.xdr.ContractEvent.fromXDR(e,\"base64\")})}),transactionEventsXdr:(null!==(o=null===(i=e.events)||void 0===i?void 0:i.transactionEventsXdr)&&void 0!==o?o:[]).map(function(e){return r.xdr.TransactionEvent.fromXDR(e,\"base64\")})}};switch(a.switch()){case 3:case 4:var c,u,l=a.value();null!==l.sorobanMeta()&&(s.returnValue=null!==(c=null===(u=l.sorobanMeta())||void 0===u?void 0:u.returnValue())&&void 0!==c?c:void 0)}return e.diagnosticEventsXdr&&(s.diagnosticEventsXdr=e.diagnosticEventsXdr.map(function(e){return r.xdr.DiagnosticEvent.fromXDR(e,\"base64\")})),s}function f(e){return s({status:e.status,txHash:e.txHash},l(e))}function p(e){var t;return{latestLedger:e.latestLedger,oldestLedger:e.oldestLedger,latestLedgerCloseTime:e.latestLedgerCloseTime,oldestLedgerCloseTime:e.oldestLedgerCloseTime,cursor:e.cursor,events:(null!==(t=e.events)&&void 0!==t?t:[]).map(function(e){var t,n=s({},e);return delete n.contractId,s(s(s({},n),\"\"!==e.contractId&&{contractId:new r.Contract(e.contractId)}),{},{topic:(null!==(t=e.topic)&&void 0!==t?t:[]).map(function(e){return r.xdr.ScVal.fromXDR(e,\"base64\")}),value:r.xdr.ScVal.fromXDR(e.value,\"base64\")})})}}function d(e){var t;return{latestLedger:e.latestLedger,entries:(null!==(t=e.entries)&&void 0!==t?t:[]).map(function(e){if(!e.key||!e.xdr)throw new TypeError(\"invalid ledger entry: \".concat(JSON.stringify(e)));return s({lastModifiedLedgerSeq:e.lastModifiedLedgerSeq,key:r.xdr.LedgerKey.fromXDR(e.key,\"base64\"),val:r.xdr.LedgerEntryData.fromXDR(e.xdr,\"base64\")},void 0!==e.liveUntilLedgerSeq&&{liveUntilLedgerSeq:e.liveUntilLedgerSeq})})}}function h(e){var t,n;if(!o.j.isSimulationRaw(e))return e;var i={_parsed:!0,id:e.id,latestLedger:e.latestLedger,events:null!==(t=null===(n=e.events)||void 0===n?void 0:n.map(function(e){return r.xdr.DiagnosticEvent.fromXDR(e,\"base64\")}))&&void 0!==t?t:[]};return\"string\"==typeof e.error?s(s({},i),{},{error:e.error}):function(e,t){var n,o,i,a,c,u=s(s(s({},t),{},{transactionData:new r.SorobanDataBuilder(e.transactionData),minResourceFee:e.minResourceFee},(null!==(n=null===(o=e.results)||void 0===o?void 0:o.length)&&void 0!==n?n:0)>0&&{result:e.results.map(function(e){var t;return{auth:(null!==(t=e.auth)&&void 0!==t?t:[]).map(function(e){return r.xdr.SorobanAuthorizationEntry.fromXDR(e,\"base64\")}),retval:e.xdr?r.xdr.ScVal.fromXDR(e.xdr,\"base64\"):r.xdr.ScVal.scvVoid()}})[0]}),(null!==(i=null===(a=e.stateChanges)||void 0===a?void 0:a.length)&&void 0!==i?i:0)>0&&{stateChanges:null===(c=e.stateChanges)||void 0===c?void 0:c.map(function(e){return{type:e.type,key:r.xdr.LedgerKey.fromXDR(e.key,\"base64\"),before:e.before?r.xdr.LedgerEntry.fromXDR(e.before,\"base64\"):null,after:e.after?r.xdr.LedgerEntry.fromXDR(e.after,\"base64\"):null}})});return e.restorePreamble&&\"\"!==e.restorePreamble.transactionData?s(s({},u),{},{restorePreamble:{minResourceFee:e.restorePreamble.minResourceFee,transactionData:new r.SorobanDataBuilder(e.restorePreamble.transactionData)}}):u}(e,i)}function y(e){var t;if(!e.metadataXdr||!e.headerXdr)throw t=e.metadataXdr||e.headerXdr?e.metadataXdr?\"headerXdr\":\"metadataXdr\":\"metadataXdr and headerXdr\",new TypeError(\"invalid ledger missing fields: \".concat(t));var n=r.xdr.LedgerCloseMeta.fromXDR(e.metadataXdr,\"base64\"),o=r.xdr.LedgerHeaderHistoryEntry.fromXDR(e.headerXdr,\"base64\");return{hash:e.hash,sequence:e.sequence,ledgerCloseTime:e.ledgerCloseTime,metadataXdr:n,headerXdr:o}}function g(e){var t,n=r.xdr.LedgerHeader.fromXDR(e.headerXdr,\"base64\"),o=r.xdr.LedgerCloseMeta.fromXDR(e.metadataXdr,\"base64\");if(e.metadataXdr||e.headerXdr?e.metadataXdr?e.headerXdr||(t=\"headerXdr\"):t=\"metadataXdr\":t=\"metadataXdr and headerXdr\",t)throw new TypeError(\"invalid getLatestLedger response missing fields: \".concat(t));return{id:e.id,sequence:e.sequence,protocolVersion:e.protocolVersion,closeTime:e.closeTime,headerXdr:n,metadataXdr:o}}},8680(e,t,n){\"use strict\";n.d(t,{X:()=>a});var r=n(8950),o=n(4076),i=n(784);function a(e,t){if(\"innerTransaction\"in e)return a(e.innerTransaction,t);if(!function(e){if(1!==e.operations.length)return!1;switch(e.operations[0].type){case\"invokeHostFunction\":case\"extendFootprintTtl\":case\"restoreFootprint\":return!0;default:return!1}}(e))throw new TypeError(\"unsupported transaction: must contain exactly one invokeHostFunction, extendFootprintTtl, or restoreFootprint operation\");var n,s=(0,i.jr)(t);if(!o.j.isSimulationSuccess(s))throw new Error(\"simulation incorrect: \".concat(JSON.stringify(s)));try{n=BigInt(e.fee)}catch(e){n=BigInt(0)}var c=e.toEnvelope().v1().tx().ext().value();c&&n-c.resourceFee().toBigInt()>BigInt(0)&&(n-=c.resourceFee().toBigInt());var u=r.TransactionBuilder.cloneFrom(e,{fee:n.toString(),sorobanData:s.transactionData.build(),networkPassphrase:e.networkPassphrase});if(\"invokeHostFunction\"===e.operations[0].type){var l;u.clearOperations();var f=e.operations[0],p=null!==(l=f.auth)&&void 0!==l?l:[];u.addOperation(r.Operation.invokeHostFunction({source:f.source,func:f.func,auth:p.length>0?p:s.result.auth}))}return u}},3898(e,t,n){\"use strict\";n.r(t),n.d(t,{Api:()=>{},Resolver:()=>b,STELLAR_TOML_MAX_SIZE:()=>m});var r=n(1293),o=n.n(r),i=n(9983),a=n(8732);function s(e){return s=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},s(e)}function c(){var e,t,n=\"function\"==typeof Symbol?Symbol:{},r=n.iterator||\"@@iterator\",o=n.toStringTag||\"@@toStringTag\";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return u(l,\"_invoke\",function(n,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,s=0,c=e,p.n=n,a}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(u>1)throw TypeError(\"Generator is already running\");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o=\"next\"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError(\"The iterator does not provide a '\"+o+\"' method\"),s=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,o,i),!0),l}var a={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,o,\"GeneratorFunction\")),e.prototype=Object.create(d),e}return l.prototype=f,u(d,\"constructor\",f),u(f,\"constructor\",l),l.displayName=\"GeneratorFunction\",u(f,o,\"GeneratorFunction\"),u(d),u(d,o,\"Generator\"),u(d,r,function(){return this}),u(d,\"toString\",function(){return\"[object Generator]\"}),(c=function(){return{w:i,m:h}})()}function u(e,t,n,r){var o=Object.defineProperty;try{o({},\"\",{})}catch(e){o=0}u=function(e,t,n,r){function i(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i(\"next\",0),i(\"throw\",1),i(\"return\",2))},u(e,t,n,r)}function l(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}function p(e){var t=function(e){if(\"object\"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=s(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==s(t)?t:t+\"\"}var d,h,y,g,m=102400,v=i.ok.CancelToken,b=(d=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e)},h=[{key:\"resolve\",value:(y=c().m(function e(t){var n,r,s,u,l,f=arguments;return c().w(function(e){for(;;)if(0===e.n)return s=void 0===(r=f.length>1&&void 0!==f[1]?f[1]:{}).allowHttp?a.T.isAllowHttp():r.allowHttp,u=void 0===r.timeout?a.T.getTimeout():r.timeout,l=s?\"http\":\"https\",e.a(2,i.ok.get(\"\".concat(l,\"://\").concat(t,\"/.well-known/stellar.toml\"),{maxRedirects:null!==(n=r.allowedRedirects)&&void 0!==n?n:0,maxContentLength:m,cancelToken:u?new v(function(e){return setTimeout(function(){return e(\"timeout of \".concat(u,\"ms exceeded\"))},u)}):void 0,timeout:u}).then(function(e){try{var t=o().parse(e.data);return Promise.resolve(t)}catch(e){return Promise.reject(new Error(\"stellar.toml is invalid - Parsing error on line \".concat(e.line,\", column \").concat(e.column,\": \").concat(e.message)))}}).catch(function(e){throw e.message.match(/^maxContentLength size/)?new Error(\"stellar.toml file exceeds allowed size of \".concat(m)):e}))},e)}),g=function(){var e=this,t=arguments;return new Promise(function(n,r){var o=y.apply(e,t);function i(e){l(o,n,r,i,a,\"next\",e)}function a(e){l(o,n,r,i,a,\"throw\",e)}i(void 0)})},function(e){return g.apply(this,arguments)})}],h&&f(d,h),Object.defineProperty(d,\"prototype\",{writable:!1}),d)},3121(e,t,n){\"use strict\";function r(e){return r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if(\"object\"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=r(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==r(t)?t:t+\"\"}n.d(t,{A:()=>c});var a,s,c=(a=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e)},s=[{key:\"validateTimebounds\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e.timeBounds)return!1;var n=Math.floor(Date.now()/1e3),r=e.timeBounds,o=r.minTime,i=r.maxTime;return n>=Number.parseInt(o,10)-t&&n<=Number.parseInt(i,10)+t}},{key:\"sleep\",value:function(e){return new Promise(function(t){return setTimeout(t,e)})}}],s&&o(a,s),Object.defineProperty(a,\"prototype\",{writable:!1}),a)},7504(e,t,n){\"use strict\";n.r(t),n.d(t,{InvalidChallengeError:()=>l,buildChallengeTx:()=>T,gatherTxSigners:()=>d,readChallengeTx:()=>k,verifyChallengeTxSigners:()=>O,verifyChallengeTxThreshold:()=>_,verifyTxSignedBy:()=>h});var r=n(8950);function o(e){return o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},o(e)}function i(e,t,n){return t=u(t),function(e,t){if(t&&(\"object\"==o(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e)}(e,s()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function a(e){var t=\"function\"==typeof Map?new Map:void 0;return a=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf(\"[native code]\")}catch(t){return\"function\"==typeof e}}(e))return e;if(\"function\"!=typeof e)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(s())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&c(o,n.prototype),o}(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},a(e)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,t),i(this,t,arguments)}return function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&c(e,t)}(t,e),n=t,Object.defineProperty(n,\"prototype\",{writable:!1}),n;var n}(a(Error));function f(e,t){if(e){if(\"string\"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n,o=e.hash(),i=function(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}(e.signatures),a=new Set,s=function(e){var t=\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(!t){if(Array.isArray(e)||(t=f(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}(t);try{for(s.s();!(n=s.n()).done;){var c=n.value;if(0===i.length)break;var u=void 0;try{u=r.Keypair.fromPublicKey(c)}catch(e){throw new l(\"Signer is not a valid address: \".concat(e.message))}for(var d=0;d<i.length;d++){var h=i[d];if(h.hint().equals(u.signatureHint())&&u.verify(o,h.signature())){a.add(c),i.splice(d,1);break}}}}catch(e){s.e(e)}finally{s.f()}return Array.from(a)}function h(e,t){return 0!==d(e,[t]).length}var y=n(3209),g=n.n(y),m=n(3121),v=n(8287).Buffer;function b(e){return function(e){if(Array.isArray(e))return E(e)}(e)||x(e)||A(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function w(e,t){var n=\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(!n){if(Array.isArray(e)||(n=A(e))||t&&e&&\"number\"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function S(e){return S=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},S(e)}function A(e,t){if(e){if(\"string\"==typeof e)return E(e,t);var n={}.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}function T(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:300,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;if(t.startsWith(\"M\")&&s)throw Error(\"memo cannot be used if clientAccountID is a muxed account\");var l=new r.Account(e.publicKey(),\"-1\"),f=Math.floor(Date.now()/1e3),p=g()(48).toString(\"base64\"),d=new r.TransactionBuilder(l,{fee:r.BASE_FEE,networkPassphrase:i,timebounds:{minTime:f,maxTime:f+o}}).addOperation(r.Operation.manageData({name:\"\".concat(n,\" auth\"),value:p,source:t})).addOperation(r.Operation.manageData({name:\"web_auth_domain\",value:a,source:l.accountId()}));if(c){if(!u)throw Error(\"clientSigningKey is required if clientDomain is provided\");d.addOperation(r.Operation.manageData({name:\"client_domain\",value:c,source:u}))}s&&d.addMemo(r.Memo.id(s));var h=d.build();return h.sign(e),h.toEnvelope().toXDR(\"base64\").toString()}function k(e,t,n,o,i){var a,s;if(t.startsWith(\"M\"))throw Error(\"Invalid serverAccountID: multiplexed accounts are not supported.\");try{s=new r.Transaction(e,n)}catch(t){try{s=new r.FeeBumpTransaction(e,n)}catch(e){throw new l(\"Invalid challenge: unable to deserialize challengeTx transaction string\")}throw new l(\"Invalid challenge: expected a Transaction but received a FeeBumpTransaction\")}if(0!==Number.parseInt(s.sequence,10))throw new l(\"The transaction sequence number should be zero\");if(s.source!==t)throw new l(\"The transaction source account is not equal to the server's account\");if(s.operations.length<1)throw new l(\"The transaction should contain at least one operation\");var c=function(e){return function(e){if(Array.isArray(e))return e}(e)||x(e)||A(e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}(s.operations),u=c[0],f=E(c).slice(1);if(!u.source)throw new l(\"The transaction's operation should contain a source account\");var p,d=u.source,y=null;if(s.memo.type!==r.MemoNone){if(d.startsWith(\"M\"))throw new l(\"The transaction has a memo but the client account ID is a muxed account\");if(s.memo.type!==r.MemoID)throw new l(\"The transaction's memo must be of type `id`\");y=s.memo.value}if(\"manageData\"!==u.type)throw new l(\"The transaction's operation type should be 'manageData'\");if(s.timeBounds&&Number.parseInt(null===(a=s.timeBounds)||void 0===a?void 0:a.maxTime,10)===r.TimeoutInfinite)throw new l(\"The transaction requires non-infinite timebounds\");if(!m.A.validateTimebounds(s,300))throw new l(\"The transaction has expired\");if(void 0===u.value)throw new l(\"The transaction's operation values should not be null\");if(!u.value)throw new l(\"The transaction's operation value should not be null\");if(48!==v.from(u.value.toString(),\"base64\").length)throw new l(\"The transaction's operation value should be a 64 bytes base64 random string\");if(!o)throw new l(\"Invalid homeDomains: a home domain must be provided for verification\");if(\"string\"==typeof o)\"\".concat(o,\" auth\")===u.name&&(p=o);else{if(!Array.isArray(o))throw new l(\"Invalid homeDomains: homeDomains type is \".concat(S(o),\" but should be a string or an array\"));p=o.find(function(e){return\"\".concat(e,\" auth\")===u.name})}if(!p)throw new l(\"Invalid homeDomains: the transaction's operation key name does not match the expected home domain\");var g,b=w(f);try{for(b.s();!(g=b.n()).done;){var T=g.value;if(\"manageData\"!==T.type)throw new l(\"The transaction has operations that are not of type 'manageData'\");if(T.source!==t&&\"client_domain\"!==T.name)throw new l(\"The transaction has operations that are unrecognized\");if(\"web_auth_domain\"===T.name){if(void 0===T.value)throw new l(\"'web_auth_domain' operation value should not be null\");if(T.value.compare(v.from(i)))throw new l(\"'web_auth_domain' operation value does not match \".concat(i))}}}catch(e){b.e(e)}finally{b.f()}if(!h(s,t))throw new l(\"Transaction not signed by server: '\".concat(t,\"'\"));return{tx:s,clientAccountID:d,matchedHomeDomain:p,memo:y}}function O(e,t,n,o,i,a){var s,c=k(e,t,n,i,a).tx;try{s=r.Keypair.fromPublicKey(t)}catch(e){throw new Error(\"Couldn't infer keypair from the provided 'serverAccountID': \".concat(e.message))}var u,f,p=new Set,h=w(o);try{for(h.s();!(u=h.n()).done;){var y=u.value;y!==s.publicKey()&&\"G\"===y.charAt(0)&&p.add(y)}}catch(e){h.e(e)}finally{h.f()}if(0===p.size)throw new l(\"No verifiable client signers provided, at least one G... address must be provided\");var g,m=w(c.operations);try{for(m.s();!(g=m.n()).done;){var v=g.value;if(\"manageData\"===v.type&&\"client_domain\"===v.name){if(f)throw new l(\"Found more than one client_domain operation\");f=v.source}}}catch(e){m.e(e)}finally{m.f()}var S=[s.publicKey()].concat(b(Array.from(p)));f&&S.push(f);var A,E=d(c,S),x=!1,T=!1,O=w(E);try{for(O.s();!(A=O.n()).done;){var _=A.value;_===s.publicKey()&&(x=!0),_===f&&(T=!0)}}catch(e){O.e(e)}finally{O.f()}if(!x)throw new l(\"Transaction not signed by server: '\".concat(s.publicKey(),\"'\"));if(f&&!T)throw new l(\"Transaction not signed by the source account of the 'client_domain' ManageData operation\");if(1===E.length)throw new l(\"None of the given signers match the transaction signatures\");if(E.length!==c.signatures.length)throw new l(\"Transaction has unrecognized signatures\");if(E.splice(E.indexOf(s.publicKey()),1),f&&E.splice(E.indexOf(f),1),0===E.length)throw new l(\"None of the given signers match the transaction signatures\");return E}function _(e,t,n,r,o,i,a){var s,c=O(e,t,n,o.map(function(e){return e.key}),i,a),u=0,f=w(c);try{var p=function(){var e,t=s.value,n=(null===(e=o.find(function(e){return e.key===t}))||void 0===e?void 0:e.weight)||0;u+=n};for(f.s();!(s=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}if(u<r)throw new l(\"signers with weight \".concat(u,\" do not meet threshold \").concat(r,'\"'));return c}},7526(e,t){\"use strict\";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,f=c>0?a-4:a;for(n=0;n<f;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,c=r-o;s<c;s+=a)i.push(u(e,s,s+a>c?c:s+a));return 1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+\"==\")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\")),i.join(\"\")};for(var n=[],r=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var n=e.indexOf(\"=\");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(c(r));return o.join(\"\")}r[\"-\".charCodeAt(0)]=62,r[\"_\".charCodeAt(0)]=63},8287(e,t,n){\"use strict\";const r=n(7526),o=n(251),i=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return f(e)}return u(e,t,n)}function u(e,t,n){if(\"string\"==typeof e)return function(e,t){if(\"string\"==typeof t&&\"\"!==t||(t=\"utf8\"),!c.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const n=0|y(e,t);let r=s(n);const o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return d(e,t,n);if(\"undefined\"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return d(e,t,n);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?\"number\"!=typeof e.length||Z(e.length)?s(0):p(e):\"Buffer\"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(o)return o;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive](\"string\"),t,n);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function l(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function f(e){return l(e),s(e<0?0:0|h(e))}function p(e){const t=e.length<0?0:0|h(e.length),n=s(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function d(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('\"length\" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,c.prototype),r}function h(e){if(e>=a)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+a.toString(16)+\" bytes\");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return n;case\"utf8\":case\"utf-8\":return $(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*n;case\"hex\":return n>>>1;case\"base64\":return G(e).length;default:if(o)return r?-1:$(e).length;t=(\"\"+t).toLowerCase(),o=!0}}function g(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return\"\";if((n>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return C(this,t,n);case\"utf8\":case\"utf-8\":return k(this,t,n);case\"ascii\":return _(this,t,n);case\"latin1\":case\"binary\":return I(this,t,n);case\"base64\":return T(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return B(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,o){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if(\"string\"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,o);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,o);throw new TypeError(\"val must be string, number or Buffer\")}function b(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&(\"ucs2\"===(r=String(r).toLowerCase())||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===c)return r*a}else-1!==r&&(i-=i-r),r=-1}else for(n+c>s&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;r<c;r++)if(u(e,i+r)!==u(t,r)){n=!1;break}if(n)return i}return-1}function w(e,t,n,r){n=Number(n)||0;const o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(Z(r))return a;e[n+a]=r}return a}function S(e,t,n,r){return W($(t,e.length-n),e,n,r)}function A(e,t,n,r){return W(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return W(G(t),e,n,r)}function x(e,t,n,r){return W(function(e,t){let n,r,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o<n;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let n=\"\",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=O));return n}(r)}t.kMaxLength=a,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(c.prototype,\"parent\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,\"offset\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?s(e):void 0!==t?\"string\"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=c.allocUnsafe(t);let o=0;for(n=0;n<e.length;++n){let t=e[n];if(X(t,Uint8Array))o+t.length>r.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?\"\":0===arguments.length?k(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e=\"\";const n=t.INSPECT_MAX_BYTES;return e=this.toString(\"hex\",0,n).replace(/(.{2})/g,\"$1 \").trim(),this.length>n&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError(\"out of range index\");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e<s;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r=\"utf8\",n=this.length,t=0;else if(void 0===n&&\"string\"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");let i=!1;for(;;)switch(r){case\"hex\":return w(this,e,t,n);case\"utf8\":case\"utf-8\":return S(this,e,t,n);case\"ascii\":case\"latin1\":case\"binary\":return A(this,e,t,n);case\"base64\":return E(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return x(this,e,t,n);default:if(i)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function _(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function I(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function C(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let o=\"\";for(let r=t;r<n;++r)o+=Y[e[r]];return o}function B(e,t,n){const r=e.slice(t,n);let o=\"\";for(let e=0;e<r.length-1;e+=2)o+=String.fromCharCode(r[e]+256*r[e+1]);return o}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function R(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('\"value\" argument is out of bounds');if(n+r>e.length)throw new RangeError(\"Index out of range\")}function j(e,t,n,r,o){V(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function U(e,t,n,r,o){V(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"Index out of range\")}function N(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J(function(e){z(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(e){z(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J(function(e){z(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=J(function(e){z(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||R(this,e,t,n,Math.pow(2,8*n)-1,0);let o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||R(this,e,t,n,Math.pow(2,8*n)-1,0);let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J(function(e,t=0){return j(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),c.prototype.writeBigUInt64BE=J(function(e,t=0){return U(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);R(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);R(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J(function(e,t=0){return j(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),c.prototype.writeBigInt64BE=J(function(e,t=0){return U(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),c.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(n<0||n>=this.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const o=r-n;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},c.prototype.fill=function(e,t,n,r){if(\"string\"==typeof e){if(\"string\"==typeof t?(r=t,t=0,n=this.length):\"string\"==typeof n&&(r=n,n=this.length),void 0!==r&&\"string\"!=typeof r)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof r&&!c.isEncoding(r))throw new TypeError(\"Unknown encoding: \"+r);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===r&&t<128||\"latin1\"===r)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError(\"Out of range index\");if(n<=t)return this;let o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o<n;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,r),a=i.length;if(0===a)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(o=0;o<n-t;++o)this[o+t]=i[o%a]}return this};const M={};function D(e,t,n){M[e]=class extends n{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t=\"\",n=e.length;const r=\"-\"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function V(e,t,n,r,o,i){if(e>n||e<t){const r=\"bigint\"==typeof t?\"n\":\"\";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new M.ERR_OUT_OF_RANGE(\"value\",o,e)}!function(e,t,n){z(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+n]||K(t,e.length-(n+1))}(r,o,i)}function z(e,t){if(\"number\"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function K(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new M.ERR_OUT_OF_RANGE(n||\"offset\",\"an integer\",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(n||\"offset\",`>= ${n?1:0} and <= ${t}`,e)}D(\"ERR_BUFFER_OUT_OF_BOUNDS\",function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"},RangeError),D(\"ERR_INVALID_ARG_TYPE\",function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`},TypeError),D(\"ERR_OUT_OF_RANGE\",function(e,t,n){let r=`The value of \"${e}\" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=q(String(n)):\"bigint\"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+=\"n\"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const H=/[^+/0-9A-Za-z-_]/g;function $(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function G(e){return r.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace(H,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function W(e,t,n,r){let o;for(o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function J(e){return\"undefined\"==typeof BigInt?Q:e}function Q(){throw new Error(\"BigInt not supported\")}},6866(e){e.exports={100:\"Continue\",101:\"Switching Protocols\",102:\"Processing\",200:\"OK\",201:\"Created\",202:\"Accepted\",203:\"Non-Authoritative Information\",204:\"No Content\",205:\"Reset Content\",206:\"Partial Content\",207:\"Multi-Status\",208:\"Already Reported\",226:\"IM Used\",300:\"Multiple Choices\",301:\"Moved Permanently\",302:\"Found\",303:\"See Other\",304:\"Not Modified\",305:\"Use Proxy\",307:\"Temporary Redirect\",308:\"Permanent Redirect\",400:\"Bad Request\",401:\"Unauthorized\",402:\"Payment Required\",403:\"Forbidden\",404:\"Not Found\",405:\"Method Not Allowed\",406:\"Not Acceptable\",407:\"Proxy Authentication Required\",408:\"Request Timeout\",409:\"Conflict\",410:\"Gone\",411:\"Length Required\",412:\"Precondition Failed\",413:\"Payload Too Large\",414:\"URI Too Long\",415:\"Unsupported Media Type\",416:\"Range Not Satisfiable\",417:\"Expectation Failed\",418:\"I'm a teapot\",421:\"Misdirected Request\",422:\"Unprocessable Entity\",423:\"Locked\",424:\"Failed Dependency\",425:\"Unordered Collection\",426:\"Upgrade Required\",428:\"Precondition Required\",429:\"Too Many Requests\",431:\"Request Header Fields Too Large\",451:\"Unavailable For Legal Reasons\",500:\"Internal Server Error\",501:\"Not Implemented\",502:\"Bad Gateway\",503:\"Service Unavailable\",504:\"Gateway Timeout\",505:\"HTTP Version Not Supported\",506:\"Variant Also Negotiates\",507:\"Insufficient Storage\",508:\"Loop Detected\",509:\"Bandwidth Limit Exceeded\",510:\"Not Extended\",511:\"Network Authentication Required\"}},3144(e,t,n){\"use strict\";var r=n(6743),o=n(1002),i=n(76),a=n(7119);e.exports=a||r.call(i,o)},2205(e,t,n){\"use strict\";var r=n(6743),o=n(1002),i=n(3144);e.exports=function(){return i(r,o,arguments)}},1002(e){\"use strict\";e.exports=Function.prototype.apply},76(e){\"use strict\";e.exports=Function.prototype.call},3126(e,t,n){\"use strict\";var r=n(6743),o=n(9675),i=n(76),a=n(3144);e.exports=function(e){if(e.length<1||\"function\"!=typeof e[0])throw new o(\"a function is required\");return a(r,i,e)}},7119(e){\"use strict\";e.exports=\"undefined\"!=typeof Reflect&&Reflect&&Reflect.apply},487(e,t,n){\"use strict\";var r=n(6897),o=n(655),i=n(3126),a=n(2205);e.exports=function(e){var t=i(arguments),n=e.length-(arguments.length-1);return r(t,1+(n>0?n:0),!0)},o?o(e.exports,\"apply\",{value:a}):e.exports.apply=a},6556(e,t,n){\"use strict\";var r=n(453),o=n(3126),i=o([r(\"%String.prototype.indexOf%\")]);e.exports=function(e,t){var n=r(e,!!t);return\"function\"==typeof n&&i(e,\".prototype.\")>-1?o([n]):n}},41(e,t,n){\"use strict\";var r=n(655),o=n(8068),i=n(9675),a=n(5795);e.exports=function(e,t,n){if(!e||\"object\"!=typeof e&&\"function\"!=typeof e)throw new i(\"`obj` must be an object or a function`\");if(\"string\"!=typeof t&&\"symbol\"!=typeof t)throw new i(\"`property` must be a string or a symbol`\");if(arguments.length>3&&\"boolean\"!=typeof arguments[3]&&null!==arguments[3])throw new i(\"`nonEnumerable`, if provided, must be a boolean or null\");if(arguments.length>4&&\"boolean\"!=typeof arguments[4]&&null!==arguments[4])throw new i(\"`nonWritable`, if provided, must be a boolean or null\");if(arguments.length>5&&\"boolean\"!=typeof arguments[5]&&null!==arguments[5])throw new i(\"`nonConfigurable`, if provided, must be a boolean or null\");if(arguments.length>6&&\"boolean\"!=typeof arguments[6])throw new i(\"`loose`, if provided, must be a boolean\");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!a&&a(e,t);if(r)r(e,t,{configurable:null===u&&f?f.configurable:!u,enumerable:null===s&&f?f.enumerable:!s,value:n,writable:null===c&&f?f.writable:!c});else{if(!l&&(s||c||u))throw new o(\"This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.\");e[t]=n}}},7176(e,t,n){\"use strict\";var r,o=n(3126),i=n(5795);try{r=[].__proto__===Array.prototype}catch(e){if(!e||\"object\"!=typeof e||!(\"code\"in e)||\"ERR_PROTO_ACCESS\"!==e.code)throw e}var a=!!r&&i&&i(Object.prototype,\"__proto__\"),s=Object,c=s.getPrototypeOf;e.exports=a&&\"function\"==typeof a.get?o([a.get]):\"function\"==typeof c&&function(e){return c(null==e?e:s(e))}},655(e){\"use strict\";var t=Object.defineProperty||!1;if(t)try{t({},\"a\",{value:1})}catch(e){t=!1}e.exports=t},1237(e){\"use strict\";e.exports=EvalError},9383(e){\"use strict\";e.exports=Error},9290(e){\"use strict\";e.exports=RangeError},9538(e){\"use strict\";e.exports=ReferenceError},8068(e){\"use strict\";e.exports=SyntaxError},9675(e){\"use strict\";e.exports=TypeError},5345(e){\"use strict\";e.exports=URIError},9612(e){\"use strict\";e.exports=Object},7007(e){\"use strict\";var t,n=\"object\"==typeof Reflect?Reflect:null,r=n&&\"function\"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&\"function\"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise(function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){\"function\"==typeof e.removeListener&&e.removeListener(\"error\",o),n([].slice.call(arguments))}y(e,t,i,{once:!0}),\"error\"!==t&&function(e,t){\"function\"==typeof e.on&&y(e,\"error\",t,{once:!0})}(e,o)})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if(\"function\"!=typeof e)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var o,i,a,u;if(s(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit(\"newListener\",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if(\"function\"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");l.name=\"MaxListenersExceededWarning\",l.emitter=e,l.type=t,l.count=a.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:\"function\"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):h(o,o.length)}function d(e){var t=this._events;if(void 0!==t){var n=t[e];if(\"function\"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if(\"function\"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if(\"function\"!=typeof e.addEventListener)throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(i){r.once&&e.removeEventListener(t,o),n(i)})}}Object.defineProperty(i,\"defaultMaxListeners\",{enumerable:!0,get:function(){return a},set:function(e){if(\"number\"!=typeof e||e<0||o(e))throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received '+e+\".\");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if(\"number\"!=typeof e||e<0||o(e))throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received '+e+\".\");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o=\"error\"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error(\"Unhandled error.\"+(a?\" (\"+a.message+\")\":\"\"));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if(\"function\"==typeof c)r(c,this,t);else{var u=c.length,l=h(c,u);for(n=0;n<u;++n)r(l[n],this,t)}return!0},i.prototype.addListener=function(e,t){return u(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return u(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(\"removeListener\",e,n.listener||t));else if(\"function\"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit(\"removeListener\",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)\"removeListener\"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners(\"removeListener\"),this._events=Object.create(null),this._eventsCount=0,this}if(\"function\"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return\"function\"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},i.prototype.listenerCount=d,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},1731(e,t,n){var r=n(8287).Buffer,o=n(8835).parse,i=n(7007),a=n(1083),s=n(1568),c=n(537),u=[\"pfx\",\"key\",\"passphrase\",\"cert\",\"ca\",\"ciphers\",\"rejectUnauthorized\",\"secureProtocol\",\"servername\",\"checkServerIdentity\"],l=[239,187,191],f=262144,p=/^(cookie|authorization)$/i;function d(e,t){var n=d.CONNECTING,i=t&&t.headers,c=!1;Object.defineProperty(this,\"readyState\",{get:function(){return n}}),Object.defineProperty(this,\"url\",{get:function(){return e}});var g,m=this;function v(t){n!==d.CLOSED&&(n=d.CONNECTING,T(\"error\",new h(\"error\",{message:t})),E&&(e=E,E=null,c=!1),setTimeout(function(){n!==d.CONNECTING||m.connectionInProgress||(m.connectionInProgress=!0,x())},m.reconnectInterval))}m.reconnectInterval=1e3,m.connectionInProgress=!1;var b=\"\";i&&i[\"Last-Event-ID\"]&&(b=i[\"Last-Event-ID\"],delete i[\"Last-Event-ID\"]);var w=!1,S=\"\",A=\"\",E=null;function x(){var y=o(e),S=\"https:\"===y.protocol;if(y.headers={\"Cache-Control\":\"no-cache\",Accept:\"text/event-stream\"},b&&(y.headers[\"Last-Event-ID\"]=b),i){var A=c?function(e){var t={};for(var n in e)p.test(n)||(t[n]=e[n]);return t}(i):i;for(var O in A){var _=A[O];_&&(y.headers[O]=_)}}if(y.rejectUnauthorized=!(t&&!t.rejectUnauthorized),t&&void 0!==t.createConnection&&(y.createConnection=t.createConnection),t&&t.proxy){var I=o(t.proxy);S=\"https:\"===I.protocol,y.protocol=S?\"https:\":\"http:\",y.path=e,y.headers.Host=y.host,y.hostname=I.hostname,y.host=I.host,y.port=I.port}if(t&&t.https)for(var C in t.https)if(-1!==u.indexOf(C)){var B=t.https[C];void 0!==B&&(y[C]=B)}t&&void 0!==t.withCredentials&&(y.withCredentials=t.withCredentials),g=(S?a:s).request(y,function(t){if(m.connectionInProgress=!1,500===t.statusCode||502===t.statusCode||503===t.statusCode||504===t.statusCode)return T(\"error\",new h(\"error\",{status:t.statusCode,message:t.statusMessage})),void v();if(301===t.statusCode||302===t.statusCode||307===t.statusCode){var o=t.headers.location;if(!o)return void T(\"error\",new h(\"error\",{status:t.statusCode,message:t.statusMessage}));var i=new URL(e).origin,a=new URL(o).origin;return c=i!==a,307===t.statusCode&&(E=e),e=o,void process.nextTick(x)}if(200!==t.statusCode)return T(\"error\",new h(\"error\",{status:t.statusCode,message:t.statusMessage})),m.close();var s,u;n=d.OPEN,t.on(\"close\",function(){t.removeAllListeners(\"close\"),t.removeAllListeners(\"end\"),v()}),t.on(\"end\",function(){t.removeAllListeners(\"close\"),t.removeAllListeners(\"end\"),v()}),T(\"open\",new h(\"open\"));var p=0,y=-1,g=0,b=0;t.on(\"data\",function(e){s?(e.length>s.length-b&&((g=2*s.length+e.length)>f&&(g=s.length+e.length+f),u=r.alloc(g),s.copy(u,0,0,b),s=u),e.copy(s,b),b+=e.length):(function(e){return l.every(function(t,n){return e[n]===t})}(s=e)&&(s=s.slice(l.length)),b=s.length);for(var t=0,n=b;t<n;){w&&(10===s[t]&&++t,w=!1);for(var o,i=-1,a=y,c=p;i<0&&c<n;++c)58===(o=s[c])?a<0&&(a=c-t):13===o?(w=!0,i=c-t):10===o&&(i=c-t);if(i<0){p=n-t,y=a;break}p=0,y=-1,k(s,t,a,i),t+=i+1}t===n?(s=void 0,b=0):t>0&&(s=s.slice(t,b),b=s.length)})}),g.on(\"error\",function(e){m.connectionInProgress=!1,v(e.message)}),g.setNoDelay&&g.setNoDelay(!0),g.end()}function T(){m.listeners(arguments[0]).length>0&&m.emit.apply(m,arguments)}function k(t,n,r,o){if(0===o){if(S.length>0){var i=A||\"message\";T(i,new y(i,{data:S.slice(0,-1),lastEventId:b,origin:new URL(e).origin})),S=\"\"}A=void 0}else if(r>0){var a,s=r<0,c=t.slice(n,n+(s?o:r)).toString();n+=a=s?o:32!==t[n+r+1]?r+1:r+2;var u=o-a,l=t.slice(n,n+u).toString();if(\"data\"===c)S+=l+\"\\n\";else if(\"event\"===c)A=l;else if(\"id\"===c)b=l;else if(\"retry\"===c){var f=parseInt(l,10);Number.isNaN(f)||(m.reconnectInterval=f)}}}x(),this._close=function(){n!==d.CLOSED&&(n=d.CLOSED,g.abort&&g.abort(),g.xhr&&g.xhr.abort&&g.xhr.abort())}}function h(e,t){if(Object.defineProperty(this,\"type\",{writable:!1,value:e,enumerable:!0}),t)for(var n in t)t.hasOwnProperty(n)&&Object.defineProperty(this,n,{writable:!1,value:t[n],enumerable:!0})}function y(e,t){for(var n in Object.defineProperty(this,\"type\",{writable:!1,value:e,enumerable:!0}),t)t.hasOwnProperty(n)&&Object.defineProperty(this,n,{writable:!1,value:t[n],enumerable:!0})}e.exports=d,c.inherits(d,i.EventEmitter),d.prototype.constructor=d,[\"open\",\"error\",\"message\"].forEach(function(e){Object.defineProperty(d.prototype,\"on\"+e,{get:function(){var t=this.listeners(e)[0];return t?t._listener?t._listener:t:void 0},set:function(t){this.removeAllListeners(e),this.addEventListener(e,t)}})}),Object.defineProperty(d,\"CONNECTING\",{enumerable:!0,value:0}),Object.defineProperty(d,\"OPEN\",{enumerable:!0,value:1}),Object.defineProperty(d,\"CLOSED\",{enumerable:!0,value:2}),d.prototype.CONNECTING=0,d.prototype.OPEN=1,d.prototype.CLOSED=2,d.prototype.close=function(){this._close()},d.prototype.addEventListener=function(e,t){\"function\"==typeof t&&(t._listener=t,this.on(e,t))},d.prototype.dispatchEvent=function(e){if(!e.type)throw new Error(\"UNSPECIFIED_EVENT_TYPE_ERR\");this.emit(e.type,e.detail)},d.prototype.removeEventListener=function(e,t){\"function\"==typeof t&&(t._listener=void 0,this.removeListener(e,t))}},2682(e,t,n){\"use strict\";var r=n(9600),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){if(!r(t))throw new TypeError(\"iterator must be a function\");var a,s;arguments.length>=3&&(a=n),s=e,\"[object Array]\"===o.call(s)?function(e,t,n){for(var r=0,o=e.length;r<o;r++)i.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,a):\"string\"==typeof e?function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)}(e,t,a):function(e,t,n){for(var r in e)i.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,a)}},9353(e){\"use strict\";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if(\"function\"!=typeof o||\"[object Function]\"!==t.apply(o))throw new TypeError(\"Function.prototype.bind called on incompatible \"+o);for(var i,a=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),s=n(0,o.length-a.length),c=[],u=0;u<s;u++)c[u]=\"$\"+u;if(i=Function(\"binder\",\"return function (\"+function(e){for(var t=\"\",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=\",\");return t}(c)+\"){ return binder.apply(this,arguments); }\")(function(){if(this instanceof i){var t=o.apply(this,r(a,arguments));return Object(t)===t?t:this}return o.apply(e,r(a,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,i.prototype=new l,l.prototype=null}return i}},6743(e,t,n){\"use strict\";var r=n(9353);e.exports=Function.prototype.bind||r},4233(e){\"use strict\";const t=function*(){}.constructor;e.exports=()=>t},453(e,t,n){\"use strict\";var r,o=n(9612),i=n(9383),a=n(1237),s=n(9290),c=n(9538),u=n(8068),l=n(9675),f=n(5345),p=n(1514),d=n(8968),h=n(6188),y=n(8002),g=n(5880),m=n(414),v=n(3093),b=Function,w=function(e){try{return b('\"use strict\"; return ('+e+\").constructor;\")()}catch(e){}},S=n(5795),A=n(655),E=function(){throw new l},x=S?function(){try{return E}catch(e){try{return S(arguments,\"callee\").get}catch(e){return E}}}():E,T=n(4039)(),k=n(3628),O=n(1064),_=n(8648),I=n(1002),C=n(76),B={},P=\"undefined\"!=typeof Uint8Array&&k?k(Uint8Array):r,R={__proto__:null,\"%AggregateError%\":\"undefined\"==typeof AggregateError?r:AggregateError,\"%Array%\":Array,\"%ArrayBuffer%\":\"undefined\"==typeof ArrayBuffer?r:ArrayBuffer,\"%ArrayIteratorPrototype%\":T&&k?k([][Symbol.iterator]()):r,\"%AsyncFromSyncIteratorPrototype%\":r,\"%AsyncFunction%\":B,\"%AsyncGenerator%\":B,\"%AsyncGeneratorFunction%\":B,\"%AsyncIteratorPrototype%\":B,\"%Atomics%\":\"undefined\"==typeof Atomics?r:Atomics,\"%BigInt%\":\"undefined\"==typeof BigInt?r:BigInt,\"%BigInt64Array%\":\"undefined\"==typeof BigInt64Array?r:BigInt64Array,\"%BigUint64Array%\":\"undefined\"==typeof BigUint64Array?r:BigUint64Array,\"%Boolean%\":Boolean,\"%DataView%\":\"undefined\"==typeof DataView?r:DataView,\"%Date%\":Date,\"%decodeURI%\":decodeURI,\"%decodeURIComponent%\":decodeURIComponent,\"%encodeURI%\":encodeURI,\"%encodeURIComponent%\":encodeURIComponent,\"%Error%\":i,\"%eval%\":eval,\"%EvalError%\":a,\"%Float16Array%\":\"undefined\"==typeof Float16Array?r:Float16Array,\"%Float32Array%\":\"undefined\"==typeof Float32Array?r:Float32Array,\"%Float64Array%\":\"undefined\"==typeof Float64Array?r:Float64Array,\"%FinalizationRegistry%\":\"undefined\"==typeof FinalizationRegistry?r:FinalizationRegistry,\"%Function%\":b,\"%GeneratorFunction%\":B,\"%Int8Array%\":\"undefined\"==typeof Int8Array?r:Int8Array,\"%Int16Array%\":\"undefined\"==typeof Int16Array?r:Int16Array,\"%Int32Array%\":\"undefined\"==typeof Int32Array?r:Int32Array,\"%isFinite%\":isFinite,\"%isNaN%\":isNaN,\"%IteratorPrototype%\":T&&k?k(k([][Symbol.iterator]())):r,\"%JSON%\":\"object\"==typeof JSON?JSON:r,\"%Map%\":\"undefined\"==typeof Map?r:Map,\"%MapIteratorPrototype%\":\"undefined\"!=typeof Map&&T&&k?k((new Map)[Symbol.iterator]()):r,\"%Math%\":Math,\"%Number%\":Number,\"%Object%\":o,\"%Object.getOwnPropertyDescriptor%\":S,\"%parseFloat%\":parseFloat,\"%parseInt%\":parseInt,\"%Promise%\":\"undefined\"==typeof Promise?r:Promise,\"%Proxy%\":\"undefined\"==typeof Proxy?r:Proxy,\"%RangeError%\":s,\"%ReferenceError%\":c,\"%Reflect%\":\"undefined\"==typeof Reflect?r:Reflect,\"%RegExp%\":RegExp,\"%Set%\":\"undefined\"==typeof Set?r:Set,\"%SetIteratorPrototype%\":\"undefined\"!=typeof Set&&T&&k?k((new Set)[Symbol.iterator]()):r,\"%SharedArrayBuffer%\":\"undefined\"==typeof SharedArrayBuffer?r:SharedArrayBuffer,\"%String%\":String,\"%StringIteratorPrototype%\":T&&k?k(\"\"[Symbol.iterator]()):r,\"%Symbol%\":T?Symbol:r,\"%SyntaxError%\":u,\"%ThrowTypeError%\":x,\"%TypedArray%\":P,\"%TypeError%\":l,\"%Uint8Array%\":\"undefined\"==typeof Uint8Array?r:Uint8Array,\"%Uint8ClampedArray%\":\"undefined\"==typeof Uint8ClampedArray?r:Uint8ClampedArray,\"%Uint16Array%\":\"undefined\"==typeof Uint16Array?r:Uint16Array,\"%Uint32Array%\":\"undefined\"==typeof Uint32Array?r:Uint32Array,\"%URIError%\":f,\"%WeakMap%\":\"undefined\"==typeof WeakMap?r:WeakMap,\"%WeakRef%\":\"undefined\"==typeof WeakRef?r:WeakRef,\"%WeakSet%\":\"undefined\"==typeof WeakSet?r:WeakSet,\"%Function.prototype.call%\":C,\"%Function.prototype.apply%\":I,\"%Object.defineProperty%\":A,\"%Object.getPrototypeOf%\":O,\"%Math.abs%\":p,\"%Math.floor%\":d,\"%Math.max%\":h,\"%Math.min%\":y,\"%Math.pow%\":g,\"%Math.round%\":m,\"%Math.sign%\":v,\"%Reflect.getPrototypeOf%\":_};if(k)try{null.error}catch(e){var j=k(k(e));R[\"%Error.prototype%\"]=j}var U=function e(t){var n;if(\"%AsyncFunction%\"===t)n=w(\"async function () {}\");else if(\"%GeneratorFunction%\"===t)n=w(\"function* () {}\");else if(\"%AsyncGeneratorFunction%\"===t)n=w(\"async function* () {}\");else if(\"%AsyncGenerator%\"===t){var r=e(\"%AsyncGeneratorFunction%\");r&&(n=r.prototype)}else if(\"%AsyncIteratorPrototype%\"===t){var o=e(\"%AsyncGenerator%\");o&&k&&(n=k(o.prototype))}return R[t]=n,n},F={__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\"]},N=n(6743),L=n(9957),M=N.call(C,Array.prototype.concat),D=N.call(I,Array.prototype.splice),q=N.call(C,String.prototype.replace),V=N.call(C,String.prototype.slice),z=N.call(C,RegExp.prototype.exec),K=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,H=/\\\\(\\\\)?/g,$=function(e,t){var n,r=e;if(L(F,r)&&(r=\"%\"+(n=F[r])[0]+\"%\"),L(R,r)){var o=R[r];if(o===B&&(o=U(r)),void 0===o&&!t)throw new l(\"intrinsic \"+e+\" exists, but is not available. Please file an issue!\");return{alias:n,name:r,value:o}}throw new u(\"intrinsic \"+e+\" does not exist!\")};e.exports=function(e,t){if(\"string\"!=typeof e||0===e.length)throw new l(\"intrinsic name must be a non-empty string\");if(arguments.length>1&&\"boolean\"!=typeof t)throw new l('\"allowMissing\" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,e))throw new u(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");var n=function(e){var t=V(e,0,1),n=V(e,-1);if(\"%\"===t&&\"%\"!==n)throw new u(\"invalid intrinsic syntax, expected closing `%`\");if(\"%\"===n&&\"%\"!==t)throw new u(\"invalid intrinsic syntax, expected opening `%`\");var r=[];return q(e,K,function(e,t,n,o){r[r.length]=n?q(o,H,\"$1\"):t||e}),r}(e),r=n.length>0?n[0]:\"\",o=$(\"%\"+r+\"%\",t),i=o.name,a=o.value,s=!1,c=o.alias;c&&(r=c[0],D(n,M([0,1],c)));for(var f=1,p=!0;f<n.length;f+=1){var d=n[f],h=V(d,0,1),y=V(d,-1);if(('\"'===h||\"'\"===h||\"`\"===h||'\"'===y||\"'\"===y||\"`\"===y)&&h!==y)throw new u(\"property names with quotes must have matching quotes\");if(\"constructor\"!==d&&p||(s=!0),L(R,i=\"%\"+(r+=\".\"+d)+\"%\"))a=R[i];else if(null!=a){if(!(d in a)){if(!t)throw new l(\"base intrinsic for \"+e+\" exists, but the property is not available.\");return}if(S&&f+1>=n.length){var g=S(a,d);a=(p=!!g)&&\"get\"in g&&!(\"originalValue\"in g.get)?g.get:a[d]}else p=L(a,d),a=a[d];p&&!s&&(R[i]=a)}}return a}},1064(e,t,n){\"use strict\";var r=n(9612);e.exports=r.getPrototypeOf||null},8648(e){\"use strict\";e.exports=\"undefined\"!=typeof Reflect&&Reflect.getPrototypeOf||null},3628(e,t,n){\"use strict\";var r=n(8648),o=n(1064),i=n(7176);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||\"object\"!=typeof e&&\"function\"!=typeof e)throw new TypeError(\"getProto: not an object\");return o(e)}:i?function(e){return i(e)}:null},6549(e){\"use strict\";e.exports=Object.getOwnPropertyDescriptor},5795(e,t,n){\"use strict\";var r=n(6549);if(r)try{r([],\"length\")}catch(e){r=null}e.exports=r},592(e,t,n){\"use strict\";var r=n(655),o=function(){return!!r};o.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],\"length\",{value:1}).length}catch(e){return!0}},e.exports=o},4039(e,t,n){\"use strict\";var r=\"undefined\"!=typeof Symbol&&Symbol,o=n(1333);e.exports=function(){return\"function\"==typeof r&&\"function\"==typeof Symbol&&\"symbol\"==typeof r(\"foo\")&&\"symbol\"==typeof Symbol(\"bar\")&&o()}},1333(e){\"use strict\";e.exports=function(){if(\"function\"!=typeof Symbol||\"function\"!=typeof Object.getOwnPropertySymbols)return!1;if(\"symbol\"==typeof Symbol.iterator)return!0;var e={},t=Symbol(\"test\"),n=Object(t);if(\"string\"==typeof t)return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(t))return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if(\"function\"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if(\"function\"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(\"function\"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092(e,t,n){\"use strict\";var r=n(1333);e.exports=function(){return r()&&!!Symbol.toStringTag}},9957(e,t,n){\"use strict\";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(6743);e.exports=i.call(r,o)},1083(e,t,n){var r=n(1568),o=n(8835),i=e.exports;for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a]);function s(e){if(\"string\"==typeof e&&(e=o.parse(e)),e.protocol||(e.protocol=\"https:\"),\"https:\"!==e.protocol)throw new Error('Protocol \"'+e.protocol+'\" not supported. Expected \"https:\"');return e}i.request=function(e,t){return e=s(e),r.request.call(this,e,t)},i.get=function(e,t){return e=s(e),r.get.call(this,e,t)}},251(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<<s)-1,u=c>>1,l=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=u}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<<u)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+d]=255&a,d+=h,a/=256,u-=8);e[n+d-h]|=128*y}},6698(e){\"function\"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},7244(e,t,n){\"use strict\";var r=n(9092)(),o=n(6556)(\"Object.prototype.toString\"),i=function(e){return!(r&&e&&\"object\"==typeof e&&Symbol.toStringTag in e)&&\"[object Arguments]\"===o(e)},a=function(e){return!!i(e)||null!==e&&\"object\"==typeof e&&\"length\"in e&&\"number\"==typeof e.length&&e.length>=0&&\"[object Array]\"!==o(e)&&\"callee\"in e&&\"[object Function]\"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},9600(e){\"use strict\";var t,n,r=Function.prototype.toString,o=\"object\"==typeof Reflect&&null!==Reflect&&Reflect.apply;if(\"function\"==typeof o&&\"function\"==typeof Object.defineProperty)try{t=Object.defineProperty({},\"length\",{get:function(){throw n}}),n={},o(function(){throw 42},null,t)}catch(e){e!==n&&(o=null)}else o=null;var i=/^\\s*class\\b/,a=function(e){try{var t=r.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(r.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,u=\"function\"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if(\"object\"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(e){if((l||!e)&&(void 0===e||\"object\"==typeof e))try{var t=c.call(e);return(\"[object HTMLAllCollection]\"===t||\"[object HTML document.all class]\"===t||\"[object HTMLCollection]\"===t||\"[object Object]\"===t)&&null==e(\"\")}catch(e){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if(\"function\"!=typeof e&&\"object\"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==n)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if(\"function\"!=typeof e&&\"object\"!=typeof e)return!1;if(u)return s(e);if(a(e))return!1;var t=c.call(e);return!(\"[object Function]\"!==t&&\"[object GeneratorFunction]\"!==t&&!/^\\[object HTML/.test(t))&&s(e)}},8184(e,t,n){\"use strict\";var r=n(6556),o=n(9721)(/^\\s*(?:function)?\\*/),i=n(9092)(),a=n(3628),s=r(\"Object.prototype.toString\"),c=r(\"Function.prototype.toString\"),u=n(4233);e.exports=function(e){if(\"function\"!=typeof e)return!1;if(o(c(e)))return!0;if(!i)return\"[object GeneratorFunction]\"===s(e);if(!a)return!1;var t=u();return t&&a(e)===t.prototype}},4035(e,t,n){\"use strict\";var r,o=n(6556),i=n(9092)(),a=n(9957),s=n(5795);if(i){var c=o(\"RegExp.prototype.exec\"),u={},l=function(){throw u},f={toString:l,valueOf:l};\"symbol\"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=l),r=function(e){if(!e||\"object\"!=typeof e)return!1;var t=s(e,\"lastIndex\");if(!t||!a(t,\"value\"))return!1;try{c(e,f)}catch(e){return e===u}}}else{var p=o(\"Object.prototype.toString\");r=function(e){return!(!e||\"object\"!=typeof e&&\"function\"!=typeof e)&&\"[object RegExp]\"===p(e)}}e.exports=r},5680(e,t,n){\"use strict\";var r=n(5767);e.exports=function(e){return!!r(e)}},1514(e){\"use strict\";e.exports=Math.abs},8968(e){\"use strict\";e.exports=Math.floor},4459(e){\"use strict\";e.exports=Number.isNaN||function(e){return e!=e}},6188(e){\"use strict\";e.exports=Math.max},8002(e){\"use strict\";e.exports=Math.min},5880(e){\"use strict\";e.exports=Math.pow},414(e){\"use strict\";e.exports=Math.round},3093(e,t,n){\"use strict\";var r=n(4459);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},8859(e,t,n){var r=\"function\"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,\"size\"):null,i=r&&o&&\"function\"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,s=\"function\"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,\"size\"):null,u=s&&c&&\"function\"==typeof c.get?c.get:null,l=s&&Set.prototype.forEach,f=\"function\"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p=\"function\"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d=\"function\"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,S=String.prototype.toLowerCase,A=RegExp.prototype.test,E=Array.prototype.concat,x=Array.prototype.join,T=Array.prototype.slice,k=Math.floor,O=\"function\"==typeof BigInt?BigInt.prototype.valueOf:null,_=Object.getOwnPropertySymbols,I=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?Symbol.prototype.toString:null,C=\"function\"==typeof Symbol&&\"object\"==typeof Symbol.iterator,B=\"function\"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,R=(\"function\"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function j(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||A.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(\"number\"==typeof e){var r=e<0?-k(-e):k(e);if(r!==e){var o=String(r),i=v.call(t,o.length+1);return b.call(o,n,\"$&_\")+\".\"+b.call(b.call(i,/([0-9]{3})/g,\"$&_\"),/_$/,\"\")}}return b.call(t,n,\"$&_\")}var U=n(2634),F=U.custom,N=H(F)?F:null,L={__proto__:null,double:'\"',single:\"'\"},M={__proto__:null,double:/([\"\\\\])/g,single:/(['\\\\])/g};function D(e,t,n){var r=n.quoteStyle||t,o=L[r];return o+e+o}function q(e){return b.call(String(e),/\"/g,\"&quot;\")}function V(e){return!B||!(\"object\"==typeof e&&(B in e||void 0!==e[B]))}function z(e){return\"[object Array]\"===W(e)&&V(e)}function K(e){return\"[object RegExp]\"===W(e)&&V(e)}function H(e){if(C)return e&&\"object\"==typeof e&&e instanceof Symbol;if(\"symbol\"==typeof e)return!0;if(!e||\"object\"!=typeof e||!I)return!1;try{return I.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,o,s){var c=r||{};if(G(c,\"quoteStyle\")&&!G(L,c.quoteStyle))throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');if(G(c,\"maxStringLength\")&&(\"number\"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');var y=!G(c,\"customInspect\")||c.customInspect;if(\"boolean\"!=typeof y&&\"symbol\"!==y)throw new TypeError(\"option \\\"customInspect\\\", if provided, must be `true`, `false`, or `'symbol'`\");if(G(c,\"indent\")&&null!==c.indent&&\"\\t\"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');if(G(c,\"numericSeparator\")&&\"boolean\"!=typeof c.numericSeparator)throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===t)return\"undefined\";if(null===t)return\"null\";if(\"boolean\"==typeof t)return t?\"true\":\"false\";if(\"string\"==typeof t)return Z(t,c);if(\"number\"==typeof t){if(0===t)return 1/0/t>0?\"0\":\"-0\";var A=String(t);return w?j(t,A):A}if(\"bigint\"==typeof t){var k=String(t)+\"n\";return w?j(t,k):k}var _=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=_&&_>0&&\"object\"==typeof t)return z(t)?\"[Array]\":\"[Object]\";var F=function(e,t){var n;if(\"\\t\"===e.indent)n=\"\\t\";else{if(!(\"number\"==typeof e.indent&&e.indent>0))return null;n=x.call(Array(e.indent+1),\" \")}return{base:n,prev:x.call(Array(t+1),n)}}(c,o);if(void 0===s)s=[];else if(X(s,t)>=0)return\"[Circular]\";function M(t,n,r){if(n&&(s=T.call(s)).push(n),r){var i={depth:c.depth};return G(c,\"quoteStyle\")&&(i.quoteStyle=c.quoteStyle),e(t,i,o+1,s)}return e(t,c,o+1,s)}if(\"function\"==typeof t&&!K(t)){var $=function(e){if(e.name)return e.name;var t=m.call(g.call(e),/^function\\s*([\\w$]+)/);return t?t[1]:null}(t),Y=ne(t,M);return\"[Function\"+($?\": \"+$:\" (anonymous)\")+\"]\"+(Y.length>0?\" { \"+x.call(Y,\", \")+\" }\":\"\")}if(H(t)){var re=C?b.call(String(t),/^(Symbol\\(.*\\))_[^)]*$/,\"$1\"):I.call(t);return\"object\"!=typeof t||C?re:J(re)}if(function(e){return!(!e||\"object\"!=typeof e)&&(\"undefined\"!=typeof HTMLElement&&e instanceof HTMLElement||\"string\"==typeof e.nodeName&&\"function\"==typeof e.getAttribute)}(t)){for(var oe=\"<\"+S.call(String(t.nodeName)),ie=t.attributes||[],ae=0;ae<ie.length;ae++)oe+=\" \"+ie[ae].name+\"=\"+D(q(ie[ae].value),\"double\",c);return oe+=\">\",t.childNodes&&t.childNodes.length&&(oe+=\"...\"),oe+\"</\"+S.call(String(t.nodeName))+\">\"}if(z(t)){if(0===t.length)return\"[]\";var se=ne(t,M);return F&&!function(e){for(var t=0;t<e.length;t++)if(X(e[t],\"\\n\")>=0)return!1;return!0}(se)?\"[\"+te(se,F)+\"]\":\"[ \"+x.call(se,\", \")+\" ]\"}if(function(e){return\"[object Error]\"===W(e)&&V(e)}(t)){var ce=ne(t,M);return\"cause\"in Error.prototype||!(\"cause\"in t)||P.call(t,\"cause\")?0===ce.length?\"[\"+String(t)+\"]\":\"{ [\"+String(t)+\"] \"+x.call(ce,\", \")+\" }\":\"{ [\"+String(t)+\"] \"+x.call(E.call(\"[cause]: \"+M(t.cause),ce),\", \")+\" }\"}if(\"object\"==typeof t&&y){if(N&&\"function\"==typeof t[N]&&U)return U(t,{depth:_-o});if(\"symbol\"!==y&&\"function\"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||\"object\"!=typeof e)return!1;try{i.call(e);try{u.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ue=[];return a&&a.call(t,function(e,n){ue.push(M(n,t,!0)+\" => \"+M(e,t))}),ee(\"Map\",i.call(t),ue,F)}if(function(e){if(!u||!e||\"object\"!=typeof e)return!1;try{u.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var le=[];return l&&l.call(t,function(e){le.push(M(e,t))}),ee(\"Set\",u.call(t),le,F)}if(function(e){if(!f||!e||\"object\"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Q(\"WeakMap\");if(function(e){if(!p||!e||\"object\"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Q(\"WeakSet\");if(function(e){if(!d||!e||\"object\"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return Q(\"WeakRef\");if(function(e){return\"[object Number]\"===W(e)&&V(e)}(t))return J(M(Number(t)));if(function(e){if(!e||\"object\"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}(t))return J(M(O.call(t)));if(function(e){return\"[object Boolean]\"===W(e)&&V(e)}(t))return J(h.call(t));if(function(e){return\"[object String]\"===W(e)&&V(e)}(t))return J(M(String(t)));if(\"undefined\"!=typeof window&&t===window)return\"{ [object Window] }\";if(\"undefined\"!=typeof globalThis&&t===globalThis||void 0!==n.g&&t===n.g)return\"{ [object globalThis] }\";if(!function(e){return\"[object Date]\"===W(e)&&V(e)}(t)&&!K(t)){var fe=ne(t,M),pe=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?\"\":\"null prototype\",he=!pe&&B&&Object(t)===t&&B in t?v.call(W(t),8,-1):de?\"Object\":\"\",ye=(pe||\"function\"!=typeof t.constructor?\"\":t.constructor.name?t.constructor.name+\" \":\"\")+(he||de?\"[\"+x.call(E.call([],he||[],de||[]),\": \")+\"] \":\"\");return 0===fe.length?ye+\"{}\":F?ye+\"{\"+te(fe,F)+\"}\":ye+\"{ \"+x.call(fe,\", \")+\" }\"}return String(t)};var $=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return $.call(e,t)}function W(e){return y.call(e)}function X(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Z(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r=\"... \"+n+\" more character\"+(n>1?\"s\":\"\");return Z(v.call(e,0,t.maxStringLength),t)+r}var o=M[t.quoteStyle||\"single\"];return o.lastIndex=0,D(b.call(b.call(e,o,\"\\\\$1\"),/[\\x00-\\x1f]/g,Y),\"single\",t)}function Y(e){var t=e.charCodeAt(0),n={8:\"b\",9:\"t\",10:\"n\",12:\"f\",13:\"r\"}[t];return n?\"\\\\\"+n:\"\\\\x\"+(t<16?\"0\":\"\")+w.call(t.toString(16))}function J(e){return\"Object(\"+e+\")\"}function Q(e){return e+\" { ? }\"}function ee(e,t,n,r){return e+\" (\"+t+\") {\"+(r?te(n,r):x.call(n,\", \"))+\"}\"}function te(e,t){if(0===e.length)return\"\";var n=\"\\n\"+t.prev+t.base;return n+x.call(e,\",\"+n)+\"\\n\"+t.prev}function ne(e,t){var n=z(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=G(e,o)?t(e[o],e):\"\"}var i,a=\"function\"==typeof _?_(e):[];if(C){i={};for(var s=0;s<a.length;s++)i[\"$\"+a[s]]=a[s]}for(var c in e)G(e,c)&&(n&&String(Number(c))===c&&c<e.length||C&&i[\"$\"+c]instanceof Symbol||(A.call(/[^\\w$]/,c)?r.push(t(c,e)+\": \"+t(e[c],e)):r.push(c+\": \"+t(e[c],e))));if(\"function\"==typeof _)for(var u=0;u<a.length;u++)P.call(e,a[u])&&r.push(\"[\"+t(a[u])+\"]: \"+t(e[a[u]],e));return r}},6578(e){\"use strict\";e.exports=[\"Float16Array\",\"Float32Array\",\"Float64Array\",\"Int8Array\",\"Int16Array\",\"Int32Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"Uint16Array\",\"Uint32Array\",\"BigInt64Array\",\"BigUint64Array\"]},4765(e){\"use strict\";var t=String.prototype.replace,n=/%20/g,r=\"RFC3986\";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,\"+\")},RFC3986:function(e){return String(e)}},RFC1738:\"RFC1738\",RFC3986:r}},5373(e,t,n){\"use strict\";var r=n(8636),o=n(2642),i=n(4765);e.exports={formats:i,parse:o,stringify:r}},2642(e,t,n){\"use strict\";var r=n(7720),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:\"utf-8\",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:\"&\",depth:5,duplicates:\"combine\",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},s=function(e){return e.replace(/&#(\\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},c=function(e,t,n){if(e&&\"string\"==typeof e&&t.comma&&e.indexOf(\",\")>-1)return e.split(\",\");if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError(\"Array limit exceeded. Only \"+t.arrayLimit+\" element\"+(1===t.arrayLimit?\"\":\"s\")+\" allowed in an array.\");return e},u=function(e,t,n,i){if(e){var a=function(e,t){var n=t.allowDots?e.replace(/\\.([^.[]+)/g,\"[$1]\"):e;if(t.depth<=0){if(!t.plainObjects&&o.call(Object.prototype,n)&&!t.allowPrototypes)return;return[n]}var r=/(\\[[^[\\]]*])/g,i=/(\\[[^[\\]]*])/.exec(n),a=i?n.slice(0,i.index):n,s=[];if(a){if(!t.plainObjects&&o.call(Object.prototype,a)&&!t.allowPrototypes)return;s[s.length]=a}for(var c=0;null!==(i=r.exec(n))&&c<t.depth;){c+=1;var u=i[1].slice(1,-1);if(!t.plainObjects&&o.call(Object.prototype,u)&&!t.allowPrototypes)return;s[s.length]=i[1]}if(i){if(!0===t.strictDepth)throw new RangeError(\"Input depth exceeded depth option of \"+t.depth+\" and strictDepth is true\");s[s.length]=\"[\"+n.slice(i.index)+\"]\"}return s}(e,n);if(a)return function(e,t,n,o){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 s=o?t:c(t,n,i),u=e.length-1;u>=0;--u){var l,f=e[u];if(\"[]\"===f&&n.parseArrays)l=r.isOverflow(s)?s:n.allowEmptyArrays&&(\"\"===s||n.strictNullHandling&&null===s)?[]:r.combine([],s,n.arrayLimit,n.plainObjects);else{l=n.plainObjects?{__proto__:null}:{};var p=\"[\"===f.charAt(0)&&\"]\"===f.charAt(f.length-1)?f.slice(1,-1):f,d=n.decodeDotInKeys?p.replace(/%2E/g,\".\"):p,h=parseInt(d,10),y=!isNaN(h)&&f!==d&&String(h)===d&&h>=0&&n.parseArrays;if(n.parseArrays||\"\"!==d)if(y&&h<n.arrayLimit)(l=[])[h]=s;else{if(y&&n.throwOnLimitExceeded)throw new RangeError(\"Array limit exceeded. Only \"+n.arrayLimit+\" element\"+(1===n.arrayLimit?\"\":\"s\")+\" allowed in an array.\");y?(l[h]=s,r.markOverflow(l,h)):\"__proto__\"!==d&&(l[d]=s)}else l={0:s}}s=l}return s}(a,t,n,i)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(void 0!==e.allowEmptyArrays&&\"boolean\"!=typeof e.allowEmptyArrays)throw new TypeError(\"`allowEmptyArrays` option can only be `true` or `false`, when provided\");if(void 0!==e.decodeDotInKeys&&\"boolean\"!=typeof e.decodeDotInKeys)throw new TypeError(\"`decodeDotInKeys` option can only be `true` or `false`, when provided\");if(null!==e.decoder&&void 0!==e.decoder&&\"function\"!=typeof e.decoder)throw new TypeError(\"Decoder has to be a function.\");if(void 0!==e.charset&&\"utf-8\"!==e.charset&&\"iso-8859-1\"!==e.charset)throw new TypeError(\"The charset option must be either utf-8, iso-8859-1, or undefined\");if(void 0!==e.throwOnLimitExceeded&&\"boolean\"!=typeof e.throwOnLimitExceeded)throw new TypeError(\"`throwOnLimitExceeded` option must be a boolean\");var t=void 0===e.charset?a.charset:e.charset,n=void 0===e.duplicates?a.duplicates:e.duplicates;if(\"combine\"!==n&&\"first\"!==n&&\"last\"!==n)throw new TypeError(\"The duplicates option must be either combine, first, or last\");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||a.allowDots:!!e.allowDots,allowEmptyArrays:\"boolean\"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:\"boolean\"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:\"boolean\"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:\"number\"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:\"boolean\"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:\"boolean\"==typeof e.comma?e.comma:a.comma,decodeDotInKeys:\"boolean\"==typeof e.decodeDotInKeys?e.decodeDotInKeys:a.decodeDotInKeys,decoder:\"function\"==typeof e.decoder?e.decoder:a.decoder,delimiter:\"string\"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:\"number\"==typeof e.depth||!1===e.depth?+e.depth:a.depth,duplicates:n,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:\"boolean\"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:\"number\"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:\"boolean\"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictDepth:\"boolean\"==typeof e.strictDepth?!!e.strictDepth:a.strictDepth,strictMerge:\"boolean\"==typeof e.strictMerge?!!e.strictMerge:a.strictMerge,strictNullHandling:\"boolean\"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:\"boolean\"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(\"\"===e||null==e)return n.plainObjects?{__proto__:null}:{};for(var l=\"string\"==typeof e?function(e,t){var n={__proto__:null},u=t.ignoreQueryPrefix?e.replace(/^\\?/,\"\"):e;u=u.replace(/%5B/gi,\"[\").replace(/%5D/gi,\"]\");var l=t.parameterLimit===1/0?void 0:t.parameterLimit,f=u.split(t.delimiter,t.throwOnLimitExceeded?l+1:l);if(t.throwOnLimitExceeded&&f.length>l)throw new RangeError(\"Parameter limit exceeded. Only \"+l+\" parameter\"+(1===l?\"\":\"s\")+\" allowed.\");var p,d=-1,h=t.charset;if(t.charsetSentinel)for(p=0;p<f.length;++p)0===f[p].indexOf(\"utf8=\")&&(\"utf8=%E2%9C%93\"===f[p]?h=\"utf-8\":\"utf8=%26%2310003%3B\"===f[p]&&(h=\"iso-8859-1\"),d=p,p=f.length);for(p=0;p<f.length;++p)if(p!==d){var y,g,m=f[p],v=m.indexOf(\"]=\"),b=-1===v?m.indexOf(\"=\"):v+1;if(-1===b?(y=t.decoder(m,a.decoder,h,\"key\"),g=t.strictNullHandling?null:\"\"):null!==(y=t.decoder(m.slice(0,b),a.decoder,h,\"key\"))&&(g=r.maybeMap(c(m.slice(b+1),t,i(n[y])?n[y].length:0),function(e){return t.decoder(e,a.decoder,h,\"value\")})),g&&t.interpretNumericEntities&&\"iso-8859-1\"===h&&(g=s(String(g))),m.indexOf(\"[]=\")>-1&&(g=i(g)?[g]:g),t.comma&&i(g)&&g.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError(\"Array limit exceeded. Only \"+t.arrayLimit+\" element\"+(1===t.arrayLimit?\"\":\"s\")+\" allowed in an array.\");g=r.combine([],g,t.arrayLimit,t.plainObjects)}if(null!==y){var w=o.call(n,y);w&&(\"combine\"===t.duplicates||m.indexOf(\"[]=\")>-1)?n[y]=r.combine(n[y],g,t.arrayLimit,t.plainObjects):w&&\"last\"!==t.duplicates||(n[y]=g)}}return n}(e,n):e,f=n.plainObjects?{__proto__:null}:{},p=Object.keys(l),d=0;d<p.length;++d){var h=p[d],y=u(h,l[h],n,\"string\"==typeof e);f=r.merge(f,y,n)}return!0===n.allowSparse?f:r.compact(f)}},8636(e,t,n){\"use strict\";var r=n(920),o=n(7720),i=n(4765),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+\"[]\"},comma:\"comma\",indices:function(e,t){return e+\"[\"+t+\"]\"},repeat:function(e){return e}},c=Array.isArray,u=Array.prototype.push,l=function(e,t){u.apply(e,c(t)?t:[t])},f=Date.prototype.toISOString,p=i.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:\"indices\",charset:\"utf-8\",charsetSentinel:!1,commaRoundTrip:!1,delimiter:\"&\",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},h={},y=function e(t,n,i,a,s,u,f,p,y,g,m,v,b,w,S,A,E,x){for(var T,k=t,O=x,_=0,I=!1;void 0!==(O=O.get(h))&&!I;){var C=O.get(t);if(_+=1,void 0!==C){if(C===_)throw new RangeError(\"Cyclic object value\");I=!0}void 0===O.get(h)&&(_=0)}if(\"function\"==typeof g?k=g(n,k):k instanceof Date?k=b(k):\"comma\"===i&&c(k)&&(k=o.maybeMap(k,function(e){return e instanceof Date?b(e):e})),null===k){if(u)return y&&!A?y(n,d.encoder,E,\"key\",w):n;k=\"\"}if(\"string\"==typeof(T=k)||\"number\"==typeof T||\"boolean\"==typeof T||\"symbol\"==typeof T||\"bigint\"==typeof T||o.isBuffer(k))return y?[S(A?n:y(n,d.encoder,E,\"key\",w))+\"=\"+S(y(k,d.encoder,E,\"value\",w))]:[S(n)+\"=\"+S(String(k))];var B,P=[];if(void 0===k)return P;if(\"comma\"===i&&c(k))A&&y&&(k=o.maybeMap(k,y)),B=[{value:k.length>0?k.join(\",\")||null:void 0}];else if(c(g))B=g;else{var R=Object.keys(k);B=m?R.sort(m):R}var j=p?String(n).replace(/\\./g,\"%2E\"):String(n),U=a&&c(k)&&1===k.length?j+\"[]\":j;if(s&&c(k)&&0===k.length)return U+\"[]\";for(var F=0;F<B.length;++F){var N=B[F],L=\"object\"==typeof N&&N&&void 0!==N.value?N.value:k[N];if(!f||null!==L){var M=v&&p?String(N).replace(/\\./g,\"%2E\"):String(N),D=c(k)?\"function\"==typeof i?i(U,M):U:U+(v?\".\"+M:\"[\"+M+\"]\");x.set(t,_);var q=r();q.set(h,x),l(P,e(L,D,i,a,s,u,f,p,\"comma\"===i&&A&&c(k)?null:y,g,m,v,b,w,S,A,E,q))}}return P};e.exports=function(e,t){var n,o=e,u=function(e){if(!e)return d;if(void 0!==e.allowEmptyArrays&&\"boolean\"!=typeof e.allowEmptyArrays)throw new TypeError(\"`allowEmptyArrays` option can only be `true` or `false`, when provided\");if(void 0!==e.encodeDotInKeys&&\"boolean\"!=typeof e.encodeDotInKeys)throw new TypeError(\"`encodeDotInKeys` option can only be `true` or `false`, when provided\");if(null!==e.encoder&&void 0!==e.encoder&&\"function\"!=typeof e.encoder)throw new TypeError(\"Encoder has to be a function.\");var t=e.charset||d.charset;if(void 0!==e.charset&&\"utf-8\"!==e.charset&&\"iso-8859-1\"!==e.charset)throw new TypeError(\"The charset option must be either utf-8, iso-8859-1, or undefined\");var n=i.default;if(void 0!==e.format){if(!a.call(i.formatters,e.format))throw new TypeError(\"Unknown format option provided.\");n=e.format}var r,o=i.formatters[n],u=d.filter;if((\"function\"==typeof e.filter||c(e.filter))&&(u=e.filter),r=e.arrayFormat in s?e.arrayFormat:\"indices\"in e?e.indices?\"indices\":\"repeat\":d.arrayFormat,\"commaRoundTrip\"in e&&\"boolean\"!=typeof e.commaRoundTrip)throw new TypeError(\"`commaRoundTrip` must be a boolean, or absent\");var l=void 0===e.allowDots?!0===e.encodeDotInKeys||d.allowDots:!!e.allowDots;return{addQueryPrefix:\"boolean\"==typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:l,allowEmptyArrays:\"boolean\"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:r,charset:t,charsetSentinel:\"boolean\"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?d.delimiter:e.delimiter,encode:\"boolean\"==typeof e.encode?e.encode:d.encode,encodeDotInKeys:\"boolean\"==typeof e.encodeDotInKeys?e.encodeDotInKeys:d.encodeDotInKeys,encoder:\"function\"==typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:\"boolean\"==typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:u,format:n,formatter:o,serializeDate:\"function\"==typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:\"boolean\"==typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:\"function\"==typeof e.sort?e.sort:null,strictNullHandling:\"boolean\"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}}(t);\"function\"==typeof u.filter?o=(0,u.filter)(\"\",o):c(u.filter)&&(n=u.filter);var f=[];if(\"object\"!=typeof o||null===o)return\"\";var p=s[u.arrayFormat],h=\"comma\"===p&&u.commaRoundTrip;n||(n=Object.keys(o)),u.sort&&n.sort(u.sort);for(var g=r(),m=0;m<n.length;++m){var v=n[m],b=o[v];u.skipNulls&&null===b||l(f,y(b,v,p,h,u.allowEmptyArrays,u.strictNullHandling,u.skipNulls,u.encodeDotInKeys,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset,g))}var w=f.join(u.delimiter),S=!0===u.addQueryPrefix?\"?\":\"\";return u.charsetSentinel&&(\"iso-8859-1\"===u.charset?S+=\"utf8=%26%2310003%3B&\":S+=\"utf8=%E2%9C%93&\"),w.length>0?S+w:\"\"}},7720(e,t,n){\"use strict\";var r=n(4765),o=n(920),i=Object.prototype.hasOwnProperty,a=Array.isArray,s=o(),c=function(e,t){return s.set(e,t),e},u=function(e){return s.has(e)},l=function(e){return s.get(e)},f=function(e,t){s.set(e,t)},p=function(){for(var e=[],t=0;t<256;++t)e[e.length]=\"%\"+((t<16?\"0\":\"\")+t.toString(16)).toUpperCase();return e}(),d=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},h=1024;e.exports={arrayToObject:d,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t,n,r){if(u(e)){var o=l(e)+1;return e[o]=t,f(e,o),e}var i=[].concat(e,t);return i.length>n?c(d(i,{plainObjects:r}),i.length-1):i},compact:function(e){for(var t=[{obj:{o:e},prop:\"o\"}],n=[],r=0;r<t.length;++r)for(var o=t[r],i=o.obj[o.prop],s=Object.keys(i),c=0;c<s.length;++c){var u=s[c],l=i[u];\"object\"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t[t.length]={obj:i,prop:u},n[n.length]=l)}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(a(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&(r[r.length]=n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\\+/g,\" \");if(\"iso-8859-1\"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var a=e;if(\"symbol\"==typeof e?a=Symbol.prototype.toString.call(e):\"string\"!=typeof e&&(a=String(e)),\"iso-8859-1\"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return\"%26%23\"+parseInt(e.slice(2),16)+\"%3B\"});for(var s=\"\",c=0;c<a.length;c+=h){for(var u=a.length>=h?a.slice(c,c+h):a,l=[],f=0;f<u.length;++f){var d=u.charCodeAt(f);45===d||46===d||95===d||126===d||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===r.RFC1738&&(40===d||41===d)?l[l.length]=u.charAt(f):d<128?l[l.length]=p[d]:d<2048?l[l.length]=p[192|d>>6]+p[128|63&d]:d<55296||d>=57344?l[l.length]=p[224|d>>12]+p[128|d>>6&63]+p[128|63&d]:(f+=1,d=65536+((1023&d)<<10|1023&u.charCodeAt(f)),l[l.length]=p[240|d>>18]+p[128|d>>12&63]+p[128|d>>6&63]+p[128|63&d])}s+=l.join(\"\")}return s},isBuffer:function(e){return!(!e||\"object\"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isOverflow:u,isRegExp:function(e){return\"[object RegExp]\"===Object.prototype.toString.call(e)},markOverflow:c,maybeMap:function(e,t){if(a(e)){for(var n=[],r=0;r<e.length;r+=1)n[n.length]=t(e[r]);return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if(\"object\"!=typeof n&&\"function\"!=typeof n){if(a(t)){var o=t.length;if(r&&\"number\"==typeof r.arrayLimit&&o>r.arrayLimit)return c(d(t.concat(n),r),o);t[o]=n}else{if(!t||\"object\"!=typeof t)return[t,n];if(u(t)){var s=l(t)+1;t[s]=n,f(t,s)}else{if(r&&r.strictMerge)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!i.call(Object.prototype,n))&&(t[n]=!0)}}return t}if(!t||\"object\"!=typeof t){if(u(n)){for(var p=Object.keys(n),h=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},y=0;y<p.length;y++)h[parseInt(p[y],10)+1]=n[p[y]];return c(h,l(n)+1)}var g=[t].concat(n);return r&&\"number\"==typeof r.arrayLimit&&g.length>r.arrayLimit?c(d(g,r),g.length-1):g}var m=t;return a(t)&&!a(n)&&(m=d(t,r)),a(t)&&a(n)?(n.forEach(function(n,o){if(i.call(t,o)){var a=t[o];a&&\"object\"==typeof a&&n&&\"object\"==typeof n?t[o]=e(a,n,r):t[t.length]=n}else t[o]=n}),t):Object.keys(n).reduce(function(t,o){var a=n[o];if(i.call(t,o)?t[o]=e(t[o],a,r):t[o]=a,u(n)&&!u(t)&&c(t,l(n)),u(t)){var s=parseInt(o,10);String(s)===o&&s>=0&&s>l(t)&&f(t,s)}return t},m)}}},3209(e,t,n){\"use strict\";var r=65536,o=n(2861).Buffer,i=n.g.crypto||n.g.msCrypto;i&&i.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError(\"requested too many random bytes\");var n=o.allocUnsafe(e);if(e>0)if(e>r)for(var a=0;a<e;a+=r)i.getRandomValues(n.slice(a,a+r));else i.getRandomValues(n);return\"function\"==typeof t?process.nextTick(function(){t(null,n)}):n}:e.exports=function(){throw new Error(\"Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11\")}},2861(e,t,n){var r=n(8287),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,n){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return o(e,t,n)},a.alloc=function(e,t,n){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var r=o(e);return void 0!==t?\"string\"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return o(e)},a.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return r.SlowBuffer(e)}},9721(e,t,n){\"use strict\";var r=n(6556),o=n(4035),i=r(\"RegExp.prototype.exec\"),a=n(9675);e.exports=function(e){if(!o(e))throw new a(\"`regex` must be a RegExp\");return function(t){return null!==i(e,t)}}},6897(e,t,n){\"use strict\";var r=n(453),o=n(41),i=n(592)(),a=n(5795),s=n(9675),c=r(\"%Math.floor%\");e.exports=function(e,t){if(\"function\"!=typeof e)throw new s(\"`fn` is not a function\");if(\"number\"!=typeof t||t<0||t>4294967295||c(t)!==t)throw new s(\"`length` must be a positive 32-bit integer\");var n=arguments.length>2&&!!arguments[2],r=!0,u=!0;if(\"length\"in e&&a){var l=a(e,\"length\");l&&!l.configurable&&(r=!1),l&&!l.writable&&(u=!1)}return(r||u||!n)&&(i?o(e,\"length\",t,!0,!0):o(e,\"length\",t)),e}},4803(e,t,n){\"use strict\";var r=n(8859),o=n(9675),i=function(e,t,n){for(var r,o=e;null!=(r=o.next);o=r)if(r.key===t)return o.next=r.next,n||(r.next=e.next,e.next=r),r};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o(\"Side channel does not contain \"+r(e))},delete:function(t){var n=e&&e.next,r=function(e,t){if(e)return i(e,t,!0)}(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return function(e,t){if(e){var n=i(e,t);return n&&n.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!i(e,t)}(e,t)},set:function(t,n){e||(e={next:void 0}),function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(e,t,n)}};return t}},507(e,t,n){\"use strict\";var r=n(453),o=n(6556),i=n(8859),a=n(9675),s=r(\"%Map%\",!0),c=o(\"Map.prototype.get\",!0),u=o(\"Map.prototype.set\",!0),l=o(\"Map.prototype.has\",!0),f=o(\"Map.prototype.delete\",!0),p=o(\"Map.prototype.size\",!0);e.exports=!!s&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a(\"Side channel does not contain \"+i(e))},delete:function(t){if(e){var n=f(e,t);return 0===p(e)&&(e=void 0),n}return!1},get:function(t){if(e)return c(e,t)},has:function(t){return!!e&&l(e,t)},set:function(t,n){e||(e=new s),u(e,t,n)}};return t}},2271(e,t,n){\"use strict\";var r=n(453),o=n(6556),i=n(8859),a=n(507),s=n(9675),c=r(\"%WeakMap%\",!0),u=o(\"WeakMap.prototype.get\",!0),l=o(\"WeakMap.prototype.set\",!0),f=o(\"WeakMap.prototype.has\",!0),p=o(\"WeakMap.prototype.delete\",!0);e.exports=c?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new s(\"Side channel does not contain \"+i(e))},delete:function(n){if(c&&n&&(\"object\"==typeof n||\"function\"==typeof n)){if(e)return p(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return c&&n&&(\"object\"==typeof n||\"function\"==typeof n)&&e?u(e,n):t&&t.get(n)},has:function(n){return c&&n&&(\"object\"==typeof n||\"function\"==typeof n)&&e?f(e,n):!!t&&t.has(n)},set:function(n,r){c&&n&&(\"object\"==typeof n||\"function\"==typeof n)?(e||(e=new c),l(e,n,r)):a&&(t||(t=a()),t.set(n,r))}};return n}:a},920(e,t,n){\"use strict\";var r=n(9675),o=n(8859),i=n(4803),a=n(507),s=n(2271)||a||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r(\"Side channel does not contain \"+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||(e=s()),e.set(t,n)}};return t}},1568(e,t,n){var r=n(5537),o=n(6917),i=n(7510),a=n(6866),s=n(8835),c=t;c.request=function(e,t){e=\"string\"==typeof e?s.parse(e):i(e);var o=-1===n.g.location.protocol.search(/^https?:$/)?\"http:\":\"\",a=e.protocol||o,c=e.hostname||e.host,u=e.port,l=e.path||\"/\";c&&-1!==c.indexOf(\":\")&&(c=\"[\"+c+\"]\"),e.url=(c?a+\"//\"+c:\"\")+(u?\":\"+u:\"\")+l,e.method=(e.method||\"GET\").toUpperCase(),e.headers=e.headers||{};var f=new r(e);return t&&f.on(\"response\",t),f},c.get=function(e,t){var n=c.request(e,t);return n.end(),n},c.ClientRequest=r,c.IncomingMessage=o.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=a,c.METHODS=[\"CHECKOUT\",\"CONNECT\",\"COPY\",\"DELETE\",\"GET\",\"HEAD\",\"LOCK\",\"M-SEARCH\",\"MERGE\",\"MKACTIVITY\",\"MKCOL\",\"MOVE\",\"NOTIFY\",\"OPTIONS\",\"PATCH\",\"POST\",\"PROPFIND\",\"PROPPATCH\",\"PURGE\",\"PUT\",\"REPORT\",\"SEARCH\",\"SUBSCRIBE\",\"TRACE\",\"UNLOCK\",\"UNSUBSCRIBE\"]},6688(e,t,n){var r;function o(){if(void 0!==r)return r;if(n.g.XMLHttpRequest){r=new n.g.XMLHttpRequest;try{r.open(\"GET\",n.g.XDomainRequest?\"/\":\"https://example.com\")}catch(e){r=null}}else r=null;return r}function i(e){var t=o();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return\"function\"==typeof e}t.fetch=a(n.g.fetch)&&a(n.g.ReadableStream),t.writableStream=a(n.g.WritableStream),t.abortController=a(n.g.AbortController),t.arraybuffer=t.fetch||i(\"arraybuffer\"),t.msstream=!t.fetch&&i(\"ms-stream\"),t.mozchunkedarraybuffer=!t.fetch&&i(\"moz-chunked-arraybuffer\"),t.overrideMimeType=t.fetch||!!o()&&a(o().overrideMimeType),r=null},5537(e,t,n){var r=n(8287).Buffer,o=n(6688),i=n(6698),a=n(6917),s=n(3242),c=a.IncomingMessage,u=a.readyStates,l=e.exports=function(e){var t,n=this;s.Writable.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader(\"Authorization\",\"Basic \"+r.from(e.auth).toString(\"base64\")),Object.keys(e.headers).forEach(function(t){n.setHeader(t,e.headers[t])});var i=!0;if(\"disable-fetch\"===e.mode||\"requestTimeout\"in e&&!o.abortController)i=!1,t=!0;else if(\"prefer-streaming\"===e.mode)t=!1;else if(\"allow-wrong-content-type\"===e.mode)t=!o.overrideMimeType;else{if(e.mode&&\"default\"!==e.mode&&\"prefer-fast\"!==e.mode)throw new Error(\"Invalid value for opts.mode\");t=!0}n._mode=function(e,t){return o.fetch&&t?\"fetch\":o.mozchunkedarraybuffer?\"moz-chunked-arraybuffer\":o.msstream?\"ms-stream\":o.arraybuffer&&e?\"arraybuffer\":\"text\"}(t,i),n._fetchTimer=null,n._socketTimeout=null,n._socketTimer=null,n.on(\"finish\",function(){n._onFinish()})};i(l,s.Writable),l.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===f.indexOf(n)&&(this._headers[n]={name:e,value:t})},l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},l.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},l.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;\"timeout\"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var r=e._headers,i=null;\"GET\"!==t.method&&\"HEAD\"!==t.method&&(i=new Blob(e._body,{type:(r[\"content-type\"]||{}).value||\"\"}));var a=[];if(Object.keys(r).forEach(function(e){var t=r[e].name,n=r[e].value;Array.isArray(n)?n.forEach(function(e){a.push([t,e])}):a.push([t,n])}),\"fetch\"===e._mode){var s=null;if(o.abortController){var c=new AbortController;s=c.signal,e._fetchAbortController=c,\"requestTimeout\"in t&&0!==t.requestTimeout&&(e._fetchTimer=n.g.setTimeout(function(){e.emit(\"requestTimeout\"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}n.g.fetch(e._opts.url,{method:e._opts.method,headers:a,body:i||void 0,mode:\"cors\",credentials:t.withCredentials?\"include\":\"same-origin\",signal:s}).then(function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()},function(t){e._resetTimers(!0),e._destroyed||e.emit(\"error\",t)})}else{var l=e._xhr=new n.g.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){return void process.nextTick(function(){e.emit(\"error\",t)})}\"responseType\"in l&&(l.responseType=e._mode),\"withCredentials\"in l&&(l.withCredentials=!!t.withCredentials),\"text\"===e._mode&&\"overrideMimeType\"in l&&l.overrideMimeType(\"text/plain; charset=x-user-defined\"),\"requestTimeout\"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit(\"requestTimeout\")}),a.forEach(function(e){l.setRequestHeader(e[0],e[1])}),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case u.LOADING:case u.DONE:e._onXHRProgress()}},\"moz-chunked-arraybuffer\"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit(\"error\",new Error(\"XHR error\")))};try{l.send(i)}catch(t){return void process.nextTick(function(){e.emit(\"error\",t)})}}}},l.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},l.prototype._connect=function(){var e=this;e._destroyed||(e._response=new c(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))},l.prototype._write=function(e,t,n){this._body.push(e),n()},l.prototype._resetTimers=function(e){var t=this;n.g.clearTimeout(t._socketTimer),t._socketTimer=null,e?(n.g.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=n.g.setTimeout(function(){t.emit(\"timeout\")},t._socketTimeout))},l.prototype.abort=l.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)},l.prototype.end=function(e,t,n){\"function\"==typeof e&&(n=e,e=void 0),s.Writable.prototype.end.call(this,e,t,n)},l.prototype.setTimeout=function(e,t){var n=this;t&&n.once(\"timeout\",t),n._socketTimeout=e,n._resetTimers(!1)},l.prototype.flushHeaders=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var f=[\"accept-charset\",\"accept-encoding\",\"access-control-request-headers\",\"access-control-request-method\",\"connection\",\"content-length\",\"cookie\",\"cookie2\",\"date\",\"dnt\",\"expect\",\"host\",\"keep-alive\",\"origin\",\"referer\",\"te\",\"trailer\",\"transfer-encoding\",\"upgrade\",\"via\"]},6917(e,t,n){var r=n(8287).Buffer,o=n(6688),i=n(6698),a=n(3242),s=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(e,t,n,i){var s=this;if(a.Readable.call(s),s._mode=n,s.headers={},s.rawHeaders=[],s.trailers={},s.rawTrailers=[],s.on(\"end\",function(){process.nextTick(function(){s.emit(\"close\")})}),\"fetch\"===n){if(s._fetchResponse=t,s.url=t.url,s.statusCode=t.status,s.statusMessage=t.statusText,t.headers.forEach(function(e,t){s.headers[t.toLowerCase()]=e,s.rawHeaders.push(t,e)}),o.writableStream){var c=new WritableStream({write:function(e){return i(!1),new Promise(function(t,n){s._destroyed?n():s.push(r.from(e))?t():s._resumeFetch=t})},close:function(){i(!0),s._destroyed||s.push(null)},abort:function(e){i(!0),s._destroyed||s.emit(\"error\",e)}});try{return void t.body.pipeTo(c).catch(function(e){i(!0),s._destroyed||s.emit(\"error\",e)})}catch(e){}}var u=t.body.getReader();!function e(){u.read().then(function(t){s._destroyed||(i(t.done),t.done?s.push(null):(s.push(r.from(t.value)),e()))}).catch(function(e){i(!0),s._destroyed||s.emit(\"error\",e)})}()}else if(s._xhr=e,s._pos=0,s.url=e.responseURL,s.statusCode=e.status,s.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\\r?\\n/).forEach(function(e){var t=e.match(/^([^:]+):\\s*(.*)/);if(t){var n=t[1].toLowerCase();\"set-cookie\"===n?(void 0===s.headers[n]&&(s.headers[n]=[]),s.headers[n].push(t[2])):void 0!==s.headers[n]?s.headers[n]+=\", \"+t[2]:s.headers[n]=t[2],s.rawHeaders.push(t[1],t[2])}}),s._charset=\"x-user-defined\",!o.overrideMimeType){var l=s.rawHeaders[\"mime-type\"];if(l){var f=l.match(/;\\s*charset=([^;])(;|$)/);f&&(s._charset=f[1].toLowerCase())}s._charset||(s._charset=\"utf-8\")}};i(c,a.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(e){var t=this,o=t._xhr,i=null;switch(t._mode){case\"text\":if((i=o.responseText).length>t._pos){var a=i.substr(t._pos);if(\"x-user-defined\"===t._charset){for(var c=r.alloc(a.length),u=0;u<a.length;u++)c[u]=255&a.charCodeAt(u);t.push(c)}else t.push(a,t._charset);t._pos=i.length}break;case\"arraybuffer\":if(o.readyState!==s.DONE||!o.response)break;i=o.response,t.push(r.from(new Uint8Array(i)));break;case\"moz-chunked-arraybuffer\":if(i=o.response,o.readyState!==s.LOADING||!i)break;t.push(r.from(new Uint8Array(i)));break;case\"ms-stream\":if(i=o.response,o.readyState!==s.LOADING)break;var l=new n.g.MSStreamReader;l.onprogress=function(){l.result.byteLength>t._pos&&(t.push(r.from(new Uint8Array(l.result.slice(t._pos)))),t._pos=l.result.byteLength)},l.onload=function(){e(!0),t.push(null)},l.readAsArrayBuffer(i)}t._xhr.readyState===s.DONE&&\"ms-stream\"!==t._mode&&(e(!0),t.push(null))}},3157(e){\"use strict\";var t={};function n(e,n,r){r||(r=Error);var o=function(e){var t,r;function o(t,r,o){return e.call(this,function(e,t,r){return\"string\"==typeof n?n:n(e,t,r)}(t,r,o))||this}return r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,o}(r);o.prototype.name=r.name,o.prototype.code=e,t[e]=o}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?\"one of \".concat(t,\" \").concat(e.slice(0,n-1).join(\", \"),\", or \")+e[n-1]:2===n?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}n(\"ERR_INVALID_OPT_VALUE\",function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'},TypeError),n(\"ERR_INVALID_ARG_TYPE\",function(e,t,n){var o,i,a;if(\"string\"==typeof t&&(i=\"not \",t.substr(0,4)===i)?(o=\"must not be\",t=t.replace(/^not /,\"\")):o=\"must be\",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e,\" argument\"))a=\"The \".concat(e,\" \").concat(o,\" \").concat(r(t,\"type\"));else{var s=function(e,t,n){return\"number\"!=typeof n&&(n=0),!(n+1>e.length)&&-1!==e.indexOf(\".\",n)}(e)?\"property\":\"argument\";a='The \"'.concat(e,'\" ').concat(s,\" \").concat(o,\" \").concat(r(t,\"type\"))}return a+\". Received type \".concat(typeof n)},TypeError),n(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),n(\"ERR_METHOD_NOT_IMPLEMENTED\",function(e){return\"The \"+e+\" method is not implemented\"}),n(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),n(\"ERR_STREAM_DESTROYED\",function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"}),n(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),n(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),n(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),n(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),n(\"ERR_UNKNOWN_ENCODING\",function(e){return\"Unknown encoding: \"+e},TypeError),n(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),e.exports.F=t},3527(e,t,n){\"use strict\";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var o=n(2341),i=n(9573);n(6698)(u,o);for(var a=r(i.prototype),s=0;s<a.length;s++){var c=a[s];u.prototype[c]||(u.prototype[c]=i.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);o.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",l)))}function l(){this._writableState.ended||process.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,\"destroyed\",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2571(e,t,n){\"use strict\";e.exports=o;var r=n(5689);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}n(6698)(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},2341(e,t,n){\"use strict\";var r;e.exports=x,x.ReadableState=E,n(7007).EventEmitter;var o,i=function(e,t){return e.listeners(t).length},a=n(1914),s=n(8287).Buffer,c=(void 0!==n.g?n.g:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){},u=n(6833);o=u&&u.debuglog?u.debuglog(\"stream\"):function(){};var l,f,p,d=n(272),h=n(6057),y=n(1922).getHighWaterMark,g=n(3157).F,m=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,b=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(6698)(x,a);var S=h.errorOrDestroy,A=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function E(e,t,o){r=r||n(3527),e=e||{},\"boolean\"!=typeof o&&(o=t instanceof r),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,\"readableHighWaterMark\",o),this.buffer=new d,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=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(3141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function x(e){if(r=r||n(3527),!(this instanceof x))return new x(e);var t=this instanceof r;this._readableState=new E(e,this,t),this.readable=!0,e&&(\"function\"==typeof e.read&&(this._read=e.read),\"function\"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function T(e,t,n,r,i){o(\"readableAddChunk\",t);var a,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(o(\"onEofChunk\"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?I(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}}(e,u);else if(i||(a=function(e,t){var n,r;return r=t,s.isBuffer(r)||r instanceof c||\"string\"==typeof t||void 0===t||e.objectMode||(n=new m(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],t)),n}(u,t)),a)S(e,a);else if(u.objectMode||t&&t.length>0)if(\"string\"==typeof t||u.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)u.endEmitted?S(e,new w):k(e,u,t,!0);else if(u.ended)S(e,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?k(e,u,t,!1):B(e,u)):k(e,u,t,!1)}else r||(u.reading=!1,B(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function k(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit(\"data\",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&I(e)),B(e,t)}Object.defineProperty(x.prototype,\"destroyed\",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=h.destroy,x.prototype._undestroy=h.undestroy,x.prototype._destroy=function(e,t){t(e)},x.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:\"string\"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=s.from(e,t),t=\"\"),n=!0),T(this,e,t,!1,n)},x.prototype.unshift=function(e){return T(this,e,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(e){l||(l=n(3141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,o=\"\";null!==r;)o+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),\"\"!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var O=1073741824;function _(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e){var t=e._readableState;o(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o(\"emitReadable\",t.flowing),t.emittedReadable=!0,process.nextTick(C,e))}function C(e){var t=e._readableState;o(\"emitReadable_\",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit(\"readable\"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,F(e)}function B(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(o(\"maybeReadMore read 0\"),e.read(0),n===t.length)break}t.readingMore=!1}function R(e){var t=e._readableState;t.readableListening=e.listenerCount(\"readable\")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(\"data\")>0&&e.resume()}function j(e){o(\"readable nexttick read 0\"),e.read(0)}function U(e,t){o(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(o(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function L(e){var t=e._readableState;o(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(M,t,e))}function M(e,t){if(o(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function D(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}x.prototype.read=function(e){o(\"read\",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?L(this):I(this),null;if(0===(e=_(e,t))&&t.ended)return 0===t.length&&L(this),null;var r,i=t.needReadable;return o(\"need readable\",i),(0===t.length||t.length-e<t.highWaterMark)&&o(\"length less than watermark\",i=!0),t.ended||t.reading?o(\"reading or ended\",i=!1):i&&(o(\"do read\"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=_(n,t))),null===(r=e>0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&L(this)),null!==r&&this.emit(\"data\",r),r},x.prototype._read=function(e){S(this,new b(\"_read()\"))},x.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,o(\"pipe count=%d opts=%j\",r.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?h:s;function s(){o(\"onend\"),e.end()}r.endEmitted?process.nextTick(a):n.once(\"end\",a),e.on(\"unpipe\",function t(i,a){o(\"onunpipe\"),i===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o(\"cleanup\"),e.removeListener(\"close\",p),e.removeListener(\"finish\",d),e.removeListener(\"drain\",c),e.removeListener(\"error\",f),e.removeListener(\"unpipe\",t),n.removeListener(\"end\",s),n.removeListener(\"end\",h),n.removeListener(\"data\",l),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;o(\"pipeOnDrain\",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,\"data\")&&(t.flowing=!0,F(e))}}(n);e.on(\"drain\",c);var u=!1;function l(t){o(\"ondata\");var i=e.write(t);o(\"dest.write\",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==D(r.pipes,e))&&!u&&(o(\"false write response, pause\",r.awaitDrain),r.awaitDrain++),n.pause())}function f(t){o(\"onerror\",t),h(),e.removeListener(\"error\",f),0===i(e,\"error\")&&S(e,t)}function p(){e.removeListener(\"finish\",d),h()}function d(){o(\"onfinish\"),e.removeListener(\"close\",p),h()}function h(){o(\"unpipe\"),n.unpipe(e)}return n.on(\"data\",l),function(e,t,n){if(\"function\"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,\"error\",f),e.once(\"close\",p),e.once(\"finish\",d),e.emit(\"pipe\",n),r.flowing||(o(\"pipe resume\"),n.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(\"unpipe\",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit(\"unpipe\",this,{hasUnpiped:!1});return this}var a=D(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit(\"unpipe\",this,n)),this},x.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t),r=this._readableState;return\"data\"===e?(r.readableListening=this.listenerCount(\"readable\")>0,!1!==r.flowing&&this.resume()):\"readable\"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,o(\"on readable\",r.length,r.reading),r.length?I(this):r.reading||process.nextTick(j,this))),n},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return\"readable\"===e&&process.nextTick(R,this),n},x.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||process.nextTick(R,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(o(\"resume\"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(U,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return o(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(o(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on(\"end\",function(){if(o(\"wrapped end\"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on(\"data\",function(i){o(\"wrapped data\"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&\"function\"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<A.length;a++)e.on(A[a],this.emit.bind(this,A[a]));return this._read=function(t){o(\"wrapped _read\",t),r&&(r=!1,e.resume())},this},\"function\"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=n(7356)),f(this)}),Object.defineProperty(x.prototype,\"readableHighWaterMark\",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,\"readableBuffer\",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,\"readableFlowing\",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),x._fromList=N,Object.defineProperty(x.prototype,\"readableLength\",{enumerable:!1,get:function(){return this._readableState.length}}),\"function\"==typeof Symbol&&(x.from=function(e,t){return void 0===p&&(p=n(6314)),p(x,e,t)})},5689(e,t,n){\"use strict\";e.exports=l;var r=n(3157).F,o=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(3527);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit(\"error\",new i);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(\"function\"==typeof e.transform&&(this._transform=e.transform),\"function\"==typeof e.flush&&(this._flush=e.flush)),this.on(\"prefinish\",f)}function f(){var e=this;\"function\"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush(function(t,n){p(e,t,n)})}function p(e,t,n){if(t)return e.emit(\"error\",t);if(null!=n&&e.push(n),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}n(6698)(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new o(\"_transform()\"))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},9573(e,t,n){\"use strict\";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(void 0),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=x,x.WritableState=E;var i,a={deprecate:n(4643)},s=n(1914),c=n(8287).Buffer,u=(void 0!==n.g?n.g:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){},l=n(6057),f=n(1922).getHighWaterMark,p=n(3157).F,d=p.ERR_INVALID_ARG_TYPE,h=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,b=p.ERR_STREAM_WRITE_AFTER_END,w=p.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;function A(){}function E(e,t,i){o=o||n(3527),e=e||{},\"boolean\"!=typeof i&&(i=t instanceof o),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,\"writableHighWaterMark\",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(\"function\"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(process.nextTick(o,r),process.nextTick(C,e,t),e._writableState.errorEmitted=!0,S(e,r)):(o(r),e._writableState.errorEmitted=!0,S(e,r),C(e,t))}(e,n,r,t,o);else{var i=_(n)||e.destroyed;i||n.corked||n.bufferProcessing||!n.bufferedRequest||O(e,n),r?process.nextTick(k,e,n,i,o):k(e,n,i,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function x(e){var t=this instanceof(o=o||n(3527));if(!t&&!i.call(x,this))return new x(e);this._writableState=new E(e,this,t),this.writable=!0,e&&(\"function\"==typeof e.write&&(this._write=e.write),\"function\"==typeof e.writev&&(this._writev=e.writev),\"function\"==typeof e.destroy&&(this._destroy=e.destroy),\"function\"==typeof e.final&&(this._final=e.final)),s.call(this)}function T(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m(\"write\")):n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function k(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit(\"drain\"))}(e,t),t.pendingcb--,r(),C(e,t)}function O(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var o=t.bufferedRequestCount,i=new Array(o),a=t.corkedRequestsFree;a.entry=n;for(var s=0,c=!0;n;)i[s]=n,n.isBuf||(c=!1),n=n.next,s+=1;i.allBuffers=c,T(e,t,!0,t.length,i,\"\",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,f=n.callback;if(T(e,t,!1,t.objectMode?1:u.length,u,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final(function(n){t.pendingcb--,n&&S(e,n),t.prefinished=!0,e.emit(\"prefinish\"),C(e,t)})}function C(e,t){var n=_(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||(\"function\"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit(\"prefinish\")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(I,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit(\"finish\"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(6698)(x,s),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,\"buffer\",{get:a.deprecate(function(){return this.getBuffer()},\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch(e){}}(),\"function\"==typeof Symbol&&Symbol.hasInstance&&\"function\"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===x&&e&&e._writableState instanceof E}})):i=function(e){return e instanceof this},x.prototype.pipe=function(){S(this,new g)},x.prototype.write=function(e,t,n){var r,o=this._writableState,i=!1,a=!o.objectMode&&(r=e,c.isBuffer(r)||r instanceof u);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),\"function\"==typeof t&&(n=t,t=null),a?t=\"buffer\":t||(t=o.defaultEncoding),\"function\"!=typeof n&&(n=A),o.ending?function(e,t){var n=new b;S(e,n),process.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var o;return null===n?o=new v:\"string\"==typeof n||t.objectMode||(o=new d(\"chunk\",[\"string\",\"Buffer\"],n)),!o||(S(e,o),process.nextTick(r,o),!1)}(this,o,e,n))&&(o.pendingcb++,i=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=c.from(t,n)),t}(t,r,o);r!==a&&(n=!0,o=\"buffer\",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else T(e,t,!1,s,r,o,i);return u}(this,o,a,e,t,n)),i},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||O(this,e))},x.prototype.setDefaultEncoding=function(e){if(\"string\"==typeof e&&(e=e.toLowerCase()),!([\"hex\",\"utf8\",\"utf-8\",\"ascii\",\"binary\",\"base64\",\"ucs2\",\"ucs-2\",\"utf16le\",\"utf-16le\",\"raw\"].indexOf((e+\"\").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,n){n(new h(\"_write()\"))},x.prototype._writev=null,x.prototype.end=function(e,t,n){var r=this._writableState;return\"function\"==typeof e?(n=e,e=null,t=null):\"function\"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?process.nextTick(n):e.once(\"finish\",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(x.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,\"destroyed\",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(e,t){t(e)}},7356(e,t,n){\"use strict\";var r;function o(e,t,n){return(t=function(e){var t=function(e){if(\"object\"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(9959),a=Symbol(\"lastResolve\"),s=Symbol(\"lastReject\"),c=Symbol(\"error\"),u=Symbol(\"ended\"),l=Symbol(\"lastPromise\"),f=Symbol(\"handlePromise\"),p=Symbol(\"stream\");function d(e,t){return{value:e,done:t}}function h(e){var t=e[a];if(null!==t){var n=e[p].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(d(n,!1)))}}function y(e){process.nextTick(h,e)}var g=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((o(r={get stream(){return this[p]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,n){process.nextTick(function(){e[c]?n(e[c]):t(d(void 0,!0))})});var n,r=this[l];if(r)n=new Promise(function(e,t){return function(n,r){e.then(function(){t[u]?n(d(void 0,!0)):t[f](n,r)},r)}}(r,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,function(){return this}),o(r,\"return\",function(){var e=this;return new Promise(function(t,n){e[p].destroy(null,function(e){e?n(e):t(d(void 0,!0))})})}),r),g);e.exports=function(e){var t,n=Object.create(m,(o(t={},p,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,u,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var r=n[p].read();r?(n[l]=null,n[a]=null,n[s]=null,e(d(r,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[l]=null,i(e,function(e){if(e&&\"ERR_STREAM_PREMATURE_CLOSE\"!==e.code){var t=n[s];return null!==t&&(n[l]=null,n[a]=null,n[s]=null,t(e)),void(n[c]=e)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[s]=null,r(d(void 0,!0))),n[u]=!0}),e.on(\"readable\",y.bind(null,n)),n}},272(e,t,n){\"use strict\";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if(\"object\"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,\"string\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==typeof t?t:String(t)}var c=n(8287).Buffer,u=n(9169).inspect,l=u&&u.custom||\"inspect\";function f(e,t,n){c.prototype.copy.call(e,t,n)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:\"push\",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:\"unshift\",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:\"shift\",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:\"clear\",value:function(){this.head=this.tail=null,this.length=0}},{key:\"join\",value:function(e){if(0===this.length)return\"\";for(var t=this.head,n=\"\"+t.data;t=t.next;)n+=e+t.data;return n}},{key:\"concat\",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),n=this.head,r=0;n;)f(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:\"consume\",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:\"first\",value:function(){return this.head.data}},{key:\"_getString\",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?r+=o:r+=o.slice(0,e),0===(e-=i)){i===o.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++n}return this.length-=n,r}},{key:\"_getBuffer\",value:function(e){var t=c.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0===(e-=i)){i===o.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(i));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return u(this,o(o({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,n),Object.defineProperty(t,\"prototype\",{writable:!1}),e}()},6057(e){\"use strict\";function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(\"close\")}function r(e,t){e.emit(\"error\",t)}e.exports={destroy:function(e,o){var i=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!o&&e?i._writableState?i._writableState.errorEmitted?process.nextTick(n,i):(i._writableState.errorEmitted=!0,process.nextTick(t,i,e)):process.nextTick(t,i,e):o?(process.nextTick(n,i),o(e)):process.nextTick(n,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(\"error\",t)}}},9959(e,t,n){\"use strict\";var r=n(3157).F.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,n,i){if(\"function\"==typeof n)return e(t,null,n);n||(n={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r)}}}(i||o);var a=n.readable||!1!==n.readable&&t.readable,s=n.writable||!1!==n.writable&&t.writable,c=function(){t.writable||l()},u=t._writableState&&t._writableState.finished,l=function(){s=!1,u=!0,a||i.call(t)},f=t._readableState&&t._readableState.endEmitted,p=function(){a=!1,f=!0,s||i.call(t)},d=function(e){i.call(t,e)},h=function(){var e;return a&&!f?(t._readableState&&t._readableState.ended||(e=new r),i.call(t,e)):s&&!u?(t._writableState&&t._writableState.ended||(e=new r),i.call(t,e)):void 0},y=function(){t.req.on(\"finish\",l)};return function(e){return e.setHeader&&\"function\"==typeof e.abort}(t)?(t.on(\"complete\",l),t.on(\"abort\",h),t.req?y():t.on(\"request\",y)):s&&!t._writableState&&(t.on(\"end\",c),t.on(\"close\",c)),t.on(\"end\",p),t.on(\"finish\",l),!1!==n.error&&t.on(\"error\",d),t.on(\"close\",h),function(){t.removeListener(\"complete\",l),t.removeListener(\"abort\",h),t.removeListener(\"request\",y),t.req&&t.req.removeListener(\"finish\",l),t.removeListener(\"end\",c),t.removeListener(\"close\",c),t.removeListener(\"finish\",l),t.removeListener(\"end\",p),t.removeListener(\"error\",d),t.removeListener(\"close\",h)}}},6314(e){e.exports=function(){throw new Error(\"Readable.from is not available in the browser\")}},7413(e,t,n){\"use strict\";var r,o=n(3157).F,i=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function c(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var l,f=function(e){return e.length?\"function\"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i(\"streams\");var p=t.map(function(e,o){var i=o<t.length-1;return function(e,t,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var s=!1;e.on(\"close\",function(){s=!0}),void 0===r&&(r=n(9959)),r(e,{readable:t,writable:o},function(e){if(e)return i(e);s=!0,i()});var c=!1;return function(t){if(!s&&!c)return c=!0,function(e){return e.setHeader&&\"function\"==typeof e.abort}(e)?e.abort():\"function\"==typeof e.destroy?e.destroy():void i(t||new a(\"pipe\"))}}(e,i,o>0,function(e){l||(l=e),e&&p.forEach(c),i||(p.forEach(c),f(l))})});return t.reduce(u)}},1922(e,t,n){\"use strict\";var r=n(3157).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,o){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,o,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new r(o?n:\"highWaterMark\",i);return Math.floor(i)}return e.objectMode?16:16384}}},1914(e,t,n){e.exports=n(7007).EventEmitter},3242(e,t,n){(t=e.exports=n(2341)).Stream=t,t.Readable=t,t.Writable=n(9573),t.Duplex=n(3527),t.Transform=n(5689),t.PassThrough=n(2571),t.finished=n(9959),t.pipeline=n(7413)},3141(e,t,n){\"use strict\";var r=n(2861).Buffer,o=r.isEncoding||function(e){switch((e=\"\"+e)&&e.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return\"utf8\";for(var t;;)switch(e){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return e;default:if(t)return;e=(\"\"+e).toLowerCase(),t=!0}}(e);if(\"string\"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error(\"Unknown encoding: \"+e);return t||e}(e),this.encoding){case\"utf16le\":this.text=c,this.end=u,t=4;break;case\"utf8\":this.fillLast=s,t=4;break;case\"base64\":this.text=l,this.end=f,t=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,\"�\";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,\"�\";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,\"�\"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var n=e.toString(\"utf16le\",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString(\"base64\",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):\"\"}t.I=i,i.prototype.write=function(e){if(0===e.length)return\"\";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return\"\";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||\"\"},i.prototype.end=function(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+\"�\":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=a(t[r]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--r<n||-2===o?0:(o=a(t[r]))>=0?(o>0&&(e.lastNeed=o-2),o):--r<n||-2===o?0:(o=a(t[r]))>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString(\"utf8\",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(\"utf8\",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},1293(e,t,n){var r=n(5546),o=n(2708);e.exports={parse:function(e){var t=r.parse(e.toString());return o.compile(t)}}},2708(e){\"use strict\";e.exports={compile:function(e){var t=[],n=[],r=\"\",o=Object.create(null),i=o;return function(e){for(var t,n=0;n<e.length;n++)switch((t=e[n]).type){case\"Assign\":s(t);break;case\"ObjectPath\":f(t);break;case\"ArrayPath\":p(t)}return o}(e);function a(e,t,n){var r=new Error(e);throw r.line=t,r.column=n,r}function s(e){var o,s=e.key,l=e.value,f=e.line,p=e.column;o=r?r+\".\"+s:s,void 0!==i[s]&&a(\"Cannot redefine existing key '\"+o+\"'.\",f,p),i[s]=u(l),c(o)||(t.push(o),n.push(o))}function c(e){return-1!==t.indexOf(e)}function u(e){return\"Array\"===e.type?function(e){for(var t=null,n=0;n<e.length;n++){var r=e[n];null===t?t=r.type:r.type!==t&&a(\"Cannot add value of type \"+r.type+\" to array of type \"+t+\".\",r.line,r.column)}return e.map(u)}(e.value):\"InlineTable\"===e.type?l(e.value):e.value}function l(e){for(var t=Object.create(null),n=0;n<e.length;n++){var r=e[n];\"InlineTable\"===r.value.type?t[r.key]=l(r.value.value):\"InlineTableValue\"===r.type&&(t[r.key]=u(r.value))}return t}function f(e){var n=e.value,s=n.map(h).join(\".\"),u=e.line,l=e.column;c(s)&&a(\"Cannot redefine existing key '\"+n+\"'.\",u,l),t.push(s),i=d(o,n,Object.create(null),u,l),r=n}function p(e){var n=e.value,s=n.map(h).join(\".\"),u=e.line,l=e.column;if(c(s)||t.push(s),(t=t.filter(function(e){return 0!==e.indexOf(s)})).push(s),i=d(o,n,[],u,l),r=s,i instanceof Array){var f=Object.create(null);i.push(f),i=f}else a(\"Cannot redefine existing key '\"+n+\"'.\",u,l)}function d(e,t,r,o,i){for(var s=[],c=\"\",u=(t.join(\".\"),e),l=0;l<t.length;l++){var f=t[l];s.push(f),c=s.join(\".\"),void 0===u[f]?l===t.length-1?u[f]=r:u[f]=Object.create(null):l!==t.length-1&&n.indexOf(c)>-1&&a(\"Cannot redefine existing key '\"+c+\"'.\",o,i),(u=u[f])instanceof Array&&u.length&&l<t.length-1&&(u=u[u.length-1])}return u}function h(e){return e.indexOf(\".\")>-1?'\"'+e+'\"':e}}}},5546(e){e.exports=function(){function e(e,t,n,r,o,i){this.message=e,this.expected=t,this.found=n,this.offset=r,this.line=o,this.column=i,this.name=\"SyntaxError\"}return function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(e,Error),{SyntaxError:e,parse:function(t){var n,r=arguments.length>1?arguments[1]:{},o={},i={start:Rt},a=Rt,s=function(){return pn},c=o,u=\"#\",l={type:\"literal\",value:\"#\",description:'\"#\"'},f=void 0,p={type:\"any\",description:\"any character\"},d=\"[\",h={type:\"literal\",value:\"[\",description:'\"[\"'},y=\"]\",g={type:\"literal\",value:\"]\",description:'\"]\"'},m=function(e){dn(hn(\"ObjectPath\",e,It,Ct))},v=function(e){dn(hn(\"ArrayPath\",e,It,Ct))},b=function(e,t){return e.concat(t)},w=function(e){return[e]},S=function(e){return e},A=\".\",E={type:\"literal\",value:\".\",description:'\".\"'},x=\"=\",T={type:\"literal\",value:\"=\",description:'\"=\"'},k=function(e,t){dn(hn(\"Assign\",t,It,Ct,e))},O=function(e){return e.join(\"\")},_=function(e){return e.value},I='\"\"\"',C={type:\"literal\",value:'\"\"\"',description:'\"\\\\\"\\\\\"\\\\\"\"'},B=null,P=function(e){return hn(\"String\",e.join(\"\"),It,Ct)},R='\"',j={type:\"literal\",value:'\"',description:'\"\\\\\"\"'},U=\"'''\",F={type:\"literal\",value:\"'''\",description:\"\\\"'''\\\"\"},N=\"'\",L={type:\"literal\",value:\"'\",description:'\"\\'\"'},M=function(e){return e},D=function(e){return e},q=\"\\\\\",V={type:\"literal\",value:\"\\\\\",description:'\"\\\\\\\\\"'},z=function(){return\"\"},K=\"e\",H={type:\"literal\",value:\"e\",description:'\"e\"'},$=\"E\",G={type:\"literal\",value:\"E\",description:'\"E\"'},W=function(e,t){return hn(\"Float\",parseFloat(e+\"e\"+t),It,Ct)},X=function(e){return hn(\"Float\",parseFloat(e),It,Ct)},Z=\"+\",Y={type:\"literal\",value:\"+\",description:'\"+\"'},J=function(e){return e.join(\"\")},Q=\"-\",ee={type:\"literal\",value:\"-\",description:'\"-\"'},te=function(e){return\"-\"+e.join(\"\")},ne=function(e){return hn(\"Integer\",parseInt(e,10),It,Ct)},re=\"true\",oe={type:\"literal\",value:\"true\",description:'\"true\"'},ie=function(){return hn(\"Boolean\",!0,It,Ct)},ae=\"false\",se={type:\"literal\",value:\"false\",description:'\"false\"'},ce=function(){return hn(\"Boolean\",!1,It,Ct)},ue=function(){return hn(\"Array\",[],It,Ct)},le=function(e){return hn(\"Array\",e?[e]:[],It,Ct)},fe=function(e){return hn(\"Array\",e,It,Ct)},pe=function(e,t){return hn(\"Array\",e.concat(t),It,Ct)},de=function(e){return e},he=\",\",ye={type:\"literal\",value:\",\",description:'\",\"'},ge=\"{\",me={type:\"literal\",value:\"{\",description:'\"{\"'},ve=\"}\",be={type:\"literal\",value:\"}\",description:'\"}\"'},we=function(e){return hn(\"InlineTable\",e,It,Ct)},Se=function(e,t){return hn(\"InlineTableValue\",t,It,Ct,e)},Ae=function(e){return\".\"+e},Ee=function(e){return e.join(\"\")},xe=\":\",Te={type:\"literal\",value:\":\",description:'\":\"'},ke=function(e){return e.join(\"\")},Oe=\"T\",_e={type:\"literal\",value:\"T\",description:'\"T\"'},Ie=\"Z\",Ce={type:\"literal\",value:\"Z\",description:'\"Z\"'},Be=function(e,t){return hn(\"Date\",new Date(e+\"T\"+t+\"Z\"),It,Ct)},Pe=function(e,t){return hn(\"Date\",new Date(e+\"T\"+t),It,Ct)},Re=/^[ \\t]/,je={type:\"class\",value:\"[ \\\\t]\",description:\"[ \\\\t]\"},Ue=\"\\n\",Fe={type:\"literal\",value:\"\\n\",description:'\"\\\\n\"'},Ne=\"\\r\",Le={type:\"literal\",value:\"\\r\",description:'\"\\\\r\"'},Me=/^[0-9a-f]/i,De={type:\"class\",value:\"[0-9a-f]i\",description:\"[0-9a-f]i\"},qe=/^[0-9]/,Ve={type:\"class\",value:\"[0-9]\",description:\"[0-9]\"},ze=\"_\",Ke={type:\"literal\",value:\"_\",description:'\"_\"'},He=function(){return\"\"},$e=/^[A-Za-z0-9_\\-]/,Ge={type:\"class\",value:\"[A-Za-z0-9_\\\\-]\",description:\"[A-Za-z0-9_\\\\-]\"},We=function(e){return e.join(\"\")},Xe='\\\\\"',Ze={type:\"literal\",value:'\\\\\"',description:'\"\\\\\\\\\\\\\"\"'},Ye=function(){return'\"'},Je=\"\\\\\\\\\",Qe={type:\"literal\",value:\"\\\\\\\\\",description:'\"\\\\\\\\\\\\\\\\\"'},et=function(){return\"\\\\\"},tt=\"\\\\b\",nt={type:\"literal\",value:\"\\\\b\",description:'\"\\\\\\\\b\"'},rt=function(){return\"\\b\"},ot=\"\\\\t\",it={type:\"literal\",value:\"\\\\t\",description:'\"\\\\\\\\t\"'},at=function(){return\"\\t\"},st=\"\\\\n\",ct={type:\"literal\",value:\"\\\\n\",description:'\"\\\\\\\\n\"'},ut=function(){return\"\\n\"},lt=\"\\\\f\",ft={type:\"literal\",value:\"\\\\f\",description:'\"\\\\\\\\f\"'},pt=function(){return\"\\f\"},dt=\"\\\\r\",ht={type:\"literal\",value:\"\\\\r\",description:'\"\\\\\\\\r\"'},yt=function(){return\"\\r\"},gt=\"\\\\U\",mt={type:\"literal\",value:\"\\\\U\",description:'\"\\\\\\\\U\"'},vt=function(e){return function(e){var t=parseInt(\"0x\"+e);if(!(!isFinite(t)||Math.floor(t)!=t||t<0||t>1114111||t>55295&&t<57344))return function(){var e,t,n=[],r=-1,o=arguments.length;if(!o)return\"\";for(var i=\"\";++r<o;){var a=Number(arguments[r]);a<=65535?n.push(a):(e=55296+((a-=65536)>>10),t=a%1024+56320,n.push(e,t)),(r+1==o||n.length>16384)&&(i+=String.fromCharCode.apply(null,n),n.length=0)}return i}(t);!function(e){var t=new Error(e);throw t.line=void 0,t.column=void 0,t}(\"Invalid Unicode escape code: \"+e)}(e.join(\"\"))},bt=\"\\\\u\",wt={type:\"literal\",value:\"\\\\u\",description:'\"\\\\\\\\u\"'},St=0,At=0,Et=0,xt={line:1,column:1,seenCR:!1},Tt=0,kt=[],Ot=0,_t={};if(\"startRule\"in r){if(!(r.startRule in i))throw new Error(\"Can't start parsing from rule \\\"\"+r.startRule+'\".');a=i[r.startRule]}function It(){return Bt(At).line}function Ct(){return Bt(At).column}function Bt(e){return Et!==e&&(Et>e&&(Et=0,xt={line:1,column:1,seenCR:!1}),function(e,n,r){var o,i;for(o=n;o<r;o++)\"\\n\"===(i=t.charAt(o))?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):\"\\r\"===i||\"\\u2028\"===i||\"\\u2029\"===i?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}(xt,Et,e),Et=e),xt}function Pt(e){St<Tt||(St>Tt&&(Tt=St,kt=[]),kt.push(e))}function Rt(){var e,t,n,r=49*St+0,i=_t[r];if(i)return St=i.nextPos,i.result;for(e=St,t=[],n=jt();n!==o;)t.push(n),n=jt();return t!==o&&(At=e,t=s()),e=t,_t[r]={nextPos:St,result:e},e}function jt(){var e,n,r,i,a,s,u,l=49*St+1,f=_t[l];if(f)return St=f.nextPos,f.result;for(e=St,n=[],r=nn();r!==o;)n.push(r),r=nn();if(n!==o)if(r=function(){var e,n=49*St+2,r=_t[n];return r?(St=r.nextPos,r.result):((e=Ut())===o&&(e=function(){var e,n,r,i,a,s,u=49*St+4,l=_t[u];if(l)return St=l.nextPos,l.result;if(e=St,91===t.charCodeAt(St)?(n=d,St++):(n=o,0===Ot&&Pt(h)),n!==o){for(r=[],i=nn();i!==o;)r.push(i),i=nn();if(r!==o)if((i=Ft())!==o){for(a=[],s=nn();s!==o;)a.push(s),s=nn();a!==o?(93===t.charCodeAt(St)?(s=y,St++):(s=o,0===Ot&&Pt(g)),s!==o?(At=e,e=n=m(i)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;return _t[u]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,n,r,i,a,s,u,l,f=49*St+5,p=_t[f];if(p)return St=p.nextPos,p.result;if(e=St,91===t.charCodeAt(St)?(n=d,St++):(n=o,0===Ot&&Pt(h)),n!==o)if(91===t.charCodeAt(St)?(r=d,St++):(r=o,0===Ot&&Pt(h)),r!==o){for(i=[],a=nn();a!==o;)i.push(a),a=nn();if(i!==o)if((a=Ft())!==o){for(s=[],u=nn();u!==o;)s.push(u),u=nn();s!==o?(93===t.charCodeAt(St)?(u=y,St++):(u=o,0===Ot&&Pt(g)),u!==o?(93===t.charCodeAt(St)?(l=y,St++):(l=o,0===Ot&&Pt(g)),l!==o?(At=e,e=n=v(a)):(St=e,e=c)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;else St=e,e=c;return _t[f]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,n,r,i,a,s,u=49*St+9,l=_t[u];if(l)return St=l.nextPos,l.result;if(e=St,(n=Mt())!==o){for(r=[],i=nn();i!==o;)r.push(i),i=nn();if(r!==o)if(61===t.charCodeAt(St)?(i=x,St++):(i=o,0===Ot&&Pt(T)),i!==o){for(a=[],s=nn();s!==o;)a.push(s),s=nn();a!==o&&(s=qt())!==o?(At=e,e=n=k(n,s)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;if(e===o)if(e=St,(n=Dt())!==o){for(r=[],i=nn();i!==o;)r.push(i),i=nn();if(r!==o)if(61===t.charCodeAt(St)?(i=x,St++):(i=o,0===Ot&&Pt(T)),i!==o){for(a=[],s=nn();s!==o;)a.push(s),s=nn();a!==o&&(s=qt())!==o?(At=e,e=n=k(n,s)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;return _t[u]={nextPos:St,result:e},e}()))),_t[n]={nextPos:St,result:e},e)}(),r!==o){for(i=[],a=nn();a!==o;)i.push(a),a=nn();if(i!==o){for(a=[],s=Ut();s!==o;)a.push(s),s=Ut();if(a!==o){if(s=[],(u=rn())!==o)for(;u!==o;)s.push(u),u=rn();else s=c;s===o&&(s=an()),s!==o?e=n=[n,r,i,a,s]:(St=e,e=c)}else St=e,e=c}else St=e,e=c}else St=e,e=c;else St=e,e=c;if(e===o){if(e=St,n=[],(r=nn())!==o)for(;r!==o;)n.push(r),r=nn();else n=c;if(n!==o){if(r=[],(i=rn())!==o)for(;i!==o;)r.push(i),i=rn();else r=c;r===o&&(r=an()),r!==o?e=n=[n,r]:(St=e,e=c)}else St=e,e=c;e===o&&(e=rn())}return _t[l]={nextPos:St,result:e},e}function Ut(){var e,n,r,i,a,s,d=49*St+3,h=_t[d];if(h)return St=h.nextPos,h.result;if(e=St,35===t.charCodeAt(St)?(n=u,St++):(n=o,0===Ot&&Pt(l)),n!==o){for(r=[],i=St,a=St,Ot++,(s=rn())===o&&(s=an()),Ot--,s===o?a=f:(St=a,a=c),a!==o?(t.length>St?(s=t.charAt(St),St++):(s=o,0===Ot&&Pt(p)),s!==o?i=a=[a,s]:(St=i,i=c)):(St=i,i=c);i!==o;)r.push(i),i=St,a=St,Ot++,(s=rn())===o&&(s=an()),Ot--,s===o?a=f:(St=a,a=c),a!==o?(t.length>St?(s=t.charAt(St),St++):(s=o,0===Ot&&Pt(p)),s!==o?i=a=[a,s]:(St=i,i=c)):(St=i,i=c);r!==o?e=n=[n,r]:(St=e,e=c)}else St=e,e=c;return _t[d]={nextPos:St,result:e},e}function Ft(){var e,t,n,r=49*St+6,i=_t[r];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(n=Lt())!==o)for(;n!==o;)t.push(n),n=Lt();else t=c;return t!==o&&(n=Nt())!==o?(At=e,e=t=b(t,n)):(St=e,e=c),e===o&&(e=St,(t=Nt())!==o&&(At=e,t=w(t)),e=t),_t[r]={nextPos:St,result:e},e}function Nt(){var e,t,n,r,i,a=49*St+7,s=_t[a];if(s)return St=s.nextPos,s.result;for(e=St,t=[],n=nn();n!==o;)t.push(n),n=nn();if(t!==o)if((n=Mt())!==o){for(r=[],i=nn();i!==o;)r.push(i),i=nn();r!==o?(At=e,e=t=S(n)):(St=e,e=c)}else St=e,e=c;else St=e,e=c;if(e===o){for(e=St,t=[],n=nn();n!==o;)t.push(n),n=nn();if(t!==o)if((n=Dt())!==o){for(r=[],i=nn();i!==o;)r.push(i),i=nn();r!==o?(At=e,e=t=S(n)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}return _t[a]={nextPos:St,result:e},e}function Lt(){var e,n,r,i,a,s,u,l=49*St+8,f=_t[l];if(f)return St=f.nextPos,f.result;for(e=St,n=[],r=nn();r!==o;)n.push(r),r=nn();if(n!==o)if((r=Mt())!==o){for(i=[],a=nn();a!==o;)i.push(a),a=nn();if(i!==o)if(46===t.charCodeAt(St)?(a=A,St++):(a=o,0===Ot&&Pt(E)),a!==o){for(s=[],u=nn();u!==o;)s.push(u),u=nn();s!==o?(At=e,e=n=S(r)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;else St=e,e=c;if(e===o){for(e=St,n=[],r=nn();r!==o;)n.push(r),r=nn();if(n!==o)if((r=Dt())!==o){for(i=[],a=nn();a!==o;)i.push(a),a=nn();if(i!==o)if(46===t.charCodeAt(St)?(a=A,St++):(a=o,0===Ot&&Pt(E)),a!==o){for(s=[],u=nn();u!==o;)s.push(u),u=nn();s!==o?(At=e,e=n=S(r)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;else St=e,e=c}return _t[l]={nextPos:St,result:e},e}function Mt(){var e,t,n,r=49*St+10,i=_t[r];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(n=un())!==o)for(;n!==o;)t.push(n),n=un();else t=c;return t!==o&&(At=e,t=O(t)),e=t,_t[r]={nextPos:St,result:e},e}function Dt(){var e,t,n=49*St+11,r=_t[n];return r?(St=r.nextPos,r.result):(e=St,(t=Vt())!==o&&(At=e,t=_(t)),(e=t)===o&&(e=St,(t=zt())!==o&&(At=e,t=_(t)),e=t),_t[n]={nextPos:St,result:e},e)}function qt(){var e,n=49*St+12,r=_t[n];return r?(St=r.nextPos,r.result):(e=function(){var e,n=49*St+13,r=_t[n];return r?(St=r.nextPos,r.result):(e=function(){var e,n,r,i,a,s=49*St+14,u=_t[s];if(u)return St=u.nextPos,u.result;if(e=St,t.substr(St,3)===I?(n=I,St+=3):(n=o,0===Ot&&Pt(C)),n!==o)if((r=rn())===o&&(r=B),r!==o){for(i=[],a=$t();a!==o;)i.push(a),a=$t();i!==o?(t.substr(St,3)===I?(a=I,St+=3):(a=o,0===Ot&&Pt(C)),a!==o?(At=e,e=n=P(i)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;else St=e,e=c;return _t[s]={nextPos:St,result:e},e}(),e===o&&(e=Vt())===o&&(e=function(){var e,n,r,i,a,s=49*St+16,u=_t[s];if(u)return St=u.nextPos,u.result;if(e=St,t.substr(St,3)===U?(n=U,St+=3):(n=o,0===Ot&&Pt(F)),n!==o)if((r=rn())===o&&(r=B),r!==o){for(i=[],a=Gt();a!==o;)i.push(a),a=Gt();i!==o?(t.substr(St,3)===U?(a=U,St+=3):(a=o,0===Ot&&Pt(F)),a!==o?(At=e,e=n=P(i)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;else St=e,e=c;return _t[s]={nextPos:St,result:e},e}(),e===o&&(e=zt())),_t[n]={nextPos:St,result:e},e)}(),e===o&&(e=function(){var e,n,r,i,a,s=49*St+38,u=_t[s];return u?(St=u.nextPos,u.result):(e=St,(n=tn())!==o?(84===t.charCodeAt(St)?(r=Oe,St++):(r=o,0===Ot&&Pt(_e)),r!==o?(i=function(){var e,n,r,i,a,s,u,l,f,p,d,h=49*St+36,y=_t[h];return y?(St=y.nextPos,y.result):(e=St,n=St,(r=cn())!==o&&(i=cn())!==o?(58===t.charCodeAt(St)?(a=xe,St++):(a=o,0===Ot&&Pt(Te)),a!==o&&(s=cn())!==o&&(u=cn())!==o?(58===t.charCodeAt(St)?(l=xe,St++):(l=o,0===Ot&&Pt(Te)),l!==o&&(f=cn())!==o&&(p=cn())!==o?((d=en())===o&&(d=B),d!==o?n=r=[r,i,a,s,u,l,f,p,d]:(St=n,n=c)):(St=n,n=c)):(St=n,n=c)):(St=n,n=c),n!==o&&(At=e,n=ke(n)),e=n,_t[h]={nextPos:St,result:e},e)}(),i!==o?(90===t.charCodeAt(St)?(a=Ie,St++):(a=o,0===Ot&&Pt(Ce)),a!==o?(At=e,e=n=Be(n,i)):(St=e,e=c)):(St=e,e=c)):(St=e,e=c)):(St=e,e=c),e===o&&(e=St,(n=tn())!==o?(84===t.charCodeAt(St)?(r=Oe,St++):(r=o,0===Ot&&Pt(_e)),r!==o?(i=function(){var e,n,r,i,a,s,u,l,f,p,d,h,y,g,m,v,b,w=49*St+37,S=_t[w];return S?(St=S.nextPos,S.result):(e=St,n=St,(r=cn())!==o&&(i=cn())!==o?(58===t.charCodeAt(St)?(a=xe,St++):(a=o,0===Ot&&Pt(Te)),a!==o&&(s=cn())!==o&&(u=cn())!==o?(58===t.charCodeAt(St)?(l=xe,St++):(l=o,0===Ot&&Pt(Te)),l!==o&&(f=cn())!==o&&(p=cn())!==o?((d=en())===o&&(d=B),d!==o?(45===t.charCodeAt(St)?(h=Q,St++):(h=o,0===Ot&&Pt(ee)),h===o&&(43===t.charCodeAt(St)?(h=Z,St++):(h=o,0===Ot&&Pt(Y))),h!==o&&(y=cn())!==o&&(g=cn())!==o?(58===t.charCodeAt(St)?(m=xe,St++):(m=o,0===Ot&&Pt(Te)),m!==o&&(v=cn())!==o&&(b=cn())!==o?n=r=[r,i,a,s,u,l,f,p,d,h,y,g,m,v,b]:(St=n,n=c)):(St=n,n=c)):(St=n,n=c)):(St=n,n=c)):(St=n,n=c)):(St=n,n=c),n!==o&&(At=e,n=ke(n)),e=n,_t[w]={nextPos:St,result:e},e)}(),i!==o?(At=e,e=n=Pe(n,i)):(St=e,e=c)):(St=e,e=c)):(St=e,e=c)),_t[s]={nextPos:St,result:e},e)}(),e===o&&(e=function(){var e,n,r,i,a=49*St+23,s=_t[a];return s?(St=s.nextPos,s.result):(e=St,(n=Wt())===o&&(n=Xt()),n!==o?(101===t.charCodeAt(St)?(r=K,St++):(r=o,0===Ot&&Pt(H)),r===o&&(69===t.charCodeAt(St)?(r=$,St++):(r=o,0===Ot&&Pt(G))),r!==o&&(i=Xt())!==o?(At=e,e=n=W(n,i)):(St=e,e=c)):(St=e,e=c),e===o&&(e=St,(n=Wt())!==o&&(At=e,n=X(n)),e=n),_t[a]={nextPos:St,result:e},e)}(),e===o&&(e=function(){var e,t,n=49*St+25,r=_t[n];return r?(St=r.nextPos,r.result):(e=St,(t=Xt())!==o&&(At=e,t=ne(t)),e=t,_t[n]={nextPos:St,result:e},e)}(),e===o&&(e=function(){var e,n,r=49*St+27,i=_t[r];return i?(St=i.nextPos,i.result):(e=St,t.substr(St,4)===re?(n=re,St+=4):(n=o,0===Ot&&Pt(oe)),n!==o&&(At=e,n=ie()),(e=n)===o&&(e=St,t.substr(St,5)===ae?(n=ae,St+=5):(n=o,0===Ot&&Pt(se)),n!==o&&(At=e,n=ce()),e=n),_t[r]={nextPos:St,result:e},e)}(),e===o&&(e=function(){var e,n,r,i,a,s=49*St+28,u=_t[s];if(u)return St=u.nextPos,u.result;if(e=St,91===t.charCodeAt(St)?(n=d,St++):(n=o,0===Ot&&Pt(h)),n!==o){for(r=[],i=Jt();i!==o;)r.push(i),i=Jt();r!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===Ot&&Pt(g)),i!==o?(At=e,e=n=ue()):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;if(e===o&&(e=St,91===t.charCodeAt(St)?(n=d,St++):(n=o,0===Ot&&Pt(h)),n!==o?((r=Zt())===o&&(r=B),r!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===Ot&&Pt(g)),i!==o?(At=e,e=n=le(r)):(St=e,e=c)):(St=e,e=c)):(St=e,e=c),e===o)){if(e=St,91===t.charCodeAt(St)?(n=d,St++):(n=o,0===Ot&&Pt(h)),n!==o){if(r=[],(i=Yt())!==o)for(;i!==o;)r.push(i),i=Yt();else r=c;r!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===Ot&&Pt(g)),i!==o?(At=e,e=n=fe(r)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;if(e===o)if(e=St,91===t.charCodeAt(St)?(n=d,St++):(n=o,0===Ot&&Pt(h)),n!==o){if(r=[],(i=Yt())!==o)for(;i!==o;)r.push(i),i=Yt();else r=c;r!==o&&(i=Zt())!==o?(93===t.charCodeAt(St)?(a=y,St++):(a=o,0===Ot&&Pt(g)),a!==o?(At=e,e=n=pe(r,i)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c}return _t[s]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,n,r,i,a,s,u=49*St+32,l=_t[u];if(l)return St=l.nextPos,l.result;if(e=St,123===t.charCodeAt(St)?(n=ge,St++):(n=o,0===Ot&&Pt(me)),n!==o){for(r=[],i=nn();i!==o;)r.push(i),i=nn();if(r!==o){for(i=[],a=Qt();a!==o;)i.push(a),a=Qt();if(i!==o){for(a=[],s=nn();s!==o;)a.push(s),s=nn();a!==o?(125===t.charCodeAt(St)?(s=ve,St++):(s=o,0===Ot&&Pt(be)),s!==o?(At=e,e=n=we(i)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c}else St=e,e=c}else St=e,e=c;return _t[u]={nextPos:St,result:e},e}())))))),_t[n]={nextPos:St,result:e},e)}function Vt(){var e,n,r,i,a=49*St+15,s=_t[a];if(s)return St=s.nextPos,s.result;if(e=St,34===t.charCodeAt(St)?(n=R,St++):(n=o,0===Ot&&Pt(j)),n!==o){for(r=[],i=Kt();i!==o;)r.push(i),i=Kt();r!==o?(34===t.charCodeAt(St)?(i=R,St++):(i=o,0===Ot&&Pt(j)),i!==o?(At=e,e=n=P(r)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;return _t[a]={nextPos:St,result:e},e}function zt(){var e,n,r,i,a=49*St+17,s=_t[a];if(s)return St=s.nextPos,s.result;if(e=St,39===t.charCodeAt(St)?(n=N,St++):(n=o,0===Ot&&Pt(L)),n!==o){for(r=[],i=Ht();i!==o;)r.push(i),i=Ht();r!==o?(39===t.charCodeAt(St)?(i=N,St++):(i=o,0===Ot&&Pt(L)),i!==o?(At=e,e=n=P(r)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;return _t[a]={nextPos:St,result:e},e}function Kt(){var e,n,r,i=49*St+18,a=_t[i];return a?(St=a.nextPos,a.result):((e=fn())===o&&(e=St,n=St,Ot++,34===t.charCodeAt(St)?(r=R,St++):(r=o,0===Ot&&Pt(j)),Ot--,r===o?n=f:(St=n,n=c),n!==o?(t.length>St?(r=t.charAt(St),St++):(r=o,0===Ot&&Pt(p)),r!==o?(At=e,e=n=M(r)):(St=e,e=c)):(St=e,e=c)),_t[i]={nextPos:St,result:e},e)}function Ht(){var e,n,r,i=49*St+19,a=_t[i];return a?(St=a.nextPos,a.result):(e=St,n=St,Ot++,39===t.charCodeAt(St)?(r=N,St++):(r=o,0===Ot&&Pt(L)),Ot--,r===o?n=f:(St=n,n=c),n!==o?(t.length>St?(r=t.charAt(St),St++):(r=o,0===Ot&&Pt(p)),r!==o?(At=e,e=n=M(r)):(St=e,e=c)):(St=e,e=c),_t[i]={nextPos:St,result:e},e)}function $t(){var e,n,r,i=49*St+20,a=_t[i];return a?(St=a.nextPos,a.result):((e=fn())===o&&(e=function(){var e,n,r,i,a=49*St+21,s=_t[a];if(s)return St=s.nextPos,s.result;if(e=St,92===t.charCodeAt(St)?(n=q,St++):(n=o,0===Ot&&Pt(V)),n!==o)if(rn()!==o){for(r=[],i=on();i!==o;)r.push(i),i=on();r!==o?(At=e,e=n=z()):(St=e,e=c)}else St=e,e=c;else St=e,e=c;return _t[a]={nextPos:St,result:e},e}(),e===o&&(e=St,n=St,Ot++,t.substr(St,3)===I?(r=I,St+=3):(r=o,0===Ot&&Pt(C)),Ot--,r===o?n=f:(St=n,n=c),n!==o?(t.length>St?(r=t.charAt(St),St++):(r=o,0===Ot&&Pt(p)),r!==o?(At=e,e=n=D(r)):(St=e,e=c)):(St=e,e=c))),_t[i]={nextPos:St,result:e},e)}function Gt(){var e,n,r,i=49*St+22,a=_t[i];return a?(St=a.nextPos,a.result):(e=St,n=St,Ot++,t.substr(St,3)===U?(r=U,St+=3):(r=o,0===Ot&&Pt(F)),Ot--,r===o?n=f:(St=n,n=c),n!==o?(t.length>St?(r=t.charAt(St),St++):(r=o,0===Ot&&Pt(p)),r!==o?(At=e,e=n=M(r)):(St=e,e=c)):(St=e,e=c),_t[i]={nextPos:St,result:e},e)}function Wt(){var e,n,r,i,a,s,u=49*St+24,l=_t[u];return l?(St=l.nextPos,l.result):(e=St,43===t.charCodeAt(St)?(n=Z,St++):(n=o,0===Ot&&Pt(Y)),n===o&&(n=B),n!==o?(r=St,(i=ln())!==o?(46===t.charCodeAt(St)?(a=A,St++):(a=o,0===Ot&&Pt(E)),a!==o&&(s=ln())!==o?r=i=[i,a,s]:(St=r,r=c)):(St=r,r=c),r!==o?(At=e,e=n=J(r)):(St=e,e=c)):(St=e,e=c),e===o&&(e=St,45===t.charCodeAt(St)?(n=Q,St++):(n=o,0===Ot&&Pt(ee)),n!==o?(r=St,(i=ln())!==o?(46===t.charCodeAt(St)?(a=A,St++):(a=o,0===Ot&&Pt(E)),a!==o&&(s=ln())!==o?r=i=[i,a,s]:(St=r,r=c)):(St=r,r=c),r!==o?(At=e,e=n=te(r)):(St=e,e=c)):(St=e,e=c)),_t[u]={nextPos:St,result:e},e)}function Xt(){var e,n,r,i,a,s=49*St+26,u=_t[s];if(u)return St=u.nextPos,u.result;if(e=St,43===t.charCodeAt(St)?(n=Z,St++):(n=o,0===Ot&&Pt(Y)),n===o&&(n=B),n!==o){if(r=[],(i=cn())!==o)for(;i!==o;)r.push(i),i=cn();else r=c;r!==o?(i=St,Ot++,46===t.charCodeAt(St)?(a=A,St++):(a=o,0===Ot&&Pt(E)),Ot--,a===o?i=f:(St=i,i=c),i!==o?(At=e,e=n=J(r)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;if(e===o)if(e=St,45===t.charCodeAt(St)?(n=Q,St++):(n=o,0===Ot&&Pt(ee)),n!==o){if(r=[],(i=cn())!==o)for(;i!==o;)r.push(i),i=cn();else r=c;r!==o?(i=St,Ot++,46===t.charCodeAt(St)?(a=A,St++):(a=o,0===Ot&&Pt(E)),Ot--,a===o?i=f:(St=i,i=c),i!==o?(At=e,e=n=te(r)):(St=e,e=c)):(St=e,e=c)}else St=e,e=c;return _t[s]={nextPos:St,result:e},e}function Zt(){var e,t,n,r,i,a=49*St+29,s=_t[a];if(s)return St=s.nextPos,s.result;for(e=St,t=[],n=Jt();n!==o;)t.push(n),n=Jt();if(t!==o)if((n=qt())!==o){for(r=[],i=Jt();i!==o;)r.push(i),i=Jt();r!==o?(At=e,e=t=de(n)):(St=e,e=c)}else St=e,e=c;else St=e,e=c;return _t[a]={nextPos:St,result:e},e}function Yt(){var e,n,r,i,a,s,u,l=49*St+30,f=_t[l];if(f)return St=f.nextPos,f.result;for(e=St,n=[],r=Jt();r!==o;)n.push(r),r=Jt();if(n!==o)if((r=qt())!==o){for(i=[],a=Jt();a!==o;)i.push(a),a=Jt();if(i!==o)if(44===t.charCodeAt(St)?(a=he,St++):(a=o,0===Ot&&Pt(ye)),a!==o){for(s=[],u=Jt();u!==o;)s.push(u),u=Jt();s!==o?(At=e,e=n=de(r)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;else St=e,e=c;return _t[l]={nextPos:St,result:e},e}function Jt(){var e,t=49*St+31,n=_t[t];return n?(St=n.nextPos,n.result):((e=nn())===o&&(e=rn())===o&&(e=Ut()),_t[t]={nextPos:St,result:e},e)}function Qt(){var e,n,r,i,a,s,u,l,f,p,d,h=49*St+33,y=_t[h];if(y)return St=y.nextPos,y.result;for(e=St,n=[],r=nn();r!==o;)n.push(r),r=nn();if(n!==o)if((r=Mt())!==o){for(i=[],a=nn();a!==o;)i.push(a),a=nn();if(i!==o)if(61===t.charCodeAt(St)?(a=x,St++):(a=o,0===Ot&&Pt(T)),a!==o){for(s=[],u=nn();u!==o;)s.push(u),u=nn();if(s!==o)if((u=qt())!==o){for(l=[],f=nn();f!==o;)l.push(f),f=nn();if(l!==o)if(44===t.charCodeAt(St)?(f=he,St++):(f=o,0===Ot&&Pt(ye)),f!==o){for(p=[],d=nn();d!==o;)p.push(d),d=nn();p!==o?(At=e,e=n=Se(r,u)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;else St=e,e=c}else St=e,e=c;else St=e,e=c}else St=e,e=c;else St=e,e=c;if(e===o){for(e=St,n=[],r=nn();r!==o;)n.push(r),r=nn();if(n!==o)if((r=Mt())!==o){for(i=[],a=nn();a!==o;)i.push(a),a=nn();if(i!==o)if(61===t.charCodeAt(St)?(a=x,St++):(a=o,0===Ot&&Pt(T)),a!==o){for(s=[],u=nn();u!==o;)s.push(u),u=nn();s!==o&&(u=qt())!==o?(At=e,e=n=Se(r,u)):(St=e,e=c)}else St=e,e=c;else St=e,e=c}else St=e,e=c;else St=e,e=c}return _t[h]={nextPos:St,result:e},e}function en(){var e,n,r,i=49*St+34,a=_t[i];return a?(St=a.nextPos,a.result):(e=St,46===t.charCodeAt(St)?(n=A,St++):(n=o,0===Ot&&Pt(E)),n!==o&&(r=ln())!==o?(At=e,e=n=Ae(r)):(St=e,e=c),_t[i]={nextPos:St,result:e},e)}function tn(){var e,n,r,i,a,s,u,l,f,p,d,h,y=49*St+35,g=_t[y];return g?(St=g.nextPos,g.result):(e=St,n=St,(r=cn())!==o&&(i=cn())!==o&&(a=cn())!==o&&(s=cn())!==o?(45===t.charCodeAt(St)?(u=Q,St++):(u=o,0===Ot&&Pt(ee)),u!==o&&(l=cn())!==o&&(f=cn())!==o?(45===t.charCodeAt(St)?(p=Q,St++):(p=o,0===Ot&&Pt(ee)),p!==o&&(d=cn())!==o&&(h=cn())!==o?n=r=[r,i,a,s,u,l,f,p,d,h]:(St=n,n=c)):(St=n,n=c)):(St=n,n=c),n!==o&&(At=e,n=Ee(n)),e=n,_t[y]={nextPos:St,result:e},e)}function nn(){var e,n=49*St+39,r=_t[n];return r?(St=r.nextPos,r.result):(Re.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===Ot&&Pt(je)),_t[n]={nextPos:St,result:e},e)}function rn(){var e,n,r,i=49*St+40,a=_t[i];return a?(St=a.nextPos,a.result):(10===t.charCodeAt(St)?(e=Ue,St++):(e=o,0===Ot&&Pt(Fe)),e===o&&(e=St,13===t.charCodeAt(St)?(n=Ne,St++):(n=o,0===Ot&&Pt(Le)),n!==o?(10===t.charCodeAt(St)?(r=Ue,St++):(r=o,0===Ot&&Pt(Fe)),r!==o?e=n=[n,r]:(St=e,e=c)):(St=e,e=c)),_t[i]={nextPos:St,result:e},e)}function on(){var e,t=49*St+41,n=_t[t];return n?(St=n.nextPos,n.result):((e=rn())===o&&(e=nn()),_t[t]={nextPos:St,result:e},e)}function an(){var e,n,r=49*St+42,i=_t[r];return i?(St=i.nextPos,i.result):(e=St,Ot++,t.length>St?(n=t.charAt(St),St++):(n=o,0===Ot&&Pt(p)),Ot--,n===o?e=f:(St=e,e=c),_t[r]={nextPos:St,result:e},e)}function sn(){var e,n=49*St+43,r=_t[n];return r?(St=r.nextPos,r.result):(Me.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===Ot&&Pt(De)),_t[n]={nextPos:St,result:e},e)}function cn(){var e,n,r=49*St+44,i=_t[r];return i?(St=i.nextPos,i.result):(qe.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===Ot&&Pt(Ve)),e===o&&(e=St,95===t.charCodeAt(St)?(n=ze,St++):(n=o,0===Ot&&Pt(Ke)),n!==o&&(At=e,n=He()),e=n),_t[r]={nextPos:St,result:e},e)}function un(){var e,n=49*St+45,r=_t[n];return r?(St=r.nextPos,r.result):($e.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===Ot&&Pt(Ge)),_t[n]={nextPos:St,result:e},e)}function ln(){var e,t,n,r=49*St+46,i=_t[r];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(n=cn())!==o)for(;n!==o;)t.push(n),n=cn();else t=c;return t!==o&&(At=e,t=We(t)),e=t,_t[r]={nextPos:St,result:e},e}function fn(){var e,n,r=49*St+47,i=_t[r];return i?(St=i.nextPos,i.result):(e=St,t.substr(St,2)===Xe?(n=Xe,St+=2):(n=o,0===Ot&&Pt(Ze)),n!==o&&(At=e,n=Ye()),(e=n)===o&&(e=St,t.substr(St,2)===Je?(n=Je,St+=2):(n=o,0===Ot&&Pt(Qe)),n!==o&&(At=e,n=et()),(e=n)===o&&(e=St,t.substr(St,2)===tt?(n=tt,St+=2):(n=o,0===Ot&&Pt(nt)),n!==o&&(At=e,n=rt()),(e=n)===o&&(e=St,t.substr(St,2)===ot?(n=ot,St+=2):(n=o,0===Ot&&Pt(it)),n!==o&&(At=e,n=at()),(e=n)===o&&(e=St,t.substr(St,2)===st?(n=st,St+=2):(n=o,0===Ot&&Pt(ct)),n!==o&&(At=e,n=ut()),(e=n)===o&&(e=St,t.substr(St,2)===lt?(n=lt,St+=2):(n=o,0===Ot&&Pt(ft)),n!==o&&(At=e,n=pt()),(e=n)===o&&(e=St,t.substr(St,2)===dt?(n=dt,St+=2):(n=o,0===Ot&&Pt(ht)),n!==o&&(At=e,n=yt()),(e=n)===o&&(e=function(){var e,n,r,i,a,s,u,l,f,p,d,h=49*St+48,y=_t[h];return y?(St=y.nextPos,y.result):(e=St,t.substr(St,2)===gt?(n=gt,St+=2):(n=o,0===Ot&&Pt(mt)),n!==o?(r=St,(i=sn())!==o&&(a=sn())!==o&&(s=sn())!==o&&(u=sn())!==o&&(l=sn())!==o&&(f=sn())!==o&&(p=sn())!==o&&(d=sn())!==o?r=i=[i,a,s,u,l,f,p,d]:(St=r,r=c),r!==o?(At=e,e=n=vt(r)):(St=e,e=c)):(St=e,e=c),e===o&&(e=St,t.substr(St,2)===bt?(n=bt,St+=2):(n=o,0===Ot&&Pt(wt)),n!==o?(r=St,(i=sn())!==o&&(a=sn())!==o&&(s=sn())!==o&&(u=sn())!==o?r=i=[i,a,s,u]:(St=r,r=c),r!==o?(At=e,e=n=vt(r)):(St=e,e=c)):(St=e,e=c)),_t[h]={nextPos:St,result:e},e)}()))))))),_t[r]={nextPos:St,result:e},e)}var pn=[];function dn(e){pn.push(e)}function hn(e,t,n,r,o){var i={type:e,value:t,line:n(),column:r()};return o&&(i.key=o),i}if((n=a())!==o&&St===t.length)return n;throw n!==o&&St<t.length&&Pt({type:\"end\",description:\"end of input\"}),function(n,r,o){var i=Bt(o),a=o<t.length?t.charAt(o):null;return null!==r&&function(e){var t=1;for(e.sort(function(e,t){return e.description<t.description?-1:e.description>t.description?1:0});t<e.length;)e[t-1]===e[t]?e.splice(t,1):t++}(r),new e(null!==n?n:function(e,t){var n,r=new Array(e.length);for(n=0;n<e.length;n++)r[n]=e[n].description;return\"Expected \"+(e.length>1?r.slice(0,-1).join(\", \")+\" or \"+r[e.length-1]:r[0])+\" but \"+(t?'\"'+function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\x08/g,\"\\\\b\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\f/g,\"\\\\f\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x07\\x0B\\x0E\\x0F]/g,function(e){return\"\\\\x0\"+t(e)}).replace(/[\\x10-\\x1F\\x80-\\xFF]/g,function(e){return\"\\\\x\"+t(e)}).replace(/[\\u0180-\\u0FFF]/g,function(e){return\"\\\\u0\"+t(e)}).replace(/[\\u1080-\\uFFFF]/g,function(e){return\"\\\\u\"+t(e)})}(t)+'\"':\"end of input\")+\" found.\"}(r,a),r,a,o,i.line,i.column)}(null,kt,Tt)}}}()},1430(e,t,n){var r,o;!function(i,a){\"use strict\";e.exports?e.exports=a():void 0===(o=\"function\"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=o)}(0,function(e){\"use strict\";var t=e&&e.IPv6;return{best:function(e){var t,n,r=e.toLowerCase().split(\":\"),o=r.length,i=8;for(\"\"===r[0]&&\"\"===r[1]&&\"\"===r[2]?(r.shift(),r.shift()):\"\"===r[0]&&\"\"===r[1]?r.shift():\"\"===r[o-1]&&\"\"===r[o-2]&&r.pop(),-1!==r[(o=r.length)-1].indexOf(\".\")&&(i=7),t=0;t<o&&\"\"!==r[t];t++);if(t<i)for(r.splice(t,1,\"0000\");r.length<i;)r.splice(t,0,\"0000\");for(var a=0;a<i;a++){n=r[a].split(\"\");for(var s=0;s<3&&\"0\"===n[0]&&n.length>1;s++)n.splice(0,1);r[a]=n.join(\"\")}var c=-1,u=0,l=0,f=-1,p=!1;for(a=0;a<i;a++)p?\"0\"===r[a]?l+=1:(p=!1,l>u&&(c=f,u=l)):\"0\"===r[a]&&(p=!0,f=a,l=1);l>u&&(c=f,u=l),u>1&&r.splice(c,u,\"\"),o=r.length;var d=\"\";for(\"\"===r[0]&&(d=\":\"),a=0;a<o&&(d+=r[a],a!==o-1);a++)d+=\":\";return\"\"===r[o-1]&&(d+=\":\"),d},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}})},4704(e,t,n){var r,o;!function(i,a){\"use strict\";e.exports?e.exports=a():void 0===(o=\"function\"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=o)}(0,function(e){\"use strict\";var t=e&&e.SecondLevelDomains,n={list:{ac:\" com gov mil net org \",ae:\" ac co gov mil name net org pro sch \",af:\" com edu gov net org \",al:\" com edu gov mil net org \",ao:\" co ed gv it og pb \",ar:\" com edu gob gov int mil net org tur \",at:\" ac co gv or \",au:\" asn com csiro edu gov id net org \",ba:\" co com edu gov mil net org rs unbi unmo unsa untz unze \",bb:\" biz co com edu gov info net org store tv \",bh:\" biz cc com edu gov info net org \",bn:\" com edu gov net org \",bo:\" com edu gob gov int mil net org tv \",br:\" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg \",bs:\" com edu gov net org \",bz:\" du et om ov rg \",ca:\" ab bc mb nb nf nl ns nt nu on pe qc sk yk \",ck:\" biz co edu gen gov info net org \",cn:\" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj \",co:\" com edu gov mil net nom org \",cr:\" ac c co ed fi go or sa \",cy:\" ac biz com ekloges gov ltd name net org parliament press pro tm \",do:\" art com edu gob gov mil net org sld web \",dz:\" art asso com edu gov net org pol \",ec:\" com edu fin gov info med mil net org pro \",eg:\" com edu eun gov mil name net org sci \",er:\" com edu gov ind mil net org rochest w \",es:\" com edu gob nom org \",et:\" biz com edu gov info name net org \",fj:\" ac biz com info mil name net org pro \",fk:\" ac co gov net nom org \",fr:\" asso com f gouv nom prd presse tm \",gg:\" co net org \",gh:\" com edu gov mil org \",gn:\" ac com gov net org \",gr:\" com edu gov mil net org \",gt:\" com edu gob ind mil net org \",gu:\" com edu gov net org \",hk:\" com edu gov idv net org \",hu:\" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video \",id:\" ac co go mil net or sch web \",il:\" ac co gov idf k12 muni net org \",in:\" ac co edu ernet firm gen gov i ind mil net nic org res \",iq:\" com edu gov i mil net org \",ir:\" ac co dnssec gov i id net org sch \",it:\" edu gov \",je:\" co net org \",jo:\" com edu gov mil name net org sch \",jp:\" ac ad co ed go gr lg ne or \",ke:\" ac co go info me mobi ne or sc \",kh:\" com edu gov mil net org per \",ki:\" biz com de edu gov info mob net org tel \",km:\" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire \",kn:\" edu gov net org \",kr:\" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan \",kw:\" com edu gov net org \",ky:\" com edu gov net org \",kz:\" com edu gov mil net org \",lb:\" com edu gov net org \",lk:\" assn com edu gov grp hotel int ltd net ngo org sch soc web \",lr:\" com edu gov net org \",lv:\" asn com conf edu gov id mil net org \",ly:\" com edu gov id med net org plc sch \",ma:\" ac co gov m net org press \",mc:\" asso tm \",me:\" ac co edu gov its net org priv \",mg:\" com edu gov mil nom org prd tm \",mk:\" com edu gov inf name net org pro \",ml:\" com edu gov net org presse \",mn:\" edu gov org \",mo:\" com edu gov net org \",mt:\" com edu gov net org \",mv:\" aero biz com coop edu gov info int mil museum name net org pro \",mw:\" ac co com coop edu gov int museum net org \",mx:\" com edu gob net org \",my:\" com edu gov mil name net org sch \",nf:\" arts com firm info net other per rec store web \",ng:\" biz com edu gov mil mobi name net org sch \",ni:\" ac co com edu gob mil net nom org \",np:\" com edu gov mil net org \",nr:\" biz com edu gov info net org \",om:\" ac biz co com edu gov med mil museum net org pro sch \",pe:\" com edu gob mil net nom org sld \",ph:\" com edu gov i mil net ngo org \",pk:\" biz com edu fam gob gok gon gop gos gov net org web \",pl:\" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora \",pr:\" ac biz com edu est gov info isla name net org pro prof \",ps:\" com edu gov net org plo sec \",pw:\" belau co ed go ne or \",ro:\" arts com firm info nom nt org rec store tm www \",rs:\" ac co edu gov in org \",sb:\" com edu gov net org \",sc:\" com edu gov net org \",sh:\" co com edu gov net nom org \",sl:\" com edu gov net org \",st:\" co com consulado edu embaixada gov mil net org principe saotome store \",sv:\" com edu gob org red \",sz:\" ac co org \",tr:\" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web \",tt:\" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel \",tw:\" club com ebiz edu game gov idv mil net org \",mu:\" ac co com gov net or org \",mz:\" ac co edu gov org \",na:\" co com \",nz:\" ac co cri geek gen govt health iwi maori mil net org parliament school \",pa:\" abo ac com edu gob ing med net nom org sld \",pt:\" com edu gov int net nome org publ \",py:\" com edu gov mil net org \",qa:\" com edu gov mil net org \",re:\" asso com nom \",ru:\" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk \",rw:\" ac co com edu gouv gov int mil net \",sa:\" com edu gov med net org pub sch \",sd:\" com edu gov info med net org tv \",se:\" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z \",sg:\" com edu gov idn net org per \",sn:\" art com edu gouv org perso univ \",sy:\" com edu gov mil net news org \",th:\" ac co go in mi net or \",tj:\" ac biz co com edu go gov info int mil name net nic org test web \",tn:\" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism \",tz:\" ac co go ne or \",ua:\" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt \",ug:\" ac co go ne or org sc \",uk:\" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc \",us:\" dni fed isa kids nsn \",uy:\" com edu gub mil net org \",ve:\" co com edu gob info mil net org web \",vi:\" co com k12 net org \",vn:\" ac biz com edu gov health info int name net org pro \",ye:\" co com gov ltd me net org plc \",yu:\" ac co edu gov org \",za:\" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web \",zm:\" ac co com edu gov net org sch \",com:\"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za \",net:\"gb jp se uk \",org:\"ae\",de:\"com \"},has:function(e){var t=e.lastIndexOf(\".\");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(\".\",t-1);if(r<=0||r>=t-1)return!1;var o=n.list[e.slice(t+1)];return!!o&&o.indexOf(\" \"+e.slice(r+1,t)+\" \")>=0},is:function(e){var t=e.lastIndexOf(\".\");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(\".\",t-1)>=0)return!1;var r=n.list[e.slice(t+1)];return!!r&&r.indexOf(\" \"+e.slice(0,t)+\" \")>=0},get:function(e){var t=e.lastIndexOf(\".\");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(\".\",t-1);if(r<=0||r>=t-1)return null;var o=n.list[e.slice(t+1)];return o?o.indexOf(\" \"+e.slice(r+1,t)+\" \")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})},4193(e,t,n){var r,o,i;!function(a,s){\"use strict\";e.exports?e.exports=s(n(9340),n(1430),n(4704)):(o=[n(9340),n(1430),n(4704)],void 0===(i=\"function\"==typeof(r=s)?r.apply(t,o):r)||(e.exports=i))}(0,function(e,t,n,r){\"use strict\";var o=r&&r.URI;function i(e,t){var n=arguments.length>=1;if(!(this instanceof i))return n?arguments.length>=2?new i(e,t):new i(e):new i;if(void 0===e){if(n)throw new TypeError(\"undefined is not a valid argument for URI\");e=\"undefined\"!=typeof location?location.href+\"\":\"\"}if(null===e&&n)throw new TypeError(\"null is not a valid argument for URI\");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version=\"1.19.11\";var a=i.prototype,s=Object.prototype.hasOwnProperty;function c(e){return e.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g,\"\\\\$1\")}function u(e){return void 0===e?\"Undefined\":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return\"Array\"===u(e)}function f(e,t){var n,r,o={};if(\"RegExp\"===u(t))o=null;else if(l(t))for(n=0,r=t.length;n<r;n++)o[t[n]]=!0;else o[t]=!0;for(n=0,r=e.length;n<r;n++)(o&&void 0!==o[e[n]]||!o&&t.test(e[n]))&&(e.splice(n,1),r--,n--);return e}function p(e,t){var n,r;if(l(t)){for(n=0,r=t.length;n<r;n++)if(!p(e,t[n]))return!1;return!0}var o=u(t);for(n=0,r=e.length;n<r;n++)if(\"RegExp\"===o){if(\"string\"==typeof e[n]&&e[n].match(t))return!0}else if(e[n]===t)return!0;return!1}function d(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function h(e){return e.replace(/^\\/+|\\/+$/g,\"\")}function y(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,y).replace(/\\*/g,\"%2A\")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/,i.ip6_expression=/^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/,i.find_uri_expression=/\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?\\xab\\xbb\\u201c\\u201d\\u2018\\u2019]))/gi,i.findUri={start:/\\b(?:([a-z][a-z0-9.+-]*:\\/\\/)|www\\.)/gi,end:/[\\s\\r\\n]|$/,trim:/[`!()\\[\\]{};:'\".,<>?\\xab\\xbb\\u201c\\u201d\\u201e\\u2018\\u2019]+$/,parens:/(\\([^\\)]*\\)|\\[[^\\]]*\\]|\\{[^}]*\\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/,i.ascii_tab_whitespace=/[\\u0009\\u000A\\u000D]+/g,i.defaultPorts={http:\"80\",https:\"443\",ftp:\"21\",gopher:\"70\",ws:\"80\",wss:\"443\"},i.hostProtocols=[\"http\",\"https\"],i.invalid_hostname_characters=/[^a-zA-Z0-9\\.\\-:_]/,i.domAttributes={a:\"href\",blockquote:\"cite\",link:\"href\",base:\"href\",script:\"src\",form:\"action\",img:\"src\",area:\"href\",iframe:\"src\",embed:\"src\",source:\"src\",track:\"src\",input:\"src\",audio:\"src\",video:\"src\"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if(\"input\"!==t||\"image\"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{\"%24\":\"$\",\"%26\":\"&\",\"%2B\":\"+\",\"%2C\":\",\",\"%3B\":\";\",\"%3D\":\"=\",\"%3A\":\":\",\"%40\":\"@\"}},decode:{expression:/[\\/\\?#]/g,map:{\"/\":\"%2F\",\"?\":\"%3F\",\"#\":\"%23\"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{\"%3A\":\":\",\"%2F\":\"/\",\"%3F\":\"?\",\"%23\":\"#\",\"%5B\":\"[\",\"%5D\":\"]\",\"%40\":\"@\",\"%21\":\"!\",\"%24\":\"$\",\"%26\":\"&\",\"%27\":\"'\",\"%28\":\"(\",\"%29\":\")\",\"%2A\":\"*\",\"%2B\":\"+\",\"%2C\":\",\",\"%3B\":\";\",\"%3D\":\"=\"}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{\"%21\":\"!\",\"%24\":\"$\",\"%27\":\"'\",\"%28\":\"(\",\"%29\":\")\",\"%2A\":\"*\",\"%2B\":\"+\",\"%2C\":\",\",\"%3B\":\";\",\"%3D\":\"=\",\"%40\":\"@\"}},decode:{expression:/[\\/\\?#:]/g,map:{\"/\":\"%2F\",\"?\":\"%3F\",\"#\":\"%23\",\":\":\"%3A\"}}}},i.encodeQuery=function(e,t){var n=i.encode(e+\"\");return void 0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,\"+\"):n},i.decodeQuery=function(e,t){e+=\"\",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\\+/g,\"%20\"):e)}catch(t){return e}};var m,v={encode:\"encode\",decode:\"decode\"},b=function(e,t){return function(n){try{return i[t](n+\"\").replace(i.characters[e][t].expression,function(n){return i.characters[e][t].map[n]})}catch(e){return n}}};for(m in v)i[m+\"PathSegment\"]=b(\"pathname\",v[m]),i[m+\"UrnPathSegment\"]=b(\"urnpath\",v[m]);var w=function(e,t,n){return function(r){var o;o=n?function(e){return i[t](i[n](e))}:i[t];for(var a=(r+\"\").split(e),s=0,c=a.length;s<c;s++)a[s]=o(a[s]);return a.join(e)}};function S(e){return function(t,n){return void 0===t?this._parts[e]||\"\":(this._parts[e]=t||null,this.build(!n),this)}}function A(e,t){return function(n,r){return void 0===n?this._parts[e]||\"\":(null!==n&&(n+=\"\").charAt(0)===t&&(n=n.substring(1)),this._parts[e]=n,this.build(!r),this)}}i.decodePath=w(\"/\",\"decodePathSegment\"),i.decodeUrnPath=w(\":\",\"decodeUrnPathSegment\"),i.recodePath=w(\"/\",\"encodePathSegment\",\"decode\"),i.recodeUrnPath=w(\":\",\"encodeUrnPathSegment\",\"decode\"),i.encodeReserved=b(\"reserved\",\"encode\"),i.parse=function(e,t){var n;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),(n=(e=(e=e.replace(i.leading_whitespace_expression,\"\")).replace(i.ascii_tab_whitespace,\"\")).indexOf(\"#\"))>-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),(n=e.indexOf(\"?\"))>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),\"//\"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\\\]*/i,\"$1://\")).replace(/^[/\\\\]{2,}/i,\"//\")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(\":\"))>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:\"//\"===e.substring(n+1,n+3).replace(/\\\\/g,\"/\")?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e=\"\");var n,r,o=(e=e.replace(/\\\\/g,\"/\")).indexOf(\"/\");if(-1===o&&(o=e.length),\"[\"===e.charAt(0))n=e.indexOf(\"]\"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,o)||null,\"/\"===t.port&&(t.port=null);else{var a=e.indexOf(\":\"),s=e.indexOf(\"/\"),c=e.indexOf(\":\",a+1);-1!==c&&(-1===s||c<s)?(t.hostname=e.substring(0,o)||null,t.port=null):(r=e.substring(0,o).split(\":\"),t.hostname=r[0]||null,t.port=r[1]||null)}return t.hostname&&\"/\"!==e.substring(o).charAt(0)&&(o++,e=\"/\"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||\"/\"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var n=e;-1!==e.indexOf(\"\\\\\")&&(e=e.replace(/\\\\/g,\"/\"));var r,o=e.indexOf(\"/\"),a=e.lastIndexOf(\"@\",o>-1?o:e.length-1);return a>-1&&(-1===o||a<o)?(r=e.substring(0,a).split(\":\"),t.username=r[0]?i.decode(r[0]):null,r.shift(),t.password=r[0]?i.decode(r.join(\":\")):null,e=n.substring(a+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,\"&\").replace(/^\\?*&*|&+$/g,\"\")))return{};for(var n,r,o,a={},c=e.split(\"&\"),u=c.length,l=0;l<u;l++)n=c[l].split(\"=\"),r=i.decodeQuery(n.shift(),t),o=n.length?i.decodeQuery(n.join(\"=\"),t):null,\"__proto__\"!==r&&(s.call(a,r)?(\"string\"!=typeof a[r]&&null!==a[r]||(a[r]=[a[r]]),a[r].push(o)):a[r]=o);return a},i.build=function(e){var t=\"\",n=!1;return e.protocol&&(t+=e.protocol+\":\"),e.urn||!t&&!e.hostname||(t+=\"//\",n=!0),t+=i.buildAuthority(e)||\"\",\"string\"==typeof e.path&&(\"/\"!==e.path.charAt(0)&&n&&(t+=\"/\"),t+=e.path),\"string\"==typeof e.query&&e.query&&(t+=\"?\"+e.query),\"string\"==typeof e.fragment&&e.fragment&&(t+=\"#\"+e.fragment),t},i.buildHost=function(e){var t=\"\";return e.hostname?(i.ip6_expression.test(e.hostname)?t+=\"[\"+e.hostname+\"]\":t+=e.hostname,e.port&&(t+=\":\"+e.port),t):\"\"},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t=\"\";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=\":\"+i.encode(e.password)),t&&(t+=\"@\"),t},i.buildQuery=function(e,t,n){var r,o,a,c,u=\"\";for(o in e)if(\"__proto__\"!==o&&s.call(e,o))if(l(e[o]))for(r={},a=0,c=e[o].length;a<c;a++)void 0!==e[o][a]&&void 0===r[e[o][a]+\"\"]&&(u+=\"&\"+i.buildQueryParameter(o,e[o][a],n),!0!==t&&(r[e[o][a]+\"\"]=!0));else void 0!==e[o]&&(u+=\"&\"+i.buildQueryParameter(o,e[o],n));return u.substring(1)},i.buildQueryParameter=function(e,t,n){return i.encodeQuery(e,n)+(null!==t?\"=\"+i.encodeQuery(t,n):\"\")},i.addQuery=function(e,t,n){if(\"object\"==typeof t)for(var r in t)s.call(t,r)&&i.addQuery(e,r,t[r]);else{if(\"string\"!=typeof t)throw new TypeError(\"URI.addQuery() accepts an object, string as the name parameter\");if(void 0===e[t])return void(e[t]=n);\"string\"==typeof e[t]&&(e[t]=[e[t]]),l(n)||(n=[n]),e[t]=(e[t]||[]).concat(n)}},i.setQuery=function(e,t,n){if(\"object\"==typeof t)for(var r in t)s.call(t,r)&&i.setQuery(e,r,t[r]);else{if(\"string\"!=typeof t)throw new TypeError(\"URI.setQuery() accepts an object, string as the name parameter\");e[t]=void 0===n?null:n}},i.removeQuery=function(e,t,n){var r,o,a;if(l(t))for(r=0,o=t.length;r<o;r++)e[t[r]]=void 0;else if(\"RegExp\"===u(t))for(a in e)t.test(a)&&(e[a]=void 0);else if(\"object\"==typeof t)for(a in t)s.call(t,a)&&i.removeQuery(e,a,t[a]);else{if(\"string\"!=typeof t)throw new TypeError(\"URI.removeQuery() accepts an object, string, RegExp as the first parameter\");void 0!==n?\"RegExp\"===u(n)?!l(e[t])&&n.test(e[t])?e[t]=void 0:e[t]=f(e[t],n):e[t]!==String(n)||l(n)&&1!==n.length?l(e[t])&&(e[t]=f(e[t],n)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,n,r){switch(u(t)){case\"String\":break;case\"RegExp\":for(var o in e)if(s.call(e,o)&&t.test(o)&&(void 0===n||i.hasQuery(e,o,n)))return!0;return!1;case\"Object\":for(var a in t)if(s.call(t,a)&&!i.hasQuery(e,a,t[a]))return!1;return!0;default:throw new TypeError(\"URI.hasQuery() accepts a string, regular expression or object as the name parameter\")}switch(u(n)){case\"Undefined\":return t in e;case\"Boolean\":return n===Boolean(l(e[t])?e[t].length:e[t]);case\"Function\":return!!n(e[t],t,e);case\"Array\":return!!l(e[t])&&(r?p:d)(e[t],n);case\"RegExp\":return l(e[t])?!!r&&p(e[t],n):Boolean(e[t]&&e[t].match(n));case\"Number\":n=String(n);case\"String\":return l(e[t])?!!r&&p(e[t],n):e[t]===n;default:throw new TypeError(\"URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter\")}},i.joinPaths=function(){for(var e=[],t=[],n=0,r=0;r<arguments.length;r++){var o=new i(arguments[r]);e.push(o);for(var a=o.segment(),s=0;s<a.length;s++)\"string\"==typeof a[s]&&t.push(a[s]),a[s]&&n++}if(!t.length||!n)return new i(\"\");var c=new i(\"\").segment(t);return\"\"!==e[0].path()&&\"/\"!==e[0].path().slice(0,1)||c.path(\"/\"+c.path()),c.normalize()},i.commonPath=function(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n)){n--;break}return n<1?e.charAt(0)===t.charAt(0)&&\"/\"===e.charAt(0)?\"/\":\"\":(\"/\"===e.charAt(n)&&\"/\"===t.charAt(n)||(n=e.substring(0,n).lastIndexOf(\"/\")),e.substring(0,n+1))},i.withinString=function(e,t,n){n||(n={});var r=n.start||i.findUri.start,o=n.end||i.findUri.end,a=n.trim||i.findUri.trim,s=n.parens||i.findUri.parens,c=/[a-z0-9-]=[\"']?$/i;for(r.lastIndex=0;;){var u=r.exec(e);if(!u)break;var l=u.index;if(n.ignoreHtml){var f=e.slice(Math.max(l-3,0),l);if(f&&c.test(f))continue}for(var p=l+e.slice(l).search(o),d=e.slice(l,p),h=-1;;){var y=s.exec(d);if(!y)break;var g=y.index+y[0].length;h=Math.max(h,g)}if(!((d=h>-1?d.slice(0,h)+d.slice(h).replace(a,\"\"):d.replace(a,\"\")).length<=u[0].length||n.ignore&&n.ignore.test(d))){var m=t(d,l,p=l+d.length,e);void 0!==m?(m=String(m),e=e.slice(0,l)+m+e.slice(p),r.lastIndex=l+m.length):r.lastIndex=p}}return r.lastIndex=0,e},i.ensureValidHostname=function(t,n){var r=!!t,o=!1;if(!!n&&(o=p(i.hostProtocols,n)),o&&!r)throw new TypeError(\"Hostname cannot be empty, if protocol is \"+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname \"'+t+'\" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname \"'+t+'\" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port \"'+e+'\" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&\"function\"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&\"function\"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&\"function\"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=o),this},a.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new i(this)},a.valueOf=a.toString=function(){return this.build(!1)._string},a.protocol=S(\"protocol\"),a.username=S(\"username\"),a.password=S(\"password\"),a.hostname=S(\"hostname\"),a.port=S(\"port\"),a.query=A(\"query\",\"?\"),a.fragment=A(\"fragment\",\"#\"),a.search=function(e,t){var n=this.query(e,t);return\"string\"==typeof n&&n.length?\"?\"+n:n},a.hash=function(e,t){var n=this.fragment(e,t);return\"string\"==typeof n&&n.length?\"#\"+n:n},a.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?\"/\":\"\");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):\"\":this._parts.path=e?i.recodePath(e):\"/\",this.build(!t),this},a.path=a.pathname,a.href=function(e,t){var n;if(void 0===e)return this.toString();this._string=\"\",this._parts=i._parts();var r=e instanceof i,o=\"object\"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||\"\",o=!1),!r&&o&&void 0!==e.pathname&&(e=e.toString()),\"string\"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)throw new TypeError(\"invalid input\");var a=r?e._parts:e;for(n in a)\"query\"!==n&&s.call(this._parts,n)&&(this._parts[n]=a[n]);a.query&&this.query(a.query,!1)}return this.build(!t),this},a.is=function(e){var t=!1,r=!1,o=!1,a=!1,s=!1,c=!1,u=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,r=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),s=(a=!(t=r||o))&&n&&n.has(this._parts.hostname),c=a&&i.idn_expression.test(this._parts.hostname),u=a&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case\"relative\":return l;case\"absolute\":return!l;case\"domain\":case\"name\":return a;case\"sld\":return s;case\"ip\":return t;case\"ip4\":case\"ipv4\":case\"inet4\":return r;case\"ip6\":case\"ipv6\":case\"inet6\":return o;case\"idn\":return c;case\"url\":return!this._parts.urn;case\"urn\":return!!this._parts.urn;case\"punycode\":return u}return null};var E=a.protocol,x=a.port,T=a.hostname;a.protocol=function(e,t){if(e&&!(e=e.replace(/:(\\/\\/)?$/,\"\")).match(i.protocol_expression))throw new TypeError('Protocol \"'+e+\"\\\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]\");return E.call(this,e,t)},a.scheme=a.protocol,a.port=function(e,t){return this._parts.urn?void 0===e?\"\":this:(void 0!==e&&(0===e&&(e=null),e&&(\":\"===(e+=\"\").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),x.call(this,e,t))},a.hostname=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname};if(\"/\"!==i.parseHost(e,n))throw new TypeError('Hostname \"'+e+'\" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return T.call(this,e,t)},a.origin=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(void 0===e){var n=this.protocol();return this.authority()?(n?n+\"://\":\"\")+this.authority():\"\"}var r=i(e);return this.protocol(r.protocol()).authority(r.authority()).build(!t),this},a.host=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):\"\";if(\"/\"!==i.parseHost(e,this._parts))throw new TypeError('Hostname \"'+e+'\" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.authority=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):\"\";if(\"/\"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname \"'+e+'\" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.userinfo=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(void 0===e){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return\"@\"!==e[e.length-1]&&(e+=\"@\"),i.parseUserinfo(e,this._parts),this.build(!t),this},a.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},a.subdomain=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(void 0===e){if(!this._parts.hostname||this.is(\"IP\"))return\"\";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||\"\"}var r=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),a=new RegExp(\"^\"+c(o));if(e&&\".\"!==e.charAt(e.length-1)&&(e+=\".\"),-1!==e.indexOf(\":\"))throw new TypeError(\"Domains cannot contain colons\");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,e),this.build(!t),this},a.domain=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(\"boolean\"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is(\"IP\"))return\"\";var n=this._parts.hostname.match(/\\./g);if(n&&n.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(\".\",r-1)+1,this._parts.hostname.substring(r)||\"\"}if(!e)throw new TypeError(\"cannot set domain empty\");if(-1!==e.indexOf(\":\"))throw new TypeError(\"Domains cannot contain colons\");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is(\"IP\"))this._parts.hostname=e;else{var o=new RegExp(c(this.domain())+\"$\");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},a.tld=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(\"boolean\"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is(\"IP\"))return\"\";var r=this._parts.hostname.lastIndexOf(\".\"),o=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError(\"cannot set TLD empty\");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD \"'+e+'\" contains characters other than [A-Z0-9]');i=new RegExp(c(this.tld())+\"$\"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is(\"IP\"))throw new ReferenceError(\"cannot set TLD on non-domain host\");i=new RegExp(c(this.tld())+\"$\"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},a.directory=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return\"\";if(\"/\"===this._parts.path)return\"/\";var n=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?\"/\":\"\");return e?i.decodePath(r):r}var o=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,o),s=new RegExp(\"^\"+c(a));return this.is(\"relative\")||(e||(e=\"/\"),\"/\"!==e.charAt(0)&&(e=\"/\"+e)),e&&\"/\"!==e.charAt(e.length-1)&&(e+=\"/\"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),this.build(!t),this},a.filename=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(\"string\"!=typeof e){if(!this._parts.path||\"/\"===this._parts.path)return\"\";var n=this._parts.path.lastIndexOf(\"/\"),r=this._parts.path.substring(n+1);return e?i.decodePathSegment(r):r}var o=!1;\"/\"===e.charAt(0)&&(e=e.substring(1)),e.match(/\\.?\\//)&&(o=!0);var a=new RegExp(c(this.filename())+\"$\");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),o?this.normalizePath(t):this.build(!t),this},a.suffix=function(e,t){if(this._parts.urn)return void 0===e?\"\":this;if(void 0===e||!0===e){if(!this._parts.path||\"/\"===this._parts.path)return\"\";var n,r,o=this.filename(),a=o.lastIndexOf(\".\");return-1===a?\"\":(n=o.substring(a+1),r=/^[a-z0-9%]+$/i.test(n)?n:\"\",e?i.decodePathSegment(r):r)}\".\"===e.charAt(0)&&(e=e.substring(1));var s,u=this.suffix();if(u)s=e?new RegExp(c(u)+\"$\"):new RegExp(c(\".\"+u)+\"$\");else{if(!e)return this;this._parts.path+=\".\"+i.recodePath(e)}return s&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e)),this.build(!t),this},a.segment=function(e,t,n){var r=this._parts.urn?\":\":\"/\",o=this.path(),i=\"/\"===o.substring(0,1),a=o.split(r);if(void 0!==e&&\"number\"!=typeof e&&(n=t,t=e,e=void 0),void 0!==e&&\"number\"!=typeof e)throw new Error('Bad segment \"'+e+'\", must be 0-based integer');if(i&&a.shift(),e<0&&(e=Math.max(a.length+e,0)),void 0===t)return void 0===e?a:a[e];if(null===e||void 0===a[e])if(l(t)){a=[];for(var s=0,c=t.length;s<c;s++)(t[s].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(h(t[s])))}else(t||\"string\"==typeof t)&&(t=h(t),\"\"===a[a.length-1]?a[a.length-1]=t:a.push(t));else t?a[e]=h(t):a.splice(e,1);return i&&a.unshift(\"\"),this.path(a.join(r),n)},a.segmentCoded=function(e,t,n){var r,o,a;if(\"number\"!=typeof e&&(n=t,t=e,e=void 0),void 0===t){if(l(r=this.segment(e,t,n)))for(o=0,a=r.length;o<a;o++)r[o]=i.decode(r[o]);else r=void 0!==r?i.decode(r):void 0;return r}if(l(t))for(o=0,a=t.length;o<a;o++)t[o]=i.encode(t[o]);else t=\"string\"==typeof t||t instanceof String?i.encode(t):t;return this.segment(e,t,n)};var k=a.query;return a.query=function(e,t){if(!0===e)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(\"function\"==typeof e){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=e.call(this,n);return this._parts.query=i.buildQuery(r||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&\"string\"!=typeof e?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):k.call(this,e,t)},a.setQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(\"string\"==typeof e||e instanceof String)r[e]=void 0!==t?t:null;else{if(\"object\"!=typeof e)throw new TypeError(\"URI.addQuery() accepts an object, string as the name parameter\");for(var o in e)s.call(e,o)&&(r[o]=e[o])}return this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),\"string\"!=typeof e&&(n=t),this.build(!n),this},a.addQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(r,e,void 0===t?null:t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),\"string\"!=typeof e&&(n=t),this.build(!n),this},a.removeQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(r,e,t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),\"string\"!=typeof e&&(n=t),this.build(!n),this},a.hasQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(r,e,t,n)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(e){return\"string\"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},a.normalizeHostname=function(n){return this._parts.hostname&&(this.is(\"IDN\")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is(\"IPv6\")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!n)),this},a.normalizePort=function(e){return\"string\"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},a.normalizePath=function(e){var t,n=this._parts.path;if(!n)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if(\"/\"===this._parts.path)return this;var r,o,a=\"\";for(\"/\"!==(n=i.recodePath(n)).charAt(0)&&(t=!0,n=\"/\"+n),\"/..\"!==n.slice(-3)&&\"/.\"!==n.slice(-2)||(n+=\"/\"),n=n.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g,\"/\").replace(/\\/{2,}/g,\"/\"),t&&(a=n.substring(1).match(/^(\\.\\.\\/)+/)||\"\")&&(a=a[0]);-1!==(r=n.search(/\\/\\.\\.(\\/|$)/));)0!==r?(-1===(o=n.substring(0,r).lastIndexOf(\"/\"))&&(o=r),n=n.substring(0,o)+n.substring(r+3)):n=n.substring(3);return t&&this.is(\"relative\")&&(n=a+n.substring(1)),this._parts.path=n,this.build(!e),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(e){return\"string\"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},a.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var e=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},a.unicode=function(){var e=i.encode,t=i.decode;i.encode=g,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},a.readable=function(){var t=this.clone();t.username(\"\").password(\"\").normalize();var n=\"\";if(t._parts.protocol&&(n+=t._parts.protocol+\"://\"),t._parts.hostname&&(t.is(\"punycode\")&&e?(n+=e.toUnicode(t._parts.hostname),t._parts.port&&(n+=\":\"+t._parts.port)):n+=t.host()),t._parts.hostname&&t._parts.path&&\"/\"!==t._parts.path.charAt(0)&&(n+=\"/\"),n+=t.path(!0),t._parts.query){for(var r=\"\",o=0,a=t._parts.query.split(\"&\"),s=a.length;o<s;o++){var c=(a[o]||\"\").split(\"=\");r+=\"&\"+i.decodeQuery(c[0],this._parts.escapeQuerySpace).replace(/&/g,\"%26\"),void 0!==c[1]&&(r+=\"=\"+i.decodeQuery(c[1],this._parts.escapeQuerySpace).replace(/&/g,\"%26\"))}n+=\"?\"+r.substring(1)}return n+i.decodeQuery(t.hash(),!0)},a.absoluteTo=function(e){var t,n,r,o=this.clone(),a=[\"protocol\",\"username\",\"password\",\"hostname\",\"port\"];if(this._parts.urn)throw new Error(\"URNs do not have any generally defined hierarchical components\");if(e instanceof i||(e=new i(e)),o._parts.protocol)return o;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)return o;for(n=0;r=a[n];n++)o._parts[r]=e._parts[r];return o._parts.path?(\"..\"===o._parts.path.substring(-2)&&(o._parts.path+=\"/\"),\"/\"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf(\"/\")?\"/\":\"\"),o._parts.path=(t?t+\"/\":\"\")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},a.relativeTo=function(e){var t,n,r,o,a,s=this.clone().normalize();if(s._parts.urn)throw new Error(\"URNs do not have any generally defined hierarchical components\");if(e=new i(e).normalize(),t=s._parts,n=e._parts,o=s.path(),a=e.path(),\"/\"!==o.charAt(0))throw new Error(\"URI is already relative\");if(\"/\"!==a.charAt(0))throw new Error(\"Cannot calculate a URI relative to another relative URI\");if(t.protocol===n.protocol&&(t.protocol=null),t.username!==n.username||t.password!==n.password)return s.build();if(null!==t.protocol||null!==t.username||null!==t.password)return s.build();if(t.hostname!==n.hostname||t.port!==n.port)return s.build();if(t.hostname=null,t.port=null,o===a)return t.path=\"\",s.build();if(!(r=i.commonPath(o,a)))return s.build();var c=n.path.substring(r.length).replace(/[^\\/]*$/,\"\").replace(/.*?\\//g,\"../\");return t.path=c+t.path.substring(r.length)||\"./\",s.build()},a.equals=function(e){var t,n,r,o,a,c=this.clone(),u=new i(e),f={};if(c.normalize(),u.normalize(),c.toString()===u.toString())return!0;if(r=c.query(),o=u.query(),c.query(\"\"),u.query(\"\"),c.toString()!==u.toString())return!1;if(r.length!==o.length)return!1;for(a in t=i.parseQuery(r,this._parts.escapeQuerySpace),n=i.parseQuery(o,this._parts.escapeQuerySpace),t)if(s.call(t,a)){if(l(t[a])){if(!d(t[a],n[a]))return!1}else if(t[a]!==n[a])return!1;f[a]=!0}for(a in n)if(s.call(n,a)&&!f[a])return!1;return!0},a.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},a.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},a.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},i})},9127(e,t,n){var r,o,i;!function(a,s){\"use strict\";e.exports?e.exports=s(n(4193)):(o=[n(4193)],void 0===(i=\"function\"==typeof(r=s)?r.apply(t,o):r)||(e.exports=i))}(0,function(e,t){\"use strict\";var n=t&&t.URITemplate,r=Object.prototype.hasOwnProperty;function o(e){return o._cache[e]?o._cache[e]:this instanceof o?(this.expression=e,o._cache[e]=this,this):new o(e)}function i(e){this.data=e,this.cache={}}var a=o.prototype,s={\"\":{prefix:\"\",separator:\",\",named:!1,empty_name_separator:!1,encode:\"encode\"},\"+\":{prefix:\"\",separator:\",\",named:!1,empty_name_separator:!1,encode:\"encodeReserved\"},\"#\":{prefix:\"#\",separator:\",\",named:!1,empty_name_separator:!1,encode:\"encodeReserved\"},\".\":{prefix:\".\",separator:\".\",named:!1,empty_name_separator:!1,encode:\"encode\"},\"/\":{prefix:\"/\",separator:\"/\",named:!1,empty_name_separator:!1,encode:\"encode\"},\";\":{prefix:\";\",separator:\";\",named:!0,empty_name_separator:!1,encode:\"encode\"},\"?\":{prefix:\"?\",separator:\"&\",named:!0,empty_name_separator:!0,encode:\"encode\"},\"&\":{prefix:\"&\",separator:\"&\",named:!0,empty_name_separator:!0,encode:\"encode\"}};return o._cache={},o.EXPRESSION_PATTERN=/\\{([^a-zA-Z0-9%_]?)([^\\}]+)(\\}|$)/g,o.VARIABLE_PATTERN=/^([^*:.](?:\\.?[^*:.])*)((\\*)|:(\\d+))?$/,o.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_.]/,o.LITERAL_PATTERN=/[<>{}\"`^| \\\\]/,o.expand=function(e,t,n){var r,i,a,c=s[e.operator],u=c.named?\"Named\":\"Unnamed\",l=e.variables,f=[];for(a=0;i=l[a];a++){if(0===(r=t.get(i.name)).type&&n&&n.strict)throw new Error('Missing expansion value for variable \"'+i.name+'\"');if(r.val.length){if(r.type>1&&i.maxlength)throw new Error('Invalid expression: Prefix modifier not applicable to variable \"'+i.name+'\"');f.push(o[\"expand\"+u](r,c,i.explode,i.explode&&c.separator||\",\",i.maxlength,i.name))}else r.type&&f.push(\"\")}return f.length?c.prefix+f.join(c.separator):\"\"},o.expandNamed=function(t,n,r,o,i,a){var s,c,u,l=\"\",f=n.encode,p=n.empty_name_separator,d=!t[f].length,h=2===t.type?\"\":e[f](a);for(c=0,u=t.val.length;c<u;c++)i?(s=e[f](t.val[c][1].substring(0,i)),2===t.type&&(h=e[f](t.val[c][0].substring(0,i)))):d?(s=e[f](t.val[c][1]),2===t.type?(h=e[f](t.val[c][0]),t[f].push([h,s])):t[f].push([void 0,s])):(s=t[f][c][1],2===t.type&&(h=t[f][c][0])),l&&(l+=o),r?l+=h+(p||s?\"=\":\"\")+s:(c||(l+=e[f](a)+(p||s?\"=\":\"\")),2===t.type&&(l+=h+\",\"),l+=s);return l},o.expandUnnamed=function(t,n,r,o,i){var a,s,c,u=\"\",l=n.encode,f=n.empty_name_separator,p=!t[l].length;for(s=0,c=t.val.length;s<c;s++)i?a=e[l](t.val[s][1].substring(0,i)):p?(a=e[l](t.val[s][1]),t[l].push([2===t.type?e[l](t.val[s][0]):void 0,a])):a=t[l][s][1],u&&(u+=o),2===t.type&&(u+=i?e[l](t.val[s][0].substring(0,i)):t[l][s][0],u+=r?f||a?\"=\":\"\":\",\"),u+=a;return u},o.noConflict=function(){return t.URITemplate===o&&(t.URITemplate=n),o},a.expand=function(e,t){var n=\"\";this.parts&&this.parts.length||this.parse(),e instanceof i||(e=new i(e));for(var r=0,a=this.parts.length;r<a;r++)n+=\"string\"==typeof this.parts[r]?this.parts[r]:o.expand(this.parts[r],e,t);return n},a.parse=function(){var e,t,n,r=this.expression,i=o.EXPRESSION_PATTERN,a=o.VARIABLE_PATTERN,c=o.VARIABLE_NAME_PATTERN,u=o.LITERAL_PATTERN,l=[],f=0,p=function(e){if(e.match(u))throw new Error('Invalid Literal \"'+e+'\"');return e};for(i.lastIndex=0;;){if(null===(t=i.exec(r))){l.push(p(r.substring(f)));break}if(l.push(p(r.substring(f,t.index))),f=t.index+t[0].length,!s[t[1]])throw new Error('Unknown Operator \"'+t[1]+'\" in \"'+t[0]+'\"');if(!t[3])throw new Error('Unclosed Expression \"'+t[0]+'\"');for(var d=0,h=(e=t[2].split(\",\")).length;d<h;d++){if(null===(n=e[d].match(a)))throw new Error('Invalid Variable \"'+e[d]+'\" in \"'+t[0]+'\"');if(n[1].match(c))throw new Error('Invalid Variable Name \"'+n[1]+'\" in \"'+t[0]+'\"');e[d]={name:n[1],explode:!!n[3],maxlength:n[4]&&parseInt(n[4],10)}}if(!e.length)throw new Error('Expression Missing Variable(s) \"'+t[0]+'\"');l.push({expression:t[0],operator:t[1],variables:e})}return l.length||l.push(p(r)),this.parts=l,this},i.prototype.get=function(e){var t,n,o,i=this.data,a={type:0,val:[],encode:[],encodeReserved:[]};if(void 0!==this.cache[e])return this.cache[e];if(this.cache[e]=a,null==(o=\"[object Function]\"===String(Object.prototype.toString.call(i))?i(e):\"[object Function]\"===String(Object.prototype.toString.call(i[e]))?i[e](e):i[e]))return a;if(\"[object Array]\"===String(Object.prototype.toString.call(o))){for(t=0,n=o.length;t<n;t++)void 0!==o[t]&&null!==o[t]&&a.val.push([void 0,String(o[t])]);a.val.length&&(a.type=3)}else if(\"[object Object]\"===String(Object.prototype.toString.call(o))){for(t in o)r.call(o,t)&&void 0!==o[t]&&null!==o[t]&&a.val.push([t,String(o[t])]);a.val.length&&(a.type=2)}else a.type=1,a.val.push([void 0,String(o)]);return a},e.expand=function(t,n){var r=new o(t).expand(n);return new e(r)},o})},9340(e,t,n){var r;e=n.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var o=\"object\"==typeof n.g&&n.g;o.global!==o&&o.window!==o&&o.self;var i,a=2147483647,s=36,c=/^xn--/,u=/[^\\x20-\\x7E]/,l=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,f={overflow:\"Overflow: input needs wider integers to process\",\"not-basic\":\"Illegal input >= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},p=Math.floor,d=String.fromCharCode;function h(e){throw new RangeError(f[e])}function y(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function g(e,t){var n=e.split(\"@\"),r=\"\";return n.length>1&&(r=n[0]+\"@\",e=n[1]),r+y((e=e.replace(l,\".\")).split(\".\"),t).join(\".\")}function m(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function v(e){return y(e,function(e){var t=\"\";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+d(e)}).join(\"\")}function b(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:s}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=s)e=p(e/35);return p(r+36*e/(e+38))}function A(e){var t,n,r,o,i,c,u,l,f,d,y=[],g=e.length,m=0,w=128,A=72;for((n=e.lastIndexOf(\"-\"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&h(\"not-basic\"),y.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=m,c=1,u=s;o>=g&&h(\"invalid-input\"),((l=b(e.charCodeAt(o++)))>=s||l>p((a-m)/c))&&h(\"overflow\"),m+=l*c,!(l<(f=u<=A?1:u>=A+26?26:u-A));u+=s)c>p(a/(d=s-f))&&h(\"overflow\"),c*=d;A=S(m-i,t=y.length+1,0==i),p(m/t)>a-w&&h(\"overflow\"),w+=p(m/t),m%=t,y.splice(m++,0,w)}return v(y)}function E(e){var t,n,r,o,i,c,u,l,f,y,g,v,b,A,E,x=[];for(v=(e=m(e)).length,t=128,n=0,i=72,c=0;c<v;++c)(g=e[c])<128&&x.push(d(g));for(r=o=x.length,o&&x.push(\"-\");r<v;){for(u=a,c=0;c<v;++c)(g=e[c])>=t&&g<u&&(u=g);for(u-t>p((a-n)/(b=r+1))&&h(\"overflow\"),n+=(u-t)*b,t=u,c=0;c<v;++c)if((g=e[c])<t&&++n>a&&h(\"overflow\"),g==t){for(l=n,f=s;!(l<(y=f<=i?1:f>=i+26?26:f-i));f+=s)E=l-y,A=s-y,x.push(d(w(y+E%A,0))),l=p(E/A);x.push(d(w(l,0))),i=S(n,b,r==o),n=0,++r}++n,++t}return x.join(\"\")}i={version:\"1.3.2\",ucs2:{decode:m,encode:v},decode:A,encode:E,toASCII:function(e){return g(e,function(e){return u.test(e)?\"xn--\"+E(e):e})},toUnicode:function(e){return g(e,function(e){return c.test(e)?A(e.slice(4).toLowerCase()):e})}},void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},1270(e,t,n){var r;e=n.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var o=\"object\"==typeof n.g&&n.g;o.global!==o&&o.window!==o&&o.self;var i,a=2147483647,s=36,c=/^xn--/,u=/[^\\x20-\\x7E]/,l=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,f={overflow:\"Overflow: input needs wider integers to process\",\"not-basic\":\"Illegal input >= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},p=Math.floor,d=String.fromCharCode;function h(e){throw new RangeError(f[e])}function y(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function g(e,t){var n=e.split(\"@\"),r=\"\";return n.length>1&&(r=n[0]+\"@\",e=n[1]),r+y((e=e.replace(l,\".\")).split(\".\"),t).join(\".\")}function m(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function v(e){return y(e,function(e){var t=\"\";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+d(e)}).join(\"\")}function b(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:s}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=s)e=p(e/35);return p(r+36*e/(e+38))}function A(e){var t,n,r,o,i,c,u,l,f,d,y=[],g=e.length,m=0,w=128,A=72;for((n=e.lastIndexOf(\"-\"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&h(\"not-basic\"),y.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=m,c=1,u=s;o>=g&&h(\"invalid-input\"),((l=b(e.charCodeAt(o++)))>=s||l>p((a-m)/c))&&h(\"overflow\"),m+=l*c,!(l<(f=u<=A?1:u>=A+26?26:u-A));u+=s)c>p(a/(d=s-f))&&h(\"overflow\"),c*=d;A=S(m-i,t=y.length+1,0==i),p(m/t)>a-w&&h(\"overflow\"),w+=p(m/t),m%=t,y.splice(m++,0,w)}return v(y)}function E(e){var t,n,r,o,i,c,u,l,f,y,g,v,b,A,E,x=[];for(v=(e=m(e)).length,t=128,n=0,i=72,c=0;c<v;++c)(g=e[c])<128&&x.push(d(g));for(r=o=x.length,o&&x.push(\"-\");r<v;){for(u=a,c=0;c<v;++c)(g=e[c])>=t&&g<u&&(u=g);for(u-t>p((a-n)/(b=r+1))&&h(\"overflow\"),n+=(u-t)*b,t=u,c=0;c<v;++c)if((g=e[c])<t&&++n>a&&h(\"overflow\"),g==t){for(l=n,f=s;!(l<(y=f<=i?1:f>=i+26?26:f-i));f+=s)E=l-y,A=s-y,x.push(d(w(y+E%A,0))),l=p(E/A);x.push(d(w(l,0))),i=S(n,b,r==o),n=0,++r}++n,++t}return x.join(\"\")}i={version:\"1.4.1\",ucs2:{decode:m,encode:v},decode:A,encode:E,toASCII:function(e){return g(e,function(e){return u.test(e)?\"xn--\"+E(e):e})},toUnicode:function(e){return g(e,function(e){return c.test(e)?A(e.slice(4).toLowerCase()):e})}},void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},8835(e,t,n){\"use strict\";var r=n(1270);function o(){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 i=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\\/\\/?(?!\\/)[^?\\s]*)(\\?[^\\s]*)?$/,c=[\"{\",\"}\",\"|\",\"\\\\\",\"^\",\"`\"].concat([\"<\",\">\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"]),u=[\"'\"].concat(c),l=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(u),f=[\"/\",\"?\",\"#\"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,\"javascript:\":!0},y={javascript:!0,\"javascript:\":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0},m=n(5373);function v(e,t,n){if(e&&\"object\"==typeof e&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(\"string\"!=typeof e)throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof e);var o=e.indexOf(\"?\"),a=-1!==o&&o<e.indexOf(\"#\")?\"?\":\"#\",c=e.split(a);c[0]=c[0].replace(/\\\\/g,\"/\");var v=e=c.join(a);if(v=v.trim(),!n&&1===e.split(\"#\").length){var b=s.exec(v);if(b)return this.path=v,this.href=v,this.pathname=b[1],b[2]?(this.search=b[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search=\"\",this.query={}),this}var w=i.exec(v);if(w){var S=(w=w[0]).toLowerCase();this.protocol=S,v=v.substr(w.length)}if(n||w||v.match(/^\\/\\/[^@/]+@[^@/]+/)){var A=\"//\"===v.substr(0,2);!A||w&&y[w]||(v=v.substr(2),this.slashes=!0)}if(!y[w]&&(A||w&&!g[w])){for(var E,x,T=-1,k=0;k<f.length;k++)-1!==(O=v.indexOf(f[k]))&&(-1===T||O<T)&&(T=O);for(-1!==(x=-1===T?v.lastIndexOf(\"@\"):v.lastIndexOf(\"@\",T))&&(E=v.slice(0,x),v=v.slice(x+1),this.auth=decodeURIComponent(E)),T=-1,k=0;k<l.length;k++){var O;-1!==(O=v.indexOf(l[k]))&&(-1===T||O<T)&&(T=O)}-1===T&&(T=v.length),this.host=v.slice(0,T),v=v.slice(T),this.parseHost(),this.hostname=this.hostname||\"\";var _=\"[\"===this.hostname[0]&&\"]\"===this.hostname[this.hostname.length-1];if(!_)for(var I=this.hostname.split(/\\./),C=(k=0,I.length);k<C;k++){var B=I[k];if(B&&!B.match(p)){for(var P=\"\",R=0,j=B.length;R<j;R++)B.charCodeAt(R)>127?P+=\"x\":P+=B[R];if(!P.match(p)){var U=I.slice(0,k),F=I.slice(k+1),N=B.match(d);N&&(U.push(N[1]),F.unshift(N[2])),F.length&&(v=\"/\"+F.join(\".\")+v),this.hostname=U.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),_||(this.hostname=r.toASCII(this.hostname));var L=this.port?\":\"+this.port:\"\",M=this.hostname||\"\";this.host=M+L,this.href+=this.host,_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==v[0]&&(v=\"/\"+v))}if(!h[S])for(k=0,C=u.length;k<C;k++){var D=u[k];if(-1!==v.indexOf(D)){var q=encodeURIComponent(D);q===D&&(q=escape(D)),v=v.split(D).join(q)}}var V=v.indexOf(\"#\");-1!==V&&(this.hash=v.substr(V),v=v.slice(0,V));var z=v.indexOf(\"?\");if(-1!==z?(this.search=v.substr(z),this.query=v.substr(z+1),t&&(this.query=m.parse(this.query)),v=v.slice(0,z)):t&&(this.search=\"\",this.query={}),v&&(this.pathname=v),g[S]&&this.hostname&&!this.pathname&&(this.pathname=\"/\"),this.pathname||this.search){L=this.pathname||\"\";var K=this.search||\"\";this.path=L+K}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||\"\";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,\":\"),e+=\"@\");var t=this.protocol||\"\",n=this.pathname||\"\",r=this.hash||\"\",o=!1,i=\"\";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(\":\")?this.hostname:\"[\"+this.hostname+\"]\"),this.port&&(o+=\":\"+this.port)),this.query&&\"object\"==typeof this.query&&Object.keys(this.query).length&&(i=m.stringify(this.query,{arrayFormat:\"repeat\",addQueryPrefix:!1}));var a=this.search||i&&\"?\"+i||\"\";return t&&\":\"!==t.substr(-1)&&(t+=\":\"),this.slashes||(!t||g[t])&&!1!==o?(o=\"//\"+(o||\"\"),n&&\"/\"!==n.charAt(0)&&(n=\"/\"+n)):o||(o=\"\"),r&&\"#\"!==r.charAt(0)&&(r=\"#\"+r),a&&\"?\"!==a.charAt(0)&&(a=\"?\"+a),t+o+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace(\"#\",\"%23\"))+r},o.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(\"string\"==typeof e){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),i=0;i<r.length;i++){var a=r[i];n[a]=this[a]}if(n.hash=e.hash,\"\"===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),c=0;c<s.length;c++){var u=s[c];\"protocol\"!==u&&(n[u]=e[u])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname=\"/\",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var p=l[f];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||y[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||\"\").split(\"/\");d.length&&!(e.host=d.shift()););e.host||(e.host=\"\"),e.hostname||(e.hostname=\"\"),\"\"!==d[0]&&d.unshift(\"\"),d.length<2&&d.unshift(\"\"),n.pathname=d.join(\"/\")}if(n.search=e.search,n.query=e.query,n.host=e.host||\"\",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var h=n.pathname||\"\",m=n.search||\"\";n.path=h+m}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var v=n.pathname&&\"/\"===n.pathname.charAt(0),b=e.host||e.pathname&&\"/\"===e.pathname.charAt(0),w=b||v||n.host&&e.pathname,S=w,A=n.pathname&&n.pathname.split(\"/\")||[],E=(d=e.pathname&&e.pathname.split(\"/\")||[],n.protocol&&!g[n.protocol]);if(E&&(n.hostname=\"\",n.port=null,n.host&&(\"\"===A[0]?A[0]=n.host:A.unshift(n.host)),n.host=\"\",e.protocol&&(e.hostname=null,e.port=null,e.host&&(\"\"===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(\"\"===d[0]||\"\"===A[0])),b)n.host=e.host||\"\"===e.host?e.host:n.host,n.hostname=e.hostname||\"\"===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,A=d;else if(d.length)A||(A=[]),A.pop(),A=A.concat(d),n.search=e.search,n.query=e.query;else if(null!=e.search)return E&&(n.host=A.shift(),n.hostname=n.host,(_=!!(n.host&&n.host.indexOf(\"@\")>0)&&n.host.split(\"@\"))&&(n.auth=_.shift(),n.hostname=_.shift(),n.host=n.hostname)),n.search=e.search,n.query=e.query,null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:\"\")+(n.search?n.search:\"\")),n.href=n.format(),n;if(!A.length)return n.pathname=null,n.search?n.path=\"/\"+n.search:n.path=null,n.href=n.format(),n;for(var x=A.slice(-1)[0],T=(n.host||e.host||A.length>1)&&(\".\"===x||\"..\"===x)||\"\"===x,k=0,O=A.length;O>=0;O--)\".\"===(x=A[O])?A.splice(O,1):\"..\"===x?(A.splice(O,1),k++):k&&(A.splice(O,1),k--);if(!w&&!S)for(;k--;k)A.unshift(\"..\");!w||\"\"===A[0]||A[0]&&\"/\"===A[0].charAt(0)||A.unshift(\"\"),T&&\"/\"!==A.join(\"/\").substr(-1)&&A.push(\"\");var _,I=\"\"===A[0]||A[0]&&\"/\"===A[0].charAt(0);return E&&(n.hostname=I?\"\":A.length?A.shift():\"\",n.host=n.hostname,(_=!!(n.host&&n.host.indexOf(\"@\")>0)&&n.host.split(\"@\"))&&(n.auth=_.shift(),n.hostname=_.shift(),n.host=n.hostname)),(w=w||n.host&&A.length)&&!I&&A.unshift(\"\"),A.length>0?n.pathname=A.join(\"/\"):(n.pathname=null,n.path=null),null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:\"\")+(n.search?n.search:\"\")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(\":\"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return\"string\"==typeof e&&(e=v(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o},4643(e,t,n){function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}e.exports=function(e,t){if(r(\"noDeprecation\"))return e;var n=!1;return function(){if(!n){if(r(\"throwDeprecation\"))throw new Error(t);r(\"traceDeprecation\")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},1135(e){e.exports=function(e){return e&&\"object\"==typeof e&&\"function\"==typeof e.copy&&\"function\"==typeof e.fill&&\"function\"==typeof e.readUInt8}},9032(e,t,n){\"use strict\";var r=n(7244),o=n(8184),i=n(5767),a=n(5680);function s(e){return e.call.bind(e)}var c=\"undefined\"!=typeof BigInt,u=\"undefined\"!=typeof Symbol,l=s(Object.prototype.toString),f=s(Number.prototype.valueOf),p=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(c)var h=s(BigInt.prototype.valueOf);if(u)var y=s(Symbol.prototype.valueOf);function g(e,t){if(\"object\"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return\"[object Map]\"===l(e)}function v(e){return\"[object Set]\"===l(e)}function b(e){return\"[object WeakMap]\"===l(e)}function w(e){return\"[object WeakSet]\"===l(e)}function S(e){return\"[object ArrayBuffer]\"===l(e)}function A(e){return\"undefined\"!=typeof ArrayBuffer&&(S.working?S(e):e instanceof ArrayBuffer)}function E(e){return\"[object DataView]\"===l(e)}function x(e){return\"undefined\"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}t.isArgumentsObject=r,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return\"undefined\"!=typeof Promise&&e instanceof Promise||null!==e&&\"object\"==typeof e&&\"function\"==typeof e.then&&\"function\"==typeof e.catch},t.isArrayBufferView=function(e){return\"undefined\"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||x(e)},t.isUint8Array=function(e){return\"Uint8Array\"===i(e)},t.isUint8ClampedArray=function(e){return\"Uint8ClampedArray\"===i(e)},t.isUint16Array=function(e){return\"Uint16Array\"===i(e)},t.isUint32Array=function(e){return\"Uint32Array\"===i(e)},t.isInt8Array=function(e){return\"Int8Array\"===i(e)},t.isInt16Array=function(e){return\"Int16Array\"===i(e)},t.isInt32Array=function(e){return\"Int32Array\"===i(e)},t.isFloat32Array=function(e){return\"Float32Array\"===i(e)},t.isFloat64Array=function(e){return\"Float64Array\"===i(e)},t.isBigInt64Array=function(e){return\"BigInt64Array\"===i(e)},t.isBigUint64Array=function(e){return\"BigUint64Array\"===i(e)},m.working=\"undefined\"!=typeof Map&&m(new Map),t.isMap=function(e){return\"undefined\"!=typeof Map&&(m.working?m(e):e instanceof Map)},v.working=\"undefined\"!=typeof Set&&v(new Set),t.isSet=function(e){return\"undefined\"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working=\"undefined\"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return\"undefined\"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working=\"undefined\"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},S.working=\"undefined\"!=typeof ArrayBuffer&&S(new ArrayBuffer),t.isArrayBuffer=A,E.working=\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=x;var T=\"undefined\"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function k(e){return\"[object SharedArrayBuffer]\"===l(e)}function O(e){return void 0!==T&&(void 0===k.working&&(k.working=k(new T)),k.working?k(e):e instanceof T)}function _(e){return g(e,f)}function I(e){return g(e,p)}function C(e){return g(e,d)}function B(e){return c&&g(e,h)}function P(e){return u&&g(e,y)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return\"[object AsyncFunction]\"===l(e)},t.isMapIterator=function(e){return\"[object Map Iterator]\"===l(e)},t.isSetIterator=function(e){return\"[object Set Iterator]\"===l(e)},t.isGeneratorObject=function(e){return\"[object Generator]\"===l(e)},t.isWebAssemblyCompiledModule=function(e){return\"[object WebAssembly.Module]\"===l(e)},t.isNumberObject=_,t.isStringObject=I,t.isBooleanObject=C,t.isBigIntObject=B,t.isSymbolObject=P,t.isBoxedPrimitive=function(e){return _(e)||I(e)||C(e)||B(e)||P(e)},t.isAnyArrayBuffer=function(e){return\"undefined\"!=typeof Uint8Array&&(A(e)||O(e))},[\"isProxy\",\"isExternal\",\"isModuleNamespaceObject\"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+\" is not supported in userland\")}})})},537(e,t,n){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(c(arguments[n]));return t.join(\" \")}n=1;for(var r=arguments,i=r.length,a=String(e).replace(o,function(e){if(\"%%\"===e)return\"%\";if(n>=i)return e;switch(e){case\"%s\":return String(r[n++]);case\"%d\":return Number(r[n++]);case\"%j\":try{return JSON.stringify(r[n++])}catch(e){return\"[Circular]\"}default:return e}}),s=r[n];n<i;s=r[++n])g(s)||!S(s)?a+=\" \"+s:a+=\" \"+c(s);return a},t.deprecate=function(e,n){if(\"undefined\"!=typeof process&&!0===process.noDeprecation)return e;if(\"undefined\"==typeof process)return function(){return t.deprecate(e,n).apply(this,arguments)};var r=!1;return function(){if(!r){if(process.throwDeprecation)throw new Error(n);process.traceDeprecation?console.trace(n):console.error(n),r=!0}return e.apply(this,arguments)}};var i={},a=/^$/,s=\"false\";function c(e,n){var r={seen:[],stylize:l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),f(r,e,r.depth)}function u(e,t){var n=c.styles[t];return n?\"\u001b[\"+c.colors[n][0]+\"m\"+e+\"\u001b[\"+c.colors[n][1]+\"m\":e}function l(e,t){return e}function f(e,n,r){if(e.customInspect&&n&&x(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return v(o)||(o=f(e,o,r)),o}var i=function(e,t){if(b(t))return e.stylize(\"undefined\",\"undefined\");if(v(t)){var n=\"'\"+JSON.stringify(t).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return e.stylize(n,\"string\")}return m(t)?e.stylize(\"\"+t,\"number\"):y(t)?e.stylize(\"\"+t,\"boolean\"):g(t)?e.stylize(\"null\",\"null\"):void 0}(e,n);if(i)return i;var a=Object.keys(n),s=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return p(n);if(0===a.length){if(x(n)){var c=n.name?\": \"+n.name:\"\";return e.stylize(\"[Function\"+c+\"]\",\"special\")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),\"regexp\");if(A(n))return e.stylize(Date.prototype.toString.call(n),\"date\");if(E(n))return p(n)}var u,l=\"\",S=!1,T=[\"{\",\"}\"];return h(n)&&(S=!0,T=[\"[\",\"]\"]),x(n)&&(l=\" [Function\"+(n.name?\": \"+n.name:\"\")+\"]\"),w(n)&&(l=\" \"+RegExp.prototype.toString.call(n)),A(n)&&(l=\" \"+Date.prototype.toUTCString.call(n)),E(n)&&(l=\" \"+p(n)),0!==a.length||S&&0!=n.length?r<0?w(n)?e.stylize(RegExp.prototype.toString.call(n),\"regexp\"):e.stylize(\"[Object]\",\"special\"):(e.seen.push(n),u=S?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a<s;++a)_(t,String(a))?i.push(d(e,t,n,r,String(a),!0)):i.push(\"\");return o.forEach(function(o){o.match(/^\\d+$/)||i.push(d(e,t,n,r,o,!0))}),i}(e,n,r,s,a):a.map(function(t){return d(e,n,r,s,t,S)}),e.seen.pop(),function(e,t,n){var r=e.reduce(function(e,t){return t.indexOf(\"\\n\"),e+t.replace(/\\u001b\\[\\d\\d?m/g,\"\").length+1},0);return r>60?n[0]+(\"\"===t?\"\":t+\"\\n \")+\" \"+e.join(\",\\n  \")+\" \"+n[1]:n[0]+t+\" \"+e.join(\", \")+\" \"+n[1]}(u,l,T)):T[0]+l+T[1]}function p(e){return\"[\"+Error.prototype.toString.call(e)+\"]\"}function d(e,t,n,r,o,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=c.set?e.stylize(\"[Getter/Setter]\",\"special\"):e.stylize(\"[Getter]\",\"special\"):c.set&&(s=e.stylize(\"[Setter]\",\"special\")),_(r,o)||(a=\"[\"+o+\"]\"),s||(e.seen.indexOf(c.value)<0?(s=g(n)?f(e,c.value,null):f(e,c.value,n-1)).indexOf(\"\\n\")>-1&&(s=i?s.split(\"\\n\").map(function(e){return\"  \"+e}).join(\"\\n\").slice(2):\"\\n\"+s.split(\"\\n\").map(function(e){return\"   \"+e}).join(\"\\n\")):s=e.stylize(\"[Circular]\",\"special\")),b(a)){if(i&&o.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+o)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.slice(1,-1),a=e.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=e.stylize(a,\"string\"))}return a+\": \"+s}function h(e){return Array.isArray(e)}function y(e){return\"boolean\"==typeof e}function g(e){return null===e}function m(e){return\"number\"==typeof e}function v(e){return\"string\"==typeof e}function b(e){return void 0===e}function w(e){return S(e)&&\"[object RegExp]\"===T(e)}function S(e){return\"object\"==typeof e&&null!==e}function A(e){return S(e)&&\"[object Date]\"===T(e)}function E(e){return S(e)&&(\"[object Error]\"===T(e)||e instanceof Error)}function x(e){return\"function\"==typeof e}function T(e){return Object.prototype.toString.call(e)}function k(e){return e<10?\"0\"+e.toString(10):e.toString(10)}s=s.replace(/[|\\\\{}()[\\]^$+?.]/g,\"\\\\$&\").replace(/\\*/g,\".*\").replace(/,/g,\"$|^\").toUpperCase(),a=new RegExp(\"^\"+s+\"$\",\"i\"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var n=process.pid;i[e]=function(){var r=t.format.apply(t,arguments);console.error(\"%s %d: %s\",e,n,r)}}else i[e]=function(){};return i[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},t.types=n(9032),t.isArray=h,t.isBoolean=y,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=v,t.isSymbol=function(e){return\"symbol\"==typeof e},t.isUndefined=b,t.isRegExp=w,t.types.isRegExp=w,t.isObject=S,t.isDate=A,t.types.isDate=A,t.isError=E,t.types.isNativeError=E,t.isFunction=x,t.isPrimitive=function(e){return null===e||\"boolean\"==typeof e||\"number\"==typeof e||\"string\"==typeof e||\"symbol\"==typeof e||void 0===e},t.isBuffer=n(1135);var O=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log(\"%s - %s\",(n=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(\":\"),[e.getDate(),O[e.getMonth()],n].join(\" \")),t.format.apply(t,arguments))},t.inherits=n(6698),t._extend=function(e,t){if(!t||!S(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var I=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function C(e,t){if(!e){var n=new Error(\"Promise was rejected with a falsy value\");n.reason=e,e=n}return t(e)}t.promisify=function(e){if(\"function\"!=typeof e)throw new TypeError('The \"original\" argument must be of type Function');if(I&&e[I]){var t;if(\"function\"!=typeof(t=e[I]))throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');return Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,r){e?n(e):t(r)});try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),I&&Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},t.promisify.custom=I,t.callbackify=function(e){if(\"function\"!=typeof e)throw new TypeError('The \"original\" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if(\"function\"!=typeof r)throw new TypeError(\"The last argument must be of type Function\");var o=this,i=function(){return r.apply(o,arguments)};e.apply(this,t).then(function(e){process.nextTick(i.bind(null,null,e))},function(e){process.nextTick(C.bind(null,e,i))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,r(e)),t}},5767(e,t,n){\"use strict\";var r=n(2682),o=n(9209),i=n(487),a=n(6556),s=n(5795),c=n(3628),u=a(\"Object.prototype.toString\"),l=n(9092)(),f=\"undefined\"==typeof globalThis?n.g:globalThis,p=o(),d=a(\"String.prototype.slice\"),h=a(\"Array.prototype.indexOf\",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},y={__proto__:null};r(p,l&&s&&c?function(e){var t=new f[e];if(Symbol.toStringTag in t&&c){var n=c(t),r=s(n,Symbol.toStringTag);if(!r&&n){var o=c(n);r=s(o,Symbol.toStringTag)}if(r&&r.get){var a=i(r.get);y[\"$\"+e]=a}}}:function(e){var t=new f[e],n=t.slice||t.set;if(n){var r=i(n);y[\"$\"+e]=r}}),e.exports=function(e){if(!e||\"object\"!=typeof e)return!1;if(!l){var t=d(u(e),8,-1);return h(p,t)>-1?t:\"Object\"===t&&function(e){var t=!1;return r(y,function(n,r){if(!t)try{n(e),t=d(r,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return r(y,function(n,r){if(!t)try{\"$\"+n(e)===r&&(t=d(r,1))}catch(e){}}),t}(e):null}},7510(e){e.exports=function(){for(var e={},n=0;n<arguments.length;n++){var r=arguments[n];for(var o in r)t.call(r,o)&&(e[o]=r[o])}return e};var t=Object.prototype.hasOwnProperty},2634(){},9169(){},6833(){},9209(e,t,n){\"use strict\";var r=n(6578),o=\"undefined\"==typeof globalThis?n.g:globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)\"function\"==typeof o[r[t]]&&(e[e.length]=r[t]);return e}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,\"exports\",{enumerable:!0,set:()=>{throw new Error(\"ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: \"+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(1924)})(),e.exports=t()},7991(e,t){\"use strict\";t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,f=c>0?a-4:a;for(n=0;n<f;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,c=r-o;s<c;s+=a)i.push(u(e,s,s+a>c?c:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+\"==\")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+\"=\"));return i.join(\"\")};for(var n=[],r=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var n=e.indexOf(\"=\");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(c(r));return o.join(\"\")}r[\"-\".charCodeAt(0)]=62,r[\"_\".charCodeAt(0)]=63},1048(e,t,n){\"use strict\";const r=n(7991),o=n(9318),i=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.hp=c,t.IS=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return f(e)}return u(e,t,n)}function u(e,t,n){if(\"string\"==typeof e)return function(e,t){\"string\"==typeof t&&\"\"!==t||(t=\"utf8\");if(!c.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const n=0|y(e,t);let r=s(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return d(e,t,n);if(\"undefined\"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return d(e,t,n);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return\"number\"!=typeof e.length||Z(e.length)?s(0):p(e);if(\"Buffer\"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(o)return o;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive](\"string\"),t,n);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function l(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function f(e){return l(e),s(e<0?0:0|h(e))}function p(e){const t=e.length<0?0:0|h(e.length),n=s(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function d(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('\"length\" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,c.prototype),r}function h(e){if(e>=a)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+a.toString(16)+\" bytes\");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return n;case\"utf8\":case\"utf-8\":return $(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*n;case\"hex\":return n>>>1;case\"base64\":return G(e).length;default:if(o)return r?-1:$(e).length;t=(\"\"+t).toLowerCase(),o=!0}}function g(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return\"\";if((n>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return C(this,t,n);case\"utf8\":case\"utf-8\":return k(this,t,n);case\"ascii\":return _(this,t,n);case\"latin1\":case\"binary\":return I(this,t,n);case\"base64\":return T(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return B(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,o){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if(\"string\"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,o);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,o);throw new TypeError(\"val must be string, number or Buffer\")}function b(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&(\"ucs2\"===(r=String(r).toLowerCase())||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===c)return r*a}else-1!==r&&(i-=i-r),r=-1}else for(n+c>s&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;r<c;r++)if(u(e,i+r)!==u(t,r)){n=!1;break}if(n)return i}return-1}function w(e,t,n,r){n=Number(n)||0;const o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(Z(r))return a;e[n+a]=r}return a}function S(e,t,n,r){return W($(t,e.length-n),e,n,r)}function A(e,t,n,r){return W(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return W(G(t),e,n,r)}function x(e,t,n,r){return W(function(e,t){let n,r,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o<n;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let n=\"\",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=O));return n}(r)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(c.prototype,\"parent\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,\"offset\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?s(e):void 0!==t?\"string\"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=c.allocUnsafe(t);let o=0;for(n=0;n<e.length;++n){let t=e[n];if(X(t,Uint8Array))o+t.length>r.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?\"\":0===arguments.length?k(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e=\"\";const n=t.IS;return e=this.toString(\"hex\",0,n).replace(/(.{2})/g,\"$1 \").trim(),this.length>n&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError(\"out of range index\");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e<s;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r=\"utf8\",n=this.length,t=0;else if(void 0===n&&\"string\"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");let i=!1;for(;;)switch(r){case\"hex\":return w(this,e,t,n);case\"utf8\":case\"utf-8\":return S(this,e,t,n);case\"ascii\":case\"latin1\":case\"binary\":return A(this,e,t,n);case\"base64\":return E(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return x(this,e,t,n);default:if(i)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function _(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function I(e,t,n){let r=\"\";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function C(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let o=\"\";for(let r=t;r<n;++r)o+=Y[e[r]];return o}function B(e,t,n){const r=e.slice(t,n);let o=\"\";for(let e=0;e<r.length-1;e+=2)o+=String.fromCharCode(r[e]+256*r[e+1]);return o}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function R(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('\"value\" argument is out of bounds');if(n+r>e.length)throw new RangeError(\"Index out of range\")}function j(e,t,n,r,o){V(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function U(e,t,n,r,o){V(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"Index out of range\")}function N(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J(function(e){z(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(e){z(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J(function(e){z(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=J(function(e){z(e>>>=0,\"offset\");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){R(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){R(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J(function(e,t=0){return j(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),c.prototype.writeBigUInt64BE=J(function(e,t=0){return U(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);R(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);R(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J(function(e,t=0){return j(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),c.prototype.writeBigInt64BE=J(function(e,t=0){return U(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),c.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(n<0||n>=this.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const o=r-n;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},c.prototype.fill=function(e,t,n,r){if(\"string\"==typeof e){if(\"string\"==typeof t?(r=t,t=0,n=this.length):\"string\"==typeof n&&(r=n,n=this.length),void 0!==r&&\"string\"!=typeof r)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof r&&!c.isEncoding(r))throw new TypeError(\"Unknown encoding: \"+r);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===r&&t<128||\"latin1\"===r)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError(\"Out of range index\");if(n<=t)return this;let o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o<n;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,r),a=i.length;if(0===a)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(o=0;o<n-t;++o)this[o+t]=i[o%a]}return this};const M={};function D(e,t,n){M[e]=class extends n{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t=\"\",n=e.length;const r=\"-\"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function V(e,t,n,r,o,i){if(e>n||e<t){const r=\"bigint\"==typeof t?\"n\":\"\";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new M.ERR_OUT_OF_RANGE(\"value\",o,e)}!function(e,t,n){z(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+n]||K(t,e.length-(n+1))}(r,o,i)}function z(e,t){if(\"number\"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function K(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new M.ERR_OUT_OF_RANGE(n||\"offset\",\"an integer\",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(n||\"offset\",`>= ${n?1:0} and <= ${t}`,e)}D(\"ERR_BUFFER_OUT_OF_BOUNDS\",function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"},RangeError),D(\"ERR_INVALID_ARG_TYPE\",function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`},TypeError),D(\"ERR_OUT_OF_RANGE\",function(e,t,n){let r=`The value of \"${e}\" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=q(String(n)):\"bigint\"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+=\"n\"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const H=/[^+/0-9A-Za-z-_]/g;function $(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function G(e){return r.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace(H,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function W(e,t,n,r){let o;for(o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function J(e){return\"undefined\"==typeof BigInt?Q:e}function Q(){throw new Error(\"BigInt not supported\")}},282(e){e.exports=a,a.default=a,a.stable=l,a.stableStringify=l;var t=\"[...]\",n=\"[Circular]\",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),c(e,\"\",0,[],void 0,0,a);try{s=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,o,i,a,u,l){var f;if(u+=1,\"object\"==typeof e&&null!==e){for(f=0;f<i.length;f++)if(i[f]===e)return void s(n,e,r,a);if(void 0!==l.depthLimit&&u>l.depthLimit)return void s(t,e,r,a);if(void 0!==l.edgesLimit&&o+1>l.edgesLimit)return void s(t,e,r,a);if(i.push(e),Array.isArray(e))for(f=0;f<e.length;f++)c(e[f],f,f,i,e,u,l);else{var p=Object.keys(e);for(f=0;f<p.length;f++){var d=p[f];c(e[d],d,f,i,e,u,l)}}i.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function l(e,t,n,a){void 0===a&&(a=i());var s,c=f(e,\"\",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,p(t),n)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function f(e,o,i,a,c,l,p){var d;if(l+=1,\"object\"==typeof e&&null!==e){for(d=0;d<a.length;d++)if(a[d]===e)return void s(n,e,o,c);try{if(\"function\"==typeof e.toJSON)return}catch(e){return}if(void 0!==p.depthLimit&&l>p.depthLimit)return void s(t,e,o,c);if(void 0!==p.edgesLimit&&i+1>p.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(d=0;d<e.length;d++)f(e[d],d,d,a,e,l,p);else{var h={},y=Object.keys(e).sort(u);for(d=0;d<y.length;d++){var g=y[d];f(e[g],g,d,a,e,l,p),h[g]=e[g]}if(void 0===c)return h;r.push([c,o,e]),c[o]=h}a.pop()}}function p(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},9318(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<<s)-1,u=c>>1,l=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=u}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<<u)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+d]=255&a,d+=h,a/=256,u-=8);e[n+d-h]|=128*y}},3103(e,t,n){var r=n(4715)(n(8942),\"DataView\");e.exports=r},5098(e,t,n){var r=n(3305),o=n(9361),i=n(1112),a=n(5276),s=n(7452);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},1386(e,t,n){var r=n(2393),o=n(2049),i=n(7144),a=n(5071),s=n(3964);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},9770(e,t,n){var r=n(4715)(n(8942),\"Map\");e.exports=r},8250(e,t,n){var r=n(9753),o=n(5681),i=n(88),a=n(4732),s=n(9068);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},9413(e,t,n){var r=n(4715)(n(8942),\"Promise\");e.exports=r},4512(e,t,n){var r=n(4715)(n(8942),\"Set\");e.exports=r},3212(e,t,n){var r=n(8250),o=n(1877),i=n(8006);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},1340(e,t,n){var r=n(1386),o=n(4103),i=n(1779),a=n(4162),s=n(7462),c=n(6638);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},5650(e,t,n){var r=n(8942).Symbol;e.exports=r},1623(e,t,n){var r=n(8942).Uint8Array;e.exports=r},9270(e,t,n){var r=n(4715)(n(8942),\"WeakMap\");e.exports=r},6912(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},9847(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},9756(e,t,n){var r=n(2478);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},935(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},358(e,t,n){var r=n(6137),o=n(3283),i=n(3142),a=n(5853),s=n(9632),c=n(8666),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),f=!n&&!l&&a(e),p=!n&&!l&&!f&&c(e),d=n||l||f||p,h=d?r(e.length,String):[],y=h.length;for(var g in e)!t&&!u.call(e,g)||d&&(\"length\"==g||f&&(\"offset\"==g||\"parent\"==g)||p&&(\"buffer\"==g||\"byteLength\"==g||\"byteOffset\"==g)||s(g,y))||h.push(g);return h}},5111(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},1129(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},6465(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},7034(e,t,n){var r=n(6285);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4570(e,t,n){var r=n(7170),o=n(5770)(r);e.exports=o},7250(e){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},313(e,t,n){var r=n(1129),o=n(714);e.exports=function e(t,n,i,a,s){var c=-1,u=t.length;for(i||(i=o),s||(s=[]);++c<u;){var l=t[c];n>0&&i(l)?n>1?e(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},5636(e,t,n){var r=n(6596)();e.exports=r},7170(e,t,n){var r=n(5636),o=n(1211);e.exports=function(e,t){return e&&r(e,t,o)}},7923(e,t,n){var r=n(3526),o=n(6040);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},8244(e,t,n){var r=n(1129),o=n(3142);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},7379(e,t,n){var r=n(5650),o=n(8870),i=n(9005),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":a&&a in Object(e)?o(e):i(e)}},3636(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},2478(e,t,n){var r=n(7250),o=n(9454),i=n(7706);e.exports=function(e,t,n){return t==t?i(e,t,n):r(e,o,n)}},6027(e,t,n){var r=n(7379),o=n(547);e.exports=function(e){return o(e)&&\"[object Arguments]\"==r(e)}},4687(e,t,n){var r=n(353),o=n(547);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}},353(e,t,n){var r=n(1340),o=n(3934),i=n(8861),a=n(1182),s=n(8486),c=n(3142),u=n(5853),l=n(8666),f=\"[object Arguments]\",p=\"[object Array]\",d=\"[object Object]\",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,y,g,m){var v=c(e),b=c(t),w=v?p:s(e),S=b?p:s(t),A=(w=w==f?d:w)==d,E=(S=S==f?d:S)==d,x=w==S;if(x&&u(e)){if(!u(t))return!1;v=!0,A=!1}if(x&&!A)return m||(m=new r),v||l(e)?o(e,t,n,y,g,m):i(e,t,w,n,y,g,m);if(!(1&n)){var T=A&&h.call(e,\"__wrapped__\"),k=E&&h.call(t,\"__wrapped__\");if(T||k){var O=T?e.value():e,_=k?t.value():t;return m||(m=new r),g(O,_,n,y,m)}}return!!x&&(m||(m=new r),a(e,t,n,y,g,m))}},8330(e,t,n){var r=n(1340),o=n(4687);e.exports=function(e,t,n,i){var a=n.length,s=a,c=!i;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<s;){var l=(u=n[a])[0],f=e[l],p=u[1];if(c&&u[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(i)var h=i(f,p,l,e,t,d);if(!(void 0===h?o(p,f,3,i,d):h))return!1}}return!0}},9454(e){e.exports=function(e){return e!=e}},9624(e,t,n){var r=n(3655),o=n(4759),i=n(1580),a=n(4066),s=/^\\[object .+?Constructor\\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,f=u.hasOwnProperty,p=RegExp(\"^\"+l.call(f).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?p:s).test(a(e))}},674(e,t,n){var r=n(7379),o=n(5387),i=n(547),a={};a[\"[object Float32Array]\"]=a[\"[object Float64Array]\"]=a[\"[object Int8Array]\"]=a[\"[object Int16Array]\"]=a[\"[object Int32Array]\"]=a[\"[object Uint8Array]\"]=a[\"[object Uint8ClampedArray]\"]=a[\"[object Uint16Array]\"]=a[\"[object Uint32Array]\"]=!0,a[\"[object Arguments]\"]=a[\"[object Array]\"]=a[\"[object ArrayBuffer]\"]=a[\"[object Boolean]\"]=a[\"[object DataView]\"]=a[\"[object Date]\"]=a[\"[object Error]\"]=a[\"[object Function]\"]=a[\"[object Map]\"]=a[\"[object Number]\"]=a[\"[object Object]\"]=a[\"[object RegExp]\"]=a[\"[object Set]\"]=a[\"[object String]\"]=a[\"[object WeakMap]\"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},3334(e,t,n){var r=n(6526),o=n(2343),i=n(2053),a=n(3142),s=n(3282);e.exports=function(e){return\"function\"==typeof e?e:null==e?i:\"object\"==typeof e?a(e)?o(e[0],e[1]):r(e):s(e)}},195(e,t,n){var r=n(4882),o=n(8121),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&\"constructor\"!=n&&t.push(n);return t}},1393(e,t,n){var r=n(4570),o=n(6529);e.exports=function(e,t){var n=-1,i=o(e)?Array(e.length):[];return r(e,function(e,r,o){i[++n]=t(e,r,o)}),i}},6526(e,t,n){var r=n(8330),o=n(4367),i=n(3904);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},2343(e,t,n){var r=n(4687),o=n(6123),i=n(7276),a=n(5187),s=n(7267),c=n(3904),u=n(6040);e.exports=function(e,t){return a(e)&&s(t)?c(u(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,3)}}},310(e,t,n){var r=n(5111),o=n(7923),i=n(3334),a=n(1393),s=n(642),c=n(9460),u=n(6775),l=n(2053),f=n(3142);e.exports=function(e,t,n){t=t.length?r(t,function(e){return f(e)?function(t){return o(t,1===e.length?e[0]:e)}:e}):[l];var p=-1;t=r(t,c(i));var d=a(e,function(e,n,o){return{criteria:r(t,function(t){return t(e)}),index:++p,value:e}});return s(d,function(e,t){return u(e,t,n)})}},2762(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},8880(e,t,n){var r=n(7923);e.exports=function(e){return function(t){return r(t,e)}}},3945(e,t,n){var r=n(2053),o=n(5234),i=n(796);e.exports=function(e,t){return i(o(e,t,r),e+\"\")}},7403(e,t,n){var r=n(2619),o=n(2532),i=n(2053),a=o?function(e,t){return o(e,\"toString\",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},642(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},6137(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},2291(e,t,n){var r=n(5650),o=n(5111),i=n(3142),a=n(1187),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if(\"string\"==typeof t)return t;if(i(t))return o(t,e)+\"\";if(a(t))return c?c.call(t):\"\";var n=t+\"\";return\"0\"==n&&1/t==-1/0?\"-0\":n}},9460(e){e.exports=function(e){return function(t){return e(t)}}},5630(e,t,n){var r=n(3212),o=n(9756),i=n(935),a=n(5568),s=n(6208),c=n(9828);e.exports=function(e,t,n){var u=-1,l=o,f=e.length,p=!0,d=[],h=d;if(n)p=!1,l=i;else if(f>=200){var y=t?null:s(e);if(y)return c(y);p=!1,l=a,h=new r}else h=t?[]:d;e:for(;++u<f;){var g=e[u],m=t?t(g):g;if(g=n||0!==g?g:0,p&&m==m){for(var v=h.length;v--;)if(h[v]===m)continue e;t&&h.push(m),d.push(g)}else l(h,m,n)||(h!==d&&h.push(m),d.push(g))}return d}},5568(e){e.exports=function(e,t){return e.has(t)}},3526(e,t,n){var r=n(3142),o=n(5187),i=n(6493),a=n(5243);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},3521(e,t,n){var r=n(1187);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,i=e==e,a=r(e),s=void 0!==t,c=null===t,u=t==t,l=r(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||o&&s&&u||!n&&u||!i)return 1;if(!o&&!a&&!l&&e<t||l&&n&&i&&!o&&!a||c&&n&&i||!s&&i||!u)return-1}return 0}},6775(e,t,n){var r=n(3521);e.exports=function(e,t,n){for(var o=-1,i=e.criteria,a=t.criteria,s=i.length,c=n.length;++o<s;){var u=r(i[o],a[o]);if(u)return o>=c?u:u*(\"desc\"==n[o]?-1:1)}return e.index-t.index}},1950(e,t,n){var r=n(8942)[\"__core-js_shared__\"];e.exports=r},5770(e,t,n){var r=n(6529);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,s=Object(n);(t?a--:++a<i)&&!1!==o(s[a],a,s););return n}}},6596(e){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===n(i[c],c,i))break}return t}}},6208(e,t,n){var r=n(4512),o=n(9071),i=n(9828),a=r&&1/i(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=a},2532(e,t,n){var r=n(4715),o=function(){try{var e=r(Object,\"defineProperty\");return e({},\"\",{}),e}catch(e){}}();e.exports=o},3934(e,t,n){var r=n(3212),o=n(6465),i=n(5568);e.exports=function(e,t,n,a,s,c){var u=1&n,l=e.length,f=t.length;if(l!=f&&!(u&&f>l))return!1;var p=c.get(e),d=c.get(t);if(p&&d)return p==t&&d==e;var h=-1,y=!0,g=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++h<l;){var m=e[h],v=t[h];if(a)var b=u?a(v,m,h,t,e,c):a(m,v,h,e,t,c);if(void 0!==b){if(b)continue;y=!1;break}if(g){if(!o(t,function(e,t){if(!i(g,t)&&(m===e||s(m,e,n,a,c)))return g.push(t)})){y=!1;break}}else if(m!==v&&!s(m,v,n,a,c)){y=!1;break}}return c.delete(e),c.delete(t),y}},8861(e,t,n){var r=n(5650),o=n(1623),i=n(6285),a=n(3934),s=n(5894),c=n(9828),u=r?r.prototype:void 0,l=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,f,p){switch(n){case\"[object DataView]\":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case\"[object ArrayBuffer]\":return!(e.byteLength!=t.byteLength||!f(new o(e),new o(t)));case\"[object Boolean]\":case\"[object Date]\":case\"[object Number]\":return i(+e,+t);case\"[object Error]\":return e.name==t.name&&e.message==t.message;case\"[object RegExp]\":case\"[object String]\":return e==t+\"\";case\"[object Map]\":var d=s;case\"[object Set]\":var h=1&r;if(d||(d=c),e.size!=t.size&&!h)return!1;var y=p.get(e);if(y)return y==t;r|=2,p.set(e,t);var g=a(d(e),d(t),r,u,f,p);return p.delete(e),g;case\"[object Symbol]\":if(l)return l.call(e)==l.call(t)}return!1}},1182(e,t,n){var r=n(393),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,a,s){var c=1&n,u=r(e),l=u.length;if(l!=r(t).length&&!c)return!1;for(var f=l;f--;){var p=u[f];if(!(c?p in t:o.call(t,p)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var y=!0;s.set(e,t),s.set(t,e);for(var g=c;++f<l;){var m=e[p=u[f]],v=t[p];if(i)var b=c?i(v,m,p,t,e,s):i(m,v,p,e,t,s);if(!(void 0===b?m===v||a(m,v,n,i,s):b)){y=!1;break}g||(g=\"constructor\"==p)}if(y&&!g){var w=e.constructor,S=t.constructor;w==S||!(\"constructor\"in e)||!(\"constructor\"in t)||\"function\"==typeof w&&w instanceof w&&\"function\"==typeof S&&S instanceof S||(y=!1)}return s.delete(e),s.delete(t),y}},4967(e){var t=\"object\"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;e.exports=t},393(e,t,n){var r=n(8244),o=n(7979),i=n(1211);e.exports=function(e){return r(e,i,o)}},4700(e,t,n){var r=n(9067);e.exports=function(e,t){var n=e.__data__;return r(t)?n[\"string\"==typeof t?\"string\":\"hash\"]:n.map}},4367(e,t,n){var r=n(7267),o=n(1211);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},4715(e,t,n){var r=n(9624),o=n(155);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},8870(e,t,n){var r=n(5650),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},7979(e,t,n){var r=n(9847),o=n(9306),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=s},8486(e,t,n){var r=n(3103),o=n(9770),i=n(9413),a=n(4512),s=n(9270),c=n(7379),u=n(4066),l=\"[object Map]\",f=\"[object Promise]\",p=\"[object Set]\",d=\"[object WeakMap]\",h=\"[object DataView]\",y=u(r),g=u(o),m=u(i),v=u(a),b=u(s),w=c;(r&&w(new r(new ArrayBuffer(1)))!=h||o&&w(new o)!=l||i&&w(i.resolve())!=f||a&&w(new a)!=p||s&&w(new s)!=d)&&(w=function(e){var t=c(e),n=\"[object Object]\"==t?e.constructor:void 0,r=n?u(n):\"\";if(r)switch(r){case y:return h;case g:return l;case m:return f;case v:return p;case b:return d}return t}),e.exports=w},155(e){e.exports=function(e,t){return null==e?void 0:e[t]}},5899(e,t,n){var r=n(3526),o=n(3283),i=n(3142),a=n(9632),s=n(5387),c=n(6040);e.exports=function(e,t,n){for(var u=-1,l=(t=r(t,e)).length,f=!1;++u<l;){var p=c(t[u]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++u!=l?f:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(i(e)||o(e))}},3305(e,t,n){var r=n(4497);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},9361(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1112(e,t,n){var r=n(4497),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return\"__lodash_hash_undefined__\"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},5276(e,t,n){var r=n(4497),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},7452(e,t,n){var r=n(4497);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?\"__lodash_hash_undefined__\":t,this}},714(e,t,n){var r=n(5650),o=n(3283),i=n(3142),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},9632(e){var t=/^(?:0|[1-9]\\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=n??9007199254740991)&&(\"number\"==r||\"symbol\"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},4535(e,t,n){var r=n(6285),o=n(6529),i=n(9632),a=n(1580);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!(\"number\"==s?o(n)&&i(t,n.length):\"string\"==s&&t in n)&&r(n[t],e)}},5187(e,t,n){var r=n(3142),o=n(1187),i=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,a=/^\\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!(\"number\"!=n&&\"symbol\"!=n&&\"boolean\"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},9067(e){e.exports=function(e){var t=typeof e;return\"string\"==t||\"number\"==t||\"symbol\"==t||\"boolean\"==t?\"__proto__\"!==e:null===e}},4759(e,t,n){var r,o=n(1950),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+r:\"\";e.exports=function(e){return!!i&&i in e}},4882(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===(\"function\"==typeof n&&n.prototype||t)}},7267(e,t,n){var r=n(1580);e.exports=function(e){return e==e&&!r(e)}},2393(e){e.exports=function(){this.__data__=[],this.size=0}},2049(e,t,n){var r=n(7034),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},7144(e,t,n){var r=n(7034);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},5071(e,t,n){var r=n(7034);e.exports=function(e){return r(this.__data__,e)>-1}},3964(e,t,n){var r=n(7034);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},9753(e,t,n){var r=n(5098),o=n(1386),i=n(9770);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},5681(e,t,n){var r=n(4700);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},88(e,t,n){var r=n(4700);e.exports=function(e){return r(this,e).get(e)}},4732(e,t,n){var r=n(4700);e.exports=function(e){return r(this,e).has(e)}},9068(e,t,n){var r=n(4700);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},5894(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},3904(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},6853(e,t,n){var r=n(9011);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},4497(e,t,n){var r=n(4715)(Object,\"create\");e.exports=r},8121(e,t,n){var r=n(3766)(Object.keys,Object);e.exports=r},2306(e,t,n){e=n.nmd(e);var r=n(4967),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require(\"util\").types;return e||a&&a.binding&&a.binding(\"util\")}catch(e){}}();e.exports=s},9005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},3766(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5234(e,t,n){var r=n(6912),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),c=Array(s);++a<s;)c[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=n(c),r(e,this,u)}}},8942(e,t,n){var r=n(4967),o=\"object\"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function(\"return this\")();e.exports=i},1877(e){e.exports=function(e){return this.__data__.set(e,\"__lodash_hash_undefined__\"),this}},8006(e){e.exports=function(e){return this.__data__.has(e)}},9828(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},796(e,t,n){var r=n(7403),o=n(3316)(r);e.exports=o},3316(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},4103(e,t,n){var r=n(1386);e.exports=function(){this.__data__=new r,this.size=0}},1779(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4162(e){e.exports=function(e){return this.__data__.get(e)}},7462(e){e.exports=function(e){return this.__data__.has(e)}},6638(e,t,n){var r=n(1386),o=n(9770),i=n(8250);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},7706(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},6493(e,t,n){var r=n(6853),o=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,i=/\\\\(\\\\)?/g,a=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(\"\"),e.replace(o,function(e,n,r,o){t.push(r?o.replace(i,\"$1\"):n||e)}),t});e.exports=a},6040(e,t,n){var r=n(1187);e.exports=function(e){if(\"string\"==typeof e||r(e))return e;var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}},4066(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}},2619(e){e.exports=function(e){return function(){return e}}},6285(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},6123(e,t,n){var r=n(7923);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},7276(e,t,n){var r=n(3636),o=n(5899);e.exports=function(e,t){return null!=e&&o(e,t,r)}},2053(e){e.exports=function(e){return e}},3283(e,t,n){var r=n(6027),o=n(547),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,\"callee\")&&!s.call(e,\"callee\")};e.exports=c},3142(e){var t=Array.isArray;e.exports=t},6529(e,t,n){var r=n(3655),o=n(5387);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},5853(e,t,n){e=n.nmd(e);var r=n(8942),o=n(4772),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},3655(e,t,n){var r=n(7379),o=n(1580);e.exports=function(e){if(!o(e))return!1;var t=r(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t}},5387(e){e.exports=function(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},1580(e){e.exports=function(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)}},547(e){e.exports=function(e){return null!=e&&\"object\"==typeof e}},1187(e,t,n){var r=n(7379),o=n(547);e.exports=function(e){return\"symbol\"==typeof e||o(e)&&\"[object Symbol]\"==r(e)}},8666(e,t,n){var r=n(674),o=n(9460),i=n(2306),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},1211(e,t,n){var r=n(358),o=n(195),i=n(6529);e.exports=function(e){return i(e)?r(e):o(e)}},5250(e,t,n){var r;e=n.nmd(e),function(){var o,i=\"Expected a function\",a=\"__lodash_hash_undefined__\",s=\"__lodash_placeholder__\",c=16,u=32,l=64,f=128,p=256,d=1/0,h=9007199254740991,y=NaN,g=4294967295,m=[[\"ary\",f],[\"bind\",1],[\"bindKey\",2],[\"curry\",8],[\"curryRight\",c],[\"flip\",512],[\"partial\",u],[\"partialRight\",l],[\"rearg\",p]],v=\"[object Arguments]\",b=\"[object Array]\",w=\"[object Boolean]\",S=\"[object Date]\",A=\"[object Error]\",E=\"[object Function]\",x=\"[object GeneratorFunction]\",T=\"[object Map]\",k=\"[object Number]\",O=\"[object Object]\",_=\"[object Promise]\",I=\"[object RegExp]\",C=\"[object Set]\",B=\"[object String]\",P=\"[object Symbol]\",R=\"[object WeakMap]\",j=\"[object ArrayBuffer]\",U=\"[object DataView]\",F=\"[object Float32Array]\",N=\"[object Float64Array]\",L=\"[object Int8Array]\",M=\"[object Int16Array]\",D=\"[object Int32Array]\",q=\"[object Uint8Array]\",V=\"[object Uint8ClampedArray]\",z=\"[object Uint16Array]\",K=\"[object Uint32Array]\",H=/\\b__p \\+= '';/g,$=/\\b(__p \\+=) '' \\+/g,G=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>\"']/g,Z=RegExp(W.source),Y=RegExp(X.source),J=/<%-([\\s\\S]+?)%>/g,Q=/<%([\\s\\S]+?)%>/g,ee=/<%=([\\s\\S]+?)%>/g,te=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,ne=/^\\w*$/,re=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,oe=/[\\\\^$.*+?()[\\]{}|]/g,ie=RegExp(oe.source),ae=/^\\s+/,se=/\\s/,ce=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,ue=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,le=/,? & /,fe=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,pe=/[()=,{}\\[\\]\\/\\s]/,de=/\\\\(\\\\)?/g,he=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,ye=/\\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\\[object .+?Constructor\\]$/,be=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\\d*)$/,Se=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Ae=/($^)/,Ee=/['\\n\\r\\u2028\\u2029\\\\]/g,xe=\"\\\\ud800-\\\\udfff\",Te=\"\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\",ke=\"\\\\u2700-\\\\u27bf\",Oe=\"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\",_e=\"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\",Ie=\"\\\\ufe0e\\\\ufe0f\",Ce=\"\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\",Be=\"['’]\",Pe=\"[\"+xe+\"]\",Re=\"[\"+Ce+\"]\",je=\"[\"+Te+\"]\",Ue=\"\\\\d+\",Fe=\"[\"+ke+\"]\",Ne=\"[\"+Oe+\"]\",Le=\"[^\"+xe+Ce+Ue+ke+Oe+_e+\"]\",Me=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",De=\"[^\"+xe+\"]\",qe=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",Ve=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",ze=\"[\"+_e+\"]\",Ke=\"\\\\u200d\",He=\"(?:\"+Ne+\"|\"+Le+\")\",$e=\"(?:\"+ze+\"|\"+Le+\")\",Ge=\"(?:['’](?:d|ll|m|re|s|t|ve))?\",We=\"(?:['’](?:D|LL|M|RE|S|T|VE))?\",Xe=\"(?:\"+je+\"|\"+Me+\")\"+\"?\",Ze=\"[\"+Ie+\"]?\",Ye=Ze+Xe+(\"(?:\"+Ke+\"(?:\"+[De,qe,Ve].join(\"|\")+\")\"+Ze+Xe+\")*\"),Je=\"(?:\"+[Fe,qe,Ve].join(\"|\")+\")\"+Ye,Qe=\"(?:\"+[De+je+\"?\",je,qe,Ve,Pe].join(\"|\")+\")\",et=RegExp(Be,\"g\"),tt=RegExp(je,\"g\"),nt=RegExp(Me+\"(?=\"+Me+\")|\"+Qe+Ye,\"g\"),rt=RegExp([ze+\"?\"+Ne+\"+\"+Ge+\"(?=\"+[Re,ze,\"$\"].join(\"|\")+\")\",$e+\"+\"+We+\"(?=\"+[Re,ze+He,\"$\"].join(\"|\")+\")\",ze+\"?\"+He+\"+\"+Ge,ze+\"+\"+We,\"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\",\"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\",Ue,Je].join(\"|\"),\"g\"),ot=RegExp(\"[\"+Ke+xe+Te+Ie+\"]\"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=[\"Array\",\"Buffer\",\"DataView\",\"Date\",\"Error\",\"Float32Array\",\"Float64Array\",\"Function\",\"Int8Array\",\"Int16Array\",\"Int32Array\",\"Map\",\"Math\",\"Object\",\"Promise\",\"RegExp\",\"Set\",\"String\",\"Symbol\",\"TypeError\",\"Uint8Array\",\"Uint8ClampedArray\",\"Uint16Array\",\"Uint32Array\",\"WeakMap\",\"_\",\"clearTimeout\",\"isFinite\",\"parseInt\",\"setTimeout\"],st=-1,ct={};ct[F]=ct[N]=ct[L]=ct[M]=ct[D]=ct[q]=ct[V]=ct[z]=ct[K]=!0,ct[v]=ct[b]=ct[j]=ct[w]=ct[U]=ct[S]=ct[A]=ct[E]=ct[T]=ct[k]=ct[O]=ct[I]=ct[C]=ct[B]=ct[R]=!1;var ut={};ut[v]=ut[b]=ut[j]=ut[U]=ut[w]=ut[S]=ut[F]=ut[N]=ut[L]=ut[M]=ut[D]=ut[T]=ut[k]=ut[O]=ut[I]=ut[C]=ut[B]=ut[P]=ut[q]=ut[V]=ut[z]=ut[K]=!0,ut[A]=ut[E]=ut[R]=!1;var lt={\"\\\\\":\"\\\\\",\"'\":\"'\",\"\\n\":\"n\",\"\\r\":\"r\",\"\\u2028\":\"u2028\",\"\\u2029\":\"u2029\"},ft=parseFloat,pt=parseInt,dt=\"object\"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis,ht=\"object\"==typeof self&&self&&self.Object===Object&&self,yt=dt||ht||Function(\"return this\")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,vt=mt&&mt.exports===gt,bt=vt&&dt.process,wt=function(){try{var e=mt&&mt.require&&mt.require(\"util\").types;return e||bt&&bt.binding&&bt.binding(\"util\")}catch(e){}}(),St=wt&&wt.isArrayBuffer,At=wt&&wt.isDate,Et=wt&&wt.isMap,xt=wt&&wt.isRegExp,Tt=wt&&wt.isSet,kt=wt&&wt.isTypedArray;function Ot(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _t(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Ct(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Bt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Rt(e,t){return!!(null==e?0:e.length)&&zt(e,t,0)>-1}function jt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Ut(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function Ft(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Nt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Lt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function Mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Dt=Gt(\"length\");function qt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function Vt(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function zt(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):Vt(e,Ht,n)}function Kt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Ht(e){return e!=e}function $t(e,t){var n=null==e?0:e.length;return n?Zt(e,t)/n:y}function Gt(e){return function(t){return null==t?o:t[e]}}function Wt(e){return function(t){return null==e?o:e[t]}}function Xt(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function Zt(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function Yt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Jt(e){return e?e.slice(0,gn(e)+1).replace(ae,\"\"):e}function Qt(e){return function(t){return e(t)}}function en(e,t){return Ut(t,function(t){return e[t]})}function tn(e,t){return e.has(t)}function nn(e,t){for(var n=-1,r=e.length;++n<r&&zt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length;n--&&zt(t,e[n],0)>-1;);return n}var on=Wt({À:\"A\",Á:\"A\",Â:\"A\",Ã:\"A\",Ä:\"A\",Å:\"A\",à:\"a\",á:\"a\",â:\"a\",ã:\"a\",ä:\"a\",å:\"a\",Ç:\"C\",ç:\"c\",Ð:\"D\",ð:\"d\",È:\"E\",É:\"E\",Ê:\"E\",Ë:\"E\",è:\"e\",é:\"e\",ê:\"e\",ë:\"e\",Ì:\"I\",Í:\"I\",Î:\"I\",Ï:\"I\",ì:\"i\",í:\"i\",î:\"i\",ï:\"i\",Ñ:\"N\",ñ:\"n\",Ò:\"O\",Ó:\"O\",Ô:\"O\",Õ:\"O\",Ö:\"O\",Ø:\"O\",ò:\"o\",ó:\"o\",ô:\"o\",õ:\"o\",ö:\"o\",ø:\"o\",Ù:\"U\",Ú:\"U\",Û:\"U\",Ü:\"U\",ù:\"u\",ú:\"u\",û:\"u\",ü:\"u\",Ý:\"Y\",ý:\"y\",ÿ:\"y\",Æ:\"Ae\",æ:\"ae\",Þ:\"Th\",þ:\"th\",ß:\"ss\",Ā:\"A\",Ă:\"A\",Ą:\"A\",ā:\"a\",ă:\"a\",ą:\"a\",Ć:\"C\",Ĉ:\"C\",Ċ:\"C\",Č:\"C\",ć:\"c\",ĉ:\"c\",ċ:\"c\",č:\"c\",Ď:\"D\",Đ:\"D\",ď:\"d\",đ:\"d\",Ē:\"E\",Ĕ:\"E\",Ė:\"E\",Ę:\"E\",Ě:\"E\",ē:\"e\",ĕ:\"e\",ė:\"e\",ę:\"e\",ě:\"e\",Ĝ:\"G\",Ğ:\"G\",Ġ:\"G\",Ģ:\"G\",ĝ:\"g\",ğ:\"g\",ġ:\"g\",ģ:\"g\",Ĥ:\"H\",Ħ:\"H\",ĥ:\"h\",ħ:\"h\",Ĩ:\"I\",Ī:\"I\",Ĭ:\"I\",Į:\"I\",İ:\"I\",ĩ:\"i\",ī:\"i\",ĭ:\"i\",į:\"i\",ı:\"i\",Ĵ:\"J\",ĵ:\"j\",Ķ:\"K\",ķ:\"k\",ĸ:\"k\",Ĺ:\"L\",Ļ:\"L\",Ľ:\"L\",Ŀ:\"L\",Ł:\"L\",ĺ:\"l\",ļ:\"l\",ľ:\"l\",ŀ:\"l\",ł:\"l\",Ń:\"N\",Ņ:\"N\",Ň:\"N\",Ŋ:\"N\",ń:\"n\",ņ:\"n\",ň:\"n\",ŋ:\"n\",Ō:\"O\",Ŏ:\"O\",Ő:\"O\",ō:\"o\",ŏ:\"o\",ő:\"o\",Ŕ:\"R\",Ŗ:\"R\",Ř:\"R\",ŕ:\"r\",ŗ:\"r\",ř:\"r\",Ś:\"S\",Ŝ:\"S\",Ş:\"S\",Š:\"S\",ś:\"s\",ŝ:\"s\",ş:\"s\",š:\"s\",Ţ:\"T\",Ť:\"T\",Ŧ:\"T\",ţ:\"t\",ť:\"t\",ŧ:\"t\",Ũ:\"U\",Ū:\"U\",Ŭ:\"U\",Ů:\"U\",Ű:\"U\",Ų:\"U\",ũ:\"u\",ū:\"u\",ŭ:\"u\",ů:\"u\",ű:\"u\",ų:\"u\",Ŵ:\"W\",ŵ:\"w\",Ŷ:\"Y\",ŷ:\"y\",Ÿ:\"Y\",Ź:\"Z\",Ż:\"Z\",Ž:\"Z\",ź:\"z\",ż:\"z\",ž:\"z\",Ĳ:\"IJ\",ĳ:\"ij\",Œ:\"Oe\",œ:\"oe\",ŉ:\"'n\",ſ:\"s\"}),an=Wt({\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#39;\"});function sn(e){return\"\\\\\"+lt[e]}function cn(e){return ot.test(e)}function un(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function ln(e,t){return function(n){return e(t(n))}}function fn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,i[o++]=n)}return i}function pn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function dn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function hn(e){return cn(e)?function(e){var t=nt.lastIndex=0;for(;nt.test(e);)++t;return t}(e):Dt(e)}function yn(e){return cn(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.split(\"\")}(e)}function gn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var mn=Wt({\"&amp;\":\"&\",\"&lt;\":\"<\",\"&gt;\":\">\",\"&quot;\":'\"',\"&#39;\":\"'\"});var vn=function e(t){var n,r=(t=null==t?yt:vn.defaults(yt.Object(),t,vn.pick(yt,at))).Array,se=t.Date,xe=t.Error,Te=t.Function,ke=t.Math,Oe=t.Object,_e=t.RegExp,Ie=t.String,Ce=t.TypeError,Be=r.prototype,Pe=Te.prototype,Re=Oe.prototype,je=t[\"__core-js_shared__\"],Ue=Pe.toString,Fe=Re.hasOwnProperty,Ne=0,Le=(n=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+n:\"\",Me=Re.toString,De=Ue.call(Oe),qe=yt._,Ve=_e(\"^\"+Ue.call(Fe).replace(oe,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),ze=vt?t.Buffer:o,Ke=t.Symbol,He=t.Uint8Array,$e=ze?ze.allocUnsafe:o,Ge=ln(Oe.getPrototypeOf,Oe),We=Oe.create,Xe=Re.propertyIsEnumerable,Ze=Be.splice,Ye=Ke?Ke.isConcatSpreadable:o,Je=Ke?Ke.iterator:o,Qe=Ke?Ke.toStringTag:o,nt=function(){try{var e=di(Oe,\"defineProperty\");return e({},\"\",{}),e}catch(e){}}(),ot=t.clearTimeout!==yt.clearTimeout&&t.clearTimeout,lt=se&&se.now!==yt.Date.now&&se.now,dt=t.setTimeout!==yt.setTimeout&&t.setTimeout,ht=ke.ceil,gt=ke.floor,mt=Oe.getOwnPropertySymbols,bt=ze?ze.isBuffer:o,wt=t.isFinite,Dt=Be.join,Wt=ln(Oe.keys,Oe),bn=ke.max,wn=ke.min,Sn=se.now,An=t.parseInt,En=ke.random,xn=Be.reverse,Tn=di(t,\"DataView\"),kn=di(t,\"Map\"),On=di(t,\"Promise\"),_n=di(t,\"Set\"),In=di(t,\"WeakMap\"),Cn=di(Oe,\"create\"),Bn=In&&new In,Pn={},Rn=Mi(Tn),jn=Mi(kn),Un=Mi(On),Fn=Mi(_n),Nn=Mi(In),Ln=Ke?Ke.prototype:o,Mn=Ln?Ln.valueOf:o,Dn=Ln?Ln.toString:o;function qn(e){if(ns(e)&&!Ha(e)&&!(e instanceof Hn)){if(e instanceof Kn)return e;if(Fe.call(e,\"__wrapped__\"))return Di(e)}return new Kn(e)}var Vn=function(){function e(){}return function(t){if(!ts(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function zn(){}function Kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function $n(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Wn;++t<n;)this.add(e[t])}function Zn(e){var t=this.__data__=new Gn(e);this.size=t.size}function Yn(e,t){var n=Ha(e),r=!n&&Ka(e),o=!n&&!r&&Xa(e),i=!n&&!r&&!o&&ls(e),a=n||r||o||i,s=a?Yt(e.length,Ie):[],c=s.length;for(var u in e)!t&&!Fe.call(e,u)||a&&(\"length\"==u||o&&(\"offset\"==u||\"parent\"==u)||i&&(\"buffer\"==u||\"byteLength\"==u||\"byteOffset\"==u)||wi(u,c))||s.push(u);return s}function Jn(e){var t=e.length;return t?e[Xr(0,t-1)]:o}function Qn(e,t){return Fi(Bo(e),cr(t,0,e.length))}function er(e){return Fi(Bo(e))}function tr(e,t,n){(n!==o&&!qa(e[t],n)||n===o&&!(t in e))&&ar(e,t,n)}function nr(e,t,n){var r=e[t];Fe.call(e,t)&&qa(r,n)&&(n!==o||t in e)||ar(e,t,n)}function rr(e,t){for(var n=e.length;n--;)if(qa(e[n][0],t))return n;return-1}function or(e,t,n,r){return dr(e,function(e,o,i){t(r,e,n(e),i)}),r}function ir(e,t){return e&&Po(t,Ps(t),e)}function ar(e,t,n){\"__proto__\"==t&&nt?nt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function sr(e,t){for(var n=-1,i=t.length,a=r(i),s=null==e;++n<i;)a[n]=s?o:Os(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ur(e,t,n,r,i,a){var s,c=1&t,u=2&t,l=4&t;if(n&&(s=i?n(e,r,i,a):n(e)),s!==o)return s;if(!ts(e))return e;var f=Ha(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&\"string\"==typeof e[0]&&Fe.call(e,\"index\")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return Bo(e,s)}else{var p=gi(e),d=p==E||p==x;if(Xa(e))return To(e,c);if(p==O||p==v||d&&!i){if(s=u||d?{}:vi(e),!c)return u?function(e,t){return Po(e,yi(e),t)}(e,function(e,t){return e&&Po(t,Rs(t),e)}(s,e)):function(e,t){return Po(e,hi(e),t)}(e,ir(s,e))}else{if(!ut[p])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case j:return ko(e);case w:case S:return new r(+e);case U:return function(e,t){var n=t?ko(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case F:case N:case L:case M:case D:case q:case V:case z:case K:return Oo(e,n);case T:return new r;case k:case B:return new r(e);case I:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new r;case P:return o=e,Mn?Oe(Mn.call(o)):{}}var o}(e,p,c)}}a||(a=new Zn);var h=a.get(e);if(h)return h;a.set(e,s),ss(e)?e.forEach(function(r){s.add(ur(r,t,n,r,e,a))}):rs(e)&&e.forEach(function(r,o){s.set(o,ur(r,t,n,o,e,a))});var y=f?o:(l?u?ai:ii:u?Rs:Ps)(e);return It(y||e,function(r,o){y&&(r=e[o=r]),nr(s,o,ur(r,t,n,o,e,a))}),s}function lr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Oe(e);r--;){var i=n[r],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function fr(e,t,n){if(\"function\"!=typeof e)throw new Ce(i);return Pi(function(){e.apply(o,n)},t)}function pr(e,t,n,r){var o=-1,i=Rt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;n&&(t=Ut(t,Qt(n))),r?(i=jt,a=!1):t.length>=200&&(i=tn,a=!1,t=new Xn(t));e:for(;++o<s;){var l=e[o],f=null==n?l:n(l);if(l=r||0!==l?l:0,a&&f==f){for(var p=u;p--;)if(t[p]===f)continue e;c.push(l)}else i(t,f,r)||c.push(l)}return c}qn.templateSettings={escape:J,evaluate:Q,interpolate:ee,variable:\"\",imports:{_:qn}},qn.prototype=zn.prototype,qn.prototype.constructor=qn,Kn.prototype=Vn(zn.prototype),Kn.prototype.constructor=Kn,Hn.prototype=Vn(zn.prototype),Hn.prototype.constructor=Hn,$n.prototype.clear=function(){this.__data__=Cn?Cn(null):{},this.size=0},$n.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$n.prototype.get=function(e){var t=this.__data__;if(Cn){var n=t[e];return n===a?o:n}return Fe.call(t,e)?t[e]:o},$n.prototype.has=function(e){var t=this.__data__;return Cn?t[e]!==o:Fe.call(t,e)},$n.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Cn&&t===o?a:t,this},Gn.prototype.clear=function(){this.__data__=[],this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=rr(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ze.call(t,n,1),--this.size,!0)},Gn.prototype.get=function(e){var t=this.__data__,n=rr(t,e);return n<0?o:t[n][1]},Gn.prototype.has=function(e){return rr(this.__data__,e)>-1},Gn.prototype.set=function(e,t){var n=this.__data__,r=rr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new $n,map:new(kn||Gn),string:new $n}},Wn.prototype.delete=function(e){var t=fi(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return fi(this,e).get(e)},Wn.prototype.has=function(e){return fi(this,e).has(e)},Wn.prototype.set=function(e,t){var n=fi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,a),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Zn.prototype.clear=function(){this.__data__=new Gn,this.size=0},Zn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Zn.prototype.get=function(e){return this.__data__.get(e)},Zn.prototype.has=function(e){return this.__data__.has(e)},Zn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Gn){var r=n.__data__;if(!kn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var dr=Uo(Sr),hr=Uo(Ar,!0);function yr(e,t){var n=!0;return dr(e,function(e,r,o){return n=!!t(e,r,o)}),n}function gr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],s=t(a);if(null!=s&&(c===o?s==s&&!us(s):n(s,c)))var c=s,u=a}return u}function mr(e,t){var n=[];return dr(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function vr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=bi),o||(o=[]);++i<a;){var s=e[i];t>0&&n(s)?t>1?vr(s,t-1,n,r,o):Ft(o,s):r||(o[o.length]=s)}return o}var br=Fo(),wr=Fo(!0);function Sr(e,t){return e&&br(e,t,Ps)}function Ar(e,t){return e&&wr(e,t,Ps)}function Er(e,t){return Pt(t,function(t){return Ja(e[t])})}function xr(e,t){for(var n=0,r=(t=So(t,e)).length;null!=e&&n<r;)e=e[Li(t[n++])];return n&&n==r?e:o}function Tr(e,t,n){var r=t(e);return Ha(e)?r:Ft(r,n(e))}function kr(e){return null==e?e===o?\"[object Undefined]\":\"[object Null]\":Qe&&Qe in Oe(e)?function(e){var t=Fe.call(e,Qe),n=e[Qe];try{e[Qe]=o;var r=!0}catch(e){}var i=Me.call(e);r&&(t?e[Qe]=n:delete e[Qe]);return i}(e):function(e){return Me.call(e)}(e)}function Or(e,t){return e>t}function _r(e,t){return null!=e&&Fe.call(e,t)}function Ir(e,t){return null!=e&&t in Oe(e)}function Cr(e,t,n){for(var i=n?jt:Rt,a=e[0].length,s=e.length,c=s,u=r(s),l=1/0,f=[];c--;){var p=e[c];c&&t&&(p=Ut(p,Qt(t))),l=wn(p.length,l),u[c]=!n&&(t||a>=120&&p.length>=120)?new Xn(c&&p):o}p=e[0];var d=-1,h=u[0];e:for(;++d<a&&f.length<l;){var y=p[d],g=t?t(y):y;if(y=n||0!==y?y:0,!(h?tn(h,g):i(f,g,n))){for(c=s;--c;){var m=u[c];if(!(m?tn(m,g):i(e[c],g,n)))continue e}h&&h.push(g),f.push(y)}}return f}function Br(e,t,n){var r=null==(e=Ii(e,t=So(t,e)))?e:e[Li(Yi(t))];return null==r?o:Ot(r,e,n)}function Pr(e){return ns(e)&&kr(e)==v}function Rr(e,t,n,r,i){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,n,r,i,a){var s=Ha(e),c=Ha(t),u=s?b:gi(e),l=c?b:gi(t),f=(u=u==v?O:u)==O,p=(l=l==v?O:l)==O,d=u==l;if(d&&Xa(e)){if(!Xa(t))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new Zn),s||ls(e)?ri(e,t,n,r,i,a):function(e,t,n,r,o,i,a){switch(n){case U:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j:return!(e.byteLength!=t.byteLength||!i(new He(e),new He(t)));case w:case S:case k:return qa(+e,+t);case A:return e.name==t.name&&e.message==t.message;case I:case B:return e==t+\"\";case T:var s=un;case C:var c=1&r;if(s||(s=pn),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var l=ri(s(e),s(t),r,o,i,a);return a.delete(e),l;case P:if(Mn)return Mn.call(e)==Mn.call(t)}return!1}(e,t,u,n,r,i,a);if(!(1&n)){var h=f&&Fe.call(e,\"__wrapped__\"),y=p&&Fe.call(t,\"__wrapped__\");if(h||y){var g=h?e.value():e,m=y?t.value():t;return a||(a=new Zn),i(g,m,n,r,a)}}if(!d)return!1;return a||(a=new Zn),function(e,t,n,r,i,a){var s=1&n,c=ii(e),u=c.length,l=ii(t),f=l.length;if(u!=f&&!s)return!1;var p=u;for(;p--;){var d=c[p];if(!(s?d in t:Fe.call(t,d)))return!1}var h=a.get(e),y=a.get(t);if(h&&y)return h==t&&y==e;var g=!0;a.set(e,t),a.set(t,e);var m=s;for(;++p<u;){var v=e[d=c[p]],b=t[d];if(r)var w=s?r(b,v,d,t,e,a):r(v,b,d,e,t,a);if(!(w===o?v===b||i(v,b,n,r,a):w)){g=!1;break}m||(m=\"constructor\"==d)}if(g&&!m){var S=e.constructor,A=t.constructor;S==A||!(\"constructor\"in e)||!(\"constructor\"in t)||\"function\"==typeof S&&S instanceof S&&\"function\"==typeof A&&A instanceof A||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,n,r,i,a)}(e,t,n,r,Rr,i))}function jr(e,t,n,r){var i=n.length,a=i,s=!r;if(null==e)return!a;for(e=Oe(e);i--;){var c=n[i];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<a;){var u=(c=n[i])[0],l=e[u],f=c[1];if(s&&c[2]){if(l===o&&!(u in e))return!1}else{var p=new Zn;if(r)var d=r(l,f,u,e,t,p);if(!(d===o?Rr(f,l,3,r,p):d))return!1}}return!0}function Ur(e){return!(!ts(e)||(t=e,Le&&Le in t))&&(Ja(e)?Ve:ve).test(Mi(e));var t}function Fr(e){return\"function\"==typeof e?e:null==e?oc:\"object\"==typeof e?Ha(e)?Vr(e[0],e[1]):qr(e):dc(e)}function Nr(e){if(!Ti(e))return Wt(e);var t=[];for(var n in Oe(e))Fe.call(e,n)&&\"constructor\"!=n&&t.push(n);return t}function Lr(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var n in Oe(e))t.push(n);return t}(e);var t=Ti(e),n=[];for(var r in e)(\"constructor\"!=r||!t&&Fe.call(e,r))&&n.push(r);return n}function Mr(e,t){return e<t}function Dr(e,t){var n=-1,o=Ga(e)?r(e.length):[];return dr(e,function(e,r,i){o[++n]=t(e,r,i)}),o}function qr(e){var t=pi(e);return 1==t.length&&t[0][2]?Oi(t[0][0],t[0][1]):function(n){return n===e||jr(n,e,t)}}function Vr(e,t){return Ai(e)&&ki(t)?Oi(Li(e),t):function(n){var r=Os(n,e);return r===o&&r===t?_s(n,e):Rr(t,r,3)}}function zr(e,t,n,r,i){e!==t&&br(t,function(a,s){if(i||(i=new Zn),ts(a))!function(e,t,n,r,i,a,s){var c=Ci(e,n),u=Ci(t,n),l=s.get(u);if(l)return void tr(e,n,l);var f=a?a(c,u,n+\"\",e,t,s):o,p=f===o;if(p){var d=Ha(u),h=!d&&Xa(u),y=!d&&!h&&ls(u);f=u,d||h||y?Ha(c)?f=c:Wa(c)?f=Bo(c):h?(p=!1,f=To(u,!0)):y?(p=!1,f=Oo(u,!0)):f=[]:is(u)||Ka(u)?(f=c,Ka(c)?f=vs(c):ts(c)&&!Ja(c)||(f=vi(u))):p=!1}p&&(s.set(u,f),i(f,u,r,a,s),s.delete(u));tr(e,n,f)}(e,t,s,n,zr,r,i);else{var c=r?r(Ci(e,s),a,s+\"\",e,t,i):o;c===o&&(c=a),tr(e,s,c)}},Rs)}function Kr(e,t){var n=e.length;if(n)return wi(t+=t<0?n:0,n)?e[t]:o}function Hr(e,t,n){t=t.length?Ut(t,function(e){return Ha(e)?function(t){return xr(t,1===e.length?e[0]:e)}:e}):[oc];var r=-1;t=Ut(t,Qt(li()));var o=Dr(e,function(e,n,o){var i=Ut(t,function(t){return t(e)});return{criteria:i,index:++r,value:e}});return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(o,function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,s=n.length;for(;++r<a;){var c=_o(o[r],i[r]);if(c)return r>=s?c:c*(\"desc\"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function $r(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],s=xr(e,a);n(s,a)&&eo(i,So(a,e),s)}return i}function Gr(e,t,n,r){var o=r?Kt:zt,i=-1,a=t.length,s=e;for(e===t&&(t=Bo(t)),n&&(s=Ut(e,Qt(n)));++i<a;)for(var c=0,u=t[i],l=n?n(u):u;(c=o(s,l,c,r))>-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Ze.call(e,o,1):po(e,o)}}return e}function Xr(e,t){return e+gt(En()*(t-e+1))}function Zr(e,t){var n=\"\";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Yr(e,t){return Ri(_i(e,t,oc),e+\"\")}function Jr(e){return Jn(qs(e))}function Qr(e,t){var n=qs(e);return Fi(n,cr(t,0,n.length))}function eo(e,t,n,r){if(!ts(e))return e;for(var i=-1,a=(t=So(t,e)).length,s=a-1,c=e;null!=c&&++i<a;){var u=Li(t[i]),l=n;if(\"__proto__\"===u||\"constructor\"===u||\"prototype\"===u)return e;if(i!=s){var f=c[u];(l=r?r(f,u,c):o)===o&&(l=ts(f)?f:wi(t[i+1])?[]:{})}nr(c,u,l),c=c[u]}return e}var to=Bn?function(e,t){return Bn.set(e,t),e}:oc,no=nt?function(e,t){return nt(e,\"toString\",{configurable:!0,enumerable:!1,value:tc(t),writable:!0})}:oc;function ro(e){return Fi(qs(e))}function oo(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function io(e,t){var n;return dr(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function ao(e,t,n){var r=0,o=null==e?r:e.length;if(\"number\"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!us(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return so(e,t,oc,n)}function so(e,t,n,r){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,c=null===t,u=us(t),l=t===o;i<a;){var f=gt((i+a)/2),p=n(e[f]),d=p!==o,h=null===p,y=p==p,g=us(p);if(s)var m=r||y;else m=l?y&&(r||d):c?y&&d&&(r||!h):u?y&&d&&!h&&(r||!g):!h&&!g&&(r?p<=t:p<t);m?i=f+1:a=f}return wn(a,4294967294)}function co(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!qa(s,c)){var c=s;i[o++]=0===a?0:a}}return i}function uo(e){return\"number\"==typeof e?e:us(e)?y:+e}function lo(e){if(\"string\"==typeof e)return e;if(Ha(e))return Ut(e,lo)+\"\";if(us(e))return Dn?Dn.call(e):\"\";var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}function fo(e,t,n){var r=-1,o=Rt,i=e.length,a=!0,s=[],c=s;if(n)a=!1,o=jt;else if(i>=200){var u=t?null:Yo(e);if(u)return pn(u);a=!1,o=tn,c=new Xn}else c=t?[]:s;e:for(;++r<i;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var p=c.length;p--;)if(c[p]===f)continue e;t&&c.push(f),s.push(l)}else o(c,f,n)||(c!==s&&c.push(f),s.push(l))}return s}function po(e,t){var n=-1,r=(t=So(t,e)).length;if(!r)return!0;for(;++n<r;){var o=Li(t[n]);if(\"__proto__\"===o&&!Fe.call(e,\"__proto__\"))return!1;if((\"constructor\"===o||\"prototype\"===o)&&n<r-1)return!1}var i=Ii(e,t);return null==i||delete i[Li(Yi(t))]}function ho(e,t,n,r){return eo(e,t,n(xr(e,t)),r)}function yo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?oo(e,r?0:i,r?i+1:o):oo(e,r?i+1:0,r?o:i)}function go(e,t){var n=e;return n instanceof Hn&&(n=n.value()),Nt(t,function(e,t){return t.func.apply(t.thisArg,Ft([e],t.args))},n)}function mo(e,t,n){var o=e.length;if(o<2)return o?fo(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var s=e[i],c=-1;++c<o;)c!=i&&(a[i]=pr(a[i]||s,e[c],t,n));return fo(vr(a,1),t,n)}function vo(e,t,n){for(var r=-1,i=e.length,a=t.length,s={};++r<i;){var c=r<a?t[r]:o;n(s,e[r],c)}return s}function bo(e){return Wa(e)?e:[]}function wo(e){return\"function\"==typeof e?e:oc}function So(e,t){return Ha(e)?e:Ai(e,t)?[e]:Ni(bs(e))}var Ao=Yr;function Eo(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:oo(e,t,n)}var xo=ot||function(e){return yt.clearTimeout(e)};function To(e,t){if(t)return e.slice();var n=e.length,r=$e?$e(n):new e.constructor(n);return e.copy(r),r}function ko(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Oo(e,t){var n=t?ko(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _o(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=us(e),s=t!==o,c=null===t,u=t==t,l=us(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||c&&n&&i||!s&&i||!u)return-1}return 0}function Io(e,t,n,o){for(var i=-1,a=e.length,s=n.length,c=-1,u=t.length,l=bn(a-s,0),f=r(u+l),p=!o;++c<u;)f[c]=t[c];for(;++i<s;)(p||i<a)&&(f[n[i]]=e[i]);for(;l--;)f[c++]=e[i++];return f}function Co(e,t,n,o){for(var i=-1,a=e.length,s=-1,c=n.length,u=-1,l=t.length,f=bn(a-c,0),p=r(f+l),d=!o;++i<f;)p[i]=e[i];for(var h=i;++u<l;)p[h+u]=t[u];for(;++s<c;)(d||i<a)&&(p[h+n[s]]=e[i++]);return p}function Bo(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Po(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var c=t[a],u=r?r(n[c],e[c],c,n,e):o;u===o&&(u=e[c]),i?ar(n,c,u):nr(n,c,u)}return n}function Ro(e,t){return function(n,r){var o=Ha(n)?_t:or,i=t?t():{};return o(n,e,li(r,2),i)}}function jo(e){return Yr(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,s=i>2?n[2]:o;for(a=e.length>3&&\"function\"==typeof a?(i--,a):o,s&&Si(n[0],n[1],s)&&(a=i<3?o:a,i=1),t=Oe(t);++r<i;){var c=n[r];c&&e(t,c,r,a)}return t})}function Uo(e,t){return function(n,r){if(null==n)return n;if(!Ga(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Oe(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function Fo(e){return function(t,n,r){for(var o=-1,i=Oe(t),a=r(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===n(i[c],c,i))break}return t}}function No(e){return function(t){var n=cn(t=bs(t))?yn(t):o,r=n?n[0]:t.charAt(0),i=n?Eo(n,1).join(\"\"):t.slice(1);return r[e]()+i}}function Lo(e){return function(t){return Nt(Js(Ks(t).replace(et,\"\")),e,\"\")}}function Mo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Vn(e.prototype),r=e.apply(n,t);return ts(r)?r:n}}function Do(e){return function(t,n,r){var i=Oe(t);if(!Ga(t)){var a=li(n,3);t=Ps(t),n=function(e){return a(i[e],e,i)}}var s=e(t,n,r);return s>-1?i[a?t[s]:s]:o}}function qo(e){return oi(function(t){var n=t.length,r=n,a=Kn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if(\"function\"!=typeof s)throw new Ce(i);if(a&&!c&&\"wrapper\"==ci(s))var c=new Kn([],!0)}for(r=c?r:n;++r<n;){var u=ci(s=t[r]),l=\"wrapper\"==u?si(s):o;c=l&&Ei(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?c[ci(l[0])].apply(c,l[3]):1==s.length&&Ei(s)?c[u]():c.thru(s)}return function(){var e=arguments,r=e[0];if(c&&1==e.length&&Ha(r))return c.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}})}function Vo(e,t,n,i,a,s,c,u,l,p){var d=t&f,h=1&t,y=2&t,g=24&t,m=512&t,v=y?o:Mo(e);return function f(){for(var b=arguments.length,w=r(b),S=b;S--;)w[S]=arguments[S];if(g)var A=ui(f),E=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(w,A);if(i&&(w=Io(w,i,a,g)),s&&(w=Co(w,s,c,g)),b-=E,g&&b<p){var x=fn(w,A);return Xo(e,t,Vo,f.placeholder,n,w,x,u,l,p-b)}var T=h?n:this,k=y?T[e]:e;return b=w.length,u?w=function(e,t){var n=e.length,r=wn(t.length,n),i=Bo(e);for(;r--;){var a=t[r];e[r]=wi(a,n)?i[a]:o}return e}(w,u):m&&b>1&&w.reverse(),d&&l<b&&(w.length=l),this&&this!==yt&&this instanceof f&&(k=v||Mo(k)),k.apply(T,w)}}function zo(e,t){return function(n,r){return function(e,t,n,r){return Sr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function Ko(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;\"string\"==typeof n||\"string\"==typeof r?(n=lo(n),r=lo(r)):(n=uo(n),r=uo(r)),i=e(n,r)}return i}}function Ho(e){return oi(function(t){return t=Ut(t,Qt(li())),Yr(function(n){var r=this;return e(t,function(e){return Ot(e,r,n)})})})}function $o(e,t){var n=(t=t===o?\" \":lo(t)).length;if(n<2)return n?Zr(t,e):t;var r=Zr(t,ht(e/hn(t)));return cn(t)?Eo(yn(r),0,e).join(\"\"):r.slice(0,e)}function Go(e){return function(t,n,i){return i&&\"number\"!=typeof i&&Si(t,n,i)&&(n=i=o),t=hs(t),n===o?(n=t,t=0):n=hs(n),function(e,t,n,o){for(var i=-1,a=bn(ht((t-e)/(n||1)),0),s=r(a);a--;)s[o?a:++i]=e,e+=n;return s}(t,n,i=i===o?t<n?1:-1:hs(i),e)}}function Wo(e){return function(t,n){return\"string\"==typeof t&&\"string\"==typeof n||(t=ms(t),n=ms(n)),e(t,n)}}function Xo(e,t,n,r,i,a,s,c,f,p){var d=8&t;t|=d?u:l,4&(t&=~(d?l:u))||(t&=-4);var h=[e,t,i,d?a:o,d?s:o,d?o:a,d?o:s,c,f,p],y=n.apply(o,h);return Ei(e)&&Bi(y,h),y.placeholder=r,ji(y,e,t)}function Zo(e){var t=ke[e];return function(e,n){if(e=ms(e),(n=null==n?0:wn(ys(n),292))&&wt(e)){var r=(bs(e)+\"e\").split(\"e\");return+((r=(bs(t(r[0]+\"e\"+(+r[1]+n)))+\"e\").split(\"e\"))[0]+\"e\"+(+r[1]-n))}return t(e)}}var Yo=_n&&1/pn(new _n([,-0]))[1]==d?function(e){return new _n(e)}:uc;function Jo(e){return function(t){var n=gi(t);return n==T?un(t):n==C?dn(t):function(e,t){return Ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function Qo(e,t,n,a,d,h,y,g){var m=2&t;if(!m&&\"function\"!=typeof e)throw new Ce(i);var v=a?a.length:0;if(v||(t&=-97,a=d=o),y=y===o?y:bn(ys(y),0),g=g===o?g:ys(g),v-=d?d.length:0,t&l){var b=a,w=d;a=d=o}var S=m?o:si(e),A=[e,t,n,a,d,b,w,h,y,g];if(S&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,a=r==f&&8==n||r==f&&n==p&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!a)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?Io(u,c,t[4]):c,e[4]=u?fn(e[3],s):t[4]}(c=t[5])&&(u=e[5],e[5]=u?Co(u,c,t[6]):c,e[6]=u?fn(e[5],s):t[6]);(c=t[7])&&(e[7]=c);r&f&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(A,S),e=A[0],t=A[1],n=A[2],a=A[3],d=A[4],!(g=A[9]=A[9]===o?m?0:e.length:bn(A[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||t==c?function(e,t,n){var i=Mo(e);return function a(){for(var s=arguments.length,c=r(s),u=s,l=ui(a);u--;)c[u]=arguments[u];var f=s<3&&c[0]!==l&&c[s-1]!==l?[]:fn(c,l);return(s-=f.length)<n?Xo(e,t,Vo,a.placeholder,o,c,f,o,o,n-s):Ot(this&&this!==yt&&this instanceof a?i:e,this,c)}}(e,t,g):t!=u&&33!=t||d.length?Vo.apply(o,A):function(e,t,n,o){var i=1&t,a=Mo(e);return function t(){for(var s=-1,c=arguments.length,u=-1,l=o.length,f=r(l+c),p=this&&this!==yt&&this instanceof t?a:e;++u<l;)f[u]=o[u];for(;c--;)f[u++]=arguments[++s];return Ot(p,i?n:this,f)}}(e,t,n,a);else var E=function(e,t,n){var r=1&t,o=Mo(e);return function t(){return(this&&this!==yt&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return ji((S?to:Bi)(E,A),e,t)}function ei(e,t,n,r){return e===o||qa(e,Re[n])&&!Fe.call(r,n)?t:e}function ti(e,t,n,r,i,a){return ts(e)&&ts(t)&&(a.set(t,e),zr(e,t,o,ti,a),a.delete(t)),e}function ni(e){return is(e)?o:e}function ri(e,t,n,r,i,a){var s=1&n,c=e.length,u=t.length;if(c!=u&&!(s&&u>c))return!1;var l=a.get(e),f=a.get(t);if(l&&f)return l==t&&f==e;var p=-1,d=!0,h=2&n?new Xn:o;for(a.set(e,t),a.set(t,e);++p<c;){var y=e[p],g=t[p];if(r)var m=s?r(g,y,p,t,e,a):r(y,g,p,e,t,a);if(m!==o){if(m)continue;d=!1;break}if(h){if(!Mt(t,function(e,t){if(!tn(h,t)&&(y===e||i(y,e,n,r,a)))return h.push(t)})){d=!1;break}}else if(y!==g&&!i(y,g,n,r,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function oi(e){return Ri(_i(e,o,$i),e+\"\")}function ii(e){return Tr(e,Ps,hi)}function ai(e){return Tr(e,Rs,yi)}var si=Bn?function(e){return Bn.get(e)}:uc;function ci(e){for(var t=e.name+\"\",n=Pn[t],r=Fe.call(Pn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ui(e){return(Fe.call(qn,\"placeholder\")?qn:e).placeholder}function li(){var e=qn.iteratee||ic;return e=e===ic?Fr:e,arguments.length?e(arguments[0],arguments[1]):e}function fi(e,t){var n,r,o=e.__data__;return(\"string\"==(r=typeof(n=t))||\"number\"==r||\"symbol\"==r||\"boolean\"==r?\"__proto__\"!==n:null===n)?o[\"string\"==typeof t?\"string\":\"hash\"]:o.map}function pi(e){for(var t=Ps(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,ki(o)]}return t}function di(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return Ur(n)?n:o}var hi=mt?function(e){return null==e?[]:(e=Oe(e),Pt(mt(e),function(t){return Xe.call(e,t)}))}:gc,yi=mt?function(e){for(var t=[];e;)Ft(t,hi(e)),e=Ge(e);return t}:gc,gi=kr;function mi(e,t,n){for(var r=-1,o=(t=So(t,e)).length,i=!1;++r<o;){var a=Li(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&es(o)&&wi(a,o)&&(Ha(e)||Ka(e))}function vi(e){return\"function\"!=typeof e.constructor||Ti(e)?{}:Vn(Ge(e))}function bi(e){return Ha(e)||Ka(e)||!!(Ye&&e&&e[Ye])}function wi(e,t){var n=typeof e;return!!(t=t??h)&&(\"number\"==n||\"symbol\"!=n&&we.test(e))&&e>-1&&e%1==0&&e<t}function Si(e,t,n){if(!ts(n))return!1;var r=typeof t;return!!(\"number\"==r?Ga(n)&&wi(t,n.length):\"string\"==r&&t in n)&&qa(n[t],e)}function Ai(e,t){if(Ha(e))return!1;var n=typeof e;return!(\"number\"!=n&&\"symbol\"!=n&&\"boolean\"!=n&&null!=e&&!us(e))||(ne.test(e)||!te.test(e)||null!=t&&e in Oe(t))}function Ei(e){var t=ci(e),n=qn[t];if(\"function\"!=typeof n||!(t in Hn.prototype))return!1;if(e===n)return!0;var r=si(n);return!!r&&e===r[0]}(Tn&&gi(new Tn(new ArrayBuffer(1)))!=U||kn&&gi(new kn)!=T||On&&gi(On.resolve())!=_||_n&&gi(new _n)!=C||In&&gi(new In)!=R)&&(gi=function(e){var t=kr(e),n=t==O?e.constructor:o,r=n?Mi(n):\"\";if(r)switch(r){case Rn:return U;case jn:return T;case Un:return _;case Fn:return C;case Nn:return R}return t});var xi=je?Ja:mc;function Ti(e){var t=e&&e.constructor;return e===(\"function\"==typeof t&&t.prototype||Re)}function ki(e){return e==e&&!ts(e)}function Oi(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==o||e in Oe(n)))}}function _i(e,t,n){return t=bn(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=bn(o.length-t,0),s=r(a);++i<a;)s[i]=o[t+i];i=-1;for(var c=r(t+1);++i<t;)c[i]=o[i];return c[t]=n(s),Ot(e,this,c)}}function Ii(e,t){return t.length<2?e:xr(e,oo(t,0,-1))}function Ci(e,t){if((\"constructor\"!==t||\"function\"!=typeof e[t])&&\"__proto__\"!=t)return e[t]}var Bi=Ui(to),Pi=dt||function(e,t){return yt.setTimeout(e,t)},Ri=Ui(no);function ji(e,t,n){var r=t+\"\";return Ri(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?\"& \":\"\")+t[r],t=t.join(n>2?\", \":\" \"),e.replace(ce,\"{\\n/* [wrapped with \"+t+\"] */\\n\")}(r,function(e,t){return It(m,function(n){var r=\"_.\"+n[0];t&n[1]&&!Rt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(le):[]}(r),n)))}function Ui(e){var t=0,n=0;return function(){var r=Sn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Fi(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=Xr(n,i),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Ni=function(e){var t=Ua(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(\"\"),e.replace(re,function(e,n,r,o){t.push(r?o.replace(de,\"$1\"):n||e)}),t});function Li(e){if(\"string\"==typeof e||us(e))return e;var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}function Mi(e){if(null!=e){try{return Ue.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}function Di(e){if(e instanceof Hn)return e.clone();var t=new Kn(e.__wrapped__,e.__chain__);return t.__actions__=Bo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var qi=Yr(function(e,t){return Wa(e)?pr(e,vr(t,1,Wa,!0)):[]}),Vi=Yr(function(e,t){var n=Yi(t);return Wa(n)&&(n=o),Wa(e)?pr(e,vr(t,1,Wa,!0),li(n,2)):[]}),zi=Yr(function(e,t){var n=Yi(t);return Wa(n)&&(n=o),Wa(e)?pr(e,vr(t,1,Wa,!0),o,n):[]});function Ki(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ys(n);return o<0&&(o=bn(r+o,0)),Vt(e,li(t,3),o)}function Hi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=ys(n),i=n<0?bn(r+i,0):wn(i,r-1)),Vt(e,li(t,3),i,!0)}function $i(e){return(null==e?0:e.length)?vr(e,1):[]}function Gi(e){return e&&e.length?e[0]:o}var Wi=Yr(function(e){var t=Ut(e,bo);return t.length&&t[0]===e[0]?Cr(t):[]}),Xi=Yr(function(e){var t=Yi(e),n=Ut(e,bo);return t===Yi(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Cr(n,li(t,2)):[]}),Zi=Yr(function(e){var t=Yi(e),n=Ut(e,bo);return(t=\"function\"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Cr(n,o,t):[]});function Yi(e){var t=null==e?0:e.length;return t?e[t-1]:o}var Ji=Yr(Qi);function Qi(e,t){return e&&e.length&&t&&t.length?Gr(e,t):e}var ea=oi(function(e,t){var n=null==e?0:e.length,r=sr(e,t);return Wr(e,Ut(t,function(e){return wi(e,n)?+e:e}).sort(_o)),r});function ta(e){return null==e?e:xn.call(e)}var na=Yr(function(e){return fo(vr(e,1,Wa,!0))}),ra=Yr(function(e){var t=Yi(e);return Wa(t)&&(t=o),fo(vr(e,1,Wa,!0),li(t,2))}),oa=Yr(function(e){var t=Yi(e);return t=\"function\"==typeof t?t:o,fo(vr(e,1,Wa,!0),o,t)});function ia(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,function(e){if(Wa(e))return t=bn(e.length,t),!0}),Yt(t,function(t){return Ut(e,Gt(t))})}function aa(e,t){if(!e||!e.length)return[];var n=ia(e);return null==t?n:Ut(n,function(e){return Ot(t,o,e)})}var sa=Yr(function(e,t){return Wa(e)?pr(e,t):[]}),ca=Yr(function(e){return mo(Pt(e,Wa))}),ua=Yr(function(e){var t=Yi(e);return Wa(t)&&(t=o),mo(Pt(e,Wa),li(t,2))}),la=Yr(function(e){var t=Yi(e);return t=\"function\"==typeof t?t:o,mo(Pt(e,Wa),o,t)}),fa=Yr(ia);var pa=Yr(function(e){var t=e.length,n=t>1?e[t-1]:o;return n=\"function\"==typeof n?(e.pop(),n):o,aa(e,n)});function da(e){var t=qn(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var ya=oi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return sr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Hn&&wi(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[i],thisArg:o}),new Kn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(o),e})):this.thru(i)});var ga=Ro(function(e,t,n){Fe.call(e,n)?++e[n]:ar(e,n,1)});var ma=Do(Ki),va=Do(Hi);function ba(e,t){return(Ha(e)?It:dr)(e,li(t,3))}function wa(e,t){return(Ha(e)?Ct:hr)(e,li(t,3))}var Sa=Ro(function(e,t,n){Fe.call(e,n)?e[n].push(t):ar(e,n,[t])});var Aa=Yr(function(e,t,n){var o=-1,i=\"function\"==typeof t,a=Ga(e)?r(e.length):[];return dr(e,function(e){a[++o]=i?Ot(t,e,n):Br(e,t,n)}),a}),Ea=Ro(function(e,t,n){ar(e,n,t)});function xa(e,t){return(Ha(e)?Ut:Dr)(e,li(t,3))}var Ta=Ro(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var ka=Yr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&Si(e,t[0],t[1])?t=[]:n>2&&Si(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,vr(t,1),[])}),Oa=lt||function(){return yt.Date.now()};function _a(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,Qo(e,f,o,o,o,o,t)}function Ia(e,t){var n;if(\"function\"!=typeof t)throw new Ce(i);return e=ys(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Ca=Yr(function(e,t,n){var r=1;if(n.length){var o=fn(n,ui(Ca));r|=u}return Qo(e,r,t,n,o)}),Ba=Yr(function(e,t,n){var r=3;if(n.length){var o=fn(n,ui(Ba));r|=u}return Qo(t,r,e,n,o)});function Pa(e,t,n){var r,a,s,c,u,l,f=0,p=!1,d=!1,h=!0;if(\"function\"!=typeof e)throw new Ce(i);function y(t){var n=r,i=a;return r=a=o,f=t,c=e.apply(i,n)}function g(e){var n=e-l;return l===o||n>=t||n<0||d&&e-f>=s}function m(){var e=Oa();if(g(e))return v(e);u=Pi(m,function(e){var n=t-(e-l);return d?wn(n,s-(e-f)):n}(e))}function v(e){return u=o,h&&r?y(e):(r=a=o,c)}function b(){var e=Oa(),n=g(e);if(r=arguments,a=this,l=e,n){if(u===o)return function(e){return f=e,u=Pi(m,t),p?y(e):c}(l);if(d)return xo(u),u=Pi(m,t),y(l)}return u===o&&(u=Pi(m,t)),c}return t=ms(t)||0,ts(n)&&(p=!!n.leading,s=(d=\"maxWait\"in n)?bn(ms(n.maxWait)||0,t):s,h=\"trailing\"in n?!!n.trailing:h),b.cancel=function(){u!==o&&xo(u),f=0,r=l=a=u=o},b.flush=function(){return u===o?c:v(Oa())},b}var Ra=Yr(function(e,t){return fr(e,1,t)}),ja=Yr(function(e,t,n){return fr(e,ms(t)||0,n)});function Ua(e,t){if(\"function\"!=typeof e||null!=t&&\"function\"!=typeof t)throw new Ce(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ua.Cache||Wn),n}function Fa(e){if(\"function\"!=typeof e)throw new Ce(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ua.Cache=Wn;var Na=Ao(function(e,t){var n=(t=1==t.length&&Ha(t[0])?Ut(t[0],Qt(li())):Ut(vr(t,1),Qt(li()))).length;return Yr(function(r){for(var o=-1,i=wn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Ot(e,this,r)})}),La=Yr(function(e,t){var n=fn(t,ui(La));return Qo(e,u,o,t,n)}),Ma=Yr(function(e,t){var n=fn(t,ui(Ma));return Qo(e,l,o,t,n)}),Da=oi(function(e,t){return Qo(e,p,o,o,o,t)});function qa(e,t){return e===t||e!=e&&t!=t}var Va=Wo(Or),za=Wo(function(e,t){return e>=t}),Ka=Pr(function(){return arguments}())?Pr:function(e){return ns(e)&&Fe.call(e,\"callee\")&&!Xe.call(e,\"callee\")},Ha=r.isArray,$a=St?Qt(St):function(e){return ns(e)&&kr(e)==j};function Ga(e){return null!=e&&es(e.length)&&!Ja(e)}function Wa(e){return ns(e)&&Ga(e)}var Xa=bt||mc,Za=At?Qt(At):function(e){return ns(e)&&kr(e)==S};function Ya(e){if(!ns(e))return!1;var t=kr(e);return t==A||\"[object DOMException]\"==t||\"string\"==typeof e.message&&\"string\"==typeof e.name&&!is(e)}function Ja(e){if(!ts(e))return!1;var t=kr(e);return t==E||t==x||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t}function Qa(e){return\"number\"==typeof e&&e==ys(e)}function es(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)}function ns(e){return null!=e&&\"object\"==typeof e}var rs=Et?Qt(Et):function(e){return ns(e)&&gi(e)==T};function os(e){return\"number\"==typeof e||ns(e)&&kr(e)==k}function is(e){if(!ns(e)||kr(e)!=O)return!1;var t=Ge(e);if(null===t)return!0;var n=Fe.call(t,\"constructor\")&&t.constructor;return\"function\"==typeof n&&n instanceof n&&Ue.call(n)==De}var as=xt?Qt(xt):function(e){return ns(e)&&kr(e)==I};var ss=Tt?Qt(Tt):function(e){return ns(e)&&gi(e)==C};function cs(e){return\"string\"==typeof e||!Ha(e)&&ns(e)&&kr(e)==B}function us(e){return\"symbol\"==typeof e||ns(e)&&kr(e)==P}var ls=kt?Qt(kt):function(e){return ns(e)&&es(e.length)&&!!ct[kr(e)]};var fs=Wo(Mr),ps=Wo(function(e,t){return e<=t});function ds(e){if(!e)return[];if(Ga(e))return cs(e)?yn(e):Bo(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=gi(e);return(t==T?un:t==C?pn:qs)(e)}function hs(e){return e?(e=ms(e))===d||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ys(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function gs(e){return e?cr(ys(e),0,g):0}function ms(e){if(\"number\"==typeof e)return e;if(us(e))return y;if(ts(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=me.test(e);return n||be.test(e)?pt(e.slice(2),n?2:8):ge.test(e)?y:+e}function vs(e){return Po(e,Rs(e))}function bs(e){return null==e?\"\":lo(e)}var ws=jo(function(e,t){if(Ti(t)||Ga(t))Po(t,Ps(t),e);else for(var n in t)Fe.call(t,n)&&nr(e,n,t[n])}),Ss=jo(function(e,t){Po(t,Rs(t),e)}),As=jo(function(e,t,n,r){Po(t,Rs(t),e,r)}),Es=jo(function(e,t,n,r){Po(t,Ps(t),e,r)}),xs=oi(sr);var Ts=Yr(function(e,t){e=Oe(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&Si(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],s=Rs(a),c=-1,u=s.length;++c<u;){var l=s[c],f=e[l];(f===o||qa(f,Re[l])&&!Fe.call(e,l))&&(e[l]=a[l])}return e}),ks=Yr(function(e){return e.push(o,ti),Ot(Us,o,e)});function Os(e,t,n){var r=null==e?o:xr(e,t);return r===o?n:r}function _s(e,t){return null!=e&&mi(e,t,Ir)}var Is=zo(function(e,t,n){null!=t&&\"function\"!=typeof t.toString&&(t=Me.call(t)),e[t]=n},tc(oc)),Cs=zo(function(e,t,n){null!=t&&\"function\"!=typeof t.toString&&(t=Me.call(t)),Fe.call(e,t)?e[t].push(n):e[t]=[n]},li),Bs=Yr(Br);function Ps(e){return Ga(e)?Yn(e):Nr(e)}function Rs(e){return Ga(e)?Yn(e,!0):Lr(e)}var js=jo(function(e,t,n){zr(e,t,n)}),Us=jo(function(e,t,n,r){zr(e,t,n,r)}),Fs=oi(function(e,t){var n={};if(null==e)return n;var r=!1;t=Ut(t,function(t){return t=So(t,e),r||(r=t.length>1),t}),Po(e,ai(e),n),r&&(n=ur(n,7,ni));for(var o=t.length;o--;)po(n,t[o]);return n});var Ns=oi(function(e,t){return null==e?{}:function(e,t){return $r(e,t,function(t,n){return _s(e,n)})}(e,t)});function Ls(e,t){if(null==e)return{};var n=Ut(ai(e),function(e){return[e]});return t=li(t),$r(e,n,function(e,n){return t(e,n[0])})}var Ms=Jo(Ps),Ds=Jo(Rs);function qs(e){return null==e?[]:en(e,Ps(e))}var Vs=Lo(function(e,t,n){return t=t.toLowerCase(),e+(n?zs(t):t)});function zs(e){return Ys(bs(e).toLowerCase())}function Ks(e){return(e=bs(e))&&e.replace(Se,on).replace(tt,\"\")}var Hs=Lo(function(e,t,n){return e+(n?\"-\":\"\")+t.toLowerCase()}),$s=Lo(function(e,t,n){return e+(n?\" \":\"\")+t.toLowerCase()}),Gs=No(\"toLowerCase\");var Ws=Lo(function(e,t,n){return e+(n?\"_\":\"\")+t.toLowerCase()});var Xs=Lo(function(e,t,n){return e+(n?\" \":\"\")+Ys(t)});var Zs=Lo(function(e,t,n){return e+(n?\" \":\"\")+t.toUpperCase()}),Ys=No(\"toUpperCase\");function Js(e,t,n){return e=bs(e),(t=n?o:t)===o?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Qs=Yr(function(e,t){try{return Ot(e,o,t)}catch(e){return Ya(e)?e:new xe(e)}}),ec=oi(function(e,t){return It(t,function(t){t=Li(t),ar(e,t,Ca(e[t],e))}),e});function tc(e){return function(){return e}}var nc=qo(),rc=qo(!0);function oc(e){return e}function ic(e){return Fr(\"function\"==typeof e?e:ur(e,1))}var ac=Yr(function(e,t){return function(n){return Br(n,e,t)}}),sc=Yr(function(e,t){return function(n){return Br(e,n,t)}});function cc(e,t,n){var r=Ps(t),o=Er(t,r);null!=n||ts(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Er(t,Ps(t)));var i=!(ts(n)&&\"chain\"in n&&!n.chain),a=Ja(e);return It(o,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=Bo(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Ft([this.value()],arguments))})}),e}function uc(){}var lc=Ho(Ut),fc=Ho(Bt),pc=Ho(Mt);function dc(e){return Ai(e)?Gt(Li(e)):function(e){return function(t){return xr(t,e)}}(e)}var hc=Go(),yc=Go(!0);function gc(){return[]}function mc(){return!1}var vc=Ko(function(e,t){return e+t},0),bc=Zo(\"ceil\"),wc=Ko(function(e,t){return e/t},1),Sc=Zo(\"floor\");var Ac,Ec=Ko(function(e,t){return e*t},1),xc=Zo(\"round\"),Tc=Ko(function(e,t){return e-t},0);return qn.after=function(e,t){if(\"function\"!=typeof t)throw new Ce(i);return e=ys(e),function(){if(--e<1)return t.apply(this,arguments)}},qn.ary=_a,qn.assign=ws,qn.assignIn=Ss,qn.assignInWith=As,qn.assignWith=Es,qn.at=xs,qn.before=Ia,qn.bind=Ca,qn.bindAll=ec,qn.bindKey=Ba,qn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},qn.chain=da,qn.chunk=function(e,t,n){t=(n?Si(e,t,n):t===o)?1:bn(ys(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,c=r(ht(i/t));a<i;)c[s++]=oo(e,a,a+=t);return c},qn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},qn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Ft(Ha(n)?Bo(n):[n],vr(t,1))},qn.cond=function(e){var t=null==e?0:e.length,n=li();return e=t?Ut(e,function(e){if(\"function\"!=typeof e[1])throw new Ce(i);return[n(e[0]),e[1]]}):[],Yr(function(n){for(var r=-1;++r<t;){var o=e[r];if(Ot(o[0],this,n))return Ot(o[1],this,n)}})},qn.conforms=function(e){return function(e){var t=Ps(e);return function(n){return lr(n,e,t)}}(ur(e,1))},qn.constant=tc,qn.countBy=ga,qn.create=function(e,t){var n=Vn(e);return null==t?n:ir(n,t)},qn.curry=function e(t,n,r){var i=Qo(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},qn.curryRight=function e(t,n,r){var i=Qo(t,c,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},qn.debounce=Pa,qn.defaults=Ts,qn.defaultsDeep=ks,qn.defer=Ra,qn.delay=ja,qn.difference=qi,qn.differenceBy=Vi,qn.differenceWith=zi,qn.drop=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,(t=n||t===o?1:ys(t))<0?0:t,r):[]},qn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,0,(t=r-(t=n||t===o?1:ys(t)))<0?0:t):[]},qn.dropRightWhile=function(e,t){return e&&e.length?yo(e,li(t,3),!0,!0):[]},qn.dropWhile=function(e,t){return e&&e.length?yo(e,li(t,3),!0):[]},qn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&\"number\"!=typeof n&&Si(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=ys(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:ys(r))<0&&(r+=i),r=n>r?0:gs(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},qn.filter=function(e,t){return(Ha(e)?Pt:mr)(e,li(t,3))},qn.flatMap=function(e,t){return vr(xa(e,t),1)},qn.flatMapDeep=function(e,t){return vr(xa(e,t),d)},qn.flatMapDepth=function(e,t,n){return n=n===o?1:ys(n),vr(xa(e,t),n)},qn.flatten=$i,qn.flattenDeep=function(e){return(null==e?0:e.length)?vr(e,d):[]},qn.flattenDepth=function(e,t){return(null==e?0:e.length)?vr(e,t=t===o?1:ys(t)):[]},qn.flip=function(e){return Qo(e,512)},qn.flow=nc,qn.flowRight=rc,qn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];ar(r,o[0],o[1])}return r},qn.functions=function(e){return null==e?[]:Er(e,Ps(e))},qn.functionsIn=function(e){return null==e?[]:Er(e,Rs(e))},qn.groupBy=Sa,qn.initial=function(e){return(null==e?0:e.length)?oo(e,0,-1):[]},qn.intersection=Wi,qn.intersectionBy=Xi,qn.intersectionWith=Zi,qn.invert=Is,qn.invertBy=Cs,qn.invokeMap=Aa,qn.iteratee=ic,qn.keyBy=Ea,qn.keys=Ps,qn.keysIn=Rs,qn.map=xa,qn.mapKeys=function(e,t){var n={};return t=li(t,3),Sr(e,function(e,r,o){ar(n,t(e,r,o),e)}),n},qn.mapValues=function(e,t){var n={};return t=li(t,3),Sr(e,function(e,r,o){ar(n,r,t(e,r,o))}),n},qn.matches=function(e){return qr(ur(e,1))},qn.matchesProperty=function(e,t){return Vr(e,ur(t,1))},qn.memoize=Ua,qn.merge=js,qn.mergeWith=Us,qn.method=ac,qn.methodOf=sc,qn.mixin=cc,qn.negate=Fa,qn.nthArg=function(e){return e=ys(e),Yr(function(t){return Kr(t,e)})},qn.omit=Fs,qn.omitBy=function(e,t){return Ls(e,Fa(li(t)))},qn.once=function(e){return Ia(2,e)},qn.orderBy=function(e,t,n,r){return null==e?[]:(Ha(t)||(t=null==t?[]:[t]),Ha(n=r?o:n)||(n=null==n?[]:[n]),Hr(e,t,n))},qn.over=lc,qn.overArgs=Na,qn.overEvery=fc,qn.overSome=pc,qn.partial=La,qn.partialRight=Ma,qn.partition=Ta,qn.pick=Ns,qn.pickBy=Ls,qn.property=dc,qn.propertyOf=function(e){return function(t){return null==e?o:xr(e,t)}},qn.pull=Ji,qn.pullAll=Qi,qn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Gr(e,t,li(n,2)):e},qn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Gr(e,t,o,n):e},qn.pullAt=ea,qn.range=hc,qn.rangeRight=yc,qn.rearg=Da,qn.reject=function(e,t){return(Ha(e)?Pt:mr)(e,Fa(li(t,3)))},qn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=li(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Wr(e,o),n},qn.rest=function(e,t){if(\"function\"!=typeof e)throw new Ce(i);return Yr(e,t=t===o?t:ys(t))},qn.reverse=ta,qn.sampleSize=function(e,t,n){return t=(n?Si(e,t,n):t===o)?1:ys(t),(Ha(e)?Qn:Qr)(e,t)},qn.set=function(e,t,n){return null==e?e:eo(e,t,n)},qn.setWith=function(e,t,n,r){return r=\"function\"==typeof r?r:o,null==e?e:eo(e,t,n,r)},qn.shuffle=function(e){return(Ha(e)?er:ro)(e)},qn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&\"number\"!=typeof n&&Si(e,t,n)?(t=0,n=r):(t=null==t?0:ys(t),n=n===o?r:ys(n)),oo(e,t,n)):[]},qn.sortBy=ka,qn.sortedUniq=function(e){return e&&e.length?co(e):[]},qn.sortedUniqBy=function(e,t){return e&&e.length?co(e,li(t,2)):[]},qn.split=function(e,t,n){return n&&\"number\"!=typeof n&&Si(e,t,n)&&(t=n=o),(n=n===o?g:n>>>0)?(e=bs(e))&&(\"string\"==typeof t||null!=t&&!as(t))&&!(t=lo(t))&&cn(e)?Eo(yn(e),0,n):e.split(t,n):[]},qn.spread=function(e,t){if(\"function\"!=typeof e)throw new Ce(i);return t=null==t?0:bn(ys(t),0),Yr(function(n){var r=n[t],o=Eo(n,0,t);return r&&Ft(o,r),Ot(e,this,o)})},qn.tail=function(e){var t=null==e?0:e.length;return t?oo(e,1,t):[]},qn.take=function(e,t,n){return e&&e.length?oo(e,0,(t=n||t===o?1:ys(t))<0?0:t):[]},qn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oo(e,(t=r-(t=n||t===o?1:ys(t)))<0?0:t,r):[]},qn.takeRightWhile=function(e,t){return e&&e.length?yo(e,li(t,3),!1,!0):[]},qn.takeWhile=function(e,t){return e&&e.length?yo(e,li(t,3)):[]},qn.tap=function(e,t){return t(e),e},qn.throttle=function(e,t,n){var r=!0,o=!0;if(\"function\"!=typeof e)throw new Ce(i);return ts(n)&&(r=\"leading\"in n?!!n.leading:r,o=\"trailing\"in n?!!n.trailing:o),Pa(e,t,{leading:r,maxWait:t,trailing:o})},qn.thru=ha,qn.toArray=ds,qn.toPairs=Ms,qn.toPairsIn=Ds,qn.toPath=function(e){return Ha(e)?Ut(e,Li):us(e)?[e]:Bo(Ni(bs(e)))},qn.toPlainObject=vs,qn.transform=function(e,t,n){var r=Ha(e),o=r||Xa(e)||ls(e);if(t=li(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:ts(e)&&Ja(i)?Vn(Ge(e)):{}}return(o?It:Sr)(e,function(e,r,o){return t(n,e,r,o)}),n},qn.unary=function(e){return _a(e,1)},qn.union=na,qn.unionBy=ra,qn.unionWith=oa,qn.uniq=function(e){return e&&e.length?fo(e):[]},qn.uniqBy=function(e,t){return e&&e.length?fo(e,li(t,2)):[]},qn.uniqWith=function(e,t){return t=\"function\"==typeof t?t:o,e&&e.length?fo(e,o,t):[]},qn.unset=function(e,t){return null==e||po(e,t)},qn.unzip=ia,qn.unzipWith=aa,qn.update=function(e,t,n){return null==e?e:ho(e,t,wo(n))},qn.updateWith=function(e,t,n,r){return r=\"function\"==typeof r?r:o,null==e?e:ho(e,t,wo(n),r)},qn.values=qs,qn.valuesIn=function(e){return null==e?[]:en(e,Rs(e))},qn.without=sa,qn.words=Js,qn.wrap=function(e,t){return La(wo(t),e)},qn.xor=ca,qn.xorBy=ua,qn.xorWith=la,qn.zip=fa,qn.zipObject=function(e,t){return vo(e||[],t||[],nr)},qn.zipObjectDeep=function(e,t){return vo(e||[],t||[],eo)},qn.zipWith=pa,qn.entries=Ms,qn.entriesIn=Ds,qn.extend=Ss,qn.extendWith=As,cc(qn,qn),qn.add=vc,qn.attempt=Qs,qn.camelCase=Vs,qn.capitalize=zs,qn.ceil=bc,qn.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=ms(n))==n?n:0),t!==o&&(t=(t=ms(t))==t?t:0),cr(ms(e),t,n)},qn.clone=function(e){return ur(e,4)},qn.cloneDeep=function(e){return ur(e,5)},qn.cloneDeepWith=function(e,t){return ur(e,5,t=\"function\"==typeof t?t:o)},qn.cloneWith=function(e,t){return ur(e,4,t=\"function\"==typeof t?t:o)},qn.conformsTo=function(e,t){return null==t||lr(e,t,Ps(t))},qn.deburr=Ks,qn.defaultTo=function(e,t){return null==e||e!=e?t:e},qn.divide=wc,qn.endsWith=function(e,t,n){e=bs(e),t=lo(t);var r=e.length,i=n=n===o?r:cr(ys(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},qn.eq=qa,qn.escape=function(e){return(e=bs(e))&&Y.test(e)?e.replace(X,an):e},qn.escapeRegExp=function(e){return(e=bs(e))&&ie.test(e)?e.replace(oe,\"\\\\$&\"):e},qn.every=function(e,t,n){var r=Ha(e)?Bt:yr;return n&&Si(e,t,n)&&(t=o),r(e,li(t,3))},qn.find=ma,qn.findIndex=Ki,qn.findKey=function(e,t){return qt(e,li(t,3),Sr)},qn.findLast=va,qn.findLastIndex=Hi,qn.findLastKey=function(e,t){return qt(e,li(t,3),Ar)},qn.floor=Sc,qn.forEach=ba,qn.forEachRight=wa,qn.forIn=function(e,t){return null==e?e:br(e,li(t,3),Rs)},qn.forInRight=function(e,t){return null==e?e:wr(e,li(t,3),Rs)},qn.forOwn=function(e,t){return e&&Sr(e,li(t,3))},qn.forOwnRight=function(e,t){return e&&Ar(e,li(t,3))},qn.get=Os,qn.gt=Va,qn.gte=za,qn.has=function(e,t){return null!=e&&mi(e,t,_r)},qn.hasIn=_s,qn.head=Gi,qn.identity=oc,qn.includes=function(e,t,n,r){e=Ga(e)?e:qs(e),n=n&&!r?ys(n):0;var o=e.length;return n<0&&(n=bn(o+n,0)),cs(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&zt(e,t,n)>-1},qn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ys(n);return o<0&&(o=bn(r+o,0)),zt(e,t,o)},qn.inRange=function(e,t,n){return t=hs(t),n===o?(n=t,t=0):n=hs(n),function(e,t,n){return e>=wn(t,n)&&e<bn(t,n)}(e=ms(e),t,n)},qn.invoke=Bs,qn.isArguments=Ka,qn.isArray=Ha,qn.isArrayBuffer=$a,qn.isArrayLike=Ga,qn.isArrayLikeObject=Wa,qn.isBoolean=function(e){return!0===e||!1===e||ns(e)&&kr(e)==w},qn.isBuffer=Xa,qn.isDate=Za,qn.isElement=function(e){return ns(e)&&1===e.nodeType&&!is(e)},qn.isEmpty=function(e){if(null==e)return!0;if(Ga(e)&&(Ha(e)||\"string\"==typeof e||\"function\"==typeof e.splice||Xa(e)||ls(e)||Ka(e)))return!e.length;var t=gi(e);if(t==T||t==C)return!e.size;if(Ti(e))return!Nr(e).length;for(var n in e)if(Fe.call(e,n))return!1;return!0},qn.isEqual=function(e,t){return Rr(e,t)},qn.isEqualWith=function(e,t,n){var r=(n=\"function\"==typeof n?n:o)?n(e,t):o;return r===o?Rr(e,t,o,n):!!r},qn.isError=Ya,qn.isFinite=function(e){return\"number\"==typeof e&&wt(e)},qn.isFunction=Ja,qn.isInteger=Qa,qn.isLength=es,qn.isMap=rs,qn.isMatch=function(e,t){return e===t||jr(e,t,pi(t))},qn.isMatchWith=function(e,t,n){return n=\"function\"==typeof n?n:o,jr(e,t,pi(t),n)},qn.isNaN=function(e){return os(e)&&e!=+e},qn.isNative=function(e){if(xi(e))throw new xe(\"Unsupported core-js use. Try https://npms.io/search?q=ponyfill.\");return Ur(e)},qn.isNil=function(e){return null==e},qn.isNull=function(e){return null===e},qn.isNumber=os,qn.isObject=ts,qn.isObjectLike=ns,qn.isPlainObject=is,qn.isRegExp=as,qn.isSafeInteger=function(e){return Qa(e)&&e>=-9007199254740991&&e<=h},qn.isSet=ss,qn.isString=cs,qn.isSymbol=us,qn.isTypedArray=ls,qn.isUndefined=function(e){return e===o},qn.isWeakMap=function(e){return ns(e)&&gi(e)==R},qn.isWeakSet=function(e){return ns(e)&&\"[object WeakSet]\"==kr(e)},qn.join=function(e,t){return null==e?\"\":Dt.call(e,t)},qn.kebabCase=Hs,qn.last=Yi,qn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=ys(n))<0?bn(r+i,0):wn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Vt(e,Ht,i,!0)},qn.lowerCase=$s,qn.lowerFirst=Gs,qn.lt=fs,qn.lte=ps,qn.max=function(e){return e&&e.length?gr(e,oc,Or):o},qn.maxBy=function(e,t){return e&&e.length?gr(e,li(t,2),Or):o},qn.mean=function(e){return $t(e,oc)},qn.meanBy=function(e,t){return $t(e,li(t,2))},qn.min=function(e){return e&&e.length?gr(e,oc,Mr):o},qn.minBy=function(e,t){return e&&e.length?gr(e,li(t,2),Mr):o},qn.stubArray=gc,qn.stubFalse=mc,qn.stubObject=function(){return{}},qn.stubString=function(){return\"\"},qn.stubTrue=function(){return!0},qn.multiply=Ec,qn.nth=function(e,t){return e&&e.length?Kr(e,ys(t)):o},qn.noConflict=function(){return yt._===this&&(yt._=qe),this},qn.noop=uc,qn.now=Oa,qn.pad=function(e,t,n){e=bs(e);var r=(t=ys(t))?hn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return $o(gt(o),n)+e+$o(ht(o),n)},qn.padEnd=function(e,t,n){e=bs(e);var r=(t=ys(t))?hn(e):0;return t&&r<t?e+$o(t-r,n):e},qn.padStart=function(e,t,n){e=bs(e);var r=(t=ys(t))?hn(e):0;return t&&r<t?$o(t-r,n)+e:e},qn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),An(bs(e).replace(ae,\"\"),t||0)},qn.random=function(e,t,n){if(n&&\"boolean\"!=typeof n&&Si(e,t,n)&&(t=n=o),n===o&&(\"boolean\"==typeof t?(n=t,t=o):\"boolean\"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=hs(e),t===o?(t=e,e=0):t=hs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=En();return wn(e+i*(t-e+ft(\"1e-\"+((i+\"\").length-1))),t)}return Xr(e,t)},qn.reduce=function(e,t,n){var r=Ha(e)?Nt:Xt,o=arguments.length<3;return r(e,li(t,4),n,o,dr)},qn.reduceRight=function(e,t,n){var r=Ha(e)?Lt:Xt,o=arguments.length<3;return r(e,li(t,4),n,o,hr)},qn.repeat=function(e,t,n){return t=(n?Si(e,t,n):t===o)?1:ys(t),Zr(bs(e),t)},qn.replace=function(){var e=arguments,t=bs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},qn.result=function(e,t,n){var r=-1,i=(t=So(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[Li(t[r])];a===o&&(r=i,a=n),e=Ja(a)?a.call(e):a}return e},qn.round=xc,qn.runInContext=e,qn.sample=function(e){return(Ha(e)?Jn:Jr)(e)},qn.size=function(e){if(null==e)return 0;if(Ga(e))return cs(e)?hn(e):e.length;var t=gi(e);return t==T||t==C?e.size:Nr(e).length},qn.snakeCase=Ws,qn.some=function(e,t,n){var r=Ha(e)?Mt:io;return n&&Si(e,t,n)&&(t=o),r(e,li(t,3))},qn.sortedIndex=function(e,t){return ao(e,t)},qn.sortedIndexBy=function(e,t,n){return so(e,t,li(n,2))},qn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ao(e,t);if(r<n&&qa(e[r],t))return r}return-1},qn.sortedLastIndex=function(e,t){return ao(e,t,!0)},qn.sortedLastIndexBy=function(e,t,n){return so(e,t,li(n,2),!0)},qn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=ao(e,t,!0)-1;if(qa(e[n],t))return n}return-1},qn.startCase=Xs,qn.startsWith=function(e,t,n){return e=bs(e),n=null==n?0:cr(ys(n),0,e.length),t=lo(t),e.slice(n,n+t.length)==t},qn.subtract=Tc,qn.sum=function(e){return e&&e.length?Zt(e,oc):0},qn.sumBy=function(e,t){return e&&e.length?Zt(e,li(t,2)):0},qn.template=function(e,t,n){var r=qn.templateSettings;n&&Si(e,t,n)&&(t=o),e=bs(e),t=Es({},t,r,ei);var i=Es({},t.imports,r.imports,ei),a=Ps(i),s=en(i,a);It(a,function(e){if(pe.test(e))throw new xe(\"Invalid `imports` option passed into `_.template`\")});var c,u,l=0,f=t.interpolate||Ae,p=\"__p += '\",d=_e((t.escape||Ae).source+\"|\"+f.source+\"|\"+(f===ee?he:Ae).source+\"|\"+(t.evaluate||Ae).source+\"|$\",\"g\"),h=\"//# sourceURL=\"+(Fe.call(t,\"sourceURL\")?(t.sourceURL+\"\").replace(/\\s/g,\" \"):\"lodash.templateSources[\"+ ++st+\"]\")+\"\\n\";e.replace(d,function(t,n,r,o,i,a){return r||(r=o),p+=e.slice(l,a).replace(Ee,sn),n&&(c=!0,p+=\"' +\\n__e(\"+n+\") +\\n'\"),i&&(u=!0,p+=\"';\\n\"+i+\";\\n__p += '\"),r&&(p+=\"' +\\n((__t = (\"+r+\")) == null ? '' : __t) +\\n'\"),l=a+t.length,t}),p+=\"';\\n\";var y=Fe.call(t,\"variable\")&&t.variable;if(y){if(pe.test(y))throw new xe(\"Invalid `variable` option passed into `_.template`\")}else p=\"with (obj) {\\n\"+p+\"\\n}\\n\";p=(u?p.replace(H,\"\"):p).replace($,\"$1\").replace(G,\"$1;\"),p=\"function(\"+(y||\"obj\")+\") {\\n\"+(y?\"\":\"obj || (obj = {});\\n\")+\"var __t, __p = ''\"+(c?\", __e = _.escape\":\"\")+(u?\", __j = Array.prototype.join;\\nfunction print() { __p += __j.call(arguments, '') }\\n\":\";\\n\")+p+\"return __p\\n}\";var g=Qs(function(){return Te(a,h+\"return \"+p).apply(o,s)});if(g.source=p,Ya(g))throw g;return g},qn.times=function(e,t){if((e=ys(e))<1||e>h)return[];var n=g,r=wn(e,g);t=li(t),e-=g;for(var o=Yt(r,t);++n<e;)t(n);return o},qn.toFinite=hs,qn.toInteger=ys,qn.toLength=gs,qn.toLower=function(e){return bs(e).toLowerCase()},qn.toNumber=ms,qn.toSafeInteger=function(e){return e?cr(ys(e),-9007199254740991,h):0===e?e:0},qn.toString=bs,qn.toUpper=function(e){return bs(e).toUpperCase()},qn.trim=function(e,t,n){if((e=bs(e))&&(n||t===o))return Jt(e);if(!e||!(t=lo(t)))return e;var r=yn(e),i=yn(t);return Eo(r,nn(r,i),rn(r,i)+1).join(\"\")},qn.trimEnd=function(e,t,n){if((e=bs(e))&&(n||t===o))return e.slice(0,gn(e)+1);if(!e||!(t=lo(t)))return e;var r=yn(e);return Eo(r,0,rn(r,yn(t))+1).join(\"\")},qn.trimStart=function(e,t,n){if((e=bs(e))&&(n||t===o))return e.replace(ae,\"\");if(!e||!(t=lo(t)))return e;var r=yn(e);return Eo(r,nn(r,yn(t))).join(\"\")},qn.truncate=function(e,t){var n=30,r=\"...\";if(ts(t)){var i=\"separator\"in t?t.separator:i;n=\"length\"in t?ys(t.length):n,r=\"omission\"in t?lo(t.omission):r}var a=(e=bs(e)).length;if(cn(e)){var s=yn(e);a=s.length}if(n>=a)return e;var c=n-hn(r);if(c<1)return r;var u=s?Eo(s,0,c).join(\"\"):e.slice(0,c);if(i===o)return u+r;if(s&&(c+=u.length-c),as(i)){if(e.slice(c).search(i)){var l,f=u;for(i.global||(i=_e(i.source,bs(ye.exec(i))+\"g\")),i.lastIndex=0;l=i.exec(f);)var p=l.index;u=u.slice(0,p===o?c:p)}}else if(e.indexOf(lo(i),c)!=c){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},qn.unescape=function(e){return(e=bs(e))&&Z.test(e)?e.replace(W,mn):e},qn.uniqueId=function(e){var t=++Ne;return bs(e)+t},qn.upperCase=Zs,qn.upperFirst=Ys,qn.each=ba,qn.eachRight=wa,qn.first=Gi,cc(qn,(Ac={},Sr(qn,function(e,t){Fe.call(qn.prototype,t)||(Ac[t]=e)}),Ac),{chain:!1}),qn.VERSION=\"4.18.1\",It([\"bind\",\"bindKey\",\"curry\",\"curryRight\",\"partial\",\"partialRight\"],function(e){qn[e].placeholder=qn}),It([\"drop\",\"take\"],function(e,t){Hn.prototype[e]=function(n){n=n===o?1:bn(ys(n),0);var r=this.__filtered__&&!t?new Hn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,g),type:e+(r.__dir__<0?\"Right\":\"\")}),r},Hn.prototype[e+\"Right\"]=function(t){return this.reverse()[e](t).reverse()}}),It([\"filter\",\"map\",\"takeWhile\"],function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:li(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),It([\"head\",\"last\"],function(e,t){var n=\"take\"+(t?\"Right\":\"\");Hn.prototype[e]=function(){return this[n](1).value()[0]}}),It([\"initial\",\"tail\"],function(e,t){var n=\"drop\"+(t?\"\":\"Right\");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}}),Hn.prototype.compact=function(){return this.filter(oc)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Yr(function(e,t){return\"function\"==typeof e?new Hn(this):this.map(function(n){return Br(n,e,t)})}),Hn.prototype.reject=function(e){return this.filter(Fa(li(e)))},Hn.prototype.slice=function(e,t){e=ys(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=ys(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(g)},Sr(Hn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=qn[r?\"take\"+(\"last\"==t?\"Right\":\"\"):t],a=r||/^find/.test(t);i&&(qn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,c=t instanceof Hn,u=s[0],l=c||Ha(t),f=function(e){var t=i.apply(qn,Ft([e],s));return r&&p?t[0]:t};l&&n&&\"function\"==typeof u&&1!=u.length&&(c=l=!1);var p=this.__chain__,d=!!this.__actions__.length,h=a&&!p,y=c&&!d;if(!a&&l){t=y?t:new Hn(this);var g=e.apply(t,s);return g.__actions__.push({func:ha,args:[f],thisArg:o}),new Kn(g,p)}return h&&y?e.apply(this,s):(g=this.thru(f),h?r?g.value()[0]:g.value():g)})}),It([\"pop\",\"push\",\"shift\",\"sort\",\"splice\",\"unshift\"],function(e){var t=Be[e],n=/^(?:push|sort|unshift)$/.test(e)?\"tap\":\"thru\",r=/^(?:pop|shift)$/.test(e);qn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ha(o)?o:[],e)}return this[n](function(n){return t.apply(Ha(n)?n:[],e)})}}),Sr(Hn.prototype,function(e,t){var n=qn[t];if(n){var r=n.name+\"\";Fe.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}}),Pn[Vo(o,2).name]=[{name:\"wrapper\",func:o}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=Bo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Bo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Bo(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ha(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case\"drop\":e+=a;break;case\"dropRight\":t-=a;break;case\"take\":t=wn(t,e+a);break;case\"takeRight\":e=bn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,s=i.end,c=s-a,u=r?s:a-1,l=this.__iteratees__,f=l.length,p=0,d=wn(c,this.__takeCount__);if(!n||!r&&o==c&&d==c)return go(e,this.__actions__);var h=[];e:for(;c--&&p<d;){for(var y=-1,g=e[u+=t];++y<f;){var m=l[y],v=m.iteratee,b=m.type,w=v(g);if(2==b)g=w;else if(!w){if(1==b)continue e;break e}}h[p++]=g}return h},qn.prototype.at=ya,qn.prototype.chain=function(){return da(this)},qn.prototype.commit=function(){return new Kn(this.value(),this.__chain__)},qn.prototype.next=function(){this.__values__===o&&(this.__values__=ds(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},qn.prototype.plant=function(e){for(var t,n=this;n instanceof zn;){var r=Di(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},qn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:ha,args:[ta],thisArg:o}),new Kn(t,this.__chain__)}return this.thru(ta)},qn.prototype.toJSON=qn.prototype.valueOf=qn.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},qn.prototype.first=qn.prototype.head,Je&&(qn.prototype[Je]=function(){return this}),qn}();yt._=vn,(r=function(){return vn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)},9011(e,t,n){var r=n(8250);function o(e,t){if(\"function\"!=typeof e||null!=t&&\"function\"!=typeof t)throw new TypeError(\"Expected a function\");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},9071(e){e.exports=function(){}},3282(e,t,n){var r=n(2762),o=n(8880),i=n(5187),a=n(6040);e.exports=function(e){return i(e)?r(a(e)):o(e)}},74(e,t,n){var r=n(313),o=n(310),i=n(3945),a=n(4535),s=i(function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])});e.exports=s},9306(e){e.exports=function(){return[]}},4772(e){e.exports=function(){return!1}},5243(e,t,n){var r=n(2291);e.exports=function(e){return null==e?\"\":r(e)}},7835(e,t,n){var r=n(3334),o=n(5630);e.exports=function(e,t){return e&&e.length?o(e,r(t,2)):[]}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{\"use strict\";n.r(r),n.d(r,{onAssetHistoricalPrice:()=>DE,onAssetsConversion:()=>ME,onAssetsLookup:()=>LE,onAssetsMarketData:()=>qE,onClientRequest:()=>KE,onCronjob:()=>HE,onKeyringRequest:()=>VE,onUserInput:()=>zE});var e={};n.r(e),n.d(e,{compressPublicKey:()=>hb,compressedPublicKeyLength:()=>vb,curve:()=>ab,decompressPublicKey:()=>yb,deriveUnhardenedKeys:()=>lb,getPublicKey:()=>pb,isValidPrivateKey:()=>ub,masterNodeGenerationSpec:()=>mb,name:()=>sb,privateKeyLength:()=>gb,publicAdd:()=>db,publicKeyLength:()=>fb,secret:()=>cb});var t={};n.r(t),n.d(t,{bytesToNumberLE:()=>kb,compressPublicKey:()=>Cb,compressedPublicKeyLength:()=>jb,curve:()=>bb,decompressPublicKey:()=>Bb,deriveUnhardenedKeys:()=>xb,getPublicKey:()=>_b,isValidPrivateKey:()=>Eb,masterNodeGenerationSpec:()=>Rb,multiplyWithBase:()=>Ob,name:()=>wb,privateKeyLength:()=>Pb,publicAdd:()=>Ib,publicKeyLength:()=>Tb,secret:()=>Sb});var o={};n.r(o),n.d(o,{deriveChildKey:()=>mw,privateKeyToEthAddress:()=>yw,publicKeyToEthAddress:()=>gw});var i={};n.r(i),n.d(i,{bip39MnemonicToMultipath:()=>Ew,createBip39KeyFromSeed:()=>Ow,deriveChildKey:()=>kw,entropyToCip3MasterNode:()=>_w,getDerivationPathWithSeed:()=>Tw,mnemonicToSeed:()=>Aw,multipathToBip39Mnemonic:()=>xw});var a={};n.r(a),n.d(a,{add:()=>Uw,bigIntToBytes:()=>Bw,bytesToBigInt:()=>Cw,deriveChainCode:()=>Vw,deriveChildKey:()=>Hw,derivePrivateKey:()=>Mw,derivePublicKey:()=>Kw,getKeyExtension:()=>Fw,mod2Pow256:()=>jw,padEnd32Bytes:()=>Pw,toReversed:()=>Iw,trunc28Mul8:()=>Rw});var s={};n.r(s),n.d(s,{deriveChildKey:()=>$w});var c={};n.r(c),n.d(c,{compressPublicKey:()=>FS,compressedPublicKeyLength:()=>DS,curve:()=>_S,decompressPublicKey:()=>NS,deriveUnhardenedKeys:()=>BS,getPublicKey:()=>jS,isValidPrivateKey:()=>RS,masterNodeGenerationSpec:()=>MS,name:()=>IS,privateKeyLength:()=>LS,publicAdd:()=>US,publicKeyLength:()=>PS,secret:()=>CS});const u=new Error(\"timeout while waiting for mutex to become available\"),l=new Error(\"mutex already locked\"),f=new Error(\"request for lock canceled\");var p=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};class d{constructor(e,t=f){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,r)=>{const o={resolve:n,reject:r,weight:e,priority:t},i=h(this._queue,e=>t<=e.priority);-1===i&&e<=this._value?this._dispatchItem(o):this._queue.splice(i+1,0,o)})}runExclusive(e){return p(this,arguments,void 0,function*(e,t=1,n=0){const[r,o]=yield this.acquire(t,n);try{return yield e(r)}finally{o()}})}waitForUnlock(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),function(e,t){const n=h(e,e=>t.priority<=e.priority);e.splice(n+1,0,t)}(this._weightedWaiters[e-1],{resolve:n,priority:t})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(0===this._queue.length)for(let e=this._value;e>0;e--){const t=this._weightedWaiters[e-1];t&&(t.forEach(e=>e.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let t=this._value;t>0;t--){const n=this._weightedWaiters[t-1];if(!n)continue;const r=n.findIndex(t=>t.priority<=e);(-1===r?n:n.splice(0,r)).forEach(e=>e.resolve())}}}_couldLockImmediately(e,t){return(0===this._queue.length||this._queue[0].priority<t)&&e<=this._value}}function h(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}var y=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};class g{constructor(e){this._semaphore=new d(1,e)}acquire(){return y(this,arguments,void 0,function*(e=0){const[,t]=yield this._semaphore.acquire(1,e);return t})}runExclusive(e,t=0){return this._semaphore.runExclusive(()=>e(),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}var m=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};function v(e){return void 0!==e.getValue}function b(e,t=l){return function(e,t,n=u){return{acquire:(r,o)=>{let i;if(v(e)?i=r:(i=void 0,o=r),void 0!==i&&i<=0)throw new Error(`invalid weight ${i}: must be positive`);return new Promise((r,a)=>m(this,void 0,void 0,function*(){let s=!1;const c=setTimeout(()=>{s=!0,a(n)},t);try{const t=yield v(e)?e.acquire(i,o):e.acquire(o);s?(Array.isArray(t)?t[1]:t)():(clearTimeout(c),r(t))}catch(e){s||(clearTimeout(c),a(e))}}))},runExclusive(e,t,n){return m(this,void 0,void 0,function*(){let r=()=>{};try{const o=yield this.acquire(t,n);return Array.isArray(o)?(r=o[1],yield e(o[0])):(r=o,yield e())}finally{r()}})},release(t){e.release(t)},cancel:()=>e.cancel(),waitForUnlock:(r,o)=>{let i;if(v(e)?i=r:(i=void 0,o=r),void 0!==i&&i<=0)throw new Error(`invalid weight ${i}: must be positive`);return new Promise((r,a)=>{const s=setTimeout(()=>a(n),t);(v(e)?e.waitForUnlock(i,o):e.waitForUnlock(o)).then(()=>{clearTimeout(s),r()})})},isLocked:()=>e.isLocked(),getValue:()=>e.getValue(),setValue:t=>e.setValue(t)}}(e,0,t)}var w=n(5250);var S=/^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,A=Math.ceil,E=Math.floor,x=\"[BigNumber Error] \",T=x+\"Number primitive has more than 15 significant digits: \",k=1e14,O=14,_=9007199254740991,I=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],C=1e7,B=1e9;function P(e){var t=0|e;return e>0||e===t?t:t-1}function R(e){for(var t,n,r=1,o=e.length,i=e[0]+\"\";r<o;){for(t=e[r++]+\"\",n=O-t.length;n--;t=\"0\"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function j(e,t){var n,r,o=e.c,i=t.c,a=e.s,s=t.s,c=e.e,u=t.e;if(!a||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=c==u,!o||!i)return r?0:!o^n?1:-1;if(!r)return c>u^n?1:-1;for(s=(c=o.length)<(u=i.length)?c:u,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function U(e,t,n,r){if(e<t||e>n||e!==E(e))throw Error(x+(r||\"Argument\")+(\"number\"==typeof e?e<t||e>n?\" out of range: \":\" not an integer: \":\" not a primitive number: \")+String(e))}function F(e){var t=e.c.length-1;return P(e.e/O)==t&&e.c[t]%2!=0}function N(e,t){return(e.length>1?e.charAt(0)+\".\"+e.slice(1):e)+(t<0?\"e\":\"e+\")+t}function L(e,t,n){var r,o;if(t<0){for(o=n+\".\";++t;o+=n);e=o+e}else if(++t>(r=e.length)){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+\".\"+e.slice(t));return e}var M=function e(t){var n,r,o,i,a,s,c,u,l,f,p=K.prototype={constructor:K,toString:null,valueOf:null},d=new K(1),h=20,y=4,g=-7,m=21,v=-1e7,b=1e7,w=!1,M=1,D=0,q={prefix:\"\",groupSize:3,secondaryGroupSize:0,groupSeparator:\",\",decimalSeparator:\".\",fractionGroupSize:0,fractionGroupSeparator:\" \",suffix:\"\"},V=\"0123456789abcdefghijklmnopqrstuvwxyz\",z=!0;function K(e,t){var n,i,a,s,c,u,l,f,p=this;if(!(p instanceof K))return new K(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>b?p.c=p.e=null:e.e<v?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((u=\"number\"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>b?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!S.test(f=String(e)))return o(p,f,u);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf(\".\"))>-1&&(f=f.replace(\".\",\"\")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(U(t,2,V.length,\"Base\"),10==t&&z)return W(p=new K(e),h+p.e+1,y);if(f=String(e),u=\"number\"==typeof e){if(0*e!=0)return o(p,f,u,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,K.DEBUG&&f.replace(/^0\\.0*|\\./,\"\").length>15)throw Error(T+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=V.slice(0,t),s=c=0,l=f.length;c<l;c++)if(n.indexOf(i=f.charAt(c))<0){if(\".\"==i){if(c>s){s=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,c=-1,s=0;continue}return o(p,String(e),u,t)}u=!1,(s=(f=r(f,t,10,p.s)).indexOf(\".\"))>-1?f=f.replace(\".\",\"\"):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,u&&K.DEBUG&&l>15&&(e>_||e!==E(e)))throw Error(T+p.s*e);if((s=s-c-1)>b)p.c=p.e=null;else if(s<v)p.c=[p.e=0];else{if(p.e=s,p.c=[],c=(s+1)%O,s<0&&(c+=O),c<l){for(c&&p.c.push(+f.slice(0,c)),l-=O;c<l;)p.c.push(+f.slice(c,c+=O));c=O-(f=f.slice(c)).length}else c-=l;for(;c--;f+=\"0\");p.c.push(+f)}}else p.c=[p.e=0]}function H(e,t,n,r){var o,i,a,s,c;if(null==n?n=y:U(n,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)c=R(e.c),c=1==r||2==r&&(a<=g||a>=m)?N(c,a):L(c,a,\"0\");else if(i=(e=W(new K(e),t,n)).e,s=(c=R(e.c)).length,1==r||2==r&&(t<=i||i<=g)){for(;s<t;c+=\"0\",s++);c=N(c,i)}else if(t-=a+(2===r&&i>a),c=L(c,i,\"0\"),i+1>s){if(--t>0)for(c+=\".\";t--;c+=\"0\");}else if((t+=i-s)>0)for(i+1==s&&(c+=\".\");t--;c+=\"0\");return e.s<0&&o?\"-\"+c:c}function $(e,t){for(var n,r,o=1,i=new K(e[0]);o<e.length;o++)(!(r=new K(e[o])).s||(n=j(i,r))===t||0===n&&i.s===t)&&(i=r);return i}function G(e,t,n){for(var r=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,r++);return(n=r+n*O-1)>b?e.c=e.e=null:n<v?e.c=[e.e=0]:(e.e=n,e.c=t),e}function W(e,t,n,r){var o,i,a,s,c,u,l,f=e.c,p=I;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=O,a=t,c=f[u=0],l=E(c/p[o-a-1]%10);else if((u=A((i+1)/O))>=f.length){if(!r)break e;for(;f.length<=u;f.push(0));c=l=0,o=1,a=(i%=O)-O+1}else{for(c=s=f[u],o=1;s>=10;s/=10,o++);l=(a=(i%=O)-O+o)<0?0:E(c/p[o-a-1]%10)}if(r=r||t<0||null!=f[u+1]||(a<0?c:c%p[o-a-1]),r=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(i>0?a>0?c/p[o-a]:0:f[u-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,r?(t-=e.e+1,f[0]=p[(O-t%O)%O],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=u,s=1,u--):(f.length=u+1,s=p[O-i],f[u]=a>0?E(c/p[o-a]%p[a])*s:0),r)for(;;){if(0==u){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==k&&(f[0]=1));break}if(f[u]+=s,f[u]!=k)break;f[u--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>b?e.c=e.e=null:e.e<v&&(e.c=[e.e=0])}return e}function X(e){var t,n=e.e;return null===n?e.toString():(t=R(e.c),t=n<=g||n>=m?N(t,n):L(t,n,\"0\"),e.s<0?\"-\"+t:t)}return K.clone=e,K.ROUND_UP=0,K.ROUND_DOWN=1,K.ROUND_CEIL=2,K.ROUND_FLOOR=3,K.ROUND_HALF_UP=4,K.ROUND_HALF_DOWN=5,K.ROUND_HALF_EVEN=6,K.ROUND_HALF_CEIL=7,K.ROUND_HALF_FLOOR=8,K.EUCLID=9,K.config=K.set=function(e){var t,n;if(null!=e){if(\"object\"!=typeof e)throw Error(x+\"Object expected: \"+e);if(e.hasOwnProperty(t=\"DECIMAL_PLACES\")&&(U(n=e[t],0,B,t),h=n),e.hasOwnProperty(t=\"ROUNDING_MODE\")&&(U(n=e[t],0,8,t),y=n),e.hasOwnProperty(t=\"EXPONENTIAL_AT\")&&((n=e[t])&&n.pop?(U(n[0],-B,0,t),U(n[1],0,B,t),g=n[0],m=n[1]):(U(n,-B,B,t),g=-(m=n<0?-n:n))),e.hasOwnProperty(t=\"RANGE\"))if((n=e[t])&&n.pop)U(n[0],-B,-1,t),U(n[1],1,B,t),v=n[0],b=n[1];else{if(U(n,-B,B,t),!n)throw Error(x+t+\" cannot be zero: \"+n);v=-(b=n<0?-n:n)}if(e.hasOwnProperty(t=\"CRYPTO\")){if((n=e[t])!==!!n)throw Error(x+t+\" not true or false: \"+n);if(n){if(\"undefined\"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!n,Error(x+\"crypto unavailable\");w=n}else w=n}if(e.hasOwnProperty(t=\"MODULO_MODE\")&&(U(n=e[t],0,9,t),M=n),e.hasOwnProperty(t=\"POW_PRECISION\")&&(U(n=e[t],0,B,t),D=n),e.hasOwnProperty(t=\"FORMAT\")){if(\"object\"!=typeof(n=e[t]))throw Error(x+t+\" not an object: \"+n);q=n}if(e.hasOwnProperty(t=\"ALPHABET\")){if(\"string\"!=typeof(n=e[t])||/^.?$|[+\\-.\\s]|(.).*\\1/.test(n))throw Error(x+t+\" invalid: \"+n);z=\"0123456789\"==n.slice(0,10),V=n}}return{DECIMAL_PLACES:h,ROUNDING_MODE:y,EXPONENTIAL_AT:[g,m],RANGE:[v,b],CRYPTO:w,MODULO_MODE:M,POW_PRECISION:D,FORMAT:q,ALPHABET:V}},K.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!K.DEBUG)return!0;var t,n,r=e.c,o=e.e,i=e.s;e:if(\"[object Array]\"=={}.toString.call(r)){if((1===i||-1===i)&&o>=-B&&o<=B&&o===E(o)){if(0===r[0]){if(0===o&&1===r.length)return!0;break e}if((t=(o+1)%O)<1&&(t+=O),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=k||n!==E(n))break e;if(0!==n)return!0}}}else if(null===r&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(x+\"Invalid BigNumber: \"+e)},K.maximum=K.max=function(){return $(arguments,-1)},K.minimum=K.min=function(){return $(arguments,1)},K.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return E(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,o,i,s=0,c=[],u=new K(d);if(null==e?e=h:U(e,0,B),o=A(e/O),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[s]=n[0],t[s+1]=n[1]):(c.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw w=!1,Error(x+\"crypto unavailable\");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=o/7}if(!w)for(;s<o;)(i=a())<9e15&&(c[s++]=i%1e14);for(o=c[--s],e%=O,o&&e&&(i=I[O-e],c[s]=E(o/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[r=0];else{for(r=-1;0===c[0];c.splice(0,1),r-=O);for(s=1,i=c[0];i>=10;i/=10,s++);s<O&&(r-=O-s)}return u.e=r,u.c=c,u}),K.sum=function(){for(var e=1,t=arguments,n=new K(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e=\"0123456789\";function t(e,t,n,r){for(var o,i,a=[0],s=0,c=e.length;s<c;){for(i=a.length;i--;a[i]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>n-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/n|0,a[o]%=n)}return a.reverse()}return function(r,o,i,a,s){var c,u,l,f,p,d,g,m,v=r.indexOf(\".\"),b=h,w=y;for(v>=0&&(f=D,D=0,r=r.replace(\".\",\"\"),d=(m=new K(o)).pow(r.length-v),D=f,m.c=t(L(R(d.c),d.e,\"0\"),10,i,e),m.e=m.c.length),l=f=(g=t(r,o,i,s?(c=V,e):(c=e,V))).length;0==g[--f];g.pop());if(!g[0])return c.charAt(0);if(v<0?--l:(d.c=g,d.e=l,d.s=a,g=(d=n(d,m,b,w,i)).c,p=d.r,l=d.e),v=g[u=l+b+1],f=i/2,p=p||u<0||null!=g[u+1],p=w<4?(null!=v||p)&&(0==w||w==(d.s<0?3:2)):v>f||v==f&&(4==w||p||6==w&&1&g[u-1]||w==(d.s<0?8:7)),u<1||!g[0])r=p?L(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(g.length=u,p)for(--i;++g[--u]>i;)g[u]=0,u||(++l,g=[1].concat(g));for(f=g.length;!g[--f];);for(v=0,r=\"\";v<=f;r+=c.charAt(g[v++]));r=L(r,l,c.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,o,i,a,s=0,c=e.length,u=t%C,l=t/C|0;for(e=e.slice();c--;)s=((o=u*(i=e[c]%C)+(r=l*i+(a=e[c]/C|0)*u)%C*C+s)/n|0)+(r/C|0)+l*a,e[c]=o%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;o<n;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function n(e,t,n,r){for(var o=0;n--;)e[n]-=o,o=e[n]<t[n]?1:0,e[n]=o*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,o,i,a,s){var c,u,l,f,p,d,h,y,g,m,v,b,w,S,A,x,T,_=r.s==o.s?1:-1,I=r.c,C=o.c;if(!(I&&I[0]&&C&&C[0]))return new K(r.s&&o.s&&(I?!C||I[0]!=C[0]:C)?I&&0==I[0]||!C?0*_:_/0:NaN);for(g=(y=new K(_)).c=[],_=i+(u=r.e-o.e)+1,s||(s=k,u=P(r.e/O)-P(o.e/O),_=_/O|0),l=0;C[l]==(I[l]||0);l++);if(C[l]>(I[l]||0)&&u--,_<0)g.push(1),f=!0;else{for(S=I.length,x=C.length,l=0,_+=2,(p=E(s/(C[0]+1)))>1&&(C=e(C,p,s),I=e(I,p,s),x=C.length,S=I.length),w=x,v=(m=I.slice(0,x)).length;v<x;m[v++]=0);T=C.slice(),T=[0].concat(T),A=C[0],C[1]>=s/2&&A++;do{if(p=0,(c=t(C,m,x,v))<0){if(b=m[0],x!=v&&(b=b*s+(m[1]||0)),(p=E(b/A))>1)for(p>=s&&(p=s-1),h=(d=e(C,p,s)).length,v=m.length;1==t(d,m,h,v);)p--,n(d,x<h?T:C,h,s),h=d.length,c=1;else 0==p&&(c=p=1),h=(d=C.slice()).length;if(h<v&&(d=[0].concat(d)),n(m,d,v,s),v=m.length,-1==c)for(;t(C,m,x,v)<1;)p++,n(m,x<v?T:C,v,s),v=m.length}else 0===c&&(p++,m=[0]);g[l++]=p,m[0]?m[v++]=I[w]||0:(m=[I[w]],v=1)}while((w++<S||null!=m[0])&&_--);f=null!=m[0],g[0]||g.splice(0,1)}if(s==k){for(l=1,_=g[0];_>=10;_/=10,l++);W(y,i+(y.e=l+u*O-1)+1,a,f)}else y.e=u,y.r=+f;return y}}(),s=/^(-?)0([xbo])(?=\\w[\\w.]*$)/i,c=/^([^.]+)\\.$/,u=/^\\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g,o=function(e,t,n,r){var o,i=n?t:t.replace(f,\"\");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!n&&(i=i.replace(s,function(e,t,n){return o=\"x\"==(n=n.toLowerCase())?16:\"b\"==n?2:8,r&&r!=o?e:t}),r&&(o=r,i=i.replace(c,\"$1\").replace(u,\"0.$1\")),t!=i))return new K(i,o);if(K.DEBUG)throw Error(x+\"Not a\"+(r?\" base \"+r:\"\")+\" number: \"+t);e.s=null}e.c=e.e=null},p.absoluteValue=p.abs=function(){var e=new K(this);return e.s<0&&(e.s=1),e},p.comparedTo=function(e,t){return j(this,new K(e,t))},p.decimalPlaces=p.dp=function(e,t){var n,r,o,i=this;if(null!=e)return U(e,0,B),null==t?t=y:U(t,0,8),W(new K(i),e+i.e+1,t);if(!(n=i.c))return null;if(r=((o=n.length-1)-P(this.e/O))*O,o=n[o])for(;o%10==0;o/=10,r--);return r<0&&(r=0),r},p.dividedBy=p.div=function(e,t){return n(this,new K(e,t),h,y)},p.dividedToIntegerBy=p.idiv=function(e,t){return n(this,new K(e,t),0,1)},p.exponentiatedBy=p.pow=function(e,t){var n,r,o,i,a,s,c,u,l=this;if((e=new K(e)).c&&!e.isInteger())throw Error(x+\"Exponent not an integer: \"+X(e));if(null!=t&&(t=new K(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return u=new K(Math.pow(+X(l),a?e.s*(2-F(e)):+X(e))),t?u.mod(t):u;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new K(NaN);(r=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&F(e)?-0:0,l.e>-1&&(i=1/i),new K(s?1/i:i);D&&(i=A(D/O+2))}for(a?(n=new K(.5),s&&(e.s=1),c=F(e)):c=(o=Math.abs(+X(e)))%2,u=new K(d);;){if(c){if(!(u=u.times(l)).c)break;i?u.c.length>i&&(u.c.length=i):r&&(u=u.mod(t))}if(o){if(0===(o=E(o/2)))break;c=o%2}else if(W(e=e.times(n),e.e+1,1),e.e>14)c=F(e);else{if(0===(o=+X(e)))break;c=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):r&&(l=l.mod(t))}return r?u:(s&&(u=d.div(u)),t?u.mod(t):i?W(u,D,y,void 0):u)},p.integerValue=function(e){var t=new K(this);return null==e?e=y:U(e,0,8),W(t,t.e+1,e)},p.isEqualTo=p.eq=function(e,t){return 0===j(this,new K(e,t))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(e,t){return j(this,new K(e,t))>0},p.isGreaterThanOrEqualTo=p.gte=function(e,t){return 1===(t=j(this,new K(e,t)))||0===t},p.isInteger=function(){return!!this.c&&P(this.e/O)>this.c.length-2},p.isLessThan=p.lt=function(e,t){return j(this,new K(e,t))<0},p.isLessThanOrEqualTo=p.lte=function(e,t){return-1===(t=j(this,new K(e,t)))||0===t},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(e,t){var n,r,o,i,a=this,s=a.s;if(t=(e=new K(e,t)).s,!s||!t)return new K(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/O,u=e.e/O,l=a.c,f=e.c;if(!c||!u){if(!l||!f)return l?(e.s=-t,e):new K(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new K(l[0]?a:3==y?-0:0)}if(c=P(c),u=P(u),l=l.slice(),s=c-u){for((i=s<0)?(s=-s,o=l):(u=c,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(r=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t<r;t++)if(l[t]!=f[t]){i=l[t]<f[t];break}if(i&&(o=l,l=f,f=o,e.s=-e.s),(t=(r=f.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=k-1;r>s;){if(l[--r]<f[r]){for(n=r;n&&!l[--n];l[n]=t);--l[n],l[r]+=k}l[r]-=f[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?G(e,l,u):(e.s=3==y?-1:1,e.c=[e.e=0],e)},p.modulo=p.mod=function(e,t){var r,o,i=this;return e=new K(e,t),!i.c||!e.s||e.c&&!e.c[0]?new K(NaN):!e.c||i.c&&!i.c[0]?new K(i):(9==M?(o=e.s,e.s=1,r=n(i,e,0,3),e.s=o,r.s*=o):r=n(i,e,0,M),(e=i.minus(r.times(e))).c[0]||1!=M||(e.s=i.s),e)},p.multipliedBy=p.times=function(e,t){var n,r,o,i,a,s,c,u,l,f,p,d,h,y,g,m=this,v=m.c,b=(e=new K(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!m.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=m.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=P(m.e/O)+P(e.e/O),e.s*=m.s,(c=v.length)<(f=b.length)&&(h=v,v=b,b=h,o=c,c=f,f=o),o=c+f,h=[];o--;h.push(0));for(y=k,g=C,o=f;--o>=0;){for(n=0,p=b[o]%g,d=b[o]/g|0,i=o+(a=c);i>o;)n=((u=p*(u=v[--a]%g)+(s=d*u+(l=v[a]/g|0)*p)%g*g+h[i]+n)/y|0)+(s/g|0)+d*l,h[i--]=u%y;h[i]=n}return n?++r:h.splice(0,1),G(e,h,r)},p.negated=function(){var e=new K(this);return e.s=-e.s||null,e},p.plus=function(e,t){var n,r=this,o=r.s;if(t=(e=new K(e,t)).s,!o||!t)return new K(NaN);if(o!=t)return e.s=-t,r.minus(e);var i=r.e/O,a=e.e/O,s=r.c,c=e.c;if(!i||!a){if(!s||!c)return new K(o/0);if(!s[0]||!c[0])return c[0]?e:new K(s[0]?r:0*o)}if(i=P(i),a=P(a),s=s.slice(),o=i-a){for(o>0?(a=i,n=c):(o=-o,n=s),n.reverse();o--;n.push(0));n.reverse()}for((o=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/k|0,s[t]=k===s[t]?0:s[t]%k;return o&&(s=[o].concat(s),++a),G(e,s,a)},p.precision=p.sd=function(e,t){var n,r,o,i=this;if(null!=e&&e!==!!e)return U(e,1,B),null==t?t=y:U(t,0,8),W(new K(i),e,t);if(!(n=i.c))return null;if(r=(o=n.length-1)*O+1,o=n[o]){for(;o%10==0;o/=10,r--);for(o=n[0];o>=10;o/=10,r++);}return e&&i.e+1>r&&(r=i.e+1),r},p.shiftedBy=function(e){return U(e,-9007199254740991,_),this.times(\"1e\"+e)},p.squareRoot=p.sqrt=function(){var e,t,r,o,i,a=this,s=a.c,c=a.s,u=a.e,l=h+4,f=new K(\"0.5\");if(1!==c||!s||!s[0])return new K(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+X(a)))||c==1/0?(((t=R(s)).length+u)%2==0&&(t+=\"0\"),c=Math.sqrt(+t),u=P((u+1)/2)-(u<0||u%2),r=new K(t=c==1/0?\"5e\"+u:(t=c.toExponential()).slice(0,t.indexOf(\"e\")+1)+u)):r=new K(c+\"\"),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(i=r,r=f.times(i.plus(n(a,i,l,1))),R(i.c).slice(0,c)===(t=R(r.c)).slice(0,c)){if(r.e<u&&--c,\"9999\"!=(t=t.slice(c-3,c+1))&&(o||\"4999\"!=t)){+t&&(+t.slice(1)||\"5\"!=t.charAt(0))||(W(r,r.e+h+2,1),e=!r.times(r).eq(a));break}if(!o&&(W(i,i.e+h+2,0),i.times(i).eq(a))){r=i;break}l+=4,c+=4,o=1}return W(r,r.e+h+1,y,e)},p.toExponential=function(e,t){return null!=e&&(U(e,0,B),e++),H(this,e,t,1)},p.toFixed=function(e,t){return null!=e&&(U(e,0,B),e=e+this.e+1),H(this,e,t)},p.toFormat=function(e,t,n){var r,o=this;if(null==n)null!=e&&t&&\"object\"==typeof t?(n=t,t=null):e&&\"object\"==typeof e?(n=e,e=t=null):n=q;else if(\"object\"!=typeof n)throw Error(x+\"Argument not an object: \"+n);if(r=o.toFixed(e,t),o.c){var i,a=r.split(\".\"),s=+n.groupSize,c=+n.secondaryGroupSize,u=n.groupSeparator||\"\",l=a[0],f=a[1],p=o.s<0,d=p?l.slice(1):l,h=d.length;if(c&&(i=s,s=c,c=i,h-=i),s>0&&h>0){for(i=h%s||s,l=d.substr(0,i);i<h;i+=s)l+=u+d.substr(i,s);c>0&&(l+=u+d.slice(i)),p&&(l=\"-\"+l)}r=f?l+(n.decimalSeparator||\"\")+((c=+n.fractionGroupSize)?f.replace(new RegExp(\"\\\\d{\"+c+\"}\\\\B\",\"g\"),\"$&\"+(n.fractionGroupSeparator||\"\")):f):l}return(n.prefix||\"\")+r+(n.suffix||\"\")},p.toFraction=function(e){var t,r,o,i,a,s,c,u,l,f,p,h,g=this,m=g.c;if(null!=e&&(!(c=new K(e)).isInteger()&&(c.c||1!==c.s)||c.lt(d)))throw Error(x+\"Argument \"+(c.isInteger()?\"out of range: \":\"not an integer: \")+X(c));if(!m)return new K(g);for(t=new K(d),l=r=new K(d),o=u=new K(d),h=R(m),a=t.e=h.length-g.e-1,t.c[0]=I[(s=a%O)<0?O+s:s],e=!e||c.comparedTo(t)>0?a>0?t:l:c,s=b,b=1/0,c=new K(h),u.c[0]=0;f=n(c,t,0,1),1!=(i=r.plus(f.times(o))).comparedTo(e);)r=o,o=i,l=u.plus(f.times(i=l)),u=i,t=c.minus(f.times(i=t)),c=i;return i=n(e.minus(r),o,0,1),u=u.plus(i.times(l)),r=r.plus(i.times(o)),u.s=l.s=g.s,p=n(l,o,a*=2,y).minus(g).abs().comparedTo(n(u,r,a,y).minus(g).abs())<1?[l,o]:[u,r],b=s,p},p.toNumber=function(){return+X(this)},p.toPrecision=function(e,t){return null!=e&&U(e,1,B),H(this,e,t,2)},p.toString=function(e){var t,n=this,o=n.s,i=n.e;return null===i?o?(t=\"Infinity\",o<0&&(t=\"-\"+t)):t=\"NaN\":(null==e?t=i<=g||i>=m?N(R(n.c),i):L(R(n.c),i,\"0\"):10===e&&z?t=L(R((n=W(new K(n),h+i+1,y)).c),n.e,\"0\"):(U(e,2,V.length,\"Base\"),t=r(L(R(n.c),i,\"0\"),10,e,o,!0)),o<0&&n.c[0]&&(t=\"-\"+t)),t},p.valueOf=p.toJSON=function(){return X(this)},p._isBigNumber=!0,p[Symbol.toStringTag]=\"BigNumber\",p[Symbol.for(\"nodejs.util.inspect.custom\")]=p.valueOf,null!=t&&K.set(t),K}();const{cloneDeepWith:D}=w,q=e=>D(e,e=>{if(void 0===e)return{__type:\"undefined\"};if(e instanceof M)return{__type:\"BigNumber\",value:e.toString()};if(\"bigint\"==typeof e)return{__type:\"bigint\",value:e.toString()};if(e instanceof Uint8Array){const t=Array.from(e,e=>String.fromCharCode(e)).join(\"\");return{__type:\"Uint8Array\",value:btoa(t)}}}),{cloneDeep:V,unset:z}=w,K=()=>globalThis.snap.request;class H{#e=new g;#t=new g;#n=new g;#r=0;#o=null;async#i(){this.#t.isLocked()||(this.#o=await this.#t.acquire())}async wrapRegularStateOperation(e){await this.#e.runExclusive(async()=>{await this.#i(),this.#r+=1});try{return await e()}finally{this.#r-=1,0===this.#r&&this.#o&&(this.#o(),this.#o=null)}}async wrapRegularStateWriteOperation(e){return await this.#n.runExclusive(async()=>this.wrapRegularStateOperation(e))}async wrapManageStateOperation(e){return await this.#e.runExclusive(async()=>(await this.#t.waitForUnlock(),await e()))}}class $ extends TypeError{constructor(e,t){let n;const{message:r,explanation:o,...i}=e,{path:a}=e,s=0===a.length?r:`At path: ${a.join(\".\")} -- ${r}`;super(o??s),null!=o&&(this.cause=s),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function G(e){return\"object\"==typeof e&&null!==e}function W(e){if(\"[object Object]\"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function X(e){return\"symbol\"==typeof e?e.toString():\"string\"==typeof e?JSON.stringify(e):`${e}`}function Z(e,t,n,r){if(!0===e)return;!1===e?e={}:\"string\"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=n,{refinement:s,message:c=`Expected a value of type \\`${a}\\`${s?` with refinement \\`${s}\\``:\"\"}, but received: \\`${X(r)}\\``}=e;return{value:r,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:c}}function*Y(e,t,n,r){(function(e){return G(e)&&\"function\"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const o of e){const e=Z(o,t,n,r);e&&(yield e)}}function*J(e,t,n={}){const{path:r=[],branch:o=[e],coerce:i=!1,mask:a=!1}=n,s={path:r,branch:o};if(i&&(e=t.coercer(e,s),a&&\"type\"!==t.type&&G(t.schema)&&G(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let c=\"valid\";for(const r of t.validator(e,s))r.explanation=n.message,c=\"not_valid\",yield[r,void 0];for(let[u,l,f]of t.entries(e,s)){const t=J(l,f,{path:void 0===u?r:[...r,u],branch:void 0===u?o:[...o,l],coerce:i,mask:a,message:n.message});for(const n of t)n[0]?(c=null===n[0].refinement||void 0===n[0].refinement?\"not_valid\":\"not_refined\",yield[n[0],void 0]):i&&(l=n[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):G(e)&&(void 0!==l||u in e)&&(e[u]=l))}if(\"not_valid\"!==c)for(const r of t.refiner(e,s))r.explanation=n.message,c=\"not_refined\",yield[r,void 0];\"valid\"===c&&(yield[void 0,e])}class Q{constructor(e){const{type:t,schema:n,validator:r,refiner:o,coercer:i=e=>e,entries:a=function*(){}}=e;this.type=t,this.schema=n,this.entries=a,this.coercer=i,this.validator=r?(e,t)=>Y(r(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>Y(o(e,t),t,this,e):()=>[];for(const t of Object.getOwnPropertySymbols(e))Object.defineProperty(this,t,Object.getOwnPropertyDescriptor(e,t))}assert(e,t){return ne(e,this,t)}create(e,t){return re(e,this,t)}is(e){return oe(e,this)}mask(e,t){return function(e,t,n){const r=ie(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(e,this,t)}validate(e,t={}){return ie(e,this,t)}}const ee=\"EXACT_OPTIONAL\";class te extends Q{constructor(e){super({...e,type:`exact optional ${e.type}`}),this.brand=ee}static isExactOptional(e){return G(e)&&\"brand\"in e&&e.brand===ee}}function ne(e,t,n){const r=ie(e,t,{message:n});if(r[0])throw r[0]}function re(e,t,n){const r=ie(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function oe(e,t){return!ie(e,t)[0]}function ie(e,t,n={}){const r=J(e,t,n),o=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(o[0]){return[new $(o[0],function*(){for(const e of r)e[0]&&(yield e[0])}),void 0]}return[void 0,o[1]]}const ae=\"***\",se=Symbol.for(\"superstruct.sensitive\");function ce(e,t){const n={...e};for(const e of t)e in n&&(n[e]=ae);return n}function ue(e){function*t(t){for(const n of t)yield{...n,value:ae,message:`Expected a value of type \\`${e.type}\\`${n.refinement?` with refinement \\`${n.refinement}\\``:\"\"}, but received: \\`${ae}\\``,branch:new Array(n.branch.length).fill(ae)}}return new Q({...e,validator:(n,r)=>t(e.validator(n,r)),refiner:(n,r)=>t(e.refiner(n,r)),*entries(t,n){for(const[r,o,i]of e.entries(t,n))yield[r,o,ue(i)]}})}function le(e,t,n){function*r(e){for(const r of e){if(!G(t)){yield r;continue}const e=r.branch.indexOf(t);if(-1===e){yield r;continue}const o=[...r.branch];o[e]=ce(t,n);for(let t=e-1;t>=0;t--){const e=o[t];if(!G(e))break;const n=r.branch[t+1],i=o[t+1];if(Array.isArray(e)){const r=e.indexOf(n);if(-1===r)break;const a=[...e];a[r]=i,o[t]=a}else if(e instanceof Map){let r,a=!1;for(const[t,o]of e)if(o===n){r=t,a=!0;break}if(!a)break;const s=new Map(e);s.set(r,i),o[t]=s}else{const r=Object.keys(e).find(t=>e[t]===n);if(void 0===r)break;o[t]={...e,[r]:i}}}yield{...r,branch:o}}}return new Q({...e,validator:(t,n)=>r(e.validator(t,n)),refiner:(t,n)=>r(e.refiner(t,n)),*entries(r,o){for(const i of e.entries(r,o)){const[e,r,o]=i;yield[e,r,le(o,t,n)]}}})}function fe(e){const t=ue(e);return Object.defineProperty(t,se,{value:!0,enumerable:!0,configurable:!0,writable:!1}),t}function pe(...e){const t=\"type\"===e[0]?.type,n=e.map(({schema:e})=>e),r=Object.assign({},...n);return t?Ie(r):Ee(r)}function de(e,t){return new Q({type:e,schema:null,validator:t})}function he(e,t){const n=Object.keys(t).filter(e=>{return void 0!==t[e]&&(n=t[e],Object.prototype.hasOwnProperty.call(n,se));var n});return 0===n.length?e:new Q({...e,*entries(t,r){const o=r.branch[r.branch.length-1]??t;for(const i of e.entries(t,r)){const[e,t,r]=i;yield[e,t,le(r,o,n)]}}})}function ye(e){return new Q({type:\"array\",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${X(e)}`})}function ge(){return de(\"boolean\",e=>\"boolean\"==typeof e)}function me(e){const t={},n=e.map(e=>X(e)).join();for(const n of e)t[n]=n;return new Q({type:\"enums\",schema:t,validator:t=>e.includes(t)||`Expected one of \\`${n}\\`, but received: ${X(t)}`})}function ve(){return de(\"integer\",e=>\"number\"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${X(e)}`)}function be(e){const t=X(e),n=typeof e;return new Q({type:\"literal\",schema:\"string\"===n||\"number\"===n||\"boolean\"===n?e:null,validator:n=>n===e||`Expected the literal \\`${t}\\`, but received: ${X(n)}`})}function we(){return de(\"never\",()=>!1)}function Se(e){return new Q({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function Ae(){return de(\"number\",e=>\"number\"==typeof e&&!isNaN(e)||`Expected a number, but received: ${X(e)}`)}function Ee(e){const t=e?Object.keys(e):[],n=we(),r=new Q({type:\"object\",schema:e??null,*entries(r){if(e&&G(r)){const o=new Set(Object.keys(r));for(const n of t){o.delete(n);const t=e[n];te.isExactOptional(t)&&!Object.prototype.hasOwnProperty.call(r,n)||(yield[n,r[n],e[n]])}for(const e of o)yield[e,r[e],n]}},validator:e=>G(e)||`Expected an object, but received: ${X(e)}`,coercer:e=>G(e)?{...e}:e});return e?he(r,e):r}function xe(e){return new Q({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function Te(e){return new te(e)}function ke(e,t){return new Q({type:\"record\",schema:null,*entries(n){if(G(n))for(const r in n){const o=n[r];yield[r,r,e],yield[r,o,t]}},validator:e=>G(e)||`Expected an object, but received: ${X(e)}`})}function Oe(){return de(\"string\",e=>\"string\"==typeof e||`Expected a string, but received: ${X(e)}`)}function _e(e){const t=we();return new Q({type:\"tuple\",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let o=0;o<r;o++)yield[o,n[o],e[o]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${X(e)}`})}function Ie(e){const t=Object.keys(e);return he(new Q({type:\"type\",schema:e,*entries(n){if(G(n))for(const r of t)te.isExactOptional(e[r])&&!Object.prototype.hasOwnProperty.call(n,r)||(yield[r,n[r],e[r]])},validator:e=>G(e)||`Expected an object, but received: ${X(e)}`,coercer:e=>G(e)?{...e}:e}),e)}function Ce(e){const t=e.map(e=>e.type).join(\" | \");return new Q({type:\"union\",schema:null,coercer(t){for(const n of e){const[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){const o=[];for(const t of e){const[...e]=J(n,t,r),[i]=e;if(!i?.[0])return[];for(const[t]of e)t&&o.push(t)}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${X(n)}`,...o]}})}function Be(){return de(\"unknown\",()=>!0)}function Pe(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Re(e,t,n={}){const{exclusive:r}=n;return Fe(e,\"min\",n=>r?n>t:n>=t||`Expected a ${e.type} greater than ${r?\"\":\"or equal to \"}${t} but received \\`${n}\\``)}function je(e){return Fe(e,\"nonempty\",t=>Pe(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Ue(e,t){return Fe(e,\"pattern\",n=>t.test(n)||`Expected a ${e.type} matching \\`/${t.source}/\\` but received \"${n}\"`)}function Fe(e,t,n){return new Q({...e,*refiner(r,o){yield*e.refiner(r,o);const i=Y(n(r,o),o,e,r);for(const e of i)yield{...e,refinement:t}}})}const Ne=Fe(Oe(),\"safe-url\",e=>{try{const t=new URL(e),n=[\"http:\",\"https:\",\"wss:\"];if(!n.includes(t.protocol))return`URL must use one of the following protocols: ${n.join(\", \")}`;if(!e.match(/^(https?|wss):\\/\\/[^/]+\\/?/u))return\"Malformed URL - incorrect protocol format\";const r=t.hostname.toLowerCase();if(!(\"localhost\"===r||r.includes(\".\")&&/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/u.test(r)))return\"Invalid hostname format\";const o=decodeURIComponent(e.toLowerCase());if(e.includes(\"\\\\\")||e.includes(\"@\")||o.includes(\"\\\\\")||o.includes(\"@\")||e.toLowerCase().includes(\"%2f@\")||e.toLowerCase().includes(\"%5c@\"))return\"URL contains protocol pollution attempts\";if(e.includes(\"../\")||e.includes(\"..%2f\")||e.includes(\"..%2F\"))return\"Directory traversal attempts are not allowed\";const i=[/<[^>]*>/u,/javascript:/u,/data:/u,/\\\\[@\\\\]/u,/%2f@/u,/[^\\x20-\\x7E]/u,/\\$\\{.*?\\}/u,/#\\{.*?\\}/u,/[|;]/u,/%0[acd]|%0[acd]/u,/\\/\\/\\w+@/u,/(?:[^a-z]|^)(?:union\\s+(?:all\\s+)?select|select\\s+(?:.*\\s+)?from|insert\\s+into|update\\s+.*\\s+set|delete\\s+from|drop\\s+table|alter\\s+table|create\\s+table|exec(?:ute)?|union|where\\s+[\\d\\w]\\s*=\\s*[\\d\\w]|\\bor\\b\\s*[\\d\\w]\\s*=\\s*[\\d\\w])/iu,/'.*?(?:OR|UNION|SELECT|FROM|WHERE).*?'/iu,/%27.*?(?:OR|UNION|SELECT|FROM|WHERE).*?(?:%27|')/iu,/%20(?:OR|UNION|SELECT|FROM|WHERE)%20/iu,/[?&](?:url|redirect|next|return_to|return_url|goto|destination|continue|redirect_uri)=(?:[^&]*\\/\\/|https?:)/iu,/[?&](?:url|redirect|next|return_to|return_url|goto|destination|continue|redirect_uri)=%(?:[^&]*\\/\\/|https?:)/iu];for(const e of i)if(e.test(o))return\"URL contains potentially malicious patterns\";return!0}catch(e){return`Invalid URL format: ${e.message}`}}),Le={SILENT:\"silent\",ERROR:\"error\",WARN:\"warn\",INFO:\"info\",DEBUG:\"debug\",TRACE:\"trace\"},Me={[Le.SILENT]:0,[Le.ERROR]:1,[Le.WARN]:2,[Le.INFO]:3,[Le.DEBUG]:4,[Le.TRACE]:5},De=me(Object.values(Le));class qe{#a;#s;#c;constructor({level:e,prefix:t,decorators:n}){ne(e,De),this.#a=e,this.#s=t,this.#c=n}withPrefix(e){return new qe({level:this.#a,prefix:this.#s?`${this.#s} ${e}`:e,decorators:this.#c})}error(...e){this.#u(Le.ERROR,console.error,e)}warn(...e){this.#u(Le.WARN,console.warn,e)}log(...e){this.info(...e)}info(...e){this.#u(Le.INFO,console.info,e)}debug(...e){this.#u(Le.DEBUG,console.debug,e)}trace(...e){this.#u(Le.TRACE,console.trace,e)}#l(e){return Me[e]>Me[this.#a]}#u(e,t,n){if(this.#l(e))return;const r=this.#s?(...e)=>t(this.#s,...e):t,o=this.#c?.[e];o?o(r,...n):r(...n)}}function Ve(e,t,n){return new Q({...e,coercer:(r,o)=>oe(r,t)?e.coercer(n(r,o),o):e.coercer(r,o)})}function ze(e,t,n={}){return Ve(e,Be(),e=>{const r=\"function\"==typeof t?t():t;if(void 0===e)return r;if(!n.strict&&W(e)&&W(r)){const t={...e};let n=!1;for(const e in r)void 0===t[e]&&(t[e]=r[e],n=!0);if(n)return t}return e})}function Ke(e,t){return de(e,e=>\"string\"==typeof e&&t.test(e))}const He=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,$e=/^[-a-z0-9]{3,8}$/u,Ge=/^[-_a-zA-Z0-9]{1,32}$/u,We=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,Xe=/^[-.%a-zA-Z0-9]{1,128}$/u,Ze=/^[-a-z0-9]{3,8}$/u,Ye=/^[-.%a-zA-Z0-9]{1,128}$/u,Je=/^[-.%a-zA-Z0-9]{1,78}$/u,Qe=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,et=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u,tt=Ke(\"CaipChainId\",He),nt=(Ke(\"CaipNamespace\",$e),Ke(\"CaipReference\",Ge),Ke(\"CaipAccountId\",We)),rt=(Ke(\"CaipAccountAddress\",Xe),Ke(\"CaipAssetNamespace\",Ze),Ke(\"CaipAssetReference\",Ye),Ke(\"CaipTokenId\",Je),Ke(\"CaipAssetType\",Qe)),ot=Ke(\"CaipAssetId\",et),it=Ke(\"CaipAssetTypeOrId\",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u);var at;function st(e){const t=Qe.exec(e);if(!t?.groups)throw new Error(\"Invalid CAIP asset type.\");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}}!function(e){e.Bip122=\"bip122\",e.Solana=\"solana\",e.Stellar=\"stellar\",e.Tron=\"tron\",e.Eip155=\"eip155\",e.Wallet=\"wallet\"}(at=at||(at={}));const ct={Mainnet:`${at.Stellar}:pubnet`,Testnet:`${at.Stellar}:testnet`},ut=me(Object.values(ct)),lt=Ke(\"UuidV4\",/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),ft=lt,pt=(de(\"Url\",e=>{try{const t=new URL(e);return\"http:\"===t.protocol||\"https:\"===t.protocol}catch{return!1}}),Ke(\"StringNumber\",/^\\d+(\\.\\d+)?$/u));function dt(e){return new Q({type:\"union\",schema:null,*entries(t,n){yield*e(t).entries(t,n)},*refiner(t,n){yield*e(t).refiner(t,n)},coercer:(t,n)=>e(t).coercer(t,n),validator:(t,n)=>e(t).validator(t,n)})}function ht(e){return null==e}function yt(e){return Boolean(e)&&\"object\"==typeof e&&!Array.isArray(e)}const gt=(e,t)=>Object.hasOwnProperty.call(e,t);var mt;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(mt=mt||(mt={}));function vt(e){if(\"object\"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}const bt=e=>Ee(e);function wt({path:e,branch:t}){const n=e[e.length-1];return gt(t[t.length-2],n)}function St(e){return new Q({...e,type:`optional ${e.type}`,validator:(t,n)=>!wt(n)||e.validator(t,n),refiner:(t,n)=>!wt(n)||e.refiner(t,n)})}function At(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let n=0;n<e.length;n++)if(!At(e[n])){t=!1;break}return t}const n=Object.entries(e);for(let e=0;e<n.length;e++)if(\"string\"!=typeof n[e][0]||!At(n[e][1])){t=!1;break}return t}return!1}const Et=de(\"JSON\",e=>At(e)),xt=Ve(Et,Fe(de(\"any\",()=>!0),\"JSON\",e=>oe(e,Et)),e=>JSON.parse(JSON.stringify(e,(e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})));function Tt(e){try{return function(e){re(e,xt)}(e),!0}catch{return!1}}const kt=be(\"2.0\"),Ot=Se(Ce([Ae(),Oe()])),_t=bt({code:ve(),message:Oe(),data:St(xt),stack:St(Oe())}),It=Ce([ke(Oe(),xt),ye(xt)]);bt({id:Ot,jsonrpc:kt,method:Oe(),params:St(It)}),bt({jsonrpc:kt,method:Oe(),params:St(It)});Ee({id:Ot,jsonrpc:kt,result:xe(Be()),error:xe(_t)});const Ct=bt({id:Ot,jsonrpc:kt,result:xt}),Bt=bt({id:Ot,jsonrpc:kt,error:_t});Ce([Ct,Bt]);function Pt(e){return oe(e,_t)}var Rt;!function(e){e.Mnemonic=\"mnemonic\",e.PrivateKey=\"private-key\",e.Custom=\"custom\"}(Rt||(Rt={}));const jt=Ee({type:be(`${Rt.Mnemonic}`),id:Oe(),derivationPath:Oe(),groupIndex:Ae()}),Ut=Ee({type:be(`${Rt.PrivateKey}`)}),Ft=Ee({type:be(`${Rt.Custom}`)}),Nt=dt(e=>{if(!vt(e))return jt;switch(e.type){case Rt.PrivateKey:return Ut;case Rt.Custom:return Ft;case Rt.Mnemonic:default:return jt}}),Lt=(Mt=[ke(Oe(),xt),Ie({entropy:Te(Nt),exportable:Te(ge())})],new Q({type:\"intersection\",schema:null,*entries(e,t){for(const{entries:n}of Mt)yield*n(e,t)},*validator(e,t){for(const{validator:n}of Mt)yield*n(e,t)},*refiner(e,t){for(const{refiner:n}of Mt)yield*n(e,t)}}));var Mt,Dt,qt,Vt,zt,Kt,Ht;!function(e){e.Eoa=\"eip155:eoa\",e.Erc4337=\"eip155:erc4337\"}(Dt||(Dt={})),function(e){e.P2pkh=\"bip122:p2pkh\",e.P2sh=\"bip122:p2sh\",e.P2wpkh=\"bip122:p2wpkh\",e.P2tr=\"bip122:p2tr\"}(qt||(qt={})),function(e){e.DataAccount=\"solana:data-account\"}(Vt||(Vt={})),function(e){e.Eoa=\"tron:eoa\"}(zt||(zt={})),function(e){e.Account=\"stellar:account\"}(Kt||(Kt={})),function(e){e.Account=\"any:account\"}(Ht||(Ht={}));const $t=me([`${Dt.Eoa}`,`${Dt.Erc4337}`,`${qt.P2pkh}`,`${qt.P2sh}`,`${qt.P2wpkh}`,`${qt.P2tr}`,`${Vt.DataAccount}`,`${zt.Eoa}`,`${Kt.Account}`,`${Ht.Account}`]),Gt=Ee({id:ft,type:me([`${Dt.Eoa}`,`${Dt.Erc4337}`,`${qt.P2pkh}`,`${qt.P2sh}`,`${qt.P2wpkh}`,`${qt.P2tr}`,`${Vt.DataAccount}`,`${zt.Eoa}`,`${Kt.Account}`,`${Ht.Account}`]),address:Oe(),scopes:je(ye(tt)),options:Lt,methods:ye(Oe())}),Wt=JSON.parse('{\"J6\":{\"t$\":{\"R\":{\"W\":[\"stellar:pubnet\"]}}}}').J6.t$.R.W,Xt=\"base32\",Zt=5e6,Yt=\"m/44'/148'\",Jt=\"XLM\",Qt=\"9223372036854775807\",en=Kt.Account,tn=\"metamask\",nn=50,rn=1,on=\"slip44\",an=\"asset\",sn=\"sep41\",cn=Ke(\"KnownCaip19Slip44Id\",/^stellar:(?:pubnet|testnet)\\/slip44:148$/u),un={[ct.Mainnet]:`${ct.Mainnet}/${on}:148`,[ct.Testnet]:`${ct.Testnet}/${on}:148`},ln=Ke(\"KnownCaip19ClassicAsset\",/^stellar:(?:pubnet|testnet)\\/asset:[A-Za-z0-9]{1,12}-G[A-Z2-7]{55}$/u),fn=Ke(\"KnownCaip19Sep41Asset\",/^stellar:(?:pubnet|testnet)\\/sep41:C[A-Z2-7]{55}$/u),pn=Ce([fn,ln,cn]);var dn=n(5263);const hn=Fe(je(fe(Oe())),\"stellar_address\",e=>{try{return!!dn.StrKey.isValidEd25519PublicKey(e)||\"Invalid Stellar address\"}catch{return\"Invalid Stellar address\"}}),yn=Fe(je(Oe()),\"stellar_secret_key\",e=>{try{return!!dn.StrKey.isValidEd25519SecretSeed(e)||\"Invalid Stellar secret key\"}catch{return\"Invalid Stellar secret key\"}}),gn=Fe(je(Oe()),\"stellar_contract_or_address\",e=>{try{return!(!dn.StrKey.isValidContract(e)&&!dn.StrKey.isValidEd25519PublicKey(e))||\"Invalid Stellar address or contract\"}catch{return\"Invalid Stellar address or contract\"}}),mn=Ee({jsonrpc:be(\"2.0\"),id:Ce([Oe(),Ae(),be(null)]),method:Oe(),params:xe(Ee())});function vn(e,t=7){return e.multipliedBy(M(10).pow(t))}function bn(e){const t=e.decimalPlaces();return null!==t&&t>0}function wn(e,t=7){return e.dividedBy(M(10).pow(t))}function Sn(e,t=7){return An(wn(e,t).toFixed(t))}function An(e){if(!e.includes(\".\"))return e;const t=e.replace(/0+$/u,\"\").replace(/\\.$/u,\"\");return\"\"===t?\"0\":t}const En=Fe(je(Oe()),\"valid_amount\",e=>{try{const t=new M(e);return!(t.isNegative()||t.isNaN()||!t.isFinite())||\"Invalid amount\"}catch{return\"Invalid amount\"}}),xn=Fe(En,\"valid_stellar_amount\",e=>{try{const t=new M(e),n=t.decimalPlaces();return!(n&&n>7||vn(t).gt(new M(Qt).toString()))||\"Invalid amount\"}catch{return\"Invalid amount\"}}),Tn=Fe(xn,\"non_zero_valid_amount\",e=>!new M(e).isZero()||\"Amount cannot be zero\");function kn(e,t){return n=e,Boolean(\"string\"==typeof n?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var n}class On extends Error{constructor(e){super(e.message),this.code=\"ERR_ASSERTION\"}}function _n(e,t=\"Assertion failed.\",n=On){if(!e){if(t instanceof Error)throw t;throw kn(n,t)}}function In(e){throw new Error(\"Invalid branch reached. Should be detected during compilation.\")}const Cn=(e,t={})=>{const n=t.paddingRequired??!1,r=t.characterSet??\"base64\";let o,i;return\"base64\"===r?o=String.raw`[A-Za-z0-9+\\/]`:(_n(\"base64url\"===r),o=String.raw`[-_A-Za-z0-9]`),i=n?new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,\"u\"):new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,\"u\"),Ue(e,i)},Bn=\"asc\",Pn=\"desc\",Rn=\"accountMerge\",jn=\"allowTrust\",Un=\"beginSponsoringFutureReserves\",Fn=\"bumpSequence\",Nn=\"changeTrust\",Ln=\"claimClaimableBalance\",Mn=\"clawback\",Dn=\"clawbackClaimableBalance\",qn=\"createAccount\",Vn=\"createClaimableBalance\",zn=\"createPassiveSellOffer\",Kn=\"endSponsoringFutureReserves\",Hn=\"extendFootprintTtl\",$n=\"inflation\",Gn=\"invokeHostFunction\",Wn=\"liquidityPoolDeposit\",Xn=\"liquidityPoolWithdraw\",Zn=\"manageBuyOffer\",Yn=\"manageData\",Jn=\"manageSellOffer\",Qn=\"pathPaymentStrictReceive\",er=\"pathPaymentStrictSend\",tr=\"payment\",nr=\"restoreFootprint\",rr=\"revokeSponsorship\",or=\"setOptions\",ir=\"setTrustLineFlags\";var ar=n(1048).hp;function sr(e,t){try{return e instanceof Uint8Array?ar.from(e):ar.from(e,t)}catch{throw new Error(\"Invalid buffer\")}}const cr=Fe(je(Cn(Oe())),\"valid_xdr\",e=>{try{return!!dn.xdr.TransactionEnvelope.validateXDR(e,\"base64\")||\"Invalid XDR\"}catch{return\"Invalid XDR\"}});function ur(e){return e===er||e===Qn}const lr=Fe(cr,\"valid_swap_transaction_xdr\",e=>{try{const t=function(e){const t=dn.TransactionBuilder.fromXDR(e,dn.Networks.PUBLIC);return(t instanceof dn.FeeBumpTransaction?t.innerTransaction.operations:t.operations).map(e=>e.type)}(e),[n,r,o]=t;return!(1!==t.length||n!==Gn&&n!==tr&&!ur(n))||(!(2!==t.length||!ur(n)||r!==tr)||(!(2!==t.length||n!==Nn||!ur(r))||(2===t.length&&n===tr&&r===tr||(!(3!==t.length||n!==Nn||!ur(r)||o!==tr)||\"Unsupported swap transaction operation shape\"))))}catch{return\"Invalid swap transaction XDR\"}}),fr=(0,dn.hash)(sr(dn.Networks.PUBLIC,\"utf8\")),pr=Fe(je(Cn(Oe())),\"valid_soroban_auth_preimage\",e=>{try{const t=dn.xdr.HashIdPreimage.fromXDR(e,\"base64\");if(t.switch()!==dn.xdr.EnvelopeType.envelopeTypeSorobanAuthorization())return\"HashIdPreimage is not a Soroban authorization preimage\";const n=t.sorobanAuthorization().networkId();return!!fr.equals(n)||\"HashIdPreimage networkId is not Stellar mainnet\"}catch{return\"Invalid HashIdPreimage XDR\"}}),dr=Ke(\"StellarTransactionHash\",/^[0-9a-f]{64}$/iu);function hr(){return ne(Wt,ye(ut)),Wt}const yr=(e,t)=>Ve(ze(Re(Ae(),e),t),Oe(),e=>\"\"===e?void 0:parseInt(e,10)),gr=(e,t)=>Ve(ze(Re(Ae(),e),t),Oe(),e=>\"\"===e?void 0:parseFloat(e)),mr=Ee({rpcUrl:Ne,horizonUrl:Ne,explorerBaseUrl:Ne}),vr=Ve(ze(me(hr()),ct.Mainnet),Oe(),e=>\"\"===e?void 0:e.toLowerCase()),br=Ve(ze(me(Object.values(Le)),Le.SILENT),Oe(),e=>\"\"===e?void 0:e.toLowerCase()),wr=ke(ut,mr),Sr=Ee({environment:me(Object.values({Local:\"local\",Test:\"test\",Production:\"production\"})),logLevel:br,networks:wr,selectedNetwork:vr,transaction:Ee({timeout:yr(100,180),pollingAttempts:yr(0,10),trackTransactionMaxReschedules:yr(0,10),baseFeeMultiplier:gr(1,10),maxFeeThresholdInXLM:gr(1,1),maxReconcileAttempts:yr(2,5),maxPendingTransactionAge:yr(15e3,3e4)}),api:Ee({tokenApi:Ee({baseUrl:Ne}),staticApi:Ee({baseUrl:Ne}),priceApi:Ee({baseUrl:Ne}),securityAlertsApi:Ee({baseUrl:Ne})}),cache:Ee({ttlMilliseconds:Ee({spotPrices:yr(1e3,36e5),baseFee:yr(1e3,36e5),loadOnChainAccount:yr(1e3,6e5),simulateTransaction:yr(1e3,1e4),sep41AssetBalance:yr(1e3,3e4)})})}),Ar=re({environment:\"production\",networks:{[ct.Mainnet]:{rpcUrl:\"https://stellar-mainnet.infura.io/v3/faf5366661c14c60830f0b59306b27e0\",horizonUrl:\"https://stellar-mainnet.infura.io/v3/faf5366661c14c60830f0b59306b27e0/horizon\",explorerBaseUrl:\"https://stellar.expert/explorer/public\"},[ct.Testnet]:{rpcUrl:\"https://stellar-testnet.infura.io/v3/faf5366661c14c60830f0b59306b27e0\",horizonUrl:\"https://stellar-testnet.infura.io/v3/faf5366661c14c60830f0b59306b27e0/horizon\",explorerBaseUrl:\"https://stellar.expert/explorer/testnet\"}},selectedNetwork:ct.Mainnet,logLevel:\"silent\",transaction:{timeout:\"\",pollingAttempts:\"\",baseFeeMultiplier:\"\",maxFeeThresholdInXLM:\"\",trackTransactionMaxReschedules:\"\",maxReconcileAttempts:\"\",maxPendingTransactionAge:\"\"},api:{tokenApi:{baseUrl:\"https://tokens.api.cx.metamask.io\"},staticApi:{baseUrl:\"https://static.cx.metamask.io\"},priceApi:{baseUrl:\"https://price.api.cx.metamask.io\"},securityAlertsApi:{baseUrl:\"https://security-alerts.api.cx.metamask.io\"}},cache:{ttlMilliseconds:{spotPrices:\"\",baseFee:\"\",loadOnChainAccount:\"\",simulateTransaction:\"\",sep41AssetBalance:\"\"}}},Sr),Er=Ke(\"DerivationPath\",/^m(?:\\/\\d+'?)+$/u),xr=Ee({type:be(\"bip44:derive-path\"),entropySource:Oe(),derivationPath:Er}),Tr=Ee({type:be(\"bip44:derive-index\"),entropySource:Oe(),groupIndex:Ae()}),kr=Ee({type:be(\"bip44:discover\"),entropySource:Oe(),groupIndex:Ae()}),Or=Ee({type:be(\"bip44:derive-index-range\"),entropySource:Oe(),range:Ee({from:Ae(),to:Ae()})}),_r=Ie({type:be(\"custom\")});var Ir;!function(e){e.Hexadecimal=\"hexadecimal\",e.Base58=\"base58\",e.Base32=\"base32\"}(Ir||(Ir={}));const Cr=me([`${Ir.Hexadecimal}`,`${Ir.Base58}`,`${Ir.Base32}`]),Br=(Ee({encoding:Cr,type:Te($t)}),Ee({encoding:Cr}),Ee({type:be(\"private-key:import\"),privateKey:fe(Oe()),encoding:Cr,accountType:Te($t)}));var Pr;!function(e){e.Bip44DerivePath=\"bip44:derive-path\",e.Bip44DeriveIndex=\"bip44:derive-index\",e.Bip44DeriveIndexRange=\"bip44:derive-index-range\",e.Bip44Discover=\"bip44:discover\",e.PrivateKeyImport=\"private-key:import\",e.Custom=\"custom\"}(Pr||(Pr={}));const Rr=dt(e=>{const t=e?.type;switch(t){case Pr.Bip44DerivePath:return xr;case Pr.Bip44DeriveIndex:return Tr;case Pr.Bip44DeriveIndexRange:return Or;case Pr.Bip44Discover:return kr;case Pr.PrivateKeyImport:return Br;case Pr.Custom:return _r;default:return xr}});const jr=Ee({jsonrpc:be(\"2.0\"),id:Ce([Oe(),Ae(),be(null)]),method:Oe(),params:Te(Ce([ye(xt),ke(Oe(),xt)]))});var Ur;!function(e){e.Bip44=\"bip44\"}(Ur||(Ur={}));const Fr=Ee({type:be(`${Ur.Bip44}`),scopes:ye(tt),derivationPath:Er}),Nr=Ee({limit:Ae(),next:Te(Se(Oe()))}),Lr=Ee({amount:pt,unit:Oe(),metadata:Te(ke(Oe(),xt))}),Mr=Ee({transport:Oe(),selfReportedOrigin:Oe()}),Dr=Ee({id:lt,scope:Oe(),account:lt,origin:Oe(),originMetadata:Te(Se(Mr)),request:Ee({method:Oe(),params:Te(Ce([ye(xt),ke(Oe(),xt)]))})});var qr;!function(e){e.CreateAccount=\"keyring_createAccount\",e.CreateAccounts=\"keyring_createAccounts\",e.DeleteAccount=\"keyring_deleteAccount\",e.DiscoverAccounts=\"keyring_discoverAccounts\",e.ExportAccount=\"keyring_exportAccount\",e.FilterAccountChains=\"keyring_filterAccountChains\",e.GetAccount=\"keyring_getAccount\",e.ListAccounts=\"keyring_listAccounts\",e.UpdateAccount=\"keyring_updateAccount\",e.ApproveRequest=\"keyring_approveRequest\",e.GetRequest=\"keyring_getRequest\",e.ListRequests=\"keyring_listRequests\",e.RejectRequest=\"keyring_rejectRequest\",e.SubmitRequest=\"keyring_submitRequest\",e.GetAccountBalances=\"keyring_getAccountBalances\",e.ListAccountAssets=\"keyring_listAccountAssets\",e.ListAccountTransactions=\"keyring_listAccountTransactions\",e.SetSelectedAccounts=\"keyring_setSelectedAccounts\",e.ResolveAccountAddress=\"keyring_resolveAccountAddress\"}(qr||(qr={}));const Vr={jsonrpc:be(\"2.0\"),id:Ce([Oe(),Ae(),be(null)])},zr=(Ee({...Vr,method:be(\"keyring_listAccounts\")}),ye(Gt),Ee({...Vr,method:be(\"keyring_getAccount\"),params:Ee({id:lt})}),Ee({...Vr,method:be(\"keyring_createAccount\"),params:Ee({options:ke(Oe(),xt)})}),Ee({...Vr,method:be(\"keyring_createAccounts\"),params:Ee({options:Rr})}),ye(Gt),Ee({...Vr,method:be(\"keyring_setSelectedAccounts\"),params:Ee({accounts:ye(Oe())})}),be(null),Ee({...Vr,method:be(\"keyring_discoverAccounts\"),params:Ee({scopes:ye(tt),entropySource:Oe(),groupIndex:Ae()})}),ye(Fr),Ee({...Vr,method:be(\"keyring_listAccountTransactions\"),params:Ee({id:lt,pagination:Nr})})),Kr=Ee({...Vr,method:be(\"keyring_listAccountAssets\"),params:Ee({id:lt})}),Hr=(ye(it),Ee({...Vr,method:be(`${qr.GetAccountBalances}`),params:Ee({id:lt,assets:ye(rt)})}),ke(rt,Lr),Ee({...Vr,method:be(\"keyring_resolveAccountAddress\"),params:Ee({scope:tt,request:jr})}),Se(Ee({address:nt})),Ee({...Vr,method:be(\"keyring_filterAccountChains\"),params:Ee({id:lt,chains:ye(Oe())})}),ye(Oe()),Ee({...Vr,method:be(\"keyring_updateAccount\"),params:Ee({account:Gt})}),be(null),Ee({...Vr,method:be(\"keyring_deleteAccount\"),params:Ee({id:lt})}),be(null),Ee({...Vr,method:be(\"keyring_exportAccount\"),params:Ee({id:lt})}),Ee({...Vr,method:be(\"keyring_listRequests\")}),ye(Dr),Ee({...Vr,method:be(\"keyring_getRequest\"),params:Ee({id:lt})}),Ee({...Vr,method:be(\"keyring_submitRequest\"),params:Dr}),Ee({...Vr,method:be(\"keyring_approveRequest\"),params:Ee({id:lt,data:ke(Oe(),xt)})}),be(null),Ee({...Vr,method:be(\"keyring_rejectRequest\"),params:Ee({id:lt})}),be(null),Ee({type:be(\"private-key\"),privateKey:fe(Oe()),encoding:Cr}),Ee({type:be(\"private-key\"),encoding:Cr}));var $r;!function(e){e.PrivateKey=\"private-key\"}($r||($r={}));const Gr=Hr;const Wr={GetAccounts:\"keyring_getAccounts\",CreateAccounts:\"keyring_createAccounts\",GetAccount:\"keyring_getAccount\",DeleteAccount:\"keyring_deleteAccount\",ExportAccount:\"keyring_exportAccount\",SubmitRequest:\"keyring_submitRequest\"};const Xr={jsonrpc:be(\"2.0\"),id:Ce([Oe(),Ae(),be(null)])},Zr=Ee({...Xr,method:be(`${Wr.GetAccounts}`)}),Yr=(ye(Gt),Ee({...Xr,method:be(`${Wr.GetAccount}`),params:Ee({id:lt})})),Jr=Ee({...Xr,method:be(`${Wr.CreateAccounts}`),params:Rr}),Qr=(ye(Gt),Ee({...Xr,method:be(`${Wr.DeleteAccount}`),params:Ee({id:lt})})),eo=(be(null),Ee({...Xr,method:be(`${Wr.ExportAccount}`),params:Ee({id:lt,options:Te(Gr)})})),to=Ee({...Xr,method:be(`${Wr.SubmitRequest}`),params:Dr}),no=Ee({address:nt});const ro={...Wr,SetSelectedAccounts:\"keyring_setSelectedAccounts\",GetAccountTransactions:\"keyring_getAccountTransactions\",GetAccountAssets:\"keyring_getAccountAssets\",GetAccountBalances:\"keyring_getAccountBalances\",ResolveAccountAddress:\"keyring_resolveAccountAddress\"};const oo={jsonrpc:be(\"2.0\"),id:Ce([Oe(),Ae(),be(null)])},io=Ee({...oo,method:be(`${ro.SetSelectedAccounts}`),params:Ee({accounts:ye(Oe())})}),ao=(be(null),Ee({...oo,method:be(`${ro.GetAccountTransactions}`),params:Ee({id:lt,pagination:Nr})})),so=Ee({...oo,method:be(`${ro.GetAccountAssets}`),params:Ee({id:lt})}),co=(ye(it),Ee({...oo,method:be(`${ro.GetAccountBalances}`),params:Ee({id:lt,assets:ye(rt)})})),uo=(ke(rt,Lr),Ee({...oo,method:be(`${ro.ResolveAccountAddress}`),params:Ee({scope:tt,request:jr})})),lo=(Se(no),Ee({jsonrpc:be(\"2.0\"),id:Ce([Oe(),Ae(),be(null)]),method:Oe(),params:Te(Ce([ye(xt),ke(Oe(),xt)]))})),fo=-31002,po=\"Snap Error\";function ho(e,t,n=null){return yt(e)&&gt(e,t)?e[t]:n}function yo(e,t,n=String(e)){const r=ho(e,t);return\"string\"==typeof r?r:n}function go(e){return yo(e,\"message\")}function mo(e){return yo(e,\"stack\",null)}function vo(e){return yo(e,\"name\",e instanceof Error?e.name:\"Error\")}function bo(e){const t=ho(e,\"data\");return null!==t&&Tt(t)&&!Array.isArray(t)?t:{}}function wo(e){if(yt(e)&&\"serialize\"in e&&\"function\"==typeof e.serialize){const t=e.serialize();return Pt(t)&&function(e){return e.code===fo&&e.message===po}(t)}return!1}var So=n(282);const Ao={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},Eo={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},xo={\"-32700\":{standard:\"JSON RPC 2.0\",message:\"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.\"},\"-32600\":{standard:\"JSON RPC 2.0\",message:\"The JSON sent is not a valid Request object.\"},\"-32601\":{standard:\"JSON RPC 2.0\",message:\"The method does not exist / is not available.\"},\"-32602\":{standard:\"JSON RPC 2.0\",message:\"Invalid method parameter(s).\"},\"-32603\":{standard:\"JSON RPC 2.0\",message:\"Internal JSON-RPC error.\"},\"-32000\":{standard:\"EIP-1474\",message:\"Invalid input.\"},\"-32001\":{standard:\"EIP-1474\",message:\"Resource not found.\"},\"-32002\":{standard:\"EIP-1474\",message:\"Resource unavailable.\"},\"-32003\":{standard:\"EIP-1474\",message:\"Transaction rejected.\"},\"-32004\":{standard:\"EIP-1474\",message:\"Method not supported.\"},\"-32005\":{standard:\"EIP-1474\",message:\"Request limit exceeded.\"},4001:{standard:\"EIP-1193\",message:\"User rejected the request.\"},4100:{standard:\"EIP-1193\",message:\"The requested account and/or method has not been authorized by the user.\"},4200:{standard:\"EIP-1193\",message:\"The requested method is not supported by this Ethereum provider.\"},4900:{standard:\"EIP-1193\",message:\"The provider is disconnected from all chains.\"},4901:{standard:\"EIP-1193\",message:\"The provider is disconnected from the specified chain.\"}};const To=Ao.internal,ko=(Oo(To),\"Unspecified server error.\");function Oo(e,t=\"Unspecified error message. This is a bug, please report it.\"){if(function(e){return Number.isInteger(e)}(e)){const t=e.toString();if(gt(xo,t))return xo[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return ko}return t}function _o(e){return Array.isArray(e)?e.map(e=>Tt(e)?e:yt(e)?Io(e):null):yt(e)?Io(e):Tt(e)?e:null}function Io(e){return Object.getOwnPropertyNames(e).reduce((t,n)=>{const r=e[n];return Tt(r)&&(t[n]=r),t},{})}const Co=function(e){return e?.__esModule?e.default:e}(So);class Bo extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('\"code\" must be an integer.');if(!t||\"string\"!=typeof t)throw new Error('\"message\" must be a non-empty string.');!function(e){return yt(e)&&gt(e,\"cause\")&&yt(e.cause)}(n)?super(t):(super(t,{cause:n.cause}),gt(this,\"cause\")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=e}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,vt(this.data)&&(e.data.cause=_o(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return Co(this.serialize(),Ro,2)}}class Po extends Bo{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('\"code\" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}function Ro(e,t){if(\"[Circular]\"!==t)return t}const jo=e=>Zo(Ao.parse,e),Uo=e=>Zo(Ao.invalidRequest,e),Fo=e=>Zo(Ao.invalidParams,e),No=e=>Zo(Ao.methodNotFound,e),Lo=e=>Zo(Ao.internal,e),Mo=e=>Zo(Ao.invalidInput,e),Do=e=>Zo(Ao.resourceNotFound,e),qo=e=>Zo(Ao.resourceUnavailable,e),Vo=e=>Zo(Ao.transactionRejected,e),zo=e=>Zo(Ao.methodNotSupported,e),Ko=e=>Zo(Ao.limitExceeded,e),Ho=e=>Yo(Eo.userRejectedRequest,e),$o=e=>Yo(Eo.unauthorized,e),Go=e=>Yo(Eo.unsupportedMethod,e),Wo=e=>Yo(Eo.disconnected,e),Xo=e=>Yo(Eo.chainDisconnected,e);function Zo(e,t){const[n,r]=Jo(t);return new Bo(e,n??Oo(e),r)}function Yo(e,t){const[n,r]=Jo(t);return new Po(e,n??Oo(e),r)}function Jo(e){if(e){if(\"string\"==typeof e)return[e];if(\"object\"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&\"string\"!=typeof t)throw new Error(\"Must specify string message.\");return[t??void 0,n]}}return[]}class Qo extends Error{#f;#p;#d;#h;constructor(e,t={}){const n=go(e);super(n),this.#p=n,this.#f=function(e){const t=ho(e,\"code\");return\"number\"==typeof t&&Number.isInteger(t)?t:-32603}(e);const r={...bo(e),...t};Object.keys(r).length>0&&(this.#d=r),this.#h=super.stack}get name(){return\"SnapError\"}get code(){return this.#f}get message(){return this.#p}get data(){return this.#d}get stack(){return this.#h}toJSON(){return{code:fo,message:po,data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}}function ei(e){if(\"string\"==typeof e)return{name:\"Error\",message:e,stack:null,cause:null};if(Pt(e))return{name:\"JsonRpcError\",message:go(e),stack:mo(e)??mo(e.data)??null,cause:null};const t=function(e){return ho(e,\"cause\")}(e);return{name:vo(e),message:go(e),stack:mo(e)??null,cause:null===t?null:ei(t)}}function ti(e){return class extends Qo{constructor(t,n){if(\"object\"==typeof t){const n=e();return void super({code:n.code,message:n.message,data:t})}const r=e(t);super({code:r.code,message:r.message,data:n})}}}const ni=ti(Lo),ri=ti(Mo),oi=ti(Fo),ii=ti(Uo),ai=ti(Ko),si=ti(No),ci=ti(zo),ui=ti(jo),li=ti(Do),fi=ti(qo),pi=ti(Vo),di=ti(Xo),hi=ti(Wo),yi=ti($o),gi=ti(Go),mi=ti(Ho);class vi extends ci{constructor(e){super(`Method not supported: ${e}`)}}async function bi(e,t){try{return await async function(e,t){switch(ne(t,lo),t.method){case`${Wr.GetAccounts}`:return ne(t,Zr),e.getAccounts();case`${Wr.GetAccount}`:return ne(t,Yr),e.getAccount(t.params.id);case`${Wr.CreateAccounts}`:return ne(t,Jr),e.createAccounts(t.params);case`${Wr.DeleteAccount}`:return ne(t,Qr),e.deleteAccount(t.params.id);case`${Wr.ExportAccount}`:if(void 0===e.exportAccount)throw new vi(t.method);return ne(t,eo),e.exportAccount(t.params.id,t.params.options);case`${Wr.SubmitRequest}`:return ne(t,to),e.submitRequest(t.params);case`${ro.SetSelectedAccounts}`:if(void 0===e.setSelectedAccounts)throw new vi(t.method);return ne(t,io),e.setSelectedAccounts(t.params.accounts);case`${qr.ListAccountTransactions}`:if(void 0===e.getAccountTransactions)throw new vi(t.method);return ne(t,zr),e.getAccountTransactions(t.params.id,t.params.pagination);case`${ro.GetAccountTransactions}`:if(void 0===e.getAccountTransactions)throw new vi(t.method);return ne(t,ao),e.getAccountTransactions(t.params.id,t.params.pagination);case`${qr.ListAccountAssets}`:if(void 0===e.getAccountAssets)throw new vi(t.method);return ne(t,Kr),e.getAccountAssets(t.params.id);case`${ro.GetAccountAssets}`:if(void 0===e.getAccountAssets)throw new vi(t.method);return ne(t,so),e.getAccountAssets(t.params.id);case`${ro.GetAccountBalances}`:if(void 0===e.getAccountBalances)throw new vi(t.method);return ne(t,co),e.getAccountBalances(t.params.id,t.params.assets);case`${ro.ResolveAccountAddress}`:if(void 0===e.resolveAccountAddress)throw new vi(t.method);return ne(t,uo),e.resolveAccountAddress(t.params.scope,t.params.request);default:throw new vi(t.method)}}(e,t)}catch(e){if(wo(e))throw e;const t=e instanceof Error&&\"string\"==typeof e.message?e.message:\"An unknown error occurred while handling the keyring (v2) request\";throw new Error(t)}}const wi=[\"http://localhost:3000\"],Si=(({dappMethods:e,metamaskMethods:t,origins:n=wi,metamaskOrigin:r=\"metamask\"})=>{const o=new Map,i=new Set(e);for(const e of n)o.set(e,i);return o.set(r,new Set(t)),o})({dappMethods:[],metamaskMethods:[ro.GetAccounts,ro.GetAccount,ro.CreateAccounts,ro.DeleteAccount,ro.GetAccountBalances,ro.SubmitRequest,ro.GetAccountTransactions,ro.GetAccountAssets,ro.ResolveAccountAddress,ro.SetSelectedAccounts,ro.ExportAccount,qr.ListAccountAssets,qr.ListAccountTransactions],origins:[\"https://portfolio.metamask.io\"],metamaskOrigin:tn}),Ai=new qe({level:Ar.logLevel}),Ei=new qe({level:Le.SILENT});function xi(e,t){try{return re(e,t)}catch(e){if(e instanceof Error)throw new oi(e.message);throw new oi(\"Invalid request parameters\")}}function Ti(e,t){try{ne(e,t)}catch{throw new Qo(\"Invalid Response\")}}Error;function ki(e){return e instanceof Error||yt(e)&&\"Error\"===e.constructor.name}function Oi(e){if(ki(e))return e;const t=new Error(\"Unknown error\");return t.cause=e,t}const _i=[Qo,si,mi,ci,ui,li,fi,pi,di,hi,yi,gi,ni,ri,oi,ii,ai];function Ii(e){return function(e){return _i.some(t=>e instanceof t)}(e)?e:new Qo(e instanceof Error?e:go(e))}function Ci({logError:e,trackError:t,normalizeErrorFn:n=Ii}){return(r,o)=>async function(e,t,n,r){try{return await r()}catch(r){await t(r);const o=n(r);throw e({error:o},`[SnapError] ${JSON.stringify(o.toJSON(),null,2)}`),o}}(o??e,t,n,r)}function Bi(e){return e instanceof Error?e:Oi(e)}function Pi(e){return!(e instanceof mi)}const Ri=\"PT1S\",ji=\"PT2S\",Ui=\"PT5S\",Fi=\"PT20S\",Ni=\"Transaction Added\",Li=\"Transaction Rejected\",Mi=\"Transaction Approved\",Di=\"Transaction Submitted\",qi=\"Transaction Finalized\";function Vi(){return snap}async function zi(){const e=(await async function(){return Vi().request({method:\"snap_listEntropySources\"})}()).find(({primary:e})=>e);if(!e)throw new Error(\"No default entropy source found\");return e.id}async function Ki({method:e,params:t={},duration:n}){return Vi().request({method:\"snap_scheduleBackgroundEvent\",params:{duration:n,request:{method:e,params:t}}})}function Hi(e){let t=\"\";return t=e instanceof Error||\"object\"==typeof e&&null!==e&&\"message\"in e?e.message.toLowerCase():String(e).toLowerCase(),t.includes(\"interface\")&&t.includes(\"not found\")}async function $i(e,t){return Vi().request({method:\"snap_createInterface\",params:{ui:e,context:t}})}async function Gi(e,t,n){try{return await Vi().request({method:\"snap_updateInterface\",params:{id:e,ui:t,context:n}}),!0}catch(e){if(Hi(e))return null;throw e}}async function Wi(e,t){return Vi().request({method:\"snap_dialog\",params:{...t?{type:t}:{},id:e}})}async function Xi(e,t){return Vi().request({method:\"snap_resolveInterface\",params:{id:e,value:t}})}async function Zi(){return Vi().request({method:\"snap_getPreferences\"})}async function Yi(e,t){try{await Vi().request({method:\"snap_trackEvent\",params:{event:{event:e,properties:t}}})}catch(e){Ai.warn({error:e},\"Failed to track event via snap_trackEvent\")}}async function Ji(e){await Yi(Ni,{message:\"Snap transaction added\",origin:e.origin,account_type:e.accountType,chain_id_caip:e.chainIdCaip})}async function Qi(e){await Yi(Li,{message:\"Snap transaction rejected\",origin:e.origin,account_type:e.accountType,chain_id_caip:e.chainIdCaip})}async function ea(e){await Yi(Mi,{message:\"Snap transaction approved\",origin:e.origin,account_type:e.accountType,chain_id_caip:e.chainIdCaip})}function ta(e,t,n){for(const n of t)if(e instanceof n)throw e;throw n}class na extends Error{data;constructor(e,t){super(e,{cause:t?.cause}),this.name=new.target.name,this.data=t?.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const ra=[\"CERT_HAS_EXPIRED\",\"UNABLE_TO_GET_ISSUER_CERT_LOC\",\"UNABLE_TO_VERIFY_LEAF_SIGNATURE\",\"ERR_TLS_CERT_ALTNAME_INVALID\",\"ECONNREFUSED\",\"ETIMEDOUT\",\"ENOTFOUND\",\"ECONNRESET\",\"AbortError\"],oa=new Set(ra),ia=Ee({cause:Ie({code:me([...ra])})});class aa extends na{constructor(e,t){super(e,t),this.name=\"ApiException\"}}class sa extends aa{constructor(e,t){super(e,t),this.name=\"HttpException\"}}class ca extends sa{constructor(e,t){super(`HTTP error! status: ${e}`,t),this.name=\"HttpResponseException\"}}class ua extends aa{constructor(e,t){super(e,t),this.name=\"InvalidHttpRequestParamsException\"}}class la extends aa{constructor(e,t){super(e,t),this.name=\"InvalidHttpResponseException\"}}function fa(e,t){try{ne(e,t)}catch(e){throw new ua(\"Invalid API request parameters\",{cause:e})}}function pa(e,t){try{ne(e,t)}catch(e){throw new la(\"Invalid API response\",{cause:e})}}function da(e){if(ia.is(e))return e.cause?.code;const{code:t}=e;return void 0!==t&&oa.has(t)?t:void 0}function ha(e){if(!(e instanceof Error))return e;if(e instanceof sa)return e;if(!function(e){return e instanceof Error&&(e instanceof sa||\"AbortError\"===e.name||void 0!==da(e))}(e))return e;const t=da(e);return new sa(t?`HTTP error! cause: ${t}`:\"HTTP error!\",{cause:e})}const{trackError:ya,withCatchAndThrowSnapError:ga}=function({logError:e,normalizeErrorFn:t,getSnapProvider:n,prepareError:r,shouldTrack:o}){const i=function({getSnapProvider:e,logError:t,prepareError:n=Bi,shouldTrack:r=Pi}){return async o=>{if(!r(o))return;const i={error:ei(n(o))};try{return await e().request({method:\"snap_trackError\",params:i})}catch(e){return void t({error:e},\"Failed to track error\")}}}({getSnapProvider:n,logError:e,prepareError:r,shouldTrack:o});return{trackError:i,withCatchAndThrowSnapError:Ci({logError:e,trackError:i,normalizeErrorFn:t})}}({getSnapProvider:Vi,logError:Ai.error.bind(Ai)}),ma=({value:e,replacer:t=null,indent:n=2})=>JSON.stringify(q(e),t,n);function va(e,t,n){return`${e}/${an}:${t}-${n}`}function ba(e,t){return`${e}/${sn}:${t}`}function wa(e){return Object.values(un).includes(e)}function Sa(e){const[t]=fn.validate(e);return void 0===t}function Aa(e){const[t]=ln.validate(e);return void 0===t}function Ea(e){return un[e]}function xa(e){const t=e.includes(\":\")?\":\":\"-\",[n,r]=e.split(t);if(!n||!r)throw new Error(`Invalid asset reference: ${e}`);return{assetCode:n,assetIssuer:r}}function Ta(e,t){if(!(e instanceof dn.Asset))throw new Error(\"Invalid asset\");return e.isNative()?Ea(t):va(t,e.getCode(),e.getIssuer())}function ka(e,t){if(t<1)throw new RangeError(\"chunkSize must be at least 1\");const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}async function Oa(e,t,n){if(t<1)throw new RangeError(\"batchSize must be at least 1\");const r=[];for(let o=0;o<e.length;o+=t){const i=e.slice(o,o+t),a=await Promise.all(i.map(async(e,t)=>n(e,o+t)));r.push(...a)}return r}async function _a(e,t,n){if(t<1)throw new RangeError(\"batchSize must be at least 1\");const r=[];for(let o=0;o<e.length;o+=t){const i=e.slice(o,o+t),a=await Promise.allSettled(i.map(async(e,t)=>n(e,o+t)));r.push(...a)}return r}function Ia(e,t){return e.toLowerCase()===t.toLowerCase()}function Ca(e,t,n){(e[t]??=[]).push(n)}const Ba=JSON.parse('{\"D\":{\"confirmation.transaction.title\":{\"message\":\"Transaction request\"},\"confirmation.estimatedChanges.title\":{\"message\":\"Estimated changes\"},\"confirmation.estimatedChanges.tooltip\":{\"message\":\"Estimated changes are what might happen if you go through with this transaction. This is just a prediction, not a guarantee.\"},\"confirmation.estimatedChanges.send\":{\"message\":\"You send\"},\"confirmation.estimatedChanges.receive\":{\"message\":\"You receive\"},\"confirmation.origin\":{\"message\":\"Request from\"},\"confirmation.origin.tooltip\":{\"message\":\"This is the site asking for your confirmation.\"},\"confirmation.from\":{\"message\":\"From\"},\"confirmation.to\":{\"message\":\"To\"},\"confirmation.network\":{\"message\":\"Network\"},\"confirmation.transactionFee\":{\"message\":\"Network fee\"},\"confirmation.confirmButton\":{\"message\":\"Confirm\"},\"confirmation.cancelButton\":{\"message\":\"Cancel\"},\"confirmation.reviewAlertsButton\":{\"message\":\"Review alert\"},\"confirmation.maliciousAck.title\":{\"message\":\"Malicious request\"},\"confirmation.maliciousAck.description\":{\"message\":\"If you confirm this request, you will probably lose your assets to a scammer.\"},\"confirmation.maliciousAck.checkbox\":{\"message\":\"I have acknowledged the risk and still want to proceed\"},\"confirmation.maliciousAck.proceed\":{\"message\":\"Confirm\"},\"confirmation.maliciousAck.back\":{\"message\":\"Go back\"},\"confirmation.closeButton\":{\"message\":\"Close\"},\"confirmation.signMessage.title\":{\"message\":\"Sign message\"},\"confirmation.signMessage.message\":{\"message\":\"Message\"},\"confirmation.signAuthEntry.title\":{\"message\":\"Authorize smart contract\"},\"confirmation.signAuthEntry.warning\":{\"message\":\"You are authorizing a smart contract to act on your behalf. Only approve if you trust this site.\"},\"confirmation.signAuthEntry.expiresAt\":{\"message\":\"Expires at ledger\"},\"confirmation.signAuthEntry.nonce\":{\"message\":\"Nonce\"},\"confirmation.authorization.heading\":{\"message\":\"Authorizations\"},\"confirmation.authorization.authorizedAddress\":{\"message\":\"Authorized address\"},\"confirmation.invocation.contractAddress\":{\"message\":\"Contract Address\"},\"confirmation.invocation.functionName\":{\"message\":\"Function\"},\"confirmation.invocation.argument\":{\"message\":\"Argument {index}\"},\"confirmation.account\":{\"message\":\"Account\"},\"confirmation.memo\":{\"message\":\"Memo\"},\"confirmation.memo.none\":{\"message\":\"None\"},\"confirmation.asset\":{\"message\":\"Asset\"},\"confirmation.signTransaction.title\":{\"message\":\"Sign transaction\"},\"confirmation.estimatedChanges.notAvailable\":{\"message\":\"Estimated changes are not available\"},\"confirmation.estimatedChanges.noChanges\":{\"message\":\"No estimated changes\"},\"confirmation.estimatedChanges.unsupportedContract\":{\"message\":\"Unsupported contract for simulation\"},\"confirmation.securityScanInProgressTitle\":{\"message\":\"Checking for security issues\"},\"confirmation.securityScanInProgressMessage\":{\"message\":\"This usually takes a few seconds.\"},\"confirmation.securityScanAPIErrorTitle\":{\"message\":\"Security scan failed\"},\"confirmation.securityScanAPIErrorMessage\":{\"message\":\"Only continue if you trust every address involved.\"},\"confirmation.securityScanErrorTitle\":{\"message\":\"Security scan failed\"},\"confirmation.securityScanErrorSubtitle\":{\"message\":\"{reason}\"},\"confirmation.securityScanIncompleteTitle\":{\"message\":\"Security scan incomplete\"},\"confirmation.securityScanIncompleteSubtitle\":{\"message\":\"{reason}. Only continue if you trust every address involved.\"},\"confirmation.simulationErrorTitle\":{\"message\":\"This transaction is expected to fail.\"},\"confirmation.simulationErrorSubtitle\":{\"message\":\"{reason}\"},\"confirmation.txnError.requiresMemo\":{\"message\":\"This account requires a memo. Sends to it are not supported.\"},\"confirmation.txnError.invalidCreateAccountAmount\":{\"message\":\"Update Send Amount. A new account requires 1 XLM minimum.\"},\"confirmation.txnError.invalidCreateAccountAsset\":{\"message\":\"Update Send Asset. New accounts must first be funded by 1 XLM.\"},\"confirmation.txnError.trustlineNotAuthorized\":{\"message\":\"The destination is not authorized to receive this asset.\"},\"confirmation.txnError.trustlineNotFound\":{\"message\":\"The destination has not activated a trustline for this asset.\"},\"confirmation.txnError.trustlineNotFoundOnAccount\":{\"message\":\"This account has not activated a trustline for this asset.\"},\"confirmation.txnError.trustlineExceedLimit\":{\"message\":\"This payment would exceed the destination\\'s trustline limit.\"},\"confirmation.txnError.insufficientBalance\":{\"message\":\"Insufficient balance for this transaction.\"},\"confirmation.txnError.insufficientBalanceToCoverFee\":{\"message\":\"Insufficient balance to cover the network fee.\"},\"confirmation.txnError.generic\":{\"message\":\"This transaction cannot be completed. Close this request and try again.\"},\"confirmation.txnError.trustlineNonZeroBalance\":{\"message\":\"Send or swap the remaining balance before removing this trustline.\"},\"confirmation.txnError.updateTrustlineLimit\":{\"message\":\"The new trustline limit cannot be below the current balance.\"},\"confirmation.txnError.insufficientBalanceToCoverBaseReserve\":{\"message\":\"Insufficient balance to cover the account reserve.\"},\"confirmation.txnError.expired\":{\"message\":\"This transaction has expired. Close this request and try again.\"},\"confirmation.validationScanErrorTitle\":{\"message\":\"Security check unavailable\"},\"confirmation.validationScanErrorSubtitle\":{\"message\":\"{reason}\"},\"confirmation.validationErrorTitle\":{\"message\":\"This is a deceptive request\"},\"confirmation.validationErrorSubtitle\":{\"message\":\"If you approve this request, a third party known for scams will take all your assets.\"},\"confirmation.validationWarningTitle\":{\"message\":\"This request may be risky\"},\"confirmation.validationWarningSubtitle\":{\"message\":\"Security Alerts found potential risk. Only continue if you trust this site and every address involved.\"},\"confirmation.validationErrorLearnMore\":{\"message\":\"See details\"},\"confirmation.validationErrorSecurityAdviced\":{\"message\":\"Powered by\"},\"confirmation.transaction.accountmerge\":{\"message\":\"Merge account\"},\"confirmation.transaction.allowtrust\":{\"message\":\"Allow trust\"},\"confirmation.transaction.beginsponsoringfuturereserves\":{\"message\":\"Begin sponsoring future reserves\"},\"confirmation.transaction.bumpsequence\":{\"message\":\"Bump sequence\"},\"confirmation.transaction.changetrust\":{\"message\":\"Change trust line\"},\"confirmation.transaction.claimclaimablebalance\":{\"message\":\"Claim claimable balance\"},\"confirmation.transaction.clawback\":{\"message\":\"Clawback\"},\"confirmation.transaction.clawbackclaimablebalance\":{\"message\":\"Clawback claimable balance\"},\"confirmation.transaction.createaccount\":{\"message\":\"Create account\"},\"confirmation.transaction.createclaimablebalance\":{\"message\":\"Create claimable balance\"},\"confirmation.transaction.createpassiveselloffer\":{\"message\":\"Create passive sell offer\"},\"confirmation.transaction.endsponsoringfuturereserves\":{\"message\":\"End sponsoring future reserves\"},\"confirmation.transaction.extendfootprintttl\":{\"message\":\"Extend footprint TTL\"},\"confirmation.transaction.inflation\":{\"message\":\"Inflation\"},\"confirmation.transaction.invokehostfunction\":{\"message\":\"Invoke host function\"},\"confirmation.transaction.liquiditypooldeposit\":{\"message\":\"Liquidity pool deposit\"},\"confirmation.transaction.liquiditypoolwithdraw\":{\"message\":\"Liquidity pool withdraw\"},\"confirmation.transaction.managedata\":{\"message\":\"Manage data\"},\"confirmation.transaction.managebuyoffer\":{\"message\":\"Manage buy offer\"},\"confirmation.transaction.manageselloffer\":{\"message\":\"Manage sell offer\"},\"confirmation.transaction.pathpaymentstrictreceive\":{\"message\":\"Path payment (strict receive)\"},\"confirmation.transaction.pathpaymentstrictsend\":{\"message\":\"Path payment (strict send)\"},\"confirmation.transaction.payment\":{\"message\":\"Payment\"},\"confirmation.transaction.restorefootprint\":{\"message\":\"Restore footprint\"},\"confirmation.transaction.revokesponsorship\":{\"message\":\"Revoke sponsorship\"},\"confirmation.transaction.setoptions\":{\"message\":\"Set options\"},\"confirmation.transaction.settrustlineflags\":{\"message\":\"Set trust line flags\"},\"confirmation.transaction.param.account\":{\"message\":\"Account\"},\"confirmation.transaction.param.amount\":{\"message\":\"Amount\"},\"confirmation.transaction.param.asset\":{\"message\":\"Asset\"},\"confirmation.transaction.param.assetCode\":{\"message\":\"Asset code\"},\"confirmation.transaction.param.authorize\":{\"message\":\"Authorize\"},\"confirmation.transaction.param.balanceId\":{\"message\":\"Balance ID\"},\"confirmation.transaction.param.buyAmount\":{\"message\":\"Buy amount\"},\"confirmation.transaction.param.bumpTo\":{\"message\":\"Bump to\"},\"confirmation.transaction.param.buying\":{\"message\":\"Buying\"},\"confirmation.transaction.param.claimants\":{\"message\":\"Claimants\"},\"confirmation.transaction.param.clearFlags\":{\"message\":\"Clear flags\"},\"confirmation.transaction.param.contractId\":{\"message\":\"Contract Address\"},\"confirmation.transaction.param.destAmount\":{\"message\":\"Destination amount\"},\"confirmation.transaction.param.destAsset\":{\"message\":\"Destination asset\"},\"confirmation.transaction.param.destMin\":{\"message\":\"Destination minimum\"},\"confirmation.transaction.param.destination\":{\"message\":\"Destination\"},\"confirmation.transaction.param.extendTo\":{\"message\":\"Extend to\"},\"confirmation.transaction.param.flags\":{\"message\":\"Flags\"},\"confirmation.transaction.param.functionName\":{\"message\":\"Function\"},\"confirmation.transaction.param.arguments\":{\"message\":\"Arguments\"},\"confirmation.transaction.param.argument\":{\"message\":\"Argument {index}\"},\"confirmation.transaction.param.authorizedAddress\":{\"message\":\"Authorized address\"},\"confirmation.transaction.param.from\":{\"message\":\"From\"},\"confirmation.transaction.param.highThreshold\":{\"message\":\"High threshold\"},\"confirmation.transaction.param.homeDomain\":{\"message\":\"Home domain\"},\"confirmation.transaction.param.hostFunctionXdrBase64\":{\"message\":\"Host function (XDR, base64)\"},\"confirmation.transaction.param.inflationDest\":{\"message\":\"Inflation destination\"},\"confirmation.transaction.param.limit\":{\"message\":\"Limit\"},\"confirmation.transaction.param.line\":{\"message\":\"Trust line\"},\"confirmation.transaction.param.liquidityPoolId\":{\"message\":\"Liquidity pool ID\"},\"confirmation.transaction.param.lowThreshold\":{\"message\":\"Low threshold\"},\"confirmation.transaction.param.masterWeight\":{\"message\":\"Master weight\"},\"confirmation.transaction.param.maxAmountA\":{\"message\":\"Max amount A\"},\"confirmation.transaction.param.maxAmountB\":{\"message\":\"Max amount B\"},\"confirmation.transaction.param.maxPrice\":{\"message\":\"Max price\"},\"confirmation.transaction.param.medThreshold\":{\"message\":\"Medium threshold\"},\"confirmation.transaction.param.minAmountA\":{\"message\":\"Min amount A\"},\"confirmation.transaction.param.minAmountB\":{\"message\":\"Min amount B\"},\"confirmation.transaction.param.minPrice\":{\"message\":\"Min price\"},\"confirmation.transaction.param.name\":{\"message\":\"Name\"},\"confirmation.transaction.param.note\":{\"message\":\"Note\"},\"confirmation.transaction.param.offerId\":{\"message\":\"Offer ID\"},\"confirmation.transaction.param.path\":{\"message\":\"Path\"},\"confirmation.transaction.param.price\":{\"message\":\"Price\"},\"confirmation.transaction.param.seller\":{\"message\":\"Seller\"},\"confirmation.transaction.param.sendAmount\":{\"message\":\"Send amount\"},\"confirmation.transaction.param.sendAsset\":{\"message\":\"Send asset\"},\"confirmation.transaction.param.sendMax\":{\"message\":\"Send max\"},\"confirmation.transaction.param.selling\":{\"message\":\"Selling\"},\"confirmation.transaction.param.setFlags\":{\"message\":\"Set flags\"},\"confirmation.transaction.param.signer\":{\"message\":\"Signer\"},\"confirmation.transaction.param.signerEd25519\":{\"message\":\"Signer (public key)\"},\"confirmation.transaction.param.signerSha256Hash\":{\"message\":\"Signer (SHA-256)\"},\"confirmation.transaction.param.signerPreAuthTx\":{\"message\":\"Signer (pre-auth tx)\"},\"confirmation.transaction.param.signerSignedPayload\":{\"message\":\"Signer (signed payload)\"},\"confirmation.transaction.param.signerWeight\":{\"message\":\"Signer weight\"},\"confirmation.transaction.param.sponsoredId\":{\"message\":\"Sponsored account\"},\"confirmation.transaction.param.startingBalance\":{\"message\":\"Starting balance\"},\"confirmation.transaction.param.source\":{\"message\":\"Source\"},\"confirmation.transaction.param.trustor\":{\"message\":\"Trustor\"},\"confirmation.transaction.param.valueBase64\":{\"message\":\"Value (base64)\"},\"confirmation.signChangeTrustOptIn.title\":{\"message\":\"Add {asset} trustline\"},\"confirmation.signChangeTrustOptIn.updateTitle\":{\"message\":\"Update {asset} trustline limit\"},\"confirmation.signChangeTrustOptOut.title\":{\"message\":\"Remove {asset} trustline\"},\"transactionScan.errors.unknownError\":{\"message\":\"An unknown error occurred\"},\"transactionScan.errors.insufficientBalance\":{\"message\":\"Insufficient balance\"},\"transactionScan.errors.invalidTransaction\":{\"message\":\"Invalid transaction\"},\"transactionScan.errors.insufficientFunds\":{\"message\":\"Insufficient funds\"},\"transactionScan.errors.noTrustline\":{\"message\":\"Trustline not found\"},\"transactionScan.errors.transactionExpired\":{\"message\":\"Transaction expired\"},\"transactionScan.errors.invalidAddress\":{\"message\":\"Invalid address\"},\"transactionScan.errors.unsupportedEIP712Message\":{\"message\":\"Unsupported method\"},\"confirmation.accountActivation.title\":{\"message\":\"Activate Stellar Wallet\"},\"confirmation.accountActivation.description\":{\"message\":\"On Stellar, your wallet must hold a minimum of 1 XLM before you can hold other assets.\"},\"confirmation.accountActivation.callToAction\":{\"message\":\"Add XLM to your wallet to get started.\"},\"confirmation.accountActivation.address\":{\"message\":\"Stellar address\"},\"confirmation.accountActivation.copyAddress\":{\"message\":\"Copy Address\"}}}'),Pa=JSON.parse('{\"D\":{\"confirmation.transaction.title\":{\"message\":\"Transaction request\"},\"confirmation.estimatedChanges.title\":{\"message\":\"Estimated changes\"},\"confirmation.estimatedChanges.tooltip\":{\"message\":\"Estimated changes are what might happen if you go through with this transaction. This is just a prediction, not a guarantee.\"},\"confirmation.estimatedChanges.send\":{\"message\":\"You send\"},\"confirmation.estimatedChanges.receive\":{\"message\":\"You receive\"},\"confirmation.origin\":{\"message\":\"Request from\"},\"confirmation.origin.tooltip\":{\"message\":\"This is the site asking for your confirmation.\"},\"confirmation.from\":{\"message\":\"From\"},\"confirmation.to\":{\"message\":\"To\"},\"confirmation.network\":{\"message\":\"Network\"},\"confirmation.transactionFee\":{\"message\":\"Network fee\"},\"confirmation.confirmButton\":{\"message\":\"Confirm\"},\"confirmation.cancelButton\":{\"message\":\"Cancel\"},\"confirmation.reviewAlertsButton\":{\"message\":\"Review alert\"},\"confirmation.maliciousAck.title\":{\"message\":\"Malicious request\"},\"confirmation.maliciousAck.description\":{\"message\":\"If you confirm this request, you will probably lose your assets to a scammer.\"},\"confirmation.maliciousAck.checkbox\":{\"message\":\"I have acknowledged the risk and still want to proceed\"},\"confirmation.maliciousAck.proceed\":{\"message\":\"Confirm\"},\"confirmation.maliciousAck.back\":{\"message\":\"Go back\"},\"confirmation.closeButton\":{\"message\":\"Close\"},\"confirmation.signMessage.title\":{\"message\":\"Sign message\"},\"confirmation.signMessage.message\":{\"message\":\"Message\"},\"confirmation.signAuthEntry.title\":{\"message\":\"Authorize smart contract\"},\"confirmation.signAuthEntry.warning\":{\"message\":\"You are authorizing a smart contract to act on your behalf. Only approve if you trust this site.\"},\"confirmation.signAuthEntry.expiresAt\":{\"message\":\"Expires at ledger\"},\"confirmation.signAuthEntry.nonce\":{\"message\":\"Nonce\"},\"confirmation.authorization.heading\":{\"message\":\"Authorizations\"},\"confirmation.authorization.authorizedAddress\":{\"message\":\"Authorized address\"},\"confirmation.invocation.contractAddress\":{\"message\":\"Contract Address\"},\"confirmation.invocation.functionName\":{\"message\":\"Function\"},\"confirmation.invocation.argument\":{\"message\":\"Argument {index}\"},\"confirmation.account\":{\"message\":\"Account\"},\"confirmation.memo\":{\"message\":\"Memo\"},\"confirmation.memo.none\":{\"message\":\"None\"},\"confirmation.asset\":{\"message\":\"Asset\"},\"confirmation.signTransaction.title\":{\"message\":\"Sign transaction\"},\"confirmation.estimatedChanges.notAvailable\":{\"message\":\"Estimated changes are not available\"},\"confirmation.estimatedChanges.noChanges\":{\"message\":\"No estimated changes\"},\"confirmation.estimatedChanges.unsupportedContract\":{\"message\":\"Unsupported contract for simulation\"},\"confirmation.securityScanInProgressTitle\":{\"message\":\"Checking for security issues\"},\"confirmation.securityScanInProgressMessage\":{\"message\":\"This usually takes a few seconds.\"},\"confirmation.securityScanAPIErrorTitle\":{\"message\":\"Security scan failed\"},\"confirmation.securityScanAPIErrorMessage\":{\"message\":\"Only continue if you trust every address involved.\"},\"confirmation.securityScanErrorTitle\":{\"message\":\"Security scan failed\"},\"confirmation.securityScanErrorSubtitle\":{\"message\":\"{reason}\"},\"confirmation.securityScanIncompleteTitle\":{\"message\":\"Security scan incomplete\"},\"confirmation.securityScanIncompleteSubtitle\":{\"message\":\"{reason}. Only continue if you trust every address involved.\"},\"confirmation.simulationErrorTitle\":{\"message\":\"This transaction is expected to fail.\"},\"confirmation.simulationErrorSubtitle\":{\"message\":\"{reason}\"},\"confirmation.txnError.requiresMemo\":{\"message\":\"This account requires a memo. Sends to it are not supported.\"},\"confirmation.txnError.invalidCreateAccountAmount\":{\"message\":\"Update Send Amount. A new account requires 1 XLM minimum.\"},\"confirmation.txnError.invalidCreateAccountAsset\":{\"message\":\"Update Send Asset. New accounts must first be funded by 1 XLM.\"},\"confirmation.txnError.trustlineNotAuthorized\":{\"message\":\"The destination is not authorized to receive this asset.\"},\"confirmation.txnError.trustlineNotFound\":{\"message\":\"The destination has not activated a trustline for this asset.\"},\"confirmation.txnError.trustlineNotFoundOnAccount\":{\"message\":\"This account has not activated a trustline for this asset.\"},\"confirmation.txnError.trustlineExceedLimit\":{\"message\":\"This payment would exceed the destination\\'s trustline limit.\"},\"confirmation.txnError.insufficientBalance\":{\"message\":\"Insufficient balance for this transaction.\"},\"confirmation.txnError.insufficientBalanceToCoverFee\":{\"message\":\"Insufficient balance to cover the network fee.\"},\"confirmation.txnError.generic\":{\"message\":\"This transaction cannot be completed. Close this request and try again.\"},\"confirmation.txnError.trustlineNonZeroBalance\":{\"message\":\"Send or swap the remaining balance before removing this trustline.\"},\"confirmation.txnError.updateTrustlineLimit\":{\"message\":\"The new trustline limit cannot be below the current balance.\"},\"confirmation.txnError.insufficientBalanceToCoverBaseReserve\":{\"message\":\"Insufficient balance to cover the account reserve.\"},\"confirmation.txnError.expired\":{\"message\":\"This transaction has expired. Close this request and try again.\"},\"confirmation.validationScanErrorTitle\":{\"message\":\"Security check unavailable\"},\"confirmation.validationScanErrorSubtitle\":{\"message\":\"{reason}\"},\"confirmation.validationErrorTitle\":{\"message\":\"This is a deceptive request\"},\"confirmation.validationErrorSubtitle\":{\"message\":\"If you approve this request, a third party known for scams will take all your assets.\"},\"confirmation.validationWarningTitle\":{\"message\":\"This request may be risky\"},\"confirmation.validationWarningSubtitle\":{\"message\":\"Security Alerts found potential risk. Only continue if you trust this site and every address involved.\"},\"confirmation.validationErrorLearnMore\":{\"message\":\"See details\"},\"confirmation.validationErrorSecurityAdviced\":{\"message\":\"Powered by\"},\"confirmation.transaction.accountmerge\":{\"message\":\"Merge account\"},\"confirmation.transaction.allowtrust\":{\"message\":\"Allow trust\"},\"confirmation.transaction.beginsponsoringfuturereserves\":{\"message\":\"Begin sponsoring future reserves\"},\"confirmation.transaction.bumpsequence\":{\"message\":\"Bump sequence\"},\"confirmation.transaction.changetrust\":{\"message\":\"Change trust line\"},\"confirmation.transaction.claimclaimablebalance\":{\"message\":\"Claim claimable balance\"},\"confirmation.transaction.clawback\":{\"message\":\"Clawback\"},\"confirmation.transaction.clawbackclaimablebalance\":{\"message\":\"Clawback claimable balance\"},\"confirmation.transaction.createaccount\":{\"message\":\"Create account\"},\"confirmation.transaction.createclaimablebalance\":{\"message\":\"Create claimable balance\"},\"confirmation.transaction.createpassiveselloffer\":{\"message\":\"Create passive sell offer\"},\"confirmation.transaction.endsponsoringfuturereserves\":{\"message\":\"End sponsoring future reserves\"},\"confirmation.transaction.extendfootprintttl\":{\"message\":\"Extend footprint TTL\"},\"confirmation.transaction.inflation\":{\"message\":\"Inflation\"},\"confirmation.transaction.invokehostfunction\":{\"message\":\"Invoke host function\"},\"confirmation.transaction.liquiditypooldeposit\":{\"message\":\"Liquidity pool deposit\"},\"confirmation.transaction.liquiditypoolwithdraw\":{\"message\":\"Liquidity pool withdraw\"},\"confirmation.transaction.managedata\":{\"message\":\"Manage data\"},\"confirmation.transaction.managebuyoffer\":{\"message\":\"Manage buy offer\"},\"confirmation.transaction.manageselloffer\":{\"message\":\"Manage sell offer\"},\"confirmation.transaction.pathpaymentstrictreceive\":{\"message\":\"Path payment (strict receive)\"},\"confirmation.transaction.pathpaymentstrictsend\":{\"message\":\"Path payment (strict send)\"},\"confirmation.transaction.payment\":{\"message\":\"Payment\"},\"confirmation.transaction.restorefootprint\":{\"message\":\"Restore footprint\"},\"confirmation.transaction.revokesponsorship\":{\"message\":\"Revoke sponsorship\"},\"confirmation.transaction.setoptions\":{\"message\":\"Set options\"},\"confirmation.transaction.settrustlineflags\":{\"message\":\"Set trust line flags\"},\"confirmation.transaction.param.account\":{\"message\":\"Account\"},\"confirmation.transaction.param.amount\":{\"message\":\"Amount\"},\"confirmation.transaction.param.asset\":{\"message\":\"Asset\"},\"confirmation.transaction.param.assetCode\":{\"message\":\"Asset code\"},\"confirmation.transaction.param.authorize\":{\"message\":\"Authorize\"},\"confirmation.transaction.param.balanceId\":{\"message\":\"Balance ID\"},\"confirmation.transaction.param.buyAmount\":{\"message\":\"Buy amount\"},\"confirmation.transaction.param.bumpTo\":{\"message\":\"Bump to\"},\"confirmation.transaction.param.buying\":{\"message\":\"Buying\"},\"confirmation.transaction.param.claimants\":{\"message\":\"Claimants\"},\"confirmation.transaction.param.clearFlags\":{\"message\":\"Clear flags\"},\"confirmation.transaction.param.contractId\":{\"message\":\"Contract Address\"},\"confirmation.transaction.param.destAmount\":{\"message\":\"Destination amount\"},\"confirmation.transaction.param.destAsset\":{\"message\":\"Destination asset\"},\"confirmation.transaction.param.destMin\":{\"message\":\"Destination minimum\"},\"confirmation.transaction.param.destination\":{\"message\":\"Destination\"},\"confirmation.transaction.param.extendTo\":{\"message\":\"Extend to\"},\"confirmation.transaction.param.flags\":{\"message\":\"Flags\"},\"confirmation.transaction.param.functionName\":{\"message\":\"Function\"},\"confirmation.transaction.param.arguments\":{\"message\":\"Arguments\"},\"confirmation.transaction.param.argument\":{\"message\":\"Argument {index}\"},\"confirmation.transaction.param.authorizedAddress\":{\"message\":\"Authorized address\"},\"confirmation.transaction.param.from\":{\"message\":\"From\"},\"confirmation.transaction.param.highThreshold\":{\"message\":\"High threshold\"},\"confirmation.transaction.param.homeDomain\":{\"message\":\"Home domain\"},\"confirmation.transaction.param.hostFunctionXdrBase64\":{\"message\":\"Host function (XDR, base64)\"},\"confirmation.transaction.param.inflationDest\":{\"message\":\"Inflation destination\"},\"confirmation.transaction.param.limit\":{\"message\":\"Limit\"},\"confirmation.transaction.param.line\":{\"message\":\"Trust line\"},\"confirmation.transaction.param.liquidityPoolId\":{\"message\":\"Liquidity pool ID\"},\"confirmation.transaction.param.lowThreshold\":{\"message\":\"Low threshold\"},\"confirmation.transaction.param.masterWeight\":{\"message\":\"Master weight\"},\"confirmation.transaction.param.maxAmountA\":{\"message\":\"Max amount A\"},\"confirmation.transaction.param.maxAmountB\":{\"message\":\"Max amount B\"},\"confirmation.transaction.param.maxPrice\":{\"message\":\"Max price\"},\"confirmation.transaction.param.medThreshold\":{\"message\":\"Medium threshold\"},\"confirmation.transaction.param.minAmountA\":{\"message\":\"Min amount A\"},\"confirmation.transaction.param.minAmountB\":{\"message\":\"Min amount B\"},\"confirmation.transaction.param.minPrice\":{\"message\":\"Min price\"},\"confirmation.transaction.param.name\":{\"message\":\"Name\"},\"confirmation.transaction.param.note\":{\"message\":\"Note\"},\"confirmation.transaction.param.offerId\":{\"message\":\"Offer ID\"},\"confirmation.transaction.param.path\":{\"message\":\"Path\"},\"confirmation.transaction.param.price\":{\"message\":\"Price\"},\"confirmation.transaction.param.seller\":{\"message\":\"Seller\"},\"confirmation.transaction.param.sendAmount\":{\"message\":\"Send amount\"},\"confirmation.transaction.param.sendAsset\":{\"message\":\"Send asset\"},\"confirmation.transaction.param.sendMax\":{\"message\":\"Send max\"},\"confirmation.transaction.param.selling\":{\"message\":\"Selling\"},\"confirmation.transaction.param.setFlags\":{\"message\":\"Set flags\"},\"confirmation.transaction.param.signer\":{\"message\":\"Signer\"},\"confirmation.transaction.param.signerEd25519\":{\"message\":\"Signer (public key)\"},\"confirmation.transaction.param.signerSha256Hash\":{\"message\":\"Signer (SHA-256)\"},\"confirmation.transaction.param.signerPreAuthTx\":{\"message\":\"Signer (pre-auth tx)\"},\"confirmation.transaction.param.signerSignedPayload\":{\"message\":\"Signer (signed payload)\"},\"confirmation.transaction.param.signerWeight\":{\"message\":\"Signer weight\"},\"confirmation.transaction.param.sponsoredId\":{\"message\":\"Sponsored account\"},\"confirmation.transaction.param.startingBalance\":{\"message\":\"Starting balance\"},\"confirmation.transaction.param.source\":{\"message\":\"Source\"},\"confirmation.transaction.param.trustor\":{\"message\":\"Trustor\"},\"confirmation.transaction.param.valueBase64\":{\"message\":\"Value (base64)\"},\"confirmation.signChangeTrustOptIn.title\":{\"message\":\"Add {asset} trustline\"},\"confirmation.signChangeTrustOptIn.updateTitle\":{\"message\":\"Update {asset} trustline limit\"},\"confirmation.signChangeTrustOptOut.title\":{\"message\":\"Remove {asset} trustline\"},\"transactionScan.errors.unknownError\":{\"message\":\"An unknown error occurred\"},\"transactionScan.errors.insufficientBalance\":{\"message\":\"Insufficient balance\"},\"transactionScan.errors.invalidTransaction\":{\"message\":\"Invalid transaction\"},\"transactionScan.errors.insufficientFunds\":{\"message\":\"Insufficient funds\"},\"transactionScan.errors.noTrustline\":{\"message\":\"Trustline not found\"},\"transactionScan.errors.transactionExpired\":{\"message\":\"Transaction expired\"},\"transactionScan.errors.invalidAddress\":{\"message\":\"Invalid address\"},\"transactionScan.errors.unsupportedEIP712Message\":{\"message\":\"Unsupported method\"},\"confirmation.accountActivation.title\":{\"message\":\"Activate Stellar Wallet\"},\"confirmation.accountActivation.description\":{\"message\":\"On Stellar, your wallet must hold a minimum of 1 XLM before you can hold other assets.\"},\"confirmation.accountActivation.callToAction\":{\"message\":\"Add XLM to your wallet to get started.\"},\"confirmation.accountActivation.address\":{\"message\":\"Stellar address\"},\"confirmation.accountActivation.copyAddress\":{\"message\":\"Copy Address\"}}}'),Ra={en:Ba.D,es:Pa.D},ja=\"en\";function Ua(e){const t=Ra[e]??Ra[ja];return(e,n)=>{let r=t[e]?.message??e;return n&&r&&Object.keys(n).forEach(e=>{const t=new RegExp(`\\\\{${e}\\\\}`,\"gu\");r=r.replace(t,n[e]??\"\")}),r}}class Fa extends na{}class Na extends Fa{constructor(e,t){super(`Account not found for address or id: ${e}`,t)}}class La extends Fa{constructor(e,t){super(`Derived account address does not match the provided address: ${e}`,t)}}class Ma extends na{}class Da extends Ma{constructor(e){super(`Balance not available for asset ${e}`)}}class qa extends Ma{constructor(){super(\"Account metadata not available\")}}const Va=Ee({accountId:Oe(),sequenceNumber:Oe(),scope:ut}),za=Ee({assetId:ln,balance:Oe(),symbol:Oe(),limit:Oe(),address:Oe(),authorized:ge(),sponsored:xe(ge()),sponsor:xe(Oe())}),Ka=Ee({assetId:fn,balance:Oe(),symbol:Oe(),decimals:ze(Ae(),7)}),Ha=Ee({assetId:cn,balance:Oe(),symbol:Oe()}),$a=Ce([za,Ka,Ha]),Ga=pe(Va,Ee({meta:Ee({subentryCount:Ae(),numSponsoring:Ae(),numSponsored:Ae(),dataEntries:xe(ke(Oe(),Oe()))}),balances:ye($a),rawNativeBalance:Oe()}));function Wa(e){return new M(2).plus(e.subentryCount).plus(e.numSponsoring).minus(e.numSponsored).times(Zt)}function Xa(e){const{nativeBalance:t,subentryCount:n,numSponsoring:r,numSponsored:o}=e,i=Wa({subentryCount:n,numSponsoring:r,numSponsored:o});return M.maximum(t.minus(i),0)}class Za{#y;#g;#m;#v;#b;#w;#S;#A=new Map;constructor(e,t,n){if(this.#y=e,this.#g=t,void 0!==n){if(n.scope!==t)throw new Ma(\"Binding scope must match constructor scope\");if(n.accountId!==e.accountId()||n.sequenceNumber!==e.sequenceNumber())throw new Ma(\"Binding account id/sequence must match the Stellar Account instance\");this.#E(n)}}get accountId(){return this.#y.accountId()}get sequenceNumber(){return this.#y.sequenceNumber()}get scope(){return this.#g}get subentryCount(){if(void 0!==this.#m)return this.#m;throw new qa}get numSponsoring(){if(void 0!==this.#v)return this.#v;throw new qa}get numSponsored(){if(void 0!==this.#b)return this.#b;throw new qa}get minimumReserveBalance(){return Wa({subentryCount:this.subentryCount,numSponsoring:this.numSponsoring,numSponsored:this.numSponsored})}get requiresMemo(){return\"MQ==\"===this.#w?.[\"config.memo_required\"]}hasAsset(e){return void 0!==this.getAsset(e)}getAsset(e){return this.#x(e)}getRawAsset(e){const t=this.#A.get(e);if(void 0!==t)return{...t}}#x(e){const t=this.#A.get(e);if(void 0!==t)return wa(e)||Aa(e)&&t.limit?.gt(0)||Sa(e)&&t.balance.gt(0)?{...t}:void 0}setAsset(e,t){this.#A.set(e,t)}setTombstoneClassicAsset(e,t){this.#A.set(e,{balance:new M(0),symbol:t.symbol,limit:new M(0),address:t.address,authorized:t.authorized??!0,...void 0===t.sponsored?{}:{sponsored:t.sponsored},...void 0===t.sponsor||0===t.sponsor.length?{}:{sponsor:t.sponsor},decimals:t.decimals})}get classicTrustlineAssetIds(){const e=[];for(const[t,n]of this.#A)Aa(t)&&!0===n.limit?.gt(0)&&e.push(t);return e}get rawAssetIds(){return Array.from(this.#A.keys())}get assetIds(){return Array.from(this.#A.keys()).filter(e=>void 0!==this.#x(e))}get nativeSpendableBalance(){const e=Ea(this.#g),t=this.#A.get(e);if(void 0===t)throw new Da(e);return t.balance}get nativeRawBalance(){const e=Ea(this.#g);if(void 0===this.#S)throw new Da(e);return this.#S}getRaw(){return this.#y}toSerializable(){const e=this.#m,t=this.#v,n=this.#b,r=this.#w??{};if(void 0===e||void 0===t||void 0===n||void 0===this.#S)return{accountId:this.accountId,sequenceNumber:this.sequenceNumber,scope:this.#g};const o=Ea(this.#g),i=[];for(const[e,t]of this.#A)if(e!==o)if(Aa(e)){if(void 0===t.limit)throw new Ma(`Classic asset entry missing limit for asset ${e}`);if(void 0===t.address)throw new Ma(`Classic asset entry missing address for asset ${e}`);if(void 0===t.authorized)throw new Ma(`Classic asset entry missing authorized for asset ${e}`);i.push(za.create({assetId:e,balance:t.balance.toString(),symbol:t.symbol,limit:t.limit.toString(),address:t.address,authorized:t.authorized,...void 0===t.sponsored?{}:{sponsored:t.sponsored},...void 0===t.sponsor||0===t.sponsor.length?{}:{sponsor:t.sponsor}}))}else{if(!Sa(e))throw new Ma(`Asset id not supported: ${e}`);i.push(Ka.create({assetId:e,balance:t.balance.toString(),symbol:t.symbol,decimals:t.decimals}))}return{accountId:this.accountId,sequenceNumber:this.sequenceNumber,scope:this.#g,meta:{subentryCount:e,numSponsoring:t,numSponsored:n,dataEntries:r},balances:i,rawNativeBalance:this.#S.toFixed(0)}}toMinimalSerializable(){return{accountId:this.accountId,sequenceNumber:this.sequenceNumber,scope:this.#g}}toSerializableFull(){const e=this.toSerializable();if(!Ga.is(e))throw new Ma(\"Account is not fully hydrated\");return e}static fromHorizon(e,t){const n=new dn.Account(e.accountId(),e.sequenceNumber()),r={subentryCount:e.subentry_count??0,numSponsoring:e.num_sponsoring??0,numSponsored:e.num_sponsored??0,dataEntries:e.data_attr??{}},o=[],i=e.balances??[];let a;for(const e of i){const n=vn(new M(e.balance));if(\"native\"!==e.asset_type){if(\"credit_alphanum12\"===e.asset_type||\"credit_alphanum4\"===e.asset_type){const r=e.is_authorized??!0,i=va(t,e.asset_code,e.asset_issuer),a=vn(new M(e.limit??0)),s=\"sponsor\"in e&&\"string\"==typeof e.sponsor?e.sponsor:void 0,c=void 0!==s&&s.length>0;o.push({assetId:i,balance:n.toString(),symbol:e.asset_code,address:e.asset_issuer,limit:a.toString(),authorized:r,...c?{sponsored:!0,sponsor:s}:{}})}}else a=n.toFixed(0)}if(void 0===a)throw new Ma(\"Native balance is not available\");const s={accountId:e.accountId(),sequenceNumber:e.sequenceNumber(),scope:t,meta:r,balances:o,rawNativeBalance:a};return new Za(n,t,s)}static fromSerializable(e){const t=new dn.Account(e.accountId,e.sequenceNumber);return new Za(t,e.scope,e)}#E(e){if(Ga.is(e)){const{meta:t,balances:n,scope:r}=e;this.#m=t.subentryCount,this.#v=t.numSponsoring,this.#b=t.numSponsored,this.#w=t.dataEntries??{},this.#S=new M(e.rawNativeBalance);const o=Ea(r);return this.#A.set(o,{balance:Xa({nativeBalance:this.#S,subentryCount:t.subentryCount,numSponsoring:t.numSponsoring,numSponsored:t.numSponsored}),symbol:Jt,decimals:7}),void n.forEach(e=>{if(e.assetId!==o){if(this.#A.has(e.assetId))throw new Ma(\"Asset id already exists in the balances map\");if(za.is(e)){const{balance:t,symbol:n,limit:r,address:o,authorized:i,sponsored:a,sponsor:s}=e;this.#A.set(e.assetId,{balance:new M(t),symbol:n,limit:new M(r),address:o,authorized:i,...void 0===a?{}:{sponsored:a},...void 0===s||0===s.length?{}:{sponsor:s},decimals:7})}else{if(!Ka.is(e))throw new Ma(`Unsupported asset entry for asset: ${String(e.assetId)}`);{const{balance:t,symbol:n,decimals:r}=Ka.create(e);this.#A.set(e.assetId,{balance:new M(t),symbol:n,decimals:r})}}}})}if(!Va.is(e))throw new Ma(\"Binding must be minimal (accountId, sequenceNumber, scope only) or full (meta, balances, rawNativeBalance)\")}}function Ya(e,t){if(!Ia(e,t))throw new La(e)}class Ja extends na{}class Qa extends Ja{transactionHash;status;scope;constructor(e,t,n,r){super(`Failed to poll transaction: ${e} with status: ${t} for scope: ${n}`,r),this.transactionHash=e,this.status=t,this.scope=n}}class es extends Ja{address;scope;constructor(e,t,n){super(`Account not activated for address: ${e} for scope: ${t}`,n),this.address=e,this.scope=t}}class ts extends Ja{reference;constructor(e,t,n){super(`Failed to send transaction: scope: ${e} ${t?` reference: ${t}`:\"\"}`,n),this.reference=t}}class ns extends ts{}class rs extends Ja{transactionHash;constructor(e,t){super(`Transaction ${e} not found`,t),this.transactionHash=e}}class os extends Ja{constructor(e,t){super(`Failed to simulate transaction: ${e}`,t)}}class is{#T=new Map;#k;constructor(e){this.#k=e}#O(e){if(void 0!==e){if(\"number\"!=typeof e)throw new Error(\"TTL must be a number\");if(e<0)throw new Error(\"TTL must be positive\");if(e>Number.MAX_SAFE_INTEGER)throw new Error(\"TTL must be less than 2^53 - 1\")}}#_(e){return e.expiresAt<Date.now()}async#I(){const e=[];for(const[t,n]of this.#T.entries())this.#_(n)&&e.push(t);await this.mdelete(e)}async get(e){return(await this.mget([e]))[e]}async set(e,t,n=Number.MAX_SAFE_INTEGER){this.#O(n),this.#T.set(e,{value:t,expiresAt:Math.min(Date.now()+(n??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})}async delete(e){return(await this.mdelete([e]))[e]??!1}async clear(){this.#T.clear()}async has(e){const t=this.#T.get(e);return!!t&&(!this.#_(t)||(this.#T.delete(e),!1))}async keys(){return await this.#I(),Array.from(this.#T.keys())}async size(){return await this.#I(),this.#T.size}async peek(e){const t=this.#T.get(e);if(t){if(!this.#_(t))return t.value;this.#T.delete(e)}}async mget(e){await this.#I();const t={};for(const n of e){const e=this.#T.get(n);e?(this.#k.info(`[InMemoryCache] 🎉 Cache hit for key \"${n}\"`),t[n]=e.value):(this.#k.info(`[InMemoryCache] ❌ Cache miss for key \"${n}\"`),t[n]=void 0)}return t}async mset(e){if(0!==e.length){if(1===e.length){_n(e[0]);const{key:t,value:n,ttlMilliseconds:r}=e[0];return void await this.set(t,n,r)}e.forEach(({ttlMilliseconds:e})=>{this.#O(e)}),e.forEach(({key:e,value:t,ttlMilliseconds:n})=>{void 0!==t&&this.#T.set(e,{value:t,expiresAt:Math.min(Date.now()+(n??Number.MAX_SAFE_INTEGER),Number.MAX_SAFE_INTEGER)})})}}async mdelete(e){return Object.fromEntries(e.map(e=>[e,this.#T.delete(e)]))}}Ai.withPrefix(\"useCache\");const as=Ai.withPrefix(\"useCache\"),ss=(e,t)=>`${e}:${t.map(e=>JSON.stringify(q(e))).join(\":\")}`,cs=(e,t,{ttlMilliseconds:n,functionName:r,generateCacheKey:o,refreshCache:i=!1})=>{const a=o??ss,s=r??e.name??\"anonymousFunction\";return async(...r)=>{const o=a(s,r);if(!i)try{const e=await t.get(o);if(void 0!==e)return e}catch(e){as.error(`Cache get error for key \"${o}\":`,e)}const c=await e(...r);return t.set(o,c,n).catch(e=>{as.error(`Cache set error for key \"${o}\":`,e)}),c}};class us extends na{}class ls extends us{}class fs extends us{constructor(e){super(\"Failed to deserialize transaction\",e)}}class ps extends us{}class ds extends ps{expectedScope;transactionScope;constructor(e,t){super(`Transaction scope ${t} does not match expected scope ${e}`),this.expectedScope=e,this.transactionScope=t}}class hs extends ps{constructor(e){super(`Transaction expired (maxTime: ${e})`)}}class ys extends ps{constructor(e){super(`Unsupported operation type: ${e}`)}}class gs extends ps{constructor(e){super(`Create account with non-native asset ${e} is not supported`)}}class ms extends ps{constructor(e){super(`Account ${e} requires a memo`)}}class vs extends ps{constructor(e){super(`Invalid amount for create account: ${e} — minimum starting balance is 1 XLM`)}}class bs extends ps{assetId;accountAddress;constructor(e,t){super(`Trustline for asset ${e} on account ${t} is not authorized`),this.assetId=e,this.accountAddress=t}}class ws extends ps{assetId;accountAddress;constructor(e,t){super(`Trustline not found for asset ${e} on account ${t}`),this.assetId=e,this.accountAddress=t}}class Ss extends ps{assetId;constructor(e){super(`Payment would exceed trustline limit for asset ${e} on destination`),this.assetId=e}}class As extends ps{constructor(e){super(`Invalid trustline: ${e}`)}}class Es extends ps{constructor(e){super(`Failed to remove the trustline: ${e}`)}}class xs extends ps{constructor(e){super(`Failed to update the trustline: ${e}`)}}class Ts extends ps{balance;required;constructor(e,t){super(`Insufficient native balance for transaction: ${e} stroops available is less than ${t} stroops required`),this.balance=e,this.required=t}}class ks extends ps{balance;required;constructor(e,t){super(`Insufficient native balance for transaction for base reserve: ${e} stroops available is less than ${t} stroops required`),this.balance=e,this.required=t}}class Os extends ps{balance;required;assetId;constructor(e,t,n){super(`Insufficient asset balance for transaction: ${e} available is less than ${t} required`),this.balance=e,this.required=t,this.assetId=n??\"\"}}class _s extends ps{constructor(){super(\"Invoke host function transaction must have exactly one operation\")}}class Is extends us{}class Cs extends us{}class Bs extends us{}const Ps=Ee({...Lr.schema}),Rs=Ee({fungible:be(!0),type:rt,...Ps.schema}),js=Ee({fungible:be(!1),id:ot}),Us=dt(e=>vt(e)&&!e.fungible?js:Rs),Fs=Ee({address:Oe(),asset:Se(Us)});var Ns;!function(e){e.Base=\"base\",e.Priority=\"priority\"}(Ns||(Ns={}));const Ls=Ee({type:me([`${Ns.Base}`,`${Ns.Priority}`]),asset:Us});var Ms,Ds,qs;!function(e){e.Submitted=\"submitted\",e.Unconfirmed=\"unconfirmed\",e.Confirmed=\"confirmed\",e.Failed=\"failed\"}(Ms||(Ms={})),function(e){e.Send=\"send\",e.Receive=\"receive\",e.Swap=\"swap\",e.BridgeSend=\"bridge:send\",e.BridgeReceive=\"bridge:receive\",e.StakeDeposit=\"stake:deposit\",e.StakeWithdraw=\"stake:withdraw\",e.TokenApprove=\"token:approve\",e.TokenDisapprove=\"token:disapprove\",e.Unknown=\"unknown\"}(Ds||(Ds={})),function(e){e.Benign=\"Benign\",e.Warning=\"Warning\",e.Malicious=\"Malicious\"}(qs||(qs={}));const Vs=Ee({origin:Te(Oe()),securityAlertResponse:Te(me([`${qs.Benign}`,`${qs.Warning}`,`${qs.Malicious}`])),typeLabel:Te(Oe())}),zs=Ee({status:me([`${Ms.Submitted}`,`${Ms.Unconfirmed}`,`${Ms.Confirmed}`,`${Ms.Failed}`]),timestamp:Se(Ae())}),Ks=Ee({id:Oe(),chain:tt,account:lt,status:me([`${Ms.Submitted}`,`${Ms.Unconfirmed}`,`${Ms.Confirmed}`,`${Ms.Failed}`]),timestamp:Se(Ae()),type:me([`${Ds.Send}`,`${Ds.Receive}`,`${Ds.Swap}`,`${Ds.BridgeSend}`,`${Ds.BridgeReceive}`,`${Ds.StakeDeposit}`,`${Ds.StakeWithdraw}`,`${Ds.TokenApprove}`,`${Ds.TokenDisapprove}`,`${Ds.Unknown}`]),from:ye(Fs),to:ye(Fs),fees:ye(Ls),events:ye(zs),details:Te(Vs)}),Hs=(Ee({data:ye(Ks),next:Se(Oe())}),Ee({metamask:Te(Ee({correlationId:lt}))}));var $s;!function(e){e.AccountCreated=\"notify:accountCreated\",e.AccountUpdated=\"notify:accountUpdated\",e.AccountDeleted=\"notify:accountDeleted\",e.RequestApproved=\"notify:requestApproved\",e.RequestRejected=\"notify:requestRejected\",e.AccountBalancesUpdated=\"notify:accountBalancesUpdated\",e.AccountAssetListUpdated=\"notify:accountAssetListUpdated\",e.AccountTransactionsUpdated=\"notify:accountTransactionsUpdated\"}($s||($s={}));Ee({method:be(`${$s.AccountCreated}`),params:Ee({account:Gt,accountNameSuggestion:Te(Oe()),displayConfirmation:Te(ge()),displayAccountNameSuggestion:Te(ge()),...Hs.schema})}),Ee({method:be(`${$s.AccountUpdated}`),params:Ee({account:Gt})}),Ee({method:be(`${$s.AccountDeleted}`),params:Ee({id:lt})}),Ee({method:be(`${$s.RequestApproved}`),params:Ee({id:lt,result:xt})}),Ee({method:be(`${$s.RequestRejected}`),params:Ee({id:lt})}),Ee({method:be(`${$s.AccountBalancesUpdated}`),params:Ee({balances:ke(ft,ke(rt,Ps))})}),Ee({method:be(`${$s.AccountTransactionsUpdated}`),params:Ee({transactions:ke(ft,ye(Ks))})}),Ee({method:be(`${$s.AccountAssetListUpdated}`),params:Ee({assets:ke(ft,Ee({added:ye(it),removed:ye(it)}))})});var Gs;!function(e){e.GetSelectedAccounts=\"getSelectedAccounts\"}(Gs||(Gs={}));Ee({method:be(Gs.GetSelectedAccounts)});const Ws=ye(Oe());async function Xs(e,t,n){await e.request({method:\"snap_manageAccounts\",params:{method:t,params:{...n}}})}async function Zs(e){const t=await e.request({method:\"snap_manageAccounts\",params:{method:Gs.GetSelectedAccounts}});return ne(t,Ws),t}function Ys(e){if(wa(e))return dn.Asset.native();if(Aa(e)){const{assetReference:t}=st(e),{assetCode:n,assetIssuer:r}=xa(t);return new dn.Asset(n,r)}throw new Error(`Invalid asset id: ${e}`)}function Js(e,t){const n=e.scope;if(n!==t)throw new ds(t,n)}function Qs(e){if(e.hasInvokeHostFunction&&1!==e.operationCount)throw new _s}function ec(e,t){const{chainId:n}=st(e);if(n!==String(t))throw new ps(`Asset ${e} scope does not match expected scope ${t}`)}function tc(e){const{expirationTime:t}=e;if(void 0!==t&&t<Math.floor(Date.now()/1e3))throw new hs(t)}function nc(e,t,n){const r=e.getMemo();if(n&&(null===r||!/\\S/u.test(r)))throw new ms(t)}function rc(e,t){if(\"native\"===t)return Ea(e);try{const{assetCode:n,assetIssuer:r}=xa(t);return va(e,n,r)}catch{return null}}function oc(e){if(\"assetWithAmount\"===e.type&&Array.isArray(e.value)){const[t]=e.value;return t}return\"asset\"===e.type&&\"string\"==typeof e.value?e.value:null}function ic(e){if(void 0===e)return;const t=parseInt(e,10);return Number.isNaN(t)||0===t?void 0:t}function ac(e){return e.type===er||e.type===Qn}function sc(e,t){return e.type===tr&&e.destination===t||e.type===qn&&e.destination===t||e.type===Qn&&e.destination===t||e.type===er&&e.destination===t}function cc(e){return e===`${Ms.Submitted}`||e===`${Ms.Unconfirmed}`}function uc(e){const{reconcileAttemptCount:t,...n}=e;return n}function lc(e){return e.map(uc)}function fc(e){return function(e=0){return e>=Ar.transaction.maxReconcileAttempts}(e.reconcileAttemptCount??0)&&(null!=(t=e.timestamp)&&Date.now()-1e3*t>Ar.transaction.maxPendingTransactionAge);var t}async function pc(e){const t=(0,w.groupBy)(e,\"account\");await Xs(Vi(),$s.AccountTransactionsUpdated,{transactions:t})}const dc=\"pathPaymentStrictSendSuccess\",hc=\"pathPaymentStrictReceiveSuccess\";function yc(e){return dn.Address.fromScAddress(e).toString()}function gc(e){return\"string\"==typeof e?e:sr(e).toString(\"utf8\")}function mc(e){const{func:t}=e;return\"hostFunctionTypeInvokeContract\"===t?.switch().name&&\"transfer\"===gc(t.invokeContract().functionName())}function vc(e,t){try{const{func:n}=e;if(\"hostFunctionTypeInvokeContract\"!==n?.switch().name)throw new Bs(\"Not an invoke contract operation\");const r=n.invokeContract();if(\"transfer\"!==gc(r.functionName()))throw new Bs(\"Contract is not a transfer function\");const o=r.args();if(3!==o.length||void 0===o[0]||void 0===o[1]||void 0===o[2])throw new Bs(\"Invalid transfer function arguments\");const i=yc(r.contractAddress()),a=(0,dn.scValToNative)(o[0]),s=(0,dn.scValToNative)(o[1]),c=(0,dn.scValToNative)(o[2]);if(\"string\"!=typeof a||!gn.is(a))throw new Bs(\"Invalid from address\");if(\"string\"!=typeof s||!gn.is(s))throw new Bs(\"Invalid to address\");return{assetId:ba(t,i),fromAccountId:a,toAccountId:s,amount:wc(c)}}catch(e){return ta(e,[Bs],new Bs(\"Failed to parse SEP-41 transfer invoke\",{cause:e}))}}function bc(e,t){switch(e.switch().name){case\"assetTypeNative\":return Ea(t);case\"assetTypeCreditAlphanum4\":case\"assetTypeCreditAlphanum12\":try{const n=dn.Asset.fromOperation(e);return va(t,n.getCode(),n.getIssuer())}catch{return}default:return}}function wc(e){let t;t=\"bigint\"==typeof e?e.toString():String(\"number\"==typeof e?Math.trunc(e):e);const n=new M(t);if(!n.isFinite()||n.isNegative())throw new Bs(`Invalid native value: ${e}`);return n}function Sc(e){try{return function(e){const t=Ac(e);if(\"string\"==typeof t)return t;return JSON.stringify(t)}((0,dn.scValToNative)(e))}catch{return e.toXDR(\"base64\")}}function Ac(e){return null==e?null:\"bigint\"==typeof e?e.toString():\"string\"==typeof e||\"number\"==typeof e||\"boolean\"==typeof e?String(e):e instanceof Uint8Array?sr(e).toString(\"hex\"):Array.isArray(e)?e.map(e=>Ac(e)):e instanceof Map?Object.fromEntries([...e.entries()].map(([e,t])=>{const n=Ac(e);return[\"string\"==typeof n?n:JSON.stringify(n),Ac(t)]})):\"object\"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Ac(t)])):null}function Ec(e){if(\"publicKeyTypeEd25519\"===e.switch().name)return dn.StrKey.encodeEd25519PublicKey(e.ed25519())}function xc(e,t){if(e)return{amount:new M(e.amount().toString()),asset:bc(e.asset(),t),destination:Ec(e.destination())}}function Tc(e,t,n){if(!e||!t)return;let r;switch(e.switch().name){case\"claimAtomTypeOrderBook\":r=e.orderBook();break;case\"claimAtomTypeLiquidityPool\":r=e.liquidityPool();break;case\"claimAtomTypeV0\":r=e.v0();break;default:return}return{amount:new M(r.amountBought().toString()),asset:bc(r.assetBought(),n),destination:Ec(t.destination())}}const kc={[ct.Mainnet]:dn.Networks.PUBLIC,[ct.Testnet]:dn.Networks.TESTNET};function Oc(e){if(!(e in kc))throw new Error(`Network not found for caip2ChainId: ${e}`);return kc[e]}function _c(e){const t=e,n=Object.keys(kc).find(e=>kc[e]===t);if(!n)throw new Error(`Caip2ChainId not found for network: ${e}`);return n}function Ic(e){if(\"bigint\"==typeof e||\"number\"==typeof e||\"string\"==typeof e)try{return wc(e)}catch{return null}return null}function Cc(e,t){return e instanceof dn.NotFoundError||Oi(e).message===`Account not found: ${t}`}function Bc(e=100){return function(e,t){const n=e.multipliedBy(t).integerValue(M.ROUND_CEIL);return M.min(n,vn(new M(Ar.transaction.maxFeeThresholdInXLM)))}(new M(e),Ar.transaction.baseFeeMultiplier)}class Pc{#C;#B;#P=new Set;#R=new Set;#j=new Set;#U=Ms.Submitted;#F;constructor(e,t){this.#C=e,this.#B=t?.feeCharged??new M(e.fee),this.#U=t?.status??Ms.Submitted,this.#F=t?.rawData,this.#N()}#N(){this.#j.add(this.sourceAccount),this.#j.add(this.feeSourceAccount),this.#R.add(this.sourceAccount),this.#R.add(this.feeSourceAccount);for(const e of this.transactionOperations){const t=e.source??this.sourceAccount;this.#j.add(t),this.#R.add(t),(e.type===er||e.type===Qn||e.type===tr)&&this.#R.add(e.destination),this.#P.add(e.type)}}getMemo(){const e=this.getRaw(),t=e instanceof dn.FeeBumpTransaction?e.innerTransaction.memo:e.memo;if(!t)return null;switch(t.type){case\"hash\":case\"return\":{const{value:e}=t;return null==e?null:sr(e).toString(\"hex\")}case\"id\":{const{value:e}=t;return null==e?null:\"string\"==typeof e?e:String(e)}case\"text\":{const{value:e}=t;return null==e?null:sr(e).toString(\"utf8\")}default:return null}}get expirationTime(){const e=this.getRaw();return e instanceof dn.FeeBumpTransaction?ic(e.innerTransaction.timeBounds?.maxTime):ic(e.timeBounds?.maxTime)}get totalFee(){const e=this.getRaw();return new M(e.fee)}get feeCharged(){return this.#B}get operationCount(){return this.transactionOperations.length}get network(){return this.#C.networkPassphrase}get scope(){return _c(this.#C.networkPassphrase)}get hasCreateAccount(){return this.#P.has(qn)}get hasInvokeHostFunction(){return this.#P.has(Gn)}get sourceAccount(){const e=this.getRaw();return e instanceof dn.FeeBumpTransaction?e.innerTransaction.source:e.source}get feeSourceAccount(){const e=this.getRaw();let t;if(t=e instanceof dn.FeeBumpTransaction?e.feeSource:e.source,!t)throw new us(\"Fee source account is not set\");return t}get participatingAccounts(){return Array.from(this.#R.values())}get id(){return this.#C.hash().toString(\"hex\")}get status(){return this.#U}get rawData(){return this.#F}isSourceAccount(e){return this.sourceAccount===e||this.feeSourceAccount===e}isExplicitSourceAccount(e){return this.sourceAccount===e}hasParticipatingAccount(e){return this.#R.has(e)}isInvokedByAccount(e){return this.#j.has(e)}getRaw(){return this.#C}get transactionOperations(){const e=this.getRaw();return e instanceof dn.FeeBumpTransaction?e.innerTransaction.operations:e.operations}static fromRaw(e){return new Pc(e)}static fromXdr(e){const{xdr:t,scope:n}=e;try{const e=dn.TransactionBuilder.fromXDR(t,Oc(n));return Pc.fromRaw(e)}catch(e){throw new fs({cause:e})}}static fromHorizon(e){const{horizonTransaction:t,scope:n}=e,r=Pc.fromXdr({xdr:t.envelope_xdr,scope:n}),o=t.successful?Ms.Confirmed:Ms.Failed;return new Pc(r.getRaw(),{feeCharged:new M(t.fee_charged),status:o,rawData:t})}}const Rc=\"txBadSeq\",jc=\"GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO\",Uc=\"CBZV3HBP672BV7FF3ZILVT4CNPW3N5V2WTJ2LAGOAYW5R7L2D5SLUDFZ\",Fc=\"CCM23MFAJHDWUMF3IM3UPUI4ZUFFKX6OWJNJRUKO2W6MUTQNQWWFH7DC\";class Nc{contract;method;args;canFail;version=\"v1\";constructor(e){this.contract=e.contract,this.method=e.method,this.args=e.args,this.canFail=e.canFail}}class Lc{#L;#M;#D;constructor({rpcClient:e,simulationAccount:t=jc,routerContract:n=Uc}){this.#L=e,this.#M=t,this.#D=n}exec(e,t){const n=t.map(e=>{switch(e.version){case\"v0\":return dn.xdr.ScVal.scvVec([new dn.Address(e.contract.toString()).toScVal(),dn.xdr.ScVal.scvSymbol(e.method),dn.xdr.ScVal.scvVec(e.args)]);case\"v1\":return dn.xdr.ScVal.scvVec([new dn.Address(e.contract.toString()).toScVal(),dn.xdr.ScVal.scvSymbol(e.method),dn.xdr.ScVal.scvVec(e.args),dn.xdr.ScVal.scvBool(!0===e.canFail)]);default:throw new Error(\"Invocation version is not supported.\")}});return new dn.Contract(this.#D).call(\"exec\",new dn.Address(e.toString()).toScVal(),dn.xdr.ScVal.scvVec(n))}async simResult(e,t){const n=t?.source??this.#M,r=t?.caller??this.#M,o=t?.scope??ct.Mainnet,i=new dn.TransactionBuilder(new dn.Account(n,\"0\"),{networkPassphrase:Oc(o),fee:100..toString()}).setTimeout(0).addOperation(this.exec(r,e)).build(),a=await this.#L.simulateTransaction(i);if(dn.rpc.Api.isSimulationError(a))throw new Error(String(a.error));const s=a.result?.retval;if(void 0===s)throw new Error(\"Simulation returned no result\");return(0,dn.scValToNative)(s)}}const Mc=Ee({unit:Oe(),amount:Oe()}),Dc=pe(Mc,Ee({unit:ze(be(Jt),Jt),metadata:xe(Ee({spendableBalance:Oe(),minimumReserveBalance:Oe(),decimal:Ae()}))})),qc=pe(Mc,Ee({metadata:xe(Ee({limit:Oe(),authorized:ze(ge(),!0),sponsor:ze(Oe(),\"\")}))}));Ce([Dc,qc,Mc]);function Vc(e){return Dc.create({amount:Sn(e.nativeBalance),metadata:{spendableBalance:e.spendableBalance.toFixed(0),minimumReserveBalance:e.minimumReserveBalance.toFixed(0),decimal:7}})}function zc(e){return qc.create({unit:e.symbol,amount:Sn(e.balance,e.decimals),metadata:{limit:Sn(e.limit??new M(0),e.decimals),authorized:e.authorized,sponsor:e.sponsor}})}function Kc(e){return Mc.create({unit:e.symbol,amount:Sn(e.balance,e.decimals)})}class Hc{#q;#V;#k;constructor({networkService:e,onChainAccountRepository:t,logger:n}){this.#q=e,this.#V=t,this.#k=n.withPrefix(\"[💼 OnChainAccountSynchronizeService]\")}async synchronize(e,t,n){if(0===e.length)return void this.#k.debug(\"No accounts to synchronize\");const r=Date.now();this.#k.debug(`Synchronize on-chain accounts started at ${r}`);try{const r=[],o=[];for(const{keyringAccount:t,onChainAccount:n}of e)o.push(t.id),r.push(n.accountId);this.#k.debug(\"Load SEP-41 token balances\");let i=null;try{i=await this.#z({stellarAccountIds:r,scope:t,sep41Assets:n})}catch(e){await ya(e),this.#k.warn(\"SEP-41 token balance step failed; merge will reuse last-saved SEP-41 asset entries where needed\",{error:e})}this.#k.debug(\"Load latest state snapshots for on-chain accounts\");const a=await this.#V.findByKeyringAccountIds(o,t),s=Object.values(a).filter(e=>null!==e).length;this.#k.debug(\"Loaded latest state snapshots for on-chain accounts - number of accounts loaded\",{noOfAccounts:s,newActivatedAccountPairs:e.length-s});const c={};let u=null,l=null;this.#k.debug(\"Diff full snapshots for on-chain accounts\");for(const{keyringAccount:t,onChainAccount:n}of e){const e=t.id,r=a[e]??null,o=null===r?null:Za.fromSerializable(r),s=this.#K(n,i);this.#H(n,o,s);const{balanceChanges:f,assetListChanges:p}=this.#$(o,n);u??={},u[e]=f,this.#k.debug(\"Prepared account balance payload for keyring account\",{keyringAccountId:e,balanceEntriesLength:Object.keys(f).length}),l??={},l[e]=p,this.#k.debug(\"Differences in full snapshots for keyring account - asset list changes\",{keyringAccountId:e,added:p.added.length,removed:p.removed.length}),c[e]=n.toSerializableFull()}this.#k.debug(\"Save snapshots to the State\"),await this.#V.saveMany(c),this.#k.debug(\"Emit keyring events\"),await this.#G(u,l)}finally{const e=Date.now();this.#k.debug(`Synchronize completed at ${e} in ${e-r}ms`)}}async#z({stellarAccountIds:e,scope:t,sep41Assets:n}){const r=[],o=n.reduce((e,t)=>{const n=t.assetId;return e[n]=t,r.push(n),e},{}),i=await this.#q.getSep41AssetBalances({accounts:e,assetIds:r,scope:t});return{assetIds:r,assetMetadataByAssetId:o,balancesByAccountId:i}}#K(e,t){if(null===t)return;const n=new Set,r=t.balancesByAccountId[e.accountId]??{};for(const o of t.assetIds){const i=r[o],a=t.assetMetadataByAssetId[o];if(!a)continue;const{decimals:s}=a.units[0],{symbol:c}=a;null!=i?e.setAsset(o,{balance:i,symbol:c,decimals:s}):n.add(o)}return n.size>0&&this.#k.debug(\"SEP-41 balances unresolved for account\",{accountId:e.accountId,unresolvedAssetIds:Array.from(n)}),n}#H(e,t,n){if(!t)return e;for(const r of t.rawAssetIds){if(void 0!==e.getRawAsset(r))continue;const o=t.getRawAsset(r);if(Sa(r)){(void 0===n||n.has(r))&&void 0!==o&&e.setAsset(r,{balance:new M(o.balance),symbol:o.symbol,decimals:o.decimals})}else if(Aa(r)){void 0!==o?.limit&&void 0!==o.address&&e.setTombstoneClassicAsset(r,o)}}return e}#$(e,t){const n=Ea(t.scope),r=new Set([...e?.rawAssetIds??[],...t.rawAssetIds]),o={},i=[],a=[];for(const n of r){const r=null===e?void 0:e.getRawAsset(n),s=t.getRawAsset(n),c=t.hasAsset(n),u=e?.hasAsset(n)??!1;if(!u&&c&&i.push(n),u&&!c&&a.push(n),c||u){const e=s??r;if(void 0===e)continue;wa(n)?o[n]=Vc({nativeBalance:t.nativeRawBalance,spendableBalance:t.nativeSpendableBalance,minimumReserveBalance:t.minimumReserveBalance}):Aa(n)?o[n]=zc(e):Sa(n)&&(o[n]=Kc(e))}}return i.includes(n)||i.push(n),{balanceChanges:o,assetListChanges:{added:i,removed:a}}}async#G(e,t){try{null!==e&&await Xs(Vi(),$s.AccountBalancesUpdated,{balances:e}),null!==t&&await Xs(Vi(),$s.AccountAssetListUpdated,{assets:t})}catch(e){await ya(e),this.#k.warn(\"Failed to emit keyring events after synchronize\",{error:e})}}}const $c=Ue(Oe(),/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),Gc=\"address\",Wc=\"asset\",Xc=\"assetWithAmount\",Zc=\"amount\",Yc=\"price\",Jc=\"text\",Qc=\"number\",eu=\"boolean\",tu=\"json\",nu=\"copyable\",ru=new Set([Gn,Hn,nr]),ou=[{mask:1,label:\"authRequired\"},{mask:2,label:\"authRevocable\"},{mask:4,label:\"authImmutable\"},{mask:8,label:\"authClawbackEnabled\"}],iu=ou.reduce((e,{mask:t})=>e|t,0);function au(e){const t=e>>>0,n=[];for(const{mask:e,label:r}of ou)0!==(t&e)&&n.push(r);const r=t&~iu;return 0!==r&&n.push(`unknown(0x${r.toString(16)})`),n}class su{field(e,t,n){let r=t;if(n===Zc)r=this.normalizeAmount(t);else if(n===Xc&&Array.isArray(t)){const[e,n]=t;r=[e,this.normalizeAmount(n)]}return{key:e,value:r,type:n}}normalizeAmount(e){return\"string\"==typeof e&&/^-?\\d+(\\.\\d+)?$/u.test(e)?new M(e).toFixed():e}}class cu extends su{mapAuthorizations(e){const t=[];for(const n of e)try{t.push(...this.mapInvocation(n.rootInvocation(),this.#W(n)))}catch{}return t}mapInvocation(e,t=null){const n=[];return this.#X(n,e,t),n}#X(e,t,n){const r=this.#Z(t,n);r.length>0&&e.push({params:r});for(const r of t.subInvocations())this.#X(e,r,n)}#Z(e,t){const n=[];null!==t&&n.push(this.field(\"authorizedAddress\",t,nu));const r=e.function();switch(r.switch()){case dn.xdr.SorobanAuthorizedFunctionType.sorobanAuthorizedFunctionTypeContractFn():{const e=r.contractFn();n.push(this.field(\"contractId\",yc(e.contractAddress()),nu)),n.push(this.field(\"functionName\",gc(e.functionName()),Jc));const t=e.args();t.length>0&&n.push(this.field(\"arguments\",t.map(e=>Sc(e)),tu));break}case dn.xdr.SorobanAuthorizedFunctionType.sorobanAuthorizedFunctionTypeCreateContractHostFn():n.push(this.field(\"functionName\",\"createContract\",Jc));break;case dn.xdr.SorobanAuthorizedFunctionType.sorobanAuthorizedFunctionTypeCreateContractV2HostFn():n.push(this.field(\"functionName\",\"createContractV2\",Jc));break;default:n.push(this.field(\"functionName\",\"authorization\",Jc))}return n}#W(e){const t=e.credentials();return t.switch()!==dn.xdr.SorobanCredentialsType.sorobanCredentialsAddress()?null:yc(t.address().address())}}class uu extends su{mapTransaction(e){const{sourceAccount:t}=e,n=e.transactionOperations.map((e,n)=>this.#Y(e,n,t)),r=this.#J(e.transactionOperations);return{scope:e.scope,feeStroops:e.totalFee.toFixed(0),operationCount:n.length,sourceAccount:t,feeSourceAccount:e.feeSourceAccount,memo:e.getMemo(),operations:n,authorizations:r}}#J(e){const t=new cu,n=[];for(const r of e){if(r.type!==Gn)continue;const{auth:e}=r;e&&0!==e.length&&n.push(...t.mapAuthorizations(e))}return n}#Y(e,t,n){const{type:r}=e,o=!ru.has(r),i=e.source??null;return{index:t,type:r,source:e.source??n,explicitSource:i,classic:o,params:o?this.#Q(e):this.#ee(e)}}#ee(e){if(e.type===Gn){const t=e,n=[];try{const{func:e}=t;if(e?.switch()===dn.xdr.HostFunctionType.hostFunctionTypeInvokeContract()){const t=e.invokeContract(),r=yc(t.contractAddress()),o=gc(t.functionName());n.push(this.field(\"contractId\",r,nu)),n.push(this.field(\"functionName\",o,Jc));const i=t.args();i.length>0&&n.push(this.field(\"arguments\",i.map(e=>Sc(e)),\"json\"))}}catch{}return 0===n.length&&n.push(this.field(\"note\",\"Soroban invokeHostFunction; review contract call on a block explorer or dedicated UI.\",Jc)),n}if(e.type===Hn){const t=e;return[this.field(\"extendTo\",t.extendTo,Qc)]}return e.type===nr?[this.field(\"note\",\"Soroban restoreFootprint.\",Jc)]:[this.field(\"note\",\"Soroban operation; expand separately if needed.\",Jc)]}#Q(e){switch(e.type){case tr:{const t=e;return[this.field(\"destination\",t.destination,Gc),this.field(\"asset\",[t.asset.toString(),t.amount],Xc)]}case qn:{const t=e;return[this.field(\"destination\",t.destination,Gc),this.field(\"startingBalance\",t.startingBalance,Zc)]}case Nn:{const t=e;return[this.field(\"line\",this.#te(t.line),Jc),this.field(\"limit\",t.limit,Zc)]}case Rn:{const t=e;return[this.field(\"destination\",t.destination,Gc)]}case Qn:{const t=e;return[this.field(\"sendAsset\",[t.sendAsset.toString(),t.sendMax],Xc),this.field(\"destination\",t.destination,Gc),this.field(\"destAsset\",[t.destAsset.toString(),t.destAmount],Xc),this.field(\"path\",t.path.map(e=>e.toString()),tu)]}case er:{const t=e;return[this.field(\"sendAsset\",[t.sendAsset.toString(),t.sendAmount],Xc),this.field(\"destination\",t.destination,Gc),this.field(\"destAsset\",[t.destAsset.toString(),t.destMin],Xc),this.field(\"path\",t.path.map(e=>e.toString()),tu)]}case Jn:{const t=e;return[this.field(\"selling\",[t.selling.toString(),t.amount],Xc),this.field(\"buying\",t.buying.toString(),Wc),this.field(\"price\",t.price,Yc),this.field(\"offerId\",t.offerId,Jc)]}case Zn:{const t=e;return[this.field(\"buying\",[t.buying.toString(),t.buyAmount],Xc),this.field(\"selling\",t.selling.toString(),Wc),this.field(\"price\",t.price,Yc),this.field(\"offerId\",t.offerId,Jc)]}case zn:{const t=e;return[this.field(\"selling\",[t.selling.toString(),t.amount],Xc),this.field(\"buying\",t.buying.toString(),Wc),this.field(\"price\",t.price,Yc)]}case or:{const t=e,n=[];if(void 0!==t.inflationDest&&n.push(this.field(\"inflationDest\",t.inflationDest,Gc)),void 0!==t.clearFlags&&n.push(this.field(\"clearFlags\",au(t.clearFlags),Jc)),void 0!==t.setFlags&&n.push(this.field(\"setFlags\",au(t.setFlags),Jc)),void 0!==t.masterWeight&&n.push(this.field(\"masterWeight\",t.masterWeight,Qc)),void 0!==t.lowThreshold&&n.push(this.field(\"lowThreshold\",t.lowThreshold,Qc)),void 0!==t.medThreshold&&n.push(this.field(\"medThreshold\",t.medThreshold,Qc)),void 0!==t.highThreshold&&n.push(this.field(\"highThreshold\",t.highThreshold,Qc)),void 0!==t.homeDomain&&n.push(this.field(\"homeDomain\",t.homeDomain,Jc)),\"signer\"in t&&void 0!==t.signer){const e=t.signer;\"ed25519PublicKey\"in e?n.push(this.field(\"signerEd25519\",e.ed25519PublicKey,Gc)):\"sha256Hash\"in e?n.push(this.field(\"signerSha256Hash\",sr(e.sha256Hash).toString(\"hex\"),Jc)):\"preAuthTx\"in e?n.push(this.field(\"signerPreAuthTx\",sr(e.preAuthTx).toString(\"hex\"),Jc)):\"ed25519SignedPayload\"in e&&n.push(this.field(\"signerSignedPayload\",e.ed25519SignedPayload,Jc)),void 0!==e.weight&&n.push(this.field(\"signerWeight\",Number(e.weight),Qc))}return n}case jn:{const t=e,n=[this.field(\"trustor\",t.trustor,Gc),this.field(\"assetCode\",t.assetCode,Jc)];if(void 0!==t.authorize){const e=t.authorize;\"boolean\"==typeof e?n.push(this.field(\"authorize\",e,eu)):n.push(this.field(\"authorize\",String(e),Jc))}return n}case Yn:{const t=e;return[this.field(\"name\",t.name,Jc),this.field(\"valueBase64\",t.value?sr(t.value).toString(\"base64\"):null,Jc)]}case Fn:{const t=e;return[this.field(\"bumpTo\",t.bumpTo,Jc)]}case $n:return[];case Vn:{const t=e;return[this.field(\"asset\",[t.asset.toString(),t.amount],Xc),this.field(\"claimants\",t.claimants.map(e=>({destination:e.destination,predicate:this.#ne(e.predicate)})),tu)]}case Ln:{const t=e;return[this.field(\"balanceId\",t.balanceId,Jc)]}case Un:{const t=e;return[this.field(\"sponsoredId\",t.sponsoredId,Gc)]}case Kn:return[];case rr:return this.#re(e);case Mn:{const t=e;return[this.field(\"asset\",[t.asset.toString(),t.amount],Xc),this.field(\"from\",t.from,Gc)]}case Dn:{const t=e;return[this.field(\"balanceId\",t.balanceId,Jc)]}case ir:{const t=e,n=[],r=[];!0===t.flags.authorized?n.push(\"authorized\"):!1===t.flags.authorized&&r.push(\"authorized\"),!0===t.flags.authorizedToMaintainLiabilities?n.push(\"authorizedToMaintainLiabilities\"):!1===t.flags.authorizedToMaintainLiabilities&&r.push(\"authorizedToMaintainLiabilities\"),!0===t.flags.clawbackEnabled?n.push(\"clawbackEnabled\"):!1===t.flags.clawbackEnabled&&r.push(\"clawbackEnabled\");const o=[this.field(\"trustor\",t.trustor,Gc),this.field(\"asset\",t.asset.toString(),Wc)];return n.length>0&&o.push(this.field(\"setFlags\",n,Jc)),r.length>0&&o.push(this.field(\"clearFlags\",r,Jc)),o}case Wn:{const t=e;return[this.field(\"liquidityPoolId\",t.liquidityPoolId,Jc),this.field(\"maxAmountA\",t.maxAmountA,Zc),this.field(\"maxAmountB\",t.maxAmountB,Zc),this.field(\"minPrice\",t.minPrice,Yc),this.field(\"maxPrice\",t.maxPrice,Yc)]}case Xn:{const t=e;return[this.field(\"liquidityPoolId\",t.liquidityPoolId,Jc),this.field(\"amount\",t.amount,Zc),this.field(\"minAmountA\",t.minAmountA,Zc),this.field(\"minAmountB\",t.minAmountB,Zc)]}case Gn:case Hn:case nr:return[this.field(\"note\",\"Soroban operation; use non-classic mapping path.\",Jc)];default:return[this.field(\"note\",\"Unhandled or newer operation type.\",Jc)]}}#re(e){if(\"seller\"in e&&\"offerId\"in e){const t=e;return[this.field(\"seller\",t.seller,\"address\"),this.field(\"offerId\",t.offerId,\"text\")]}if(\"balanceId\"in e&&!(\"account\"in e)){const t=e;return[this.field(\"balanceId\",t.balanceId,\"text\")]}if(\"liquidityPoolId\"in e&&!(\"account\"in e)){const t=e;return[this.field(\"liquidityPoolId\",t.liquidityPoolId,\"text\")]}if(\"account\"in e&&\"name\"in e){const t=e;return[this.field(\"account\",t.account,\"address\"),this.field(\"name\",t.name,\"text\")]}if(\"account\"in e&&\"signer\"in e){const t=e;return[this.field(\"account\",t.account,\"address\"),this.field(\"signer\",JSON.stringify(t.signer),\"text\")]}if(\"account\"in e&&\"asset\"in e){const t=e,{asset:n}=t,r=n instanceof dn.LiquidityPoolId?n.getLiquidityPoolId():n.toString();return[this.field(\"account\",t.account,\"address\"),this.field(\"asset\",r,\"asset\")]}if(\"account\"in e){const t=e;return[this.field(\"account\",t.account,\"address\")]}return[this.field(\"note\",\"revokeSponsorship shape not recognized.\",\"text\")]}#te(e){return e instanceof dn.LiquidityPoolAsset?`${e.assetA.toString()} / ${e.assetB.toString()} (LP fee ${e.fee})`:e.toString()}#ne(e){try{const t=e.switch();if(t===dn.xdr.ClaimPredicateType.claimPredicateUnconditional())return\"unconditional\";if(t===dn.xdr.ClaimPredicateType.claimPredicateBeforeAbsoluteTime()){const t=e.absBefore(),n=Number(t.toXDR().readBigInt64BE(0));return`before ${new Date(1e3*n).toISOString()}`}if(t===dn.xdr.ClaimPredicateType.claimPredicateBeforeRelativeTime()){const t=e.relBefore();return`within ${String(t)}s`}if(t===dn.xdr.ClaimPredicateType.claimPredicateAnd()){const t=e.andPredicates(),n=t[0],r=t[1];if(n&&r)return`(${this.#ne(n)} AND ${this.#ne(r)})`}if(t===dn.xdr.ClaimPredicateType.claimPredicateOr()){const t=e.orPredicates(),n=t[0],r=t[1];if(n&&r)return`(${this.#ne(n)} OR ${this.#ne(r)})`}if(t===dn.xdr.ClaimPredicateType.claimPredicateNot()){const t=e.notPredicate();return t?`NOT ${this.#ne(t)}`:\"NOT(null)\"}}catch{}return\"unknown predicate\"}}var lu=n(74),fu=n.n(lu),pu=n(7835),du=n.n(pu);const hu=\"swap\",yu=\"bridgeSend\",gu=\"changeTrustOptIn\",mu=\"changeTrustOptOut\",vu=\"send\",bu=\"pending\",wu=\"unknown\",Su=\"trustline-approve\",Au=\"trustline-disapprove\";class Eu{createTransaction(e){switch(e.type){case mu:case gu:return this.#oe(e.request,e.type);case vu:return this.#ie(e.request);case hu:return this.#ae(e.request);case bu:return this.#se(e.request);case wu:case yu:return this.#ce(e.request);default:throw new Is(\"Invalid transaction type\")}}#oe(e,t){const{txId:n,account:r,scope:o,asset:i,status:a=Ms.Unconfirmed}=e,s=this.#ue(e.timestamp),c=t===gu?Ds.TokenApprove:Ds.TokenDisapprove,u=t===gu?Su:Au;return this.#le({type:c,id:n,account:r,scope:o,from:[{address:r.address,asset:i}],to:[{address:r.address,asset:i}],status:a,timestamp:s,fees:e.fees??[],details:{typeLabel:u}})}#ce(e){const{fees:t=[],txId:n,account:r,scope:o,transactionType:i=Ds.Unknown,from:a=[],to:s=[],status:c=Ms.Unconfirmed}=e,u=this.#ue(e.timestamp);return this.#le({type:i,id:n,account:r,scope:o,from:a,to:s,status:c,timestamp:u,fees:t})}#se(e){const t=this.getCreateTime(),{txId:n,account:r,scope:o}=e,i=e.status??Ms.Unconfirmed;if(\"from\"in e)return this.#le({type:e.transactionType,id:n,account:r,scope:o,from:e.from,to:e.to,status:i,timestamp:t,fees:e.fees??[]});const{asset:a}=e;return this.#le({type:e.transactionType??Ds.Unknown,id:n,account:r,scope:o,from:[{address:r.address,asset:{unit:a.symbol,type:a.type,amount:\"0\",fungible:!0}}],to:[{address:r.address,asset:{unit:a.symbol,type:a.type,amount:\"0\",fungible:!0}}],status:i,timestamp:t,fees:[]})}#ie(e){const{txId:t,account:n,scope:r,toAddress:o,asset:i,fees:a=[]}=e,s=e.status??Ms.Unconfirmed,c=this.#ue(e.timestamp);return this.#le({type:Ds.Send,id:t,account:n,scope:r,from:[{address:n.address,asset:i}],to:[{address:o,asset:i}],status:s,timestamp:c,fees:a})}#ae(e){const{txId:t,account:n,scope:r,toAddress:o,fromAsset:i,toAsset:a,fees:s=[]}=e,c=e.status??Ms.Unconfirmed,u=this.#ue(e.timestamp);return this.#le({type:Ds.Swap,id:t,account:n,scope:r,from:[{address:n.address,asset:i}],to:[{address:o,asset:a}],status:c,timestamp:u,fees:s})}#le({type:e,id:t,account:n,scope:r,from:o,to:i,status:a,timestamp:s,fees:c,details:u}){return{type:e,id:t,from:o,to:i,events:[{status:a,timestamp:s}],chain:r,status:a,account:n.id,timestamp:s,fees:c,...void 0===u?{}:{details:u}}}#ue(e){return e??this.getCreateTime()}getCreateTime(e){return Math.floor(e??Date.now()/1e3)}getBaseFees(e,t){return[{type:Ns.Base,asset:{unit:Jt,type:Ea(t),amount:Sn(e),fungible:!0}}]}}class xu{#fe;#k;constructor({keyringTransactionBuilder:e,logger:t}){this.#fe=e,this.#k=t.withPrefix(\"[💰 TransactionMapper]\")}mapTransactionSafe(e){const{transaction:t,keyringAccount:n,assetMetadata:r,transactionFromState:o}=e;try{if(!t.rawData||!t.id)throw new Cs(\"Transaction raw data and id are required; this transaction does not appear to be sourced from an on-chain transaction record\");if(o)return this.#pe(t,n,o);if(function(e,t){const n=e.transactionOperations;return e.sourceAccount!==t&&!!n.some(e=>e.type===tr&&e.destination===t&&e.asset.isNative()&&new M(e.amount).isLessThanOrEqualTo(new M(\"0.001\")))}(t,n.address))return;return this.#de(t,n,r)}catch(e){return this.#k.warn(\"Unable to map a transaction, mapping to an unknown transaction\",{error:e,transactionId:t.id}),this.#he(t,n)}}#de(e,t,n){const{address:r}=t;return e.hasInvokeHostFunction&&1===e.operationCount?this.#ye(e,t,n)??this.#ge(e,t)??this.#he(e,t):function(e,t){const n=e.transactionOperations;return!(e.sourceAccount!==t||!n.every(e=>e.type===tr||e.type===qn))}(e,r)?this.#me(e,t):function(e,t){const n=lr.is(e.getRaw().toXDR()),r=e.sourceAccount===t;return!(!n||!r)&&e.transactionOperations.some(e=>ac(e)&&e.destination===t)}(e,r)?this.#ve(e,t):function(e,t){const n=e.transactionOperations;return!(e.sourceAccount!==t||!n.every(e=>e.type===Nn&&new M(e.limit).isGreaterThan(0)))}(e,r)?this.#be(e,t,gu):function(e,t){const n=e.sourceAccount===t,r=e.transactionOperations;return!(!n||!r.every(e=>e.type===Nn&&new M(e.limit).isZero()))}(e,r)?this.#be(e,t,mu):function(e,t){return!!e.transactionOperations.some(e=>sc(e,t))}(e,r)?this.#we(e,t):e.isExplicitSourceAccount(r)?this.#he(e,t):void 0}#pe(e,t,n){let{from:r}=n,{to:o}=n;try{if(n.type===Ds.Swap){const n=this.#ve(e,t);r=n.from,o=n.to}}catch{r=n.from,o=n.to}return{...n,from:r,to:o,fees:this.#fe.getBaseFees(e.feeCharged,e.scope),events:[...n.events,{status:e.status,timestamp:this.#Se(e)}],status:e.status}}#Ae(e,t){return{txId:e.id,account:t,scope:e.scope,status:e.status,fees:this.#fe.getBaseFees(e.feeCharged,e.scope),timestamp:this.#Se(e)}}#Ee(e){const{scope:t}=e,[n]=e.transactionOperations;if(n?.type===tr){const{destination:e,asset:r,amount:o}=n;return{toAddress:e,asset:this.#xe(r,t,o)}}return n?.type===qn?{toAddress:n.destination,asset:this.#xe(dn.Asset.native(),t,n.startingBalance)}:null}#me(e,t){const n=this.#Ee(e);if(n)return this.#fe.createTransaction({type:vu,request:{...this.#Ae(e,t),...n}});throw new Cs(\"Unable to map a send transaction\")}#he(e,t,n=Ds.Unknown){return this.#fe.createTransaction({type:wu,request:{...this.#Ae(e,t),transactionType:n,from:[],to:[]}})}#ve(e,t){const n=e.transactionOperations.findIndex(e=>ac(e)),r=e.transactionOperations[n];if(r&&ac(r)){const{scope:o}=e,i=this.#Te(e),{destination:a,sendAsset:s,destAsset:c}=r;let u,l;return r.type===er?(l=this.#ke(i,n)??r.destMin,u=r.sendAmount):(l=r.destAmount,u=this.#ke(i,n)??r.sendMax),this.#fe.createTransaction({type:hu,request:{...this.#Ae(e,t),toAddress:a,fromAsset:this.#xe(s,o,u),toAsset:this.#xe(c,o,l)}})}throw new Cs(\"Unable to map a swap transaction\")}#be(e,t,n){const r=e.transactionOperations,{scope:o}=e,[i]=r;if(i?.type===Nn){const r=i.line;if(!(r instanceof dn.Asset))throw new Cs(\"ChangeTrust line must be Stellar SAC Asset or Stellar Classic Asset\");return this.#fe.createTransaction({type:n,request:{...this.#Ae(e,t),asset:this.#xe(r,o,\"0\")}})}throw new Cs(\"Unable to map a change trust transaction\")}#we(e,t){if(e.status===Ms.Failed)return;const[n]=this.#Oe(e,t.address);if(n)return this.#fe.createTransaction({type:wu,request:{...this.#Ae(e,t),transactionType:Ds.Receive,from:[{address:e.sourceAccount,asset:n}],to:[{address:t.address,asset:n}]}});throw new Cs(\"Unable to map a receive transaction\")}#ye(e,t,n){const{scope:r}=e,[o]=e.transactionOperations;if(i=o,i?.type!==Gn)return;var i;if(!mc(o))return;const a=vc(o,r),{assetId:s,amount:c,toAccountId:u,fromAccountId:l}=a;if(l!==t.address)return;const f=n[s];if(!f)return;const p=this.#_e(f.symbol,f.assetId,Sn(c,f.units[0].decimals));return this.#fe.createTransaction({type:vu,request:{...this.#Ae(e,t),asset:p,toAddress:u}})}#ge(e,t){if(e.status===Ms.Failed||e.isSourceAccount(t.address))return;const n=e.rawData?.result_meta_xdr;if(!n)return;const r=function(e){try{const{resultMetaXdr:t,parseEvent:n}=e,r=dn.xdr.TransactionMeta.fromXDR(sr(t,\"base64\")),o=[];let i=[];switch(r.switch()){case 3:{const e=r.v3().sorobanMeta();i=e?[...e.events()]:[];break}case 4:i=r.v4().operations().flatMap(e=>[...e.events()])}for(const e of i){const t=n(e);null!==t&&o.push(t)}return o}catch{return[]}}({resultMetaXdr:n,parseEvent:n=>function(e,t,n){try{const r=e.body();if(0!==r.switch())return null;const o=r.v0(),i=o.topics().map(e=>(0,dn.scValToNative)(e));if(4!==i.length)return null;const[a,s,c,u]=i;if(\"transfer\"!==a||\"string\"!=typeof s||\"string\"!=typeof c||\"string\"!=typeof u||c!==t)return null;if(!gn.is(s)||!gn.is(c))return null;const l=(0,dn.scValToNative)(o.data());if(\"bigint\"!=typeof l&&\"number\"!=typeof l&&\"string\"!=typeof l)return null;const f=rc(n,u);return f?{fromAddress:s,toAddress:c,assetId:f,amount:wc(l)}:null}catch{return null}}(n,t.address,e.scope)}),[o]=r;if(!o)return;const i=this.#Ie(o.assetId,Sn(o.amount,7));return this.#fe.createTransaction({type:wu,request:{...this.#Ae(e,t),transactionType:Ds.Receive,from:[{address:o.fromAddress,asset:i}],to:[{address:t.address,asset:i}]}})}#Se(e){const t=e.rawData?.created_at?Math.floor(new Date(e.rawData.created_at).getTime()/1e3):void 0;return this.#fe.getCreateTime(t)}#Ie(e,t){const n=wa(e);return this.#_e(n?Jt:xa(function(e){const{assetReference:t}=st(e);return t}(e)).assetCode,e,t)}#xe(e,t,n){return this.#_e(e.getCode(),Ta(e,t),n)}#_e(e,t,n){return{unit:e,type:t,amount:An(n),fungible:!0}}#Oe(e,t){const n=e.transactionOperations,r=new Map,o=this.#Te(e);return n.forEach((n,i)=>{if(!sc(n,t))return;const a=this.#Ce(e,o,i);a&&r.set(a.type,a)}),Array.from(r.values())}#Ce(e,t,n){try{const{scope:r}=e,o=e.transactionOperations[n];if(!o)return null;if(o.type===tr)return this.#xe(o.asset,r,o.amount);if(o.type===qn)return this.#xe(dn.Asset.native(),r,o.startingBalance);if(o.type===Qn)return this.#xe(o.destAsset,r,o.destAmount);if(o.type===er){const e=this.#ke(t,n)??o.destMin;return this.#xe(o.destAsset,r,e)}}catch(t){this.#k.warn(\"Failed to get receive operation asset\",{error:t,transactionId:e.id,operationIndex:n})}return null}#Te(e){try{if(!e.rawData?.result_xdr)return null;const t=function(e,t){try{const n=dn.xdr.TransactionResult.fromXDR(sr(e,\"base64\")),r=n.feeCharged().toString(),o=[],i=n.result();if(\"txSuccess\"!==i.switch().name)return null;for(const e of i.results()){const n=e.tr(),{name:r}=n.value().switch();try{if(r===dc){const e=xc(n.pathPaymentStrictSendResult().success().last(),t);if(e){o.push({type:dc,amount:Sn(e.amount),asset:e.asset,destination:e.destination});continue}}else if(r===hc){const e=n.pathPaymentStrictReceiveResult().success(),r=Tc(e.offers()[0],e.last(),t);if(r){o.push({type:hc,amount:Sn(r.amount),asset:r.asset,destination:r.destination});continue}}o.push(null)}catch{o.push(null)}}return{operationResults:o,feeCharged:r}}catch(e){throw new Bs(\"Failed to parse successful transaction result\",{cause:e})}}(e.rawData?.result_xdr,e.scope);return t?.operationResults.length!==e.transactionOperations.length?null:t}catch(t){return this.#k.warn(\"Failed to parse successful transaction result\",{error:t,transactionId:e.id}),null}}#ke(e,t){const n=e?.operationResults[t];return!n||n?.type!==dc&&n?.type!==hc||void 0===n?.amount?null:n.amount}}function Tu(e,t){return e.source??t}function ku(e){return Xa({nativeBalance:e.nativeRawBalance,subentryCount:e.subentryCount,numSponsoring:e.numSponsoring,numSponsored:e.numSponsored})}function Ou(e,t){const n=e.accounts.get(t);if(void 0===n)throw new ps(`Account not loaded: ${t}`);return n}function _u(e,t){if(e instanceof dn.Asset)return Ta(e,t);throw new ps(\"Only native or alphanum Asset payments are supported for sequential validation\")}function Iu(e){const{account:t,accountId:n,assetId:r,amount:o}=e;if(wa(r)){const e=ku(t);if(e.isLessThan(o))throw new Os(e.toString(),o.toString(),r);return}const i=t.trustlines.get(r);if(void 0===i)throw new ws(r,n);if(!i.authorized)throw new bs(r,n);if(i.balance.isLessThan(o))throw new Os(i.balance.toString(),o.toString(),r)}function Cu(e){const{account:t,accountId:n,assetId:r,amount:o,balanceAfterDebit:i}=e;if(wa(r)){if((i??t.nativeRawBalance).plus(o).isGreaterThan(new M(Qt)))throw new ps(\"Payment would exceed maximum int64 balance for destination\");return}const a=t.trustlines.get(r);if(void 0===a)throw new ws(r,n);if(!a.authorized)throw new bs(r,n);if((i??a.balance).plus(o).isGreaterThan(a.limit))throw new Ss(r)}function Bu(e){const{account:t,assetId:n,amount:r}=e;if(wa(n))return void(t.nativeRawBalance=t.nativeRawBalance.minus(r));const o=t.trustlines.get(n);void 0!==o&&(o.balance=o.balance.minus(r))}function Pu(e){const{account:t,assetId:n,amount:r}=e;if(wa(n))return void(t.nativeRawBalance=t.nativeRawBalance.plus(r));const o=t.trustlines.get(n);void 0!==o&&(o.balance=o.balance.plus(r))}class Ru{validate(e,t){const n=t,{opIndex:r}=e,{assetId:o,payAmt:i,source:a,dest:s,sourceId:c,destId:u}=this.#Be(e,t);if(void 0===n.amount||null===n.amount)throw new ps(`Payment operation at index ${r} has no amount`);let l;if(c!==u&&nc(e.transaction,u,s.requiresMemo),Iu({account:a,accountId:c,assetId:o,amount:i}),c===u)if(wa(o))l=a.nativeRawBalance.minus(i);else{const e=a.trustlines.get(o);void 0!==e&&(l=e.balance.minus(i))}Cu({account:s,accountId:u,assetId:o,amount:i,balanceAfterDebit:l})}apply(e,t){const{assetId:n,payAmt:r,source:o,dest:i}=this.#Be(e,t);Bu({account:o,assetId:n,amount:r}),Pu({account:i,assetId:n,amount:r})}#Be(e,t){const{txSource:n,scope:r,state:o}=e,i=t,a=Tu(i,n),s=this.#Pe(i);return{sourceId:a,destId:s,payAmt:vn(new M(i.amount)),assetId:_u(i.asset,r),source:Ou(o,a),dest:Ou(o,s)}}#Pe(e){const{destination:t}=e;if(\"string\"==typeof t)return t;throw new ps(\"Unsupported payment destination type\")}}class ju{validate(e,t){const{source:n,sourceId:r,sendAssetId:o,sendAmount:i}=this.#Re(e,t),{dest:a,destId:s,destAssetId:c,destAmount:u}=this.#je(e,t);let l;if(r!==s&&nc(e.transaction,s,a.requiresMemo),Iu({account:n,accountId:r,assetId:o,amount:i}),r===s&&o===c)if(wa(o)&&wa(c))l=n.nativeRawBalance.minus(i);else if(!wa(c)){const e=n.trustlines.get(c);void 0!==e&&(l=e.balance.minus(i))}Cu({account:a,accountId:s,assetId:c,amount:u,balanceAfterDebit:l})}apply(e,t){const{source:n,sendAssetId:r,sendAmount:o}=this.#Re(e,t),{dest:i,destAssetId:a,destAmount:s}=this.#je(e,t);Bu({account:n,assetId:r,amount:o}),Pu({account:i,assetId:a,amount:s})}#Re(e,t){const{txSource:n,scope:r,state:o}=e,i=Tu(t,n),a=Ou(o,i),s=_u(t.sendAsset,r),c=t.type===er?t.sendAmount:t.sendMax;return{source:a,sourceId:i,sendAssetId:s,sendAmount:vn(new M(c))}}#je(e,t){const{scope:n,state:r}=e,{destination:o}=t,i=Ou(r,o),a=_u(t.destAsset,n),s=t.type===er?t.destMin:t.destAmount;return{dest:i,destId:o,destAssetId:a,destAmount:vn(new M(s))}}}class Uu{validate(e,t){const{state:n,opIndex:r,scope:o}=e;if(\"string\"!=typeof t.destination||0===t.destination.length)throw new ps(`CreateAccount at index ${r} has no destination`);const{source:i,destId:a,startingBalance:s}=this.#Be(e,t),c=vn(new M(1));if(s.isLessThan(c))throw new vs(s.toString());const u=ku(i);if(u.isLessThan(s))throw new Os(u.toString(),s.toString(),Ea(o));if(void 0!==n.accounts.get(a))throw new ps(`CreateAccount destination already exists in simulation: ${a}`)}apply(e,t){const{state:n}=e,{source:r,destId:o,startingBalance:i}=this.#Be(e,t);r.nativeRawBalance=r.nativeRawBalance.minus(i),n.accounts.set(o,{nativeRawBalance:i,subentryCount:0,numSponsoring:0,numSponsored:0,requiresMemo:!1,trustlines:new Map,sep41Balances:new Map})}#Be(e,t){const{txSource:n,state:r}=e,o=Tu(t,n),i=t.destination,a=vn(new M(t.startingBalance));return{source:Ou(r,o),destId:i,startingBalance:a}}}class Fu{validate(e,t){const{opIndex:n}=e;if(void 0===t.limit||null===t.limit||void 0===t.line||null===t.line)throw new As(`ChangeTrust at index ${n} is incomplete`);const{source:r,sourceId:o,assetId:i,trustlineLimit:a}=this.#Be(e,t),s=r.trustlines.get(i);if(a.isZero()){if(void 0===s)throw new ws(i,o);if(s.balance.isGreaterThan(0))throw new Es(`Cannot remove trustline for ${i}: balance must be zero`)}else{if(void 0===s){const e=ku(r),t=new M(Zt);if(e.isLessThan(t))throw new ks(e.toString(),t.toString());return}if(a.isLessThan(s.balance))throw new xs(`ChangeTrust limit cannot be below current balance for ${i}`)}}apply(e,t){const{source:n,assetId:r,trustlineLimit:o}=this.#Be(e,t),i=n.trustlines.get(r);if(!o.isZero())return void 0===i?(n.trustlines.set(r,{balance:new M(0),limit:o,authorized:!0,sponsored:!1}),void(n.subentryCount+=1)):void(i.limit=o);void 0!==i&&(n.subentryCount=Math.max(0,n.subentryCount-1),i.sponsored&&(n.numSponsored=Math.max(0,n.numSponsored-1)),n.trustlines.delete(r))}#Be(e,t){const{txSource:n,state:r,scope:o}=e,i=Tu(t,n),a=Ou(r,i),s=t.line;if(!(s instanceof dn.Asset))throw new As(`ChangeTrust line must be Stellar SAC Asset or Stellar Classic Asset, ${s.constructor.name} is not supported`);const c=va(o,s.getCode(),s.getIssuer()),u=new M(t.limit);return{source:a,sourceId:i,assetId:c,trustlineLimit:u.isZero()?new M(0):vn(u)}}}class Nu{validate(e,t){const{txSource:n,state:r,scope:o}=e,i=Tu(t,n),a=Ou(r,i);if(!mc(t))return;const s=vc(t,o),{fromAccountId:c,assetId:u,amount:l}=s;if(c!==i)throw new ps(\"SEP-41 transfer requires the sender account to be the same as the source account\");const f=a.sep41Balances.get(u);if(void 0===f)throw new ps(\"SEP-41 transfer requires a SEP-41 token balance on the sender account snapshot for this contract\");if(f.isLessThan(l))throw new Os(f.toString(),l.toString(),u)}apply(e,t){}}const Lu={Payment:\"payment\",PathPayment:\"pathPayment\",CreateAccount:\"createAccount\",ChangeTrust:\"changeTrust\",InvokeHostFunction:\"invokeHostFunction\"};class Mu{#Ue;constructor(){this.#Ue={payment:new Ru,pathPayment:new ju,createAccount:new Uu,changeTrust:new Fu,invokeHostFunction:new Nu}}simulate(e,t,n){const r=e.transactionOperations;return this.#Fe(r,t,e,n),this.#Ne({operations:r,transaction:e,initialState:this.#Le(t,n)})}#Ne(e){const{operations:t,initialState:n,transaction:r}=e,o=r.sourceAccount,i=r.feeSourceAccount,a=r.totalFee,{scope:s}=r,c=this.#Me({state:this.#De(n),feeSource:i,fee:a});return t.reduce((e,n,i)=>{const a=e[e.length-1];if(void 0===a)throw new ps(\"Simulation failed: missing state snapshot\");const c=this.#De(a);return this.#qe({op:n,opIndex:i,state:c,txSource:o,scope:s,operations:t,transaction:r}),this.#Ve({op:n,state:c,txSource:o,scope:s,opIndex:i}),e.push(c),e},[c])}#Fe(e,t,n,r){const{expectedOPTypes:o=[]}=r??{};tc(n),Js(n,t.scope),function(e,t){if(!e.isSourceAccount(t))throw new ps(\"Transaction does not involve this wallet account as source account or fee source\")}(n,t.accountId),Qs(n);const i=new Set(o),a=new Set(Object.values(Lu));this.#ze(e);for(const t of e)this.#Ke(t,a),this.#He(t,i)}#Le(e,t){const{preloadedAccounts:n}=t??{},r=this.#$e(e),o=new Map([[e.accountId,r]]);if(void 0!==n&&n.length>0)for(const e of n)o.has(e.accountId)||o.set(e.accountId,this.#$e(e));return{accounts:o}}#$e(e){const t=new Map,n=new Map;for(const r of e.assetIds){const o=e.getAsset(r);if(void 0!==o)if(Sa(r))n.set(r,o.balance);else if(Aa(r)){const{limit:e}=o;if(void 0===e||e.isLessThanOrEqualTo(0))continue;t.set(r,{balance:o.balance,limit:e,authorized:!1!==o.authorized,sponsored:!0===o.sponsored})}}return{nativeRawBalance:e.nativeRawBalance,subentryCount:e.subentryCount,numSponsoring:e.numSponsoring,numSponsored:e.numSponsored,requiresMemo:e.requiresMemo,trustlines:t,sep41Balances:n}}#Ke(e,t){const n=this.#Ge(e);if(null===n||!t.has(n))throw new ys(e.type)}#He(e,t){const n=this.#Ge(e);if(null===n)throw new ys(e.type);if(t.size>0&&!t.has(n))throw new ps(`Unexpected operation type ${e.type}, expected one of: ${Array.from(t).join(\", \")}`)}#ze(e){if(0===e.length)throw new ps(\"Transaction must have at least one operation\")}#Me(e){const{state:t,feeSource:n,fee:r}=e,o=Ou(t,n),i=ku(o);if(i.isLessThan(r))throw new Ts(i.toString(),r.toString());return o.nativeRawBalance=o.nativeRawBalance.minus(r),t}#qe(e){const{op:t,opIndex:n,state:r,txSource:o,scope:i,operations:a,transaction:s}=e,c=this.#We(t);this.#Ue[c].validate({state:r,txSource:o,scope:i,opIndex:n,transaction:s},t,a)}#Ve(e){const{op:t,state:n,txSource:r,scope:o,opIndex:i}=e,a=this.#We(t);return this.#Ue[a].apply({state:n,txSource:r,scope:o,opIndex:i},t),n}#De(e){const t=new Map;for(const[n,r]of e.accounts)t.set(n,this.#Xe(r));return{accounts:t}}#Xe(e){const t=new Map,n=new Map,{nativeRawBalance:r,subentryCount:o,numSponsoring:i,numSponsored:a,requiresMemo:s}=e;for(const[n,r]of e.trustlines)t.set(n,{balance:new M(r.balance.toString()),limit:new M(r.limit.toString()),authorized:r.authorized,sponsored:r.sponsored});for(const[t,r]of e.sep41Balances)n.set(t,new M(r.toString()));return{nativeRawBalance:new M(r.toString()),subentryCount:o,numSponsoring:i,numSponsored:a,requiresMemo:s,trustlines:t,sep41Balances:n}}#We(e){const t=this.#Ge(e);if(null===t)throw new ys(e.type);return t}#Ge(e){return e.type===Lu.Payment?Lu.Payment:e.type===Qn||e.type===er?Lu.PathPayment:e.type===Lu.CreateAccount?Lu.CreateAccount:e.type===Lu.ChangeTrust?Lu.ChangeTrust:e.type===Lu.InvokeHostFunction?Lu.InvokeHostFunction:null}}class Du{#Ze;#Ye;#q;#Je;#k;constructor({networkService:e,transactionMapper:t,transactionRepository:n,accountService:r,logger:o}){this.#q=e,this.#Ye=n,this.#Ze=t,this.#Je=r,this.#k=o.withPrefix(\"[💼 TransactionSynchronizeService]\")}async synchronize(e,t,n){if(0===e.length)return void this.#k.debug(\"No accounts to synchronize\");const r=Date.now();this.#k.debug(`Synchronize transactions started at ${r}`);try{const r=await this.#Qe(e,t,n);await this.#et(r),await this.#tt(r),await this.#nt(r)}finally{const e=Date.now();this.#k.debug(`Synchronize transactions completed at ${e} in ${e-r}ms`)}}async#Qe(e,t,n){const r=[],o=[],i=new Map;for(const{keyringAccount:t}of e)o.push(t.id),r.push(t),i.set(t.id,t);const[a,s,c]=await Promise.all([this.#rt(o,t),this.#ot(o,t),this.#it(t)]);return{scope:t,keyringAccounts:r,keyringAccountsById:i,allAccountsByAddress:c,pendingTransactionsById:a,lastScanTokenByAccountId:s,transactionsToSave:{},sep41AssetsMetadata:this.#at(n)}}async#it(e){const t=await this.#Je.listAccountsByScope(e),n=new Map;for(const e of t)n.set(e.address.toLowerCase(),e);return n}#at(e){return e.reduce((e,t)=>(e[t.assetId]=t,e),{})}async#ot(e,t){return this.#Ye.findLastScanTokenByAccountIds(e,t)}async#rt(e,t){const n=await this.#Ye.findStellarTransactionsByAccountIds(e,t),r=new Map;for(const e of n)cc(e.status)&&r.set(e.id,e);return this.#k.debug(\"Pending transactions loaded from snap state\",{noOfAccounts:e.length,noOfStoredTransactions:n.length,noOfPendingTransactions:r.size}),r}async#et(e){const t=await _a(e.keyringAccounts,10,async t=>{const n=e.lastScanTokenByAccountId[t.id]??null;return{keyringAccount:t,...await this.#st({address:t.address,lastScanToken:n,scope:e.scope})}});for(const n of t){if(\"rejected\"===n.status){this.#k.warn(\"Failed to fetch on-chain transactions\",n.reason),await ya(n.reason);continue}const{keyringAccount:t,transactions:r,nextScanToken:o}=n.value;let i=0;for(const n of r){const r=e.pendingTransactionsById.get(n.id),o=r?.account===t.id?r:void 0;o&&(e.pendingTransactionsById.delete(n.id),i+=1),this.#ct(e,{keyringAccount:t,onChainTransaction:n,pendingTransaction:o})}this.#k.debug(\"On-chain transactions mapped for account in scan\",{accountId:t.id,noOfPendingResolved:i,noOfOnChainTransactions:r.length}),e.lastScanTokenByAccountId={...e.lastScanTokenByAccountId,[t.id]:o}}}async#tt(e){const t=e.pendingTransactionsById.size;if(0===t)return;const n=Array.from(e.pendingTransactionsById.keys());this.#k.debug(\"Reconciling pending transactions\",{transactionIdsToFetch:n});const r=await _a(n,10,async t=>this.#ut(t,e.scope));for(const t of r){if(\"rejected\"===t.status){const n=t.reason;if(n instanceof rs){this.#lt(e,n.transactionHash);continue}this.#k.warn(\"Failed to fetch on-chain transaction\",{error:t.reason}),await ya(t.reason);continue}const n=t.value,r=e.pendingTransactionsById.get(n.id);if(!r){this.#k.warn(\"Pending transaction not found after fetch\",{transactionId:n.id});continue}const o=e.keyringAccountsById.get(r.account);o?(this.#ct(e,{keyringAccount:o,onChainTransaction:n,pendingTransaction:r}),e.pendingTransactionsById.delete(r.id)):this.#k.warn(\"Failed to find keyring account for pending transaction\",{transactionId:r.id,accountId:r.account})}const o=e.pendingTransactionsById.size;this.#k.debug(\"Pending transactions reconciled\",{noOfResolved:t-o,noOfRemaining:o})}#ct(e,t){const{keyringAccount:n,onChainTransaction:r,pendingTransaction:o}=t,i=this.#Ze.mapTransactionSafe({transaction:r,keyringAccount:n,transactionFromState:o,assetMetadata:e.sep41AssetsMetadata});i&&(Ca(e.transactionsToSave,n.id,i),this.#ft(e,{keyringTransaction:i,senderKeyringAccount:n}))}#ft(e,t){try{const{keyringTransaction:n,senderKeyringAccount:r}=t,o=this.#pt(n,r);if(!o)return;const i=e.allAccountsByAddress.get(o.toLowerCase());if(!i)return;const a=(0,w.cloneDeep)(n);if(a.type=Ds.Receive,a.account=i.id,a.events.length>1){const e=a.events.at(-1);a.events=e?[e]:a.events}Ca(e.transactionsToSave,i.id,a)}catch(e){this.#k.warn(\"Failed to append SEP-41 receive mapping\",{error:e})}}async#st(e){const{address:t,lastScanToken:n,scope:r}=e,o=n?Bn:Pn;this.#k.debug(\"Fetching on-chain transactions\",{address:t,lastScanToken:n,scope:r,order:o});const i=await this.#q.getTransactions({accountAddress:t,lastScanToken:n,scope:r,order:o,includeSelfTransactionsOnly:!1,includeFailed:!0});return{transactions:i,nextScanToken:this.#dt(i,o)??n}}async#ut(e,t){return this.#q.getTransaction(e,t)}#dt(e,t){if(0===e.length)return null;const n=t===Pn?0:-1;return e.at(n)?.rawData?.paging_token??null}async#nt(e){await this.#ht(e),await this.#yt(e)}async#yt(e){this.#k.debug(\"Saving transactions\");const t=Object.values(e.transactionsToSave).flat(),n=Array.from(e.pendingTransactionsById.values()),r={};for(const[t,n]of Object.entries(e.lastScanTokenByAccountId))r[t]={[e.scope]:n??null};await this.#Ye.saveMany(t.concat(n),r),this.#k.debug(\"Transactions saved\")}async#ht(e){const t=Object.values(e.transactionsToSave).flat();this.#k.debug(\"Emitting transactions updated event\",{noOfTransactions:t.length}),await pc(lc(t)),this.#k.debug(\"Transactions updated event emitted\")}#pt(e,t){const n=e.to?.[0],r=e.from?.[0],o=r?.asset,i=n?.asset;return e.type===Ds.Send&&n&&r&&Rs.is(o)&&Rs.is(i)&&e.status===Ms.Confirmed&&Ia(r.address,t.address)&&!Ia(r.address,n.address)&&Ia(o.type,i.type)&&Sa(o.type)?n.address:null}#lt(e,t){const n=e.pendingTransactionsById.get(t);if(!n)return;const r=(n.reconcileAttemptCount??0)+1;n.reconcileAttemptCount=r,e.pendingTransactionsById.set(t,n),fc(n)&&this.#k.debug(\"Pending transaction eligible for eviction on save after max reconcile attempts and max age are exceeded\",{transactionId:t,accountId:n.account,reconcileAttemptCount:r})}}function qu(e){const{confirmedTransaction:t,refreshedTransaction:n}=e;if(n.totalFee.gt(t.totalFee))throw new ps(\"Refreshed transaction fee exceeds confirmed fee\")}function Vu(e,t){return e instanceof Os?\"confirmation.txnError.insufficientBalance\":e instanceof Ts?\"confirmation.txnError.insufficientBalanceToCoverFee\":e instanceof ks?\"confirmation.txnError.insufficientBalanceToCoverBaseReserve\":e instanceof ms?\"confirmation.txnError.requiresMemo\":e instanceof vs?\"confirmation.txnError.invalidCreateAccountAmount\":e instanceof gs?\"confirmation.txnError.invalidCreateAccountAsset\":e instanceof bs?\"confirmation.txnError.trustlineNotAuthorized\":e instanceof ws?e.accountAddress===t?\"confirmation.txnError.trustlineNotFoundOnAccount\":\"confirmation.txnError.trustlineNotFound\":e instanceof Ss?\"confirmation.txnError.trustlineExceedLimit\":e instanceof Es?\"confirmation.txnError.trustlineNonZeroBalance\":e instanceof xs?\"confirmation.txnError.updateTrustlineLimit\":e instanceof hs?\"confirmation.txnError.expired\":\"confirmation.txnError.generic\"}function zu(e){const t=\"metamask:proof-of-ownership:\";if(!e.startsWith(t))throw new Error(`Message must start with \"${t}\"`);const n=e.slice(28),r=n.lastIndexOf(\":\");if(-1===r)throw new Error('Message must follow the format \"metamask:proof-of-ownership:{nonce}:{address}\"');const o=n.slice(0,r),i=n.slice(r+1);if(\"\"===o)throw new Error(\"Proof-of-ownership message must contain a non-empty nonce\");if(!hn.is(i))throw new Error(\"Invalid Stellar address in proof-of-ownership message\");return{nonce:o,address:i}}const Ku={OnAddressInput:\"onAddressInput\",OnAmountInput:\"onAmountInput\",ConfirmSend:\"confirmSend\",SignAndSendTransaction:\"signAndSendTransaction\",ComputeFee:\"computeFee\",SignProofOfOwnership:\"signProofOfOwnership\",ChangeTrustOpt:\"changeTrustOpt\"},Hu=\"Invalid\",$u=\"InsufficientBalance\",Gu=\"InsufficientBalanceToCoverFee\",Wu={Add:\"add\",Delete:\"delete\"},Xu=me(Object.values(Ku)),Zu=(pe(mn,Ie({params:Ie({accountId:$c})})),me(Object.values(Wu)),Ee({accountId:$c,assetId:ln,scope:ut})),Yu=pe(Zu,Ee({action:be(Wu.Add),limit:xe(Tn)})),Ju=pe(Zu,Ee({action:be(Wu.Delete)})),Qu=Fe(pe(mn,Ee({method:be(Ku.ChangeTrustOpt),params:Ce([Yu,Ju])})),\"change-trust-asset-id-scope-match\",({params:e})=>!(st(e.assetId).chainId!==String(e.scope))||`The chain implied by asset id ${e.assetId} does not match request scope ${e.scope}`),el=Ee({status:ge(),transactionId:xe(dr)}),tl=pe(mn,Ee({method:be(Ku.SignAndSendTransaction),params:Ee({transaction:lr,accountId:$c,scope:ut,options:Ee({visible:xe(ge()),type:xe(Oe()),sourceAssetId:pn,destAssetId:rt})})})),nl=Ee({transactionId:dr}),rl=pe(mn,Ee({method:be(Ku.OnAddressInput),params:Ee({value:hn})})),ol=(Ee({valid:ge(),errors:ye(Ee({code:Oe()}))}),Ee({accountId:$c,assetId:Ce([ln,fn,cn]),value:je(Oe()),to:xe(hn)})),il=pe(ol,Ee({scope:ut})),al=Fe(Ve(pe(mn,Ee({method:be(Ku.OnAmountInput),params:il})),pe(mn,Ee({method:be(Ku.OnAmountInput),params:ol})),e=>({...e,params:{...e.params,scope:st(e.params.assetId).chainId}})),\"on-amount-input-request\",({params:e})=>!!(Sa(e.assetId)&&En.is(e.value)||!Sa(e.assetId)&&xn.is(e.value))||\"Invalid amount\"),sl=Ee({valid:ge(),errors:ye(Ee({code:Oe()}))}),cl=Ee({fromAccountId:$c,toAddress:hn,assetId:Ce([ln,fn,cn]),amount:je(Oe())}),ul=Fe(Ve(pe(mn,Ee({method:be(Ku.ConfirmSend),params:pe(cl,Ee({accountId:$c,scope:ut}))})),pe(mn,Ee({method:be(Ku.ConfirmSend),params:cl})),e=>({...e,params:{...e.params,accountId:e.params.fromAccountId,scope:st(e.params.assetId).chainId}})),\"confirm-send-request\",({params:e})=>!!(Sa(e.assetId)&&En.is(e.amount)||!Sa(e.assetId)&&xn.is(e.amount))||\"Invalid amount\"),ll=Ee({valid:ge(),errors:ye(Ee({code:Oe()})),transactionId:xe(dr)}),fl=pe(mn,Ee({method:be(Ku.ComputeFee),params:Ee({transaction:lr,accountId:$c,scope:ut,options:xe(Ee({visible:xe(ge()),type:xe(Oe()),feeLimit:xe(Re(ve(),0))}))})})),pl=ye(Ee({type:me(Object.values(Ns)),asset:Us})),dl=Fe(Oe(),\"ProofOfOwnershipMessage\",e=>{try{return zu(e),!0}catch(e){return e instanceof Error?e.message:\"Invalid proof-of-ownership message\"}}),hl=Ve(pe(mn,Ee({method:be(Ku.SignProofOfOwnership),params:Ee({accountId:$c,message:dl,nonce:je(Oe()),address:hn})})),pe(mn,Ee({method:be(Ku.SignProofOfOwnership),params:Ee({accountId:$c,message:dl})})),e=>({...e,params:{...e.params,...zu(e.params.message)}})),yl=Ee({signature:Ue(Oe(),/^0x[0-9a-f]{128}$/u)}),gl=\"insufficientbalance\",ml=\"invalidtransaction\",vl=\"notrustline\",bl=\"transactionexpired\",wl={Simulation:\"simulation\",Validation:\"validation\"},Sl={Benign:\"Benign\",Warning:\"Warning\",Malicious:\"Malicious\"},Al={In:\"in\",Out:\"out\"},El=Ie({accountAddress:Oe(),origin:Oe(),scope:me(Object.values(ct)),transaction:Oe()}),xl=Ie({accountAddress:je(Oe()),origin:Oe(),scope:me(Object.values(ct)),transaction:cr,options:xe(ye(me(Object.values(wl))))}),Tl=Ie({raw_value:Ae(),value:Ae(),summary:xe(Se(Oe())),usd_price:xe(Se(Ae()))}),kl=Ie({type:be(\"ASSET\"),code:Oe(),issuer:Oe(),org_name:Oe(),org_url:Oe()}),Ol=Ie({type:be(\"NATIVE\"),code:be(\"XLM\")}),_l=Ie({type:be(\"SEP41\"),address:Oe(),name:Oe(),symbol:Oe(),decimals:Ae()}),Il=Ie({type:Oe()}),Cl=Ie({asset:Ce([Ol,kl,_l,Il]),asset_type:Oe(),in:xe(Se(Tl)),out:xe(Se(Tl))}),Bl=Ie({status:be(\"Success\"),account_summary:Ie({account_assets_diffs:xe(ye(Cl)),account_exposures:xe(ye(Be())),account_ownerships_diff:xe(ye(Be())),total_usd_diff:xe(Ie({in:Ae(),out:Ae(),total:xe(Ae())}))}),assets_ownership_diff:xe(ke(Oe(),Be())),address_details:xe(ye(Be())),assets_diffs:xe(ke(Oe(),ye(Cl))),exposures:xe(ke(Oe(),ye(Be())))}),Pl=Ie({status:be(\"Error\"),error:Oe()}),Rl=Ie({status:be(\"Success\"),result_type:me(Object.values(Sl)),classification:xe(Oe()),description:xe(Oe()),reason:xe(Oe()),features:xe(ye(Be()))}),jl=Ie({status:be(\"Error\"),error:Oe()}),Ul=Ie({simulation:xe(Se(Ce([Bl,Pl]))),validation:xe(Se(Ce([Rl,jl])))}),Fl=Ie({type:me(Object.values(Al)),value:Se(Oe()),price:Se(Ae()),symbol:Oe(),name:Oe(),logo:Se(Oe())}),Nl=Ie({type:Se(me(Object.values(Sl))),reason:Se(Oe()),description:Se(Oe())}),Ll=Ie({type:Se(me(Object.values([\"simulation\",\"validation\",\"response\"]))),code:Se(Oe()),message:Se(Oe())}),Ml=Ie({status:me([\"SUCCESS\",\"ERROR\"]),estimatedChanges:Ie({assets:ye(Fl)}),validation:Se(Nl),error:Se(Ll)});class Dl extends na{}function ql(e){return e&&\"string\"==typeof e?e.replace(/[\\u0000-\\u0008\\u000A-\\u001F\\u007F]/gu,\"\"):\"\"}function Vl(e){const{baseUrl:t,path:n,pathParams:r,queryParams:o,encodePathParams:i=!0}=e,a=function(e){if(!e||\"string\"!=typeof e)return\"\";const t=ql(e);try{const e=new URL(t);return![\"http:\",\"https:\",\"wss:\",\"ipfs:\"].includes(e.protocol)||t.length>2048?\"\":t}catch{return\"\"}}(t);if(\"\"===a)throw new Error(\"Invalid URL format\");ne(a,Ne);const s=n.replace(/\\{(\\w+)\\}/gu,(e,t)=>{const n=r?.[t];if(void 0===n)throw new Error(`Path parameter ${t} is undefined`);const o=ql(n);return i?encodeURIComponent(o):o}).replace(/^\\/+/u,\"\").replace(/\\/+/gu,\"/\").replace(/\\/+$/u,\"\"),c=a.endsWith(\"/\")?a:`${a}/`,u=new URL(s,c);Object.entries(o??{}).filter(([e,t])=>void 0!==t).filter(([e,t])=>null!==t).forEach(([e,t])=>{if(t){const n=ql(t);u.searchParams.append(e,n)}});const l=u.toString();return ne(l,Ne),l}const zl={[ct.Mainnet]:\"pubnet\",[ct.Testnet]:\"testnet\"};const Kl='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\" viewBox=\"0 0 100 100\"><path d=\"M50 100c27.613 0 50-22.387 50-50S77.613 0 50 0 0 22.387 0 50s22.387 50 50 50m0 0\" style=\"stroke:none;fill-rule:nonzero;fill:#000;fill-opacity:1\"/><path d=\"m72.281 29.04-7.5 3.823L28.54 51.32a21.56 21.56 0 0 1 1.719-11.644 21.56 21.56 0 0 1 7.578-9.012 21.55 21.55 0 0 1 11.176-3.7 21.6 21.6 0 0 1 11.457 2.716l4.293-2.188.64-.328a26.4 26.4 0 0 0-13.93-4.98 26.38 26.38 0 0 0-24.796 13.855 26.4 26.4 0 0 0-3.059 14.477 4.78 4.78 0 0 1-.601 2.714 4.8 4.8 0 0 1-2.004 1.922l-2.266 1.157v5.386l6.668-3.398 2.16-1.102 2.13-1.086L67.91 36.641l4.293-2.184 8.875-4.523V24.55Zm8.801 6.284L31.879 60.375l-4.293 2.188-8.836 4.507v5.387l8.773-4.469 7.504-3.824L71.31 45.676a21.6 21.6 0 0 1-1.707 11.668 21.64 21.64 0 0 1-7.586 9.031 21.6 21.6 0 0 1-22.672.957l-.266.14-4.656 2.376a26.37 26.37 0 0 0 28.36 1.676 26.34 26.34 0 0 0 10.374-10.555 26.4 26.4 0 0 0 3.055-14.48 4.76 4.76 0 0 1 .602-2.712 4.8 4.8 0 0 1 2-1.925l2.269-1.157Zm0 0\" style=\"stroke:none;fill-rule:nonzero;fill:#fff;fill-opacity:1\"/></svg>';function Hl(e){return Vl({baseUrl:Ar.api.staticApi.baseUrl,path:\"/api/v2/tokenIcons/assets/{assetId}.png\",pathParams:{assetId:e.replace(/:/gu,\"/\")},encodePathParams:!1})}function $l(e){const t=e.name??e.symbol,{assetNamespace:n,chainId:r}=st(e.assetId);return{assetId:e.assetId,name:t,symbol:e.symbol,chainId:r,assetType:n,fungible:!0,iconUrl:Hl(e.assetId),units:[{name:t,symbol:e.symbol,decimals:e.decimals}]}}function Gl(e){return $l({assetId:Ea(e),decimals:7,symbol:Jt,name:\"XLM\"})}function Wl(e){const t=new Map,n=new Map,r=new Set;for(const o of e){if(r.has(o))continue;r.add(o);const{chainId:e}=st(o);ne(e,ut),wa(o)?(n.has(e)||n.set(e,[]),n.get(e)?.push(o)):(t.has(e)||t.set(e,[]),t.get(e)?.push(o))}return{nativeAssets:n,assets:t}}const Xl={Initial:\"initial\",Fetching:\"fetching\",Fetched:\"fetched\",Error:\"error\"},Zl=Ie({tokenPrices:ke(Ce([fn,ln,cn]),Se(Oe())),tokenPricesFetchStatus:me(Object.values(Xl)),currency:je(Oe())}),Yl=Ie({useSecurityAlerts:ge(),simulateOnChainActions:ge()}),Jl=Ie({preferences:Yl,scan:xe(Se(Ml)),scanFetchStatus:me(Object.values(Xl)),securityScanRequest:xe(El),securityScanning:ge(),remoteSimulation:ge()}),Ql=Ie({transaction:je(cr),transactionsFetchStatus:me(Object.values(Xl)),accountId:$c,scope:ut,request:Ce([ul,Qu])}),ef={ChangeTrustlineOptIn:\"ChangeTrustlineOptIn\",ChangeTrustlineOptOut:\"ChangeTrustlineOptOut\",SignMessage:\"SignMessage\",SignTransaction:\"SignTransaction\",SignAuthEntry:\"SignAuthEntry\",ConfirmSendTransaction:\"ConfirmSendTransaction\"},tf=me(Object.values(ef)),nf={Prices:\"prices\",Scan:\"scan\",Transaction:\"transaction\"},rf=me(Object.values(nf)),of={SynchronizeAssets:\"synchronizeAssets\",SynchronizeAccounts:\"synchronizeAccounts\",TrackTransaction:\"trackTransaction\",RefreshConfirmationContext:\"refreshConfirmationContext\"},af=me(Object.values(of)),sf=Ie({scope:ut,interfaceId:je(Oe()),interfaceKey:tf,refresherKeys:je(ye(rf))}),cf=pe(mn,Ee({method:be(of.RefreshConfirmationContext),params:sf})),uf=Ie({txId:dr,accountIdsOrAddresses:Ce([je(_e([$c])),je(_e([$c,hn]))]),scope:ut,attempt:xe(function(e,t,n=t){const r=`Expected a ${e.type}`,o=t===n?`of \\`${t}\\``:`between \\`${t}\\` and \\`${n}\\``;return Fe(e,\"size\",e=>{if(\"number\"==typeof e||e instanceof Date)return t<=e&&e<=n||`${r} ${o} but received \\`${e}\\``;if(e instanceof Map||e instanceof Set){const{size:i}=e;return t<=i&&i<=n||`${r} with a size ${o} but received one with a size of \\`${i}\\``}const{length:i}=e;return t<=i&&i<=n||`${r} with a length ${o} but received one with a length of \\`${i}\\``})}(ve(),0,Ar.transaction.trackTransactionMaxReschedules))}),lf=Ee({accountIds:xe(Ce([je(ye($c)),be(\"selected\")]))}),ff=pe(mn,Ee({method:be(of.TrackTransaction),params:uf})),pf=pe(mn,Ee({method:be(of.SynchronizeAccounts),params:xe(lf)})),df=Ee({}),hf=pe(mn,Ee({method:be(of.SynchronizeAssets),params:xe(df)})),yf=Ee({status:ge()});class gf{requestStruct;responseStruct;logger;constructor({logger:e,requestStruct:t,responseStruct:n}){this.logger=e,this.requestStruct=t,this.responseStruct=n}async handle(e){this.logger.debug(\"Handling request\",{request:ma({value:e})});const t=xi(e,this.requestStruct);this.logger.debug(\"Starting handle transformed request\",{request:ma({value:t})});const n=await this.handleRequest(t);return this.logger.debug(\"Handled request\",{result:ma({value:n})}),Ti(n,this.responseStruct),n}}class mf extends gf{constructor({logger:e,requestStruct:t}){super({logger:e,requestStruct:t,responseStruct:yf})}async handleRequest(e){return await this.handleCronJobRequest(e),{status:!0}}}class vf extends mf{static async scheduleBackgroundEvent(e,t=Ri){await Ki({method:of.SynchronizeAccounts,params:e,duration:t})}#gt;#Je;constructor({logger:e,synchronizeService:t,accountService:n}){super({logger:e.withPrefix(\"[SyncAccountsHandler]\"),requestStruct:pf}),this.#gt=t,this.#Je=n}async handleCronJobRequest(e){const t=Ar.selectedNetwork,n=e.params?.accountIds??\"selected\";let r=[];\"selected\"===n?(this.logger.debug(\"Synchronizing selected accounts\"),r=await this.#Je.getAllSelected()):(this.logger.debug(\"Synchronizing accounts by IDs\",{accountIds:n}),r=await this.#Je.findByIds(n)),await this.#gt.synchronize(r,{scope:t})}}const bf=Fe(Oe(),\"utf8\",e=>{try{return(new TextEncoder).encode(e),!0}catch{return\"Invalid UTF-8 string\"}}),wf={SignMessage:\"signMessage\",SignTransaction:\"signTransaction\",SignAuthEntry:\"signAuthEntry\"},Sf=me(Object.values(wf)),Af=(xe(Ee({entropySource:xe(je(Oe())),index:xe(Re(ve(),0)),addressType:xe(je(Oe())),scope:xe(je(Oe())),metamask:xe(Ee({correlationId:xe(Oe())}))})),Ee({jsonrpc:be(\"2.0\"),id:Ce([Oe(),Ae(),be(null)]),method:Sf,params:Ie({opts:Ie({address:hn})})})),Ef=Ee({request:Af,scope:ut}),xf=Ee({networkPassphrase:xe(Fe(je(Oe()),\"mainnet-passphrase\",e=>{try{return _c(e)===ct.Mainnet||`Only Stellar mainnet is supported, received passphrase: ${e}`}catch{return`Unknown network passphrase: ${e}`}})),address:xe(hn)}),Tf=Ee({message:je(Oe()),code:Ae(),ext:xe(ye(Oe()))}),kf=pe(Dr,Ee({request:Ee({method:be(wf.SignMessage),params:Ee({message:je(bf),opts:xe(xf)})}),scope:be(ct.Mainnet),account:$c})),Of=Ee({signedMessage:Ce([je(Cn(Oe())),be(\"\")]),signerAddress:Ce([hn,be(\"\")]),error:Tf}),_f=Ce([Of,Ee({signedMessage:je(Cn(Oe())),signerAddress:hn})]),If=pe(Dr,Ee({request:Ee({method:be(wf.SignTransaction),params:Ee({xdr:cr,opts:xe(xf)})}),scope:be(ct.Mainnet),account:$c})),Cf=Ee({accountId:$c,pagination:Ee({limit:Re(ve(),1),next:xe(Se($c))})}),Bf=Ee({signedTxXdr:Ce([cr,be(\"\")]),signerAddress:Ce([hn,be(\"\")]),error:Tf}),Pf=Ce([Bf,Ee({signedTxXdr:cr,signerAddress:hn})]),Rf=pe(Dr,Ee({request:Ee({method:be(wf.SignAuthEntry),params:Ee({authEntry:pr,opts:xe(xf)})}),scope:be(ct.Mainnet),account:$c})),jf=Ee({signedAuthEntry:Ce([je(Cn(Oe())),be(\"\")]),signerAddress:Ce([hn,be(\"\")]),error:Tf}),Uf=Ce([jf,Ee({signedAuthEntry:je(Cn(Oe())),signerAddress:hn})]),Ff=$c,Nf=Ee({accountId:$c,options:ze(Ee({type:be(\"private-key\"),encoding:ze(me([Xt]),Xt)}),{type:\"private-key\",encoding:Xt})}),Lf=$c,Mf=$c,Df=ye($c),qf=Ee({accountId:$c,assets:ye(Ce([fn,ln,cn]))});class Vf extends na{}class zf extends Vf{}const Kf=-1,Hf=-2,$f=-3,Gf=-4,Wf={[Kf]:\"The wallet encountered an internal error. Please try again or contact the wallet if the problem persists.\",[Hf]:\"An error occurred with an external service. Please try again.\",[$f]:\"Request is invalid. Please check the details and try again.\",[Gf]:\"The user rejected this request.\"};class Xf extends Error{code;ext;constructor(e){super(e.message??Wf[e.code]),this.name=\"Sep43Error\",this.code=e.code,this.ext=e.ext}toJSON(){return{message:this.message,code:this.code,...void 0===this.ext?{}:{ext:this.ext}}}}const Zf=\"confirm-send-transaction-cancel\",Yf=\"confirm-send-transaction-confirm\";function Jf(){return{[Zf]:async e=>async function(e){const{id:t}=e;await Xi(t,!1)}(e),[Yf]:async e=>async function(e){const{id:t}=e;await Xi(t,!0)}(e)}}const Qf=\"confirm-sign-auth-entry-cancel\",ep=\"confirm-sign-auth-entry-confirm\";function tp(){return{[Qf]:async e=>async function(e){const{id:t}=e;await Xi(t,!1)}(e),[ep]:async e=>async function(e){const{id:t}=e;await Xi(t,!0)}(e)}}const np=\"confirm-sign-change-trust-opt-in-cancel\",rp=\"confirm-sign-change-trust-opt-in-confirm\";function op(){return{[np]:async e=>async function(e){const{id:t}=e;await Xi(t,!1)}(e),[rp]:async e=>async function(e){const{id:t}=e;await Xi(t,!0)}(e)}}const ip=\"confirm-sign-change-trust-opt-out-cancel\",ap=\"confirm-sign-change-trust-opt-out-confirm\";function sp(){return{[ip]:async e=>async function(e){const{id:t}=e;await Xi(t,!1)}(e),[ap]:async e=>async function(e){const{id:t}=e;await Xi(t,!0)}(e)}}const cp=\"confirm-sign-message-cancel\",up=\"confirm-sign-message-confirm\";function lp(){return{[cp]:async e=>async function(e){const{id:t}=e;await Xi(t,!1)}(e),[up]:async e=>async function(e){const{id:t}=e;await Xi(t,!0)}(e)}}const fp=\"confirm-sign-transaction-cancel\",pp=\"confirm-sign-transaction-confirm\";function dp(){return{[fp]:async e=>async function(e){const{id:t}=e;await Xi(t,!1)}(e),[pp]:async e=>async function(e){const{id:t}=e;await Xi(t,!0)}(e)}}const hp={[ct.Mainnet]:\"Mainnet\",[ct.Testnet]:\"Testnet\"};function yp(e){return hp[e]??\"Unknown\"}const gp={metamask:\"MetaMask\",\"wallet-connect\":\"WalletConnect\"};function mp(e){if(!e)return\"Unknown\";const t=gp[e.toLowerCase()];if(t)return t;try{const t=new URL(e);return function(e){return\"http:\"===e.protocol||\"https:\"===e.protocol}(t)?t.hostname:\"\"}catch{return\"\"}}function vp(e){return`${Ar.networks[Ar.selectedNetwork].explorerBaseUrl}/account/${e}`}function bp(e){return`${Ar.networks[Ar.selectedNetwork].explorerBaseUrl}/asset/${e}`}function wp(e,t){return`${e}:${t}`}function Sp(e,t){const n=Gl(e),r=Sn(new M(t));return{assetId:n.assetId,symbol:n.symbol,iconUrl:n.iconUrl,amount:r}}function Ap(e){const{preferences:t,scan:n}=e;return t.useSecurityAlerts&&n?.validation?.type===Sl.Malicious}function Ep(e){return e.useSecurityAlerts||e.simulateOnChainActions}function xp(e){return e===Xl.Error}function Tp(e){return function(e){return e.scanFetchStatus===Xl.Fetching}({scanFetchStatus:e.scanFetchStatus??Xl.Initial})||xp(e.transactionsFetchStatus)}const kp=\"none\",Op=\"transaction-validation\",_p=\"transaction-scan\";function Ip(e,t){const n=rc(e,t);if(null===n)return null;if(\"native\"===t){return{assetId:n,symbol:Gl(e).symbol,iconUrl:Kl}}const{assetCode:r}=xa(t);return{assetId:n,symbol:r,link:bp(t)}}function Cp(e,t){const n=e.find(e=>e.key===t)?.value;return n??null}function Bp(e,t,n){if(\"string\"==typeof e)throw new Error(`An HTML element (\"${String(e)}\") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error(\"A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.\");return e({...t,key:n})}function Pp(e,t,n){return Bp(e,t,n)}function Rp(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}function jp(e){return t=>{const{key:n=null,...r}=t;return{type:e,props:Rp(r),key:n}}}const Up=jp(\"Container\"),Fp=jp(\"Box\"),Np=jp(\"Heading\"),Lp=jp(\"Section\"),Mp=jp(\"Text\"),Dp=jp(\"Tooltip\");var qp;!function(e){e.Accessibility=\"accessibility\",e.Activity=\"activity\",e.AddCard=\"add-card\",e.AddCircle=\"add-circle\",e.AddSquare=\"add-square\",e.Add=\"add\",e.Ai=\"ai\",e.AlternateEmail=\"alternate-email\",e.Apple=\"apple\",e.Apps=\"apps\",e.Arrow2Down=\"arrow-2-down\",e.Arrow2Left=\"arrow-2-left\",e.Arrow2Right=\"arrow-2-right\",e.Arrow2UpRight=\"arrow-2-up-right\",e.Arrow2Up=\"arrow-2-up\",e.ArrowCircleDown=\"arrow-circle-down\",e.ArrowCircleUp=\"arrow-circle-up\",e.ArrowDoubleLeft=\"arrow-double-left\",e.ArrowDoubleRight=\"arrow-double-right\",e.ArrowDown=\"arrow-down\",e.ArrowDropDownCircle=\"arrow-drop-down-circle\",e.ArrowLeft=\"arrow-left\",e.ArrowRight=\"arrow-right\",e.ArrowUp=\"arrow-up\",e.Attachment=\"attachment\",e.Ban=\"ban\",e.BankAssured=\"bank-assured\",e.Bank=\"bank\",e.Bold=\"bold\",e.Book=\"book\",e.Bookmark=\"bookmark\",e.Bridge=\"bridge\",e.Briefcase=\"briefcase\",e.Bulb=\"bulb\",e.BuySell=\"buy-sell\",e.Cake=\"cake\",e.Calculator=\"calculator\",e.Calendar=\"calendar\",e.Call=\"call\",e.Camera=\"camera\",e.Campaign=\"campaign\",e.CardPos=\"card-pos\",e.Card=\"card\",e.Cash=\"cash\",e.Category=\"category\",e.Chart=\"chart\",e.CheckBold=\"check-bold\",e.Check=\"check\",e.CircleX=\"circle-x\",e.ClockFilled=\"clock-filled\",e.Clock=\"clock\",e.Close=\"close\",e.CloudDownload=\"cloud-download\",e.CloudUpload=\"cloud-upload\",e.Cloud=\"cloud\",e.CodeCircle=\"code-circle\",e.Code=\"code\",e.Coin=\"coin\",e.Collapse=\"collapse\",e.Confirmation=\"confirmation\",e.Connect=\"connect\",e.CopySuccess=\"copy-success\",e.Copy=\"copy\",e.CreditCheck=\"credit-check\",e.CurrencyFranc=\"currency-franc\",e.CurrencyLira=\"currency-lira\",e.CurrencyPound=\"currency-pound\",e.CurrencyYuan=\"currency-yuan\",e.Customize=\"customize\",e.Danger=\"danger\",e.DarkFilled=\"dark-filled\",e.Dark=\"dark\",e.Data=\"data\",e.Description=\"description\",e.Details=\"details\",e.Diagram=\"diagram\",e.DocumentCode=\"document-code\",e.Download=\"download\",e.Draft=\"draft\",e.EcoLeaf=\"eco-leaf\",e.EditSquare=\"edit-square\",e.Edit=\"edit\",e.EncryptedAdd=\"encrypted-add\",e.Eraser=\"eraser\",e.Error=\"error\",e.Ethereum=\"ethereum\",e.Exchange=\"exchange\",e.ExpandVertical=\"expand-vertical\",e.Expand=\"expand\",e.ExploreFilled=\"explore-filled\",e.Explore=\"explore\",e.Export=\"export\",e.Extension=\"extension\",e.EyeSlash=\"eye-slash\",e.Eye=\"eye\",e.FaceId=\"face-id\",e.Feedback=\"feedback\",e.File=\"file\",e.Filter=\"filter\",e.Fingerprint=\"fingerprint\",e.Fire=\"fire\",e.FirstPage=\"first-page\",e.Flag=\"flag\",e.FlashSlash=\"flash-slash\",e.Flash=\"flash\",e.Flask=\"flask\",e.Flower=\"flower\",e.Folder=\"folder\",e.Forest=\"forest\",e.FullCircle=\"full-circle\",e.Gas=\"gas\",e.Gift=\"gift\",e.GlobalSearch=\"global-search\",e.Global=\"global\",e.Graph=\"graph\",e.Hardware=\"hardware\",e.HashTag=\"hash-tag\",e.HeartFilled=\"heart-filled\",e.Heart=\"heart\",e.Hierarchy=\"hierarchy\",e.HomeFilled=\"home-filled\",e.Home=\"home\",e.Image=\"image\",e.Info=\"info\",e.Inventory=\"inventory\",e.Joystick=\"joystick\",e.KeepFilled=\"keep-filled\",e.Keep=\"keep\",e.Key=\"key\",e.LastPage=\"last-page\",e.LightFilled=\"light-filled\",e.Light=\"light\",e.Link=\"link\",e.Loading=\"loading\",e.Location=\"location\",e.LockSlash=\"lock-slash\",e.Lock=\"lock\",e.LockedFilled=\"locked-filled\",e.Login=\"login\",e.Logout=\"logout\",e.Mail=\"mail\",e.Map=\"map\",e.Menu=\"menu\",e.MessageQuestion=\"message-question\",e.Messages=\"messages\",e.Mic=\"mic\",e.MinusBold=\"minus-bold\",e.MinusSquare=\"minus-square\",e.Minus=\"minus\",e.Mobile=\"mobile\",e.MoneyBag=\"money-bag\",e.Money=\"money\",e.Monitor=\"monitor\",e.MoreHorizontal=\"more-horizontal\",e.MoreVertical=\"more-vertical\",e.MountainFlag=\"mountain-flag\",e.MusicNote=\"music-note\",e.Notification=\"notification\",e.PageInfo=\"page-info\",e.Palette=\"palette\",e.PasswordCheck=\"password-check\",e.Pending=\"pending\",e.People=\"people\",e.PersonCancel=\"person-cancel\",e.Pin=\"pin\",e.Plant=\"plant\",e.Plug=\"plug\",e.PlusAndMinus=\"plus-and-minus\",e.PolicyAlert=\"policy-alert\",e.Print=\"print\",e.PriorityHigh=\"priority-high\",e.PrivacyTip=\"privacy-tip\",e.ProgrammingArrows=\"programming-arrows\",e.Publish=\"publish\",e.QrCode=\"qr-code\",e.Question=\"question\",e.Receive=\"receive\",e.Received=\"received\",e.Refresh=\"refresh\",e.RemoveMinus=\"remove-minus\",e.Report=\"report\",e.Rocket=\"rocket\",e.SaveFilled=\"save-filled\",e.Save=\"save\",e.Saving=\"saving\",e.ScanBarcode=\"scan-barcode\",e.ScanFocus=\"scan-focus\",e.Scan=\"scan\",e.Search=\"search\",e.SecurityAlert=\"security-alert\",e.SecurityCross=\"security-cross\",e.SecurityKey=\"security-key\",e.SecuritySearch=\"security-search\",e.SecuritySlash=\"security-slash\",e.SecurityTick=\"security-tick\",e.SecurityTime=\"security-time\",e.SecurityUser=\"security-user\",e.Security=\"security\",e.Send=\"send\",e.SentimentDissatisfied=\"sentiment-dissatisfied\",e.SentimentNeutral=\"sentiment-neutral\",e.SentimentSatisfied=\"sentiment-satisfied\",e.SentimentVerySatisfied=\"sentiment-very-satisfied\",e.SettingFilled=\"setting-filled\",e.Setting=\"setting\",e.Share=\"share\",e.ShieldLock=\"shield-lock\",e.ShoppingBag=\"shopping-bag\",e.ShoppingCart=\"shopping-cart\",e.SignalCellular=\"signal-cellular\",e.Slash=\"slash\",e.Sms=\"sms\",e.SnapsMobile=\"snaps-mobile\",e.SnapsPlus=\"snaps-plus\",e.SnapsRound=\"snaps-round\",e.Snaps=\"snaps\",e.SortByAlpha=\"sort-by-alpha\",e.Sort=\"sort\",e.Sparkle=\"sparkle\",e.Speed=\"speed\",e.Speedometer=\"speedometer\",e.Square=\"square\",e.Stake=\"stake\",e.StarFilled=\"star-filled\",e.Star=\"star\",e.Start=\"start\",e.Storefront=\"storefront\",e.Student=\"student\",e.SwapHorizontal=\"swap-horizontal\",e.SwapVertical=\"swap-vertical\",e.TabClose=\"tab-close\",e.TableRow=\"table-row\",e.Tablet=\"tablet\",e.Tag=\"tag\",e.ThumbDownFilled=\"thumb-down-filled\",e.ThumbDown=\"thumb-down\",e.ThumbUpFilled=\"thumb-up-filled\",e.ThumbUp=\"thumb-up\",e.Tint=\"tint\",e.Tooltip=\"tooltip\",e.Translate=\"translate\",e.Trash=\"trash\",e.TrendDown=\"trend-down\",e.TrendUp=\"trend-up\",e.TriangleUp=\"triangle-up\",e.TriangleDown=\"triangle-down\",e.Undo=\"undo\",e.Unfold=\"unfold\",e.UnlockedFilled=\"unlocked-filled\",e.Unpin=\"unpin\",e.UploadFile=\"upload-file\",e.Upload=\"upload\",e.Usb=\"usb\",e.UserCheck=\"user-check\",e.UserCircleAdd=\"user-circle-add\",e.UserCircleRemove=\"user-circle-remove\",e.UserCircle=\"user-circle\",e.User=\"user\",e.VerifiedFilled=\"verified-filled\",e.Verified=\"verified\",e.Videocam=\"videocam\",e.ViewColumn=\"view-column\",e.ViewInAr=\"view-in-ar\",e.VolumeOff=\"volume-off\",e.VolumeUp=\"volume-up\",e.WalletFilled=\"wallet-filled\",e.Wallet=\"wallet\",e.Warning=\"warning\",e.WebTraffic=\"web-traffic\",e.Widgets=\"widgets\",e.WifiOff=\"wifi-off\",e.Wifi=\"wifi\",e.X=\"x\"}(qp||(qp={}));const Vp=jp(\"Icon\"),zp=jp(\"Link\"),Kp=jp(\"Address\"),Hp=jp(\"Skeleton\"),$p=jp(\"Image\"),Gp={sm:16,md:24,lg:32,xl:48},Wp=e=>{const{iconUrl:t,size:n=\"md\"}=e,r=void 0===t||\"\"===(0,w.trim)(t)?'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\" width=\"16\" height=\"16\">\\n  <path fill=\"#999999\" d=\"M42.75 24c0 10.59375-8.53125 19.21875-19.125 19.21875-10.6875 0-19.21875-8.625-19.21875-19.21875 0-10.59375 8.53125-19.21875 19.21875-19.21875 10.59375 0 19.125 8.625 19.125 19.21875zM23.625 14.0625c-3.09375 0-5.90625 2.25-5.90625 5.4375 0 0.84375 0.75 1.59375 1.59375 1.59375 0.84375 0 1.59375-0.75 1.59375-1.59375 0-1.125 1.03125-2.25 2.71875-2.25 1.59375 0 2.625 1.125 2.625 2.25 0 0.5625-0.375 1.03125-1.3125 1.59375l0 0c-1.125 0.75-3 1.96875-3 4.5l0 0.46875c0 0.84375 0.75 1.59375 1.6875 1.59375 0.84375 0 1.59375-0.75 1.59375-1.59375l0-0.46875c0-0.65625 0.28125-1.125 1.40625-1.78125 1.03125-0.65625 2.8125-1.875 2.8125-4.3125 0-3.1875-2.8125-5.4375-5.8125-5.4375zM23.53125 31.875c-0.84375 0-1.59375 0.65625-1.59375 1.59375 0 0.84375 0.75 1.59375 1.59375 1.59375l0.09375 0c0.84375 0 1.59375-0.75 1.59375-1.59375 0-0.9375-0.75-1.59375-1.59375-1.59375z\"/>\\n</svg>':t;return Bp($p,{borderRadius:\"full\",src:r,height:Gp[n],width:Gp[n]})},Xp=e=>{const{asset:t,link:n}=e;return n?Bp(zp,{href:n,children:t}):Bp(Mp,{children:t})},Zp=e=>{const{symbol:t,link:n,amount:r,iconUrl:o,price:i,preferences:a,priceLoading:s}=e,c=a&&i&&void 0!==r?function(e,t,n){const r=new M(e).decimalPlaces(2,M.ROUND_HALF_UP);if(!r.isFinite())throw new RangeError(\"Amount must be a finite number for fiat formatting\");const o=r.toNumber(),[i]=n.split(\"_\");return o.toLocaleString(i,{style:\"currency\",currency:t,maximumFractionDigits:2,minimumFractionDigits:2})}((u=i,new M(r).multipliedBy(new M(u)).toString()),a.currency,a.locale):\"\";var u;const l=void 0!==a&&void 0!==r,f=l&&!s&&c,p=void 0===r?t:`${r} ${t}`;return Pp(Fp,{direction:\"horizontal\",alignment:\"center\",children:[l&&s?Bp(Hp,{width:80}):null,f?Bp(Mp,{color:\"muted\",children:c}):null,Bp(Fp,{alignment:\"center\",center:!0,children:Bp(Wp,{iconUrl:o,size:\"sm\"})}),Bp(Xp,{asset:p,link:n})]})},Yp=({fee:e,preferences:t,price:n,tokenPricesFetchStatus:r=Xl.Initial})=>{const o=Ua(t.locale),i=r===Xl.Fetching;return Bp(Fp,{children:Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:o(\"confirmation.transactionFee\")}),Bp(Zp,{amount:e.amount,symbol:e.symbol,iconUrl:Kl,price:n,preferences:t,priceLoading:i})]})})};function Jp(e,t){return`${e.type}-${e.symbol}-${e.value??\"unknown\"}-${t}`}const Qp=({preferences:e})=>{const t=Ua(e.locale);return Pp(Fp,{direction:\"horizontal\",alignment:\"start\",children:[Bp(Mp,{fontWeight:\"medium\",children:t(\"confirmation.estimatedChanges.title\")}),Bp(Dp,{content:t(\"confirmation.estimatedChanges.tooltip\"),children:Bp(Vp,{name:\"question\",color:\"muted\"})})]})},ed=({preferences:e})=>Pp(Lp,{direction:\"vertical\",children:[Bp(Qp,{preferences:e}),Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Hp,{width:60}),Bp(Hp,{width:100})]})]}),td=({asset:e})=>{const t=e.type===Al.Out,n=e.logo??(e.symbol===Jt?Kl:null),r=null===e.value,o=r?`– ${e.symbol}`:`${t?\"-\":\"+\"}${e.value} ${e.symbol}`,i=function(e,t){return e?\"alternative\":t?\"error\":\"success\"}(r,t);return Pp(Fp,{direction:\"horizontal\",alignment:\"end\",center:!0,children:[n?Bp($p,{src:n,borderRadius:\"full\",height:16,width:16}):null,Bp(Mp,{color:i,children:o})]})},nd=({changes:e,preferences:t,scanFetchStatus:n})=>{const r=Ua(t.locale),o=(i=n)===Xl.Initial||i===Xl.Fetching;var i;const a=n===Xl.Fetched,s=n===Xl.Error,c=(e?.assets.length??0)>0;if(o&&!c)return Bp(ed,{preferences:t});if(s&&!c)return Pp(Lp,{direction:\"vertical\",children:[Bp(Qp,{preferences:t}),Bp(Mp,{color:\"alternative\",children:r(\"confirmation.estimatedChanges.notAvailable\")})]});const u=e?.assets.filter(e=>e.type===Al.Out)??[],l=e?.assets.filter(e=>e.type===Al.In)??[],f=u.length>0||l.length>0;return Pp(Lp,a&&!f?{direction:\"vertical\",children:[Bp(Qp,{preferences:t}),Bp(Mp,{color:\"alternative\",children:r(\"confirmation.estimatedChanges.noChanges\")})]}:{children:[Bp(Qp,{preferences:t}),u.length>0?Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:r(\"confirmation.estimatedChanges.send\")}),Bp(Fp,{direction:\"vertical\",alignment:\"end\",children:u.map((e,t)=>Bp(Fp,{children:Bp(td,{asset:e})},Jp(e,t)))})]}):null,l.length>0?Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:r(\"confirmation.estimatedChanges.receive\")}),Bp(Fp,{direction:\"vertical\",alignment:\"end\",children:l.map((e,t)=>Bp(Fp,{children:Bp(td,{asset:e})},Jp(e,t)))})]}):null]})},rd=jp(\"Banner\"),od={[Sl.Malicious]:{severity:\"danger\",title:\"confirmation.validationErrorTitle\",subtitle:\"confirmation.validationErrorSubtitle\"},[Sl.Warning]:{severity:\"warning\",title:\"confirmation.validationWarningTitle\",subtitle:\"confirmation.validationWarningSubtitle\"}},id={insufficientbalance:\"transactionScan.errors.insufficientBalance\",insufficientfunds:\"transactionScan.errors.insufficientFunds\",invalidtransaction:\"transactionScan.errors.invalidTransaction\",invalidaddress:\"transactionScan.errors.invalidAddress\",notrustline:\"transactionScan.errors.noTrustline\",transactionexpired:\"transactionScan.errors.transactionExpired\",unsupportedeip712message:\"transactionScan.errors.unsupportedEIP712Message\"},ad={severity:\"warning\",title:\"confirmation.securityScanErrorTitle\",subtitle:\"confirmation.securityScanErrorSubtitle\"},sd={simulation:{severity:\"warning\",title:\"confirmation.simulationErrorTitle\",subtitle:\"confirmation.simulationErrorSubtitle\"},validation:{severity:\"warning\",title:\"confirmation.validationScanErrorTitle\",subtitle:\"confirmation.validationScanErrorSubtitle\"},response:{severity:\"warning\",title:\"confirmation.securityScanIncompleteTitle\",subtitle:\"confirmation.securityScanIncompleteSubtitle\"}},cd=({preferences:e,validation:t,error:n,scanFetchStatus:r})=>{const o=Ua(e.locale);if(r===Xl.Fetching)return Bp(rd,{title:o(\"confirmation.securityScanInProgressTitle\"),severity:\"info\",children:Bp(Mp,{children:o(\"confirmation.securityScanInProgressMessage\")})});if(r===Xl.Error)return Bp(rd,{title:o(\"confirmation.securityScanAPIErrorTitle\"),severity:\"danger\",children:Bp(Mp,{children:o(\"confirmation.securityScanAPIErrorMessage\")})});if(n&&function(e,t){if(\"simulation\"===e.type)return t.simulateOnChainActions;if(\"validation\"===e.type)return t.useSecurityAlerts;return t.simulateOnChainActions||t.useSecurityAlerts}(n,e)){const t=function(e){if(e.type)return sd[e.type]??ad;return ad}(n);return Bp(rd,{title:o(t.title),severity:t.severity,children:Bp(Mp,{children:o(t.subtitle,{reason:ud(n,e.locale)})})})}if(t?.type&&e.useSecurityAlerts){const e=od[t.type];if(e){const n=t.description?.trim(),r=void 0===n||0===n.length?o(e.subtitle):n;return Pp(rd,{title:o(e.title),severity:e.severity,children:[Bp(Mp,{children:r}),Bp(Mp,{size:\"sm\",children:Bp(zp,{href:\"https://support.metamask.io/configure/wallet/how-to-turn-on-security-alerts/\",children:o(\"confirmation.validationErrorLearnMore\")})}),Pp(Mp,{size:\"sm\",children:[Bp(Vp,{color:\"primary\",name:\"security-tick\"}),\" \",o(\"confirmation.validationErrorSecurityAdviced\"),\" \",Bp(zp,{href:\"https://www.blockaid.io\",children:\"Blockaid\"})]})]})}}return null};function ud(e,t){const n=Ua(t),r=e.code?.replace(/[^a-zA-Z0-9]/gu,\"\").toLowerCase(),o=r?id[r]:null;return o?n(o):e.message??n(\"transactionScan.errors.unknownError\")}const ld=({preferences:e,transactionsFetchStatus:t,errorMessage:n=\"confirmation.txnError.generic\"})=>{if(t!==Xl.Error)return null;const r=Ua(e.locale),o=r(\"confirmation.simulationErrorTitle\"),i=r(n);return Bp(rd,{title:o,severity:\"danger\",children:Bp(Mp,{children:i})})},fd=({preferences:e,scan:t,scanFetchStatus:n,transactionsFetchStatus:r,errorMessage:o})=>{switch(function(e){const{preferences:t,transactionsFetchStatus:n}=e;return xp(n)?Op:Ep(t)?_p:kp}({preferences:e,transactionsFetchStatus:r})){case Op:return Bp(ld,{preferences:e,transactionsFetchStatus:r,errorMessage:o});case _p:return Bp(cd,{scanFetchStatus:n,validation:t?.validation??null,error:t?.error??null,preferences:e});default:return null}},pd=jp(\"Footer\"),dd=jp(\"Button\"),hd=\"malicious-acknowledgement-review\",yd=\"malicious-acknowledgement-checkbox\",gd=\"malicious-acknowledgement-proceed\",md=\"malicious-acknowledgement-back\",vd=({locale:e,cancelButtonName:t,confirmButtonName:n,confirmDisabled:r=!1,requiresAcknowledgement:o=!1})=>{const i=Ua(e);return Pp(pd,{children:[Bp(dd,{name:t,children:i(\"confirmation.cancelButton\")}),Bp(dd,o&&!r?{name:hd,children:i(\"confirmation.reviewAlertsButton\")}:{name:n,disabled:r,children:i(\"confirmation.confirmButton\")})]})},bd=jp(\"Copyable\"),wd=jp(\"Divider\"),Sd=({value:e,locale:t})=>{const n=Ua(t);return Array.isArray(e)?Bp(Fp,{direction:\"vertical\",alignment:\"end\",children:e.map((e,t)=>{const r=\"string\"==typeof e?e:JSON.stringify(e);return Pp(Fp,{direction:\"vertical\",alignment:\"end\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:n(\"confirmation.invocation.argument\",{index:(t+1).toString()})}),Bp(bd,{value:r})]},`arg-${t}`)})}):Bp(bd,\"object\"==typeof e?{value:JSON.stringify(e,null,2)}:{value:String(e)})},Ad=({locale:e,contractAddress:t,functionName:n,args:r})=>{const o=Ua(e);return Pp(Fp,{direction:\"vertical\",children:[t?Pp(Fp,{direction:\"vertical\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:o(\"confirmation.invocation.contractAddress\")}),Bp(bd,{value:t})]}):null,null===n?null:Pp(Fp,{direction:\"vertical\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:o(\"confirmation.invocation.functionName\")}),Bp(Mp,{children:n})]}),null===r?null:Bp(Sd,{value:r,locale:e})]})},Ed=({authorizations:e,locale:t})=>{const n=Ua(t);return Pp(Lp,{children:[Bp(Np,{children:n(\"confirmation.authorization.heading\")}),e.map((e,r)=>{const o=Cp(e.params,\"authorizedAddress\");return Pp(Fp,{alignment:\"space-between\",direction:\"vertical\",children:[null===o?null:Pp(Fp,{direction:\"vertical\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:n(\"confirmation.authorization.authorizedAddress\")}),Bp(bd,{value:o})]}),Bp(Ad,{locale:t,contractAddress:Cp(e.params,\"contractId\"),functionName:Cp(e.params,\"functionName\"),args:Cp(e.params,\"arguments\")}),Bp(Fp,{children:null}),Bp(wd,{}),Bp(Fp,{children:null})]},`auth-${r}`)})]})},xd=({networkImage:e,scope:t,locale:n})=>{const r=Ua(n);return Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:r(\"confirmation.network\")}),Pp(Fp,{direction:\"horizontal\",alignment:\"end\",children:[Bp($p,{borderRadius:\"medium\",src:e??Kl,height:16,width:16}),Bp(Mp,{children:yp(t)})]})]})},Td=({account:e,toAddress:t,scope:n,locale:r,networkImage:o,feeData:i,tokenPrices:a,origin:s,preferences:c,tokenPricesFetchStatus:u=Xl.Initial,scan:l,scanFetchStatus:f=Xl.Initial,transactionsFetchStatus:p=Xl.Initial,errorMessage:d})=>{const h=Ua(r),{address:y}=e,g=Tp({scanFetchStatus:f,transactionsFetchStatus:p});return Pp(Up,{children:[Pp(Fp,{children:[Bp(fd,{preferences:c,scan:l,scanFetchStatus:f,transactionsFetchStatus:p,errorMessage:d}),Pp(Fp,{alignment:\"center\",center:!0,children:[Bp(Fp,{children:null}),Bp(Np,{size:\"lg\",children:h(\"confirmation.transaction.title\")}),Bp(Fp,{children:null})]}),Bp(nd,{changes:l?.estimatedChanges??null,preferences:c,scanFetchStatus:f}),Pp(Lp,{children:[s?Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Pp(Fp,{direction:\"horizontal\",alignment:\"start\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.origin\")}),Bp(Dp,{content:h(\"confirmation.origin.tooltip\"),children:Bp(Vp,{name:\"question\",color:\"muted\"})})]}),Bp(Mp,{children:s})]}):null,Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.account\")}),Bp(zp,{href:vp(y),children:Bp(Kp,{address:`${n}:${y}`,truncate:!0,displayName:!0,avatar:!0})})]}),Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.to\")}),Bp(zp,{href:vp(t),children:Bp(Kp,{address:wp(n,t),truncate:!0,displayName:!0,avatar:!0})})]}),Bp(xd,{networkImage:o,scope:n,locale:r}),Bp(Fp,{children:null}),0===Object.keys(i).length?null:Bp(Yp,{fee:i,price:a?.[i.assetId]??null,preferences:c,tokenPricesFetchStatus:u})]})]}),Bp(vd,{locale:r,cancelButtonName:Zf,confirmButtonName:Yf,confirmDisabled:g,requiresAcknowledgement:Ap({preferences:c,scan:l})})]})},kd=({readableAuthEntry:e,account:t,scope:n,locale:r,networkImage:o,origin:i})=>{const a=Ua(r),{address:s}=t,c=wp(n,s),{authorizations:u,nonce:l,signatureExpirationLedger:f}=e;return Pp(Up,{children:[Pp(Fp,{children:[Pp(Fp,{alignment:\"center\",center:!0,children:[Bp(Fp,{children:null}),Bp(Np,{size:\"lg\",children:a(\"confirmation.signAuthEntry.title\")}),Bp(Fp,{children:null})]}),Bp(rd,{severity:\"warning\",title:\"\",children:Bp(Mp,{children:a(\"confirmation.signAuthEntry.warning\")})}),Pp(Lp,{children:[i?Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Pp(Fp,{direction:\"horizontal\",alignment:\"start\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:a(\"confirmation.origin\")}),Bp(Dp,{content:a(\"confirmation.origin.tooltip\"),children:Bp(Vp,{name:\"question\",color:\"muted\"})})]}),Bp(Mp,{children:i})]}):null,Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:a(\"confirmation.account\")}),Bp(Kp,{address:c,truncate:!0,displayName:!0,avatar:!0})]}),Bp(xd,{networkImage:o,scope:n,locale:r}),Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:a(\"confirmation.signAuthEntry.expiresAt\")}),Bp(Mp,{children:String(f)})]}),Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:a(\"confirmation.signAuthEntry.nonce\")}),Bp(Mp,{children:l})]})]}),u.length>0?Bp(Ed,{locale:r,authorizations:u}):null]}),Pp(pd,{children:[Bp(dd,{name:Qf,children:a(\"confirmation.cancelButton\")}),Bp(dd,{name:ep,children:a(\"confirmation.confirmButton\")})]})]})},Od=({account:e,scope:t,assetMetadata:n,locale:r,networkImage:o,feeData:i,tokenPrices:a,origin:s,preferences:c,tokenPricesFetchStatus:u=Xl.Initial,scan:l,scanFetchStatus:f=Xl.Initial,transactionsFetchStatus:p=Xl.Initial,errorMessage:d})=>{const h=Ua(r),{address:y}=e,g=Tp({scanFetchStatus:f,transactionsFetchStatus:p});return Pp(Up,{children:[Pp(Fp,{children:[Bp(fd,{preferences:c,scan:l,scanFetchStatus:f,transactionsFetchStatus:p,errorMessage:d}),Pp(Fp,{alignment:\"center\",center:!0,children:[Bp(Fp,{children:null}),Bp(Np,{size:\"lg\",children:h(\"confirmation.signChangeTrustOptIn.title\",{asset:n.symbol})}),Bp(Fp,{children:Bp(Wp,{iconUrl:n.iconUrl,size:\"xl\"})}),Bp(Fp,{children:null}),Bp(Fp,{children:null})]}),Pp(Lp,{children:[s?Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Pp(Fp,{direction:\"horizontal\",alignment:\"start\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.origin\")}),Bp(Dp,{content:h(\"confirmation.origin.tooltip\"),children:Bp(Vp,{name:\"question\",color:\"muted\"})})]}),Bp(Mp,{children:s})]}):null,Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.account\")}),Bp(Kp,{address:wp(t,y),truncate:!0,displayName:!0,avatar:!0})]}),Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.asset\")}),Bp(Zp,{symbol:n.symbol,iconUrl:n.iconUrl,link:bp(st(n.assetId).assetReference)})]}),Bp(xd,{networkImage:o,scope:t,locale:r}),Bp(Fp,{children:null}),0===Object.keys(i).length?null:Bp(Yp,{fee:i,price:a?.[i.assetId]??null,preferences:c,tokenPricesFetchStatus:u})]})]}),Bp(vd,{locale:r,cancelButtonName:np,confirmButtonName:rp,confirmDisabled:g,requiresAcknowledgement:Ap({preferences:c,scan:l})})]})},_d=({account:e,scope:t,assetMetadata:n,locale:r,networkImage:o,feeData:i,tokenPrices:a,origin:s,preferences:c,tokenPricesFetchStatus:u=Xl.Initial,scan:l,scanFetchStatus:f=Xl.Initial,transactionsFetchStatus:p=Xl.Initial,errorMessage:d})=>{const h=Ua(r),{address:y}=e,g=Tp({scanFetchStatus:f,transactionsFetchStatus:p});return Pp(Up,{children:[Pp(Fp,{children:[Bp(fd,{preferences:c,scan:l,scanFetchStatus:f,transactionsFetchStatus:p,errorMessage:d}),Pp(Fp,{alignment:\"center\",center:!0,children:[Bp(Fp,{children:null}),Bp(Np,{size:\"lg\",children:h(\"confirmation.signChangeTrustOptOut.title\",{asset:n.symbol})}),Bp(Fp,{children:Bp(Wp,{iconUrl:n.iconUrl,size:\"xl\"})}),Bp(Fp,{children:null}),Bp(Fp,{children:null})]}),Pp(Lp,{children:[s?Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Pp(Fp,{direction:\"horizontal\",alignment:\"start\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.origin\")}),Bp(Dp,{content:h(\"confirmation.origin.tooltip\"),children:Bp(Vp,{name:\"question\",color:\"muted\"})})]}),Bp(Mp,{children:s})]}):null,Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.account\")}),Bp(Kp,{address:wp(t,y),truncate:!0,displayName:!0,avatar:!0})]}),Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:h(\"confirmation.asset\")}),Bp(Zp,{symbol:n.symbol,iconUrl:n.iconUrl,link:bp(st(n.assetId).assetReference)})]}),Bp(xd,{networkImage:o,scope:t,locale:r}),Bp(Fp,{children:null}),0===Object.keys(i).length?null:Bp(Yp,{fee:i,price:a?.[i.assetId]??null,preferences:c,tokenPricesFetchStatus:u})]})]}),Bp(vd,{locale:r,cancelButtonName:ip,confirmButtonName:ap,confirmDisabled:g,requiresAcknowledgement:Ap({preferences:c,scan:l})})]})},Id=({message:e,account:t,scope:n,locale:r,networkImage:o,origin:i})=>{const a=Ua(r),{address:s}=t,c=wp(n,s);return Pp(Up,{children:[Pp(Fp,{children:[Pp(Fp,{alignment:\"center\",center:!0,children:[Bp(Fp,{children:null}),Bp(Np,{size:\"lg\",children:a(\"confirmation.signMessage.title\")}),Bp(Fp,{children:null})]}),Pp(Lp,{children:[Bp(Mp,{fontWeight:\"medium\",children:a(\"confirmation.signMessage.message\")}),Bp(Mp,{children:e})]}),Pp(Lp,{children:[i?Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Pp(Fp,{direction:\"horizontal\",alignment:\"start\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:a(\"confirmation.origin\")}),Bp(Dp,{content:a(\"confirmation.origin.tooltip\"),children:Bp(Vp,{name:\"question\",color:\"muted\"})})]}),Bp(Mp,{children:i})]}):null,Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:a(\"confirmation.account\")}),Bp(Kp,{address:c,truncate:!0,displayName:!0,avatar:!0})]}),Bp(xd,{networkImage:o,scope:n,locale:r})]})]}),Pp(pd,{children:[Bp(dd,{name:cp,children:a(\"confirmation.cancelButton\")}),Bp(dd,{name:up,children:a(\"confirmation.confirmButton\")})]})]})},Cd=({amount:e})=>Bp(Mp,{children:e}),Bd=({scope:e,assetReference:t,amount:n,preferences:r,price:o,priceLoading:i})=>{const a=Ip(e,t);return a?Bp(Zp,{symbol:a.symbol,amount:n,iconUrl:a.iconUrl,link:a.link,preferences:r,price:o??null,priceLoading:i}):void 0===n?Bp(Mp,{children:t}):Pp(Fp,{direction:\"horizontal\",alignment:\"end\",children:[Bp(Mp,{children:n}),Bp(Mp,{children:t})]})},Pd=e=>{const{type:t,value:n,scope:r,preferences:o,tokenPrices:i,priceLoading:a,locale:s}=e;if(ht(n))return null;switch(t){case\"assetWithAmount\":{if(!Array.isArray(n))return null;const[e,t]=n,s=Ip(r,e),c=s?i?.[s.assetId]??null:null;return Bp(Bd,{scope:r,assetReference:e,amount:t,preferences:o,price:c,priceLoading:a})}case\"asset\":return Bp(Bd,{scope:r,assetReference:n});case\"address\":return Bp(bd,{value:n});case\"amount\":return Bp(Cd,{amount:n});default:return Bp(Sd,{value:n,locale:s})}},Rd=({params:e,locale:t,scope:n,preferences:r,tokenPrices:o,priceLoading:i})=>{const a=Ua(t);return Bp(Fp,{direction:\"vertical\",children:e.filter(e=>!ht(e.value)).map((e,s)=>{const c=\"json\"===e.type||\"copyable\"===e.type||\"string\"==typeof e.value&&e.value.length>40;return Pp(Fp,{alignment:\"space-between\",direction:c?\"vertical\":\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:a(`confirmation.transaction.param.${e.key}`)}),Bp(Pd,{locale:t,type:e.type,value:e.value,scope:n,preferences:r,tokenPrices:o,priceLoading:i})]},`${e.key}-${s}`)})})},jd=({readableTransaction:e,account:t,scope:n,locale:r,networkImage:o,origin:i,preferences:a,feeData:s,tokenPrices:c,tokenPricesFetchStatus:u=Xl.Initial,scan:l,scanFetchStatus:f=Xl.Initial})=>{const p=Ua(r),{address:d}=t,h=wp(n,d),y=u===Xl.Fetching,g=c?.[s.assetId]??null,m=Tp({scanFetchStatus:f});return Pp(Up,{children:[Pp(Fp,{children:[Ep(a)?Bp(cd,{scanFetchStatus:f,validation:l?.validation??null,error:l?.error??null,preferences:a}):null,Pp(Fp,{alignment:\"center\",center:!0,children:[Bp(Fp,{children:null}),Bp(Np,{size:\"lg\",children:p(\"confirmation.signTransaction.title\")}),Bp(Fp,{children:null})]}),a.simulateOnChainActions?Bp(nd,{changes:l?.estimatedChanges??null,preferences:a,scanFetchStatus:f}):null,Pp(Lp,{children:[i?Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Pp(Fp,{direction:\"horizontal\",alignment:\"start\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:p(\"confirmation.origin\")}),Bp(Dp,{content:p(\"confirmation.origin.tooltip\"),children:Bp(Vp,{name:\"question\",color:\"muted\"})})]}),Bp(Mp,{children:i})]}):null,Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:p(\"confirmation.account\")}),Bp(Kp,{address:h,truncate:!0,displayName:!0,avatar:!0})]}),Bp(xd,{networkImage:o,scope:n,locale:r}),Bp(Fp,{children:null}),Bp(Yp,{fee:s,preferences:a,price:g,tokenPricesFetchStatus:u}),Pp(Fp,{alignment:\"space-between\",direction:\"horizontal\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:p(\"confirmation.memo\")}),Bp(Mp,{children:e.memo??p(\"confirmation.memo.none\")})]})]}),e.authorizations.length>0?Bp(Ed,{locale:r,authorizations:e.authorizations}):null,Bp(Lp,{children:e.operations.map((t,o)=>{const i=t.type===Gn,s=Cp(t.params,\"contractId\"),u=Cp(t.params,\"functionName\"),l=Cp(t.params,\"arguments\"),f=i&&(null!==s||null!==u);return Pp(Fp,{alignment:\"space-between\",direction:\"vertical\",children:[Bp(Np,{children:p(`confirmation.transaction.${t.type.toLowerCase()}`)}),t.source===d?null:Pp(Fp,{direction:\"vertical\",children:[Bp(Mp,{fontWeight:\"medium\",color:\"alternative\",children:p(\"confirmation.transaction.param.source\")}),Bp(bd,{value:t.source})]}),f?Bp(Ad,{locale:r,contractAddress:s,functionName:u,args:l}):Bp(Rd,{params:t.params,locale:r,scope:n,preferences:a,tokenPrices:c,priceLoading:y}),o<e.operations.length-1&&Bp(wd,{})]},`op-${o}`)})})]}),Bp(vd,{locale:r,cancelButtonName:fp,confirmButtonName:pp,confirmDisabled:m,requiresAcknowledgement:Ap({preferences:a,scan:l})})]})},Ud=jp(\"Checkbox\"),Fd=({locale:e,acknowledged:t=!1})=>{const n=Ua(e);return Pp(Up,{children:[Pp(Fp,{children:[Bp(Fp,{alignment:\"center\",center:!0,children:Bp(Np,{size:\"lg\",children:n(\"confirmation.maliciousAck.title\")})}),Bp(rd,{title:n(\"confirmation.maliciousAck.title\"),severity:\"danger\",children:Bp(Mp,{children:n(\"confirmation.maliciousAck.description\")})}),Bp(Ud,{name:yd,label:n(\"confirmation.maliciousAck.checkbox\"),checked:t})]}),Pp(pd,{children:[Bp(dd,{name:md,children:n(\"confirmation.maliciousAck.back\")}),Bp(dd,{name:gd,disabled:!t,children:n(\"confirmation.maliciousAck.proceed\")})]})]})};function Nd(e,t){const n=t;if(n.acknowledgementScreen)return Bp(Fd,{locale:n.locale,acknowledged:n.acknowledged});switch(e){case ef.ChangeTrustlineOptIn:return Bp(Od,{...t});case ef.ChangeTrustlineOptOut:return Bp(_d,{...t});case ef.SignTransaction:return Bp(jd,{...t});case ef.SignMessage:return Bp(Id,{...t});case ef.SignAuthEntry:return Bp(kd,{...t});case ef.ConfirmSendTransaction:return Bp(Td,{...t});default:throw new Error(`Unsupported interface key: ${String(e)}`)}}async function Ld(e,t,n){const r={...t,...n},o=t.interfaceKey;await Gi(e,Nd(o,r),r)}async function Md(e){const{id:t,context:n}=e;n&&await Ld(t,n,{acknowledgementScreen:!0,acknowledged:!1})}async function Dd(e){const{id:t,event:n,context:r}=e;if(!r)return;const o=Boolean(n.value);await Ld(t,r,{acknowledged:o})}async function qd(e){const{id:t,context:n}=e;!0===n?.acknowledged&&(Tp({scanFetchStatus:n.scanFetchStatus,transactionsFetchStatus:n.transactionsFetchStatus})?await Ld(t,n,{acknowledgementScreen:!1,acknowledged:!1}):await Xi(t,!0))}async function Vd(e){const{id:t,context:n}=e;n&&await Ld(t,n,{acknowledgementScreen:!1,acknowledged:!1})}class zd extends Error{constructor(e){super(e),this.name=\"CronjobError\"}}class Kd extends zd{constructor(e){super(`Unknown cronjob method: ${e}`),this.name=\"CronjobMethodNotFoundError\"}}class Hd extends na{}class $d extends Hd{constructor(e){super(\"Key derivation failed.\"+(e?` ${e}`:\"\"))}}class Gd extends Hd{constructor(){super(\"Failed to sign transaction\")}}class Wd extends Hd{constructor(){super(\"Failed to sign message\")}}class Xd extends Hd{constructor(){super(\"Failed to sign auth entry\")}}class Zd extends Hd{constructor(){super(\"Failed to verify message\")}}class Yd{#mt;constructor(e){this.#mt=e}get address(){return this.#mt.publicKey()}get secret(){return this.#mt.secret()}signTransaction(e){try{e.getRaw().sign(this.#mt)}catch{throw new Gd}}signMessage(e,t=\"base64\"){try{const n=this.#vt(e);return this.#mt.sign((0,dn.hash)(sr(n))).toString(t)}catch{throw new Wd}}verifyMessage(e,t,n=\"base64\"){try{const r=this.#vt(e);return this.#mt.verify((0,dn.hash)(sr(r)),sr(t,n))}catch{throw new Zd}}signAuthEntry(e,t=\"base64\"){try{const n=sr(e,\"base64\");return this.#mt.sign((0,dn.hash)(n)).toString(t)}catch{throw new Xd}}#vt(e){return new Uint8Array([...sr(\"Stellar Signed Message:\\n\"),...sr(e,\"utf8\")])}}const Jd=32,Qd=4294967295,eh=\"bip32:44'\",th=/^\\d+$/u,nh=/^bip32:\\d+'?$/u,rh=/^slip10:\\d+'?$/u,oh=/^cip3:\\d+'?$/u,ih=/^bip39:([a-z]+){1}( [a-z]+){11,23}$/u,ah=2147483648,sh=BigInt(2**32-1),ch=BigInt(32);function uh(e,t=!1){return t?{h:Number(e&sh),l:Number(e>>ch&sh)}:{h:0|Number(e>>ch&sh),l:0|Number(e&sh)}}function lh(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:a}=uh(e[i],t);[r[i],o[i]]=[n,a]}return[r,o]}const fh=(e,t,n)=>e>>>n,ph=(e,t,n)=>e<<32-n|t>>>n,dh=(e,t,n)=>e>>>n|t<<32-n,hh=(e,t,n)=>e<<32-n|t>>>n,yh=(e,t,n)=>e<<64-n|t>>>n-32,gh=(e,t,n)=>e>>>n-32|t<<64-n,mh=(e,t,n)=>e<<n|t>>>32-n,vh=(e,t,n)=>t<<n|e>>>32-n,bh=(e,t,n)=>t<<n-32|e>>>64-n,wh=(e,t,n)=>e<<n-32|t>>>64-n;function Sh(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}const Ah=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Eh=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,xh=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Th=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,kh=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),Oh=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,_h=\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0;function Ih(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function Ch(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(\"positive integer expected, got \"+e)}function Bh(e,...t){if(!Ih(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function Ph(e){if(\"function\"!=typeof e||\"function\"!=typeof e.create)throw new Error(\"Hash should be wrapped by utils.createHasher\");Ch(e.outputLen),Ch(e.blockLen)}function Rh(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function jh(e,t){Bh(e);const n=t.outputLen;if(e.length<n)throw new Error(\"digestInto() expects output buffer of length at least \"+n)}function Uh(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Fh(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Nh(e,t){return e<<32-t|e>>>t}function Lh(e,t){return e<<t|e>>>32-t>>>0}const Mh=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Dh(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const qh=Mh?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Dh(e[t]);return e},Vh=\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex,zh=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\"));function Kh(e){if(Bh(e),Vh)return e.toHex();let t=\"\";for(let n=0;n<e.length;n++)t+=zh[e[n]];return t}const Hh=48,$h=57,Gh=65,Wh=70,Xh=97,Zh=102;function Yh(e){return e>=Hh&&e<=$h?e-Hh:e>=Gh&&e<=Wh?e-(Gh-10):e>=Xh&&e<=Zh?e-(Xh-10):void 0}function Jh(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);if(Vh)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error(\"hex string expected, got unpadded hex of length \"+t);const r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){const n=Yh(e.charCodeAt(o)),i=Yh(e.charCodeAt(o+1));if(void 0===n||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character \"'+t+'\" at index '+o)}r[t]=16*n+i}return r}const Qh=async()=>{};async function ey(e,t,n){let r=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-r;e>=0&&e<t||(await Qh(),r+=e)}}function ty(e){if(\"string\"!=typeof e)throw new Error(\"string expected\");return new Uint8Array((new TextEncoder).encode(e))}function ny(e){return\"string\"==typeof e&&(e=ty(e)),Bh(e),e}function ry(e){return\"string\"==typeof e&&(e=ty(e)),Bh(e),e}function oy(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];Bh(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n}class iy{}function ay(e){const t=t=>e().update(ny(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function sy(e=32){if(_h&&\"function\"==typeof _h.getRandomValues)return _h.getRandomValues(new Uint8Array(e));if(_h&&\"function\"==typeof _h.randomBytes)return Uint8Array.from(_h.randomBytes(e));throw new Error(\"crypto.getRandomValues must be defined\")}const cy=BigInt(0),uy=BigInt(1),ly=BigInt(2),fy=BigInt(7),py=BigInt(256),dy=BigInt(113),hy=[],yy=[],gy=[];for(let e=0,t=uy,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],hy.push(2*(5*r+n)),yy.push((e+1)*(e+2)/2%64);let o=cy;for(let e=0;e<7;e++)t=(t<<uy^(t>>fy)*dy)%py,t&ly&&(o^=uy<<(uy<<BigInt(e))-uy);gy.push(o)}const my=lh(gy,!0),vy=my[0],by=my[1],wy=(e,t,n)=>n>32?bh(e,t,n):mh(e,t,n),Sy=(e,t,n)=>n>32?wh(e,t,n):vh(e,t,n);class Ay extends iy{constructor(e,t,n,r=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=o,Ch(n),!(0<e&&e<200))throw new Error(\"only keccak-f1600 function is supported\");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}clone(){return this._cloneInto()}keccak(){qh(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,o=(t+2)%10,i=n[o],a=n[o+1],s=wy(i,a,1)^n[r],c=Sy(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],o=e[3];for(let n=0;n<24;n++){const r=yy[n],i=wy(t,o,r),a=Sy(t,o,r),s=hy[n];t=e[s],o=e[s+1],e[s]=i,e[s+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=vy[r],e[1]^=by[r]}Uh(n)}(this.state32,this.rounds),qh(this.state32),this.posOut=0,this.pos=0}update(e){Rh(this),Bh(e=ny(e));const{blockLen:t,state:n}=this,r=e.length;for(let o=0;o<r;){const i=Math.min(t-this.pos,r-o);for(let t=0;t<i;t++)n[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Rh(this,!1),Bh(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,o=e.length;r<o;){this.posOut>=n&&this.keccak();const i=Math.min(n-this.posOut,o-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error(\"XOF is not possible for this instance\");return this.writeInto(e)}xof(e){return Ch(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(jh(e,this),this.finished)throw new Error(\"digest() was already called\");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Uh(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:o,enableXOF:i}=this;return e||(e=new Ay(t,n,r,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=r,e.enableXOF=i,e.destroyed=this.destroyed,e}}const Ey=(e,t,n)=>ay(()=>new Ay(t,e,n)),xy=Ey(1,136,32);const{memoize:Ty}=w,ky=/^(?:0x)?[0-9a-f]+$/iu,Oy=/^0x[0-9a-f]+$/iu,_y=/^0x[0-9a-f]{40}$/u,Iy=/^0x[0-9a-fA-F]{40}$/u,Cy=(Ue(Oe(),ky),Ue(Oe(),Oy),Ue(Oe(),_y),Ue(Oe(),Iy),e=>\"string\"==typeof e);function By(e){return Cy(e)&&Iy.test(e)}function Py(e){_n(function(e){return Cy(e)&&ky.test(e)}(e),\"Value must be a hexadecimal string.\")}const Ry=Ty(function(e){_n(By(e),\"Invalid hex address.\");const t=Fy(e).toLowerCase(),n=xy(t),{length:r}=t,o=new Array(r);for(let e=0;e<r;e++){const r=1&e,i=n[e>>1],a=0===r?i>>4:15&i;o[e]=a>=8?t[e].toUpperCase():t[e]}return`0x${o.join(\"\")}`});const jy=Ty(function(e){return!!By(e)&&Ry(e)===e});Ty(function(e){return Cy(t=e)&&_y.test(t)||jy(e);var t});function Uy(e){return e.startsWith(\"0x\")?e:e.startsWith(\"0X\")?`0x${e.substring(2)}`:`0x${e}`}function Fy(e){return e.startsWith(\"0x\")||e.startsWith(\"0X\")?e.substring(2):e}var Ny=n(1048).hp;const Ly=48,My=58,Dy=87;const qy=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,\"0\"));return e}}();function Vy(e){return e instanceof Uint8Array}function zy(e){_n(Vy(e),\"Value must be a Uint8Array.\")}function Ky(e){if(zy(e),0===e.length)return\"0x\";const t=qy(),n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return Uy(n.join(\"\"))}function Hy(e){zy(e);const t=Ky(e);return BigInt(t)}function $y(e){if(\"0x\"===e?.toLowerCase?.())return new Uint8Array;Py(e);const t=Fy(e).toLowerCase(),n=t.length%2==0?t:`0${t}`,r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++){const t=n.charCodeAt(2*e),o=n.charCodeAt(2*e+1),i=t-(t<My?Ly:Dy),a=o-(o<My?Ly:Dy);r[e]=16*i+a}return r}function Gy(e){return _n(\"string\"==typeof e,\"Value must be a string.\"),(new TextEncoder).encode(e)}function Wy(e){if(\"bigint\"==typeof e)return function(e){return _n(\"bigint\"==typeof e,\"Value must be a bigint.\"),_n(e>=BigInt(0),\"Value must be a non-negative bigint.\"),$y(e.toString(16))}(e);if(\"number\"==typeof e)return function(e){return _n(\"number\"==typeof e,\"Value must be a number.\"),_n(e>=0,\"Value must be a non-negative number.\"),_n(Number.isSafeInteger(e),\"Value is not a safe integer. Use `bigIntToBytes` instead.\"),$y(e.toString(16))}(e);if(\"string\"==typeof e)return e.startsWith(\"0x\")?$y(e):Gy(e);if(Vy(e))return e;throw new TypeError(`Unsupported value type: \"${typeof e}\".`)}function Xy(e){const t=new Array(e.length);let n=0;for(let r=0;r<e.length;r++){const o=Wy(e[r]);t[r]=o,n+=o.length}const r=new Uint8Array(n);for(let e=0,n=0;e<t.length;e++)r.set(t[e],n),n+=t[e].length;return r}function Zy(e){if(void 0!==Ny&&e instanceof Ny){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Yy(e,t,n){return e&t^~e&n}function Jy(e,t,n){return e&t^e&n^t&n}class Qy extends iy{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=Fh(this.buffer)}update(e){Rh(this),Bh(e=ny(e));const{view:t,buffer:n,blockLen:r}=this,o=e.length;for(let i=0;i<o;){const a=Math.min(r-this.pos,o-i);if(a===r){const t=Fh(e);for(;r<=o-i;i+=r)this.process(t,i);continue}n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Rh(this),jh(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:o}=this;let{pos:i}=this;t[i++]=128,Uh(this.buffer.subarray(i)),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;e<r;e++)t[e]=0;!function(e,t,n,r){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,r-8,BigInt(8*this.length),o),this.process(n,0);const a=Fh(e),s=this.outputLen;if(s%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const c=s/4,u=this.get();if(c>u.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=r,e.pos=a,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const eg=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tg=(Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]));const ng=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),rg=new Uint32Array(64);class og extends Qy{constructor(e=32){super(64,e,8,!1),this.A=0|eg[0],this.B=0|eg[1],this.C=0|eg[2],this.D=0|eg[3],this.E=0|eg[4],this.F=0|eg[5],this.G=0|eg[6],this.H=0|eg[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)rg[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=rg[e-15],n=rg[e-2],r=Nh(t,7)^Nh(t,18)^t>>>3,o=Nh(n,17)^Nh(n,19)^n>>>10;rg[e]=o+rg[e-7]+r+rg[e-16]|0}let{A:n,B:r,C:o,D:i,E:a,F:s,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Nh(a,6)^Nh(a,11)^Nh(a,25))+Yy(a,s,c)+ng[e]+rg[e]|0,l=(Nh(n,2)^Nh(n,13)^Nh(n,22))+Jy(n,r,o)|0;u=c,c=s,s=a,a=i+t|0,i=o,o=r,r=n,n=t+l|0}n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,s=s+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,o,i,a,s,c,u)}roundClean(){Uh(rg)}destroy(){this.set(0,0,0,0,0,0,0,0),Uh(this.buffer)}}const ig=lh([\"0x428a2f98d728ae22\",\"0x7137449123ef65cd\",\"0xb5c0fbcfec4d3b2f\",\"0xe9b5dba58189dbbc\",\"0x3956c25bf348b538\",\"0x59f111f1b605d019\",\"0x923f82a4af194f9b\",\"0xab1c5ed5da6d8118\",\"0xd807aa98a3030242\",\"0x12835b0145706fbe\",\"0x243185be4ee4b28c\",\"0x550c7dc3d5ffb4e2\",\"0x72be5d74f27b896f\",\"0x80deb1fe3b1696b1\",\"0x9bdc06a725c71235\",\"0xc19bf174cf692694\",\"0xe49b69c19ef14ad2\",\"0xefbe4786384f25e3\",\"0x0fc19dc68b8cd5b5\",\"0x240ca1cc77ac9c65\",\"0x2de92c6f592b0275\",\"0x4a7484aa6ea6e483\",\"0x5cb0a9dcbd41fbd4\",\"0x76f988da831153b5\",\"0x983e5152ee66dfab\",\"0xa831c66d2db43210\",\"0xb00327c898fb213f\",\"0xbf597fc7beef0ee4\",\"0xc6e00bf33da88fc2\",\"0xd5a79147930aa725\",\"0x06ca6351e003826f\",\"0x142929670a0e6e70\",\"0x27b70a8546d22ffc\",\"0x2e1b21385c26c926\",\"0x4d2c6dfc5ac42aed\",\"0x53380d139d95b3df\",\"0x650a73548baf63de\",\"0x766a0abb3c77b2a8\",\"0x81c2c92e47edaee6\",\"0x92722c851482353b\",\"0xa2bfe8a14cf10364\",\"0xa81a664bbc423001\",\"0xc24b8b70d0f89791\",\"0xc76c51a30654be30\",\"0xd192e819d6ef5218\",\"0xd69906245565a910\",\"0xf40e35855771202a\",\"0x106aa07032bbd1b8\",\"0x19a4c116b8d2d0c8\",\"0x1e376c085141ab53\",\"0x2748774cdf8eeb99\",\"0x34b0bcb5e19b48a8\",\"0x391c0cb3c5c95a63\",\"0x4ed8aa4ae3418acb\",\"0x5b9cca4f7763e373\",\"0x682e6ff3d6b2b8a3\",\"0x748f82ee5defb2fc\",\"0x78a5636f43172f60\",\"0x84c87814a1f0ab72\",\"0x8cc702081a6439ec\",\"0x90befffa23631e28\",\"0xa4506cebde82bde9\",\"0xbef9a3f7b2c67915\",\"0xc67178f2e372532b\",\"0xca273eceea26619c\",\"0xd186b8c721c0c207\",\"0xeada7dd6cde0eb1e\",\"0xf57d4f7fee6ed178\",\"0x06f067aa72176fba\",\"0x0a637dc5a2c898a6\",\"0x113f9804bef90dae\",\"0x1b710b35131c471b\",\"0x28db77f523047d84\",\"0x32caab7b40c72493\",\"0x3c9ebe0a15c9bebc\",\"0x431d67c49c100d4c\",\"0x4cc5d4becb3e42b6\",\"0x597f299cfc657e2a\",\"0x5fcb6fab3ad6faec\",\"0x6c44198c4a475817\"].map(e=>BigInt(e))),ag=ig[0],sg=ig[1],cg=new Uint32Array(80),ug=new Uint32Array(80);class lg extends Qy{constructor(e=64){super(128,e,16,!1),this.Ah=0|tg[0],this.Al=0|tg[1],this.Bh=0|tg[2],this.Bl=0|tg[3],this.Ch=0|tg[4],this.Cl=0|tg[5],this.Dh=0|tg[6],this.Dl=0|tg[7],this.Eh=0|tg[8],this.El=0|tg[9],this.Fh=0|tg[10],this.Fl=0|tg[11],this.Gh=0|tg[12],this.Gl=0|tg[13],this.Hh=0|tg[14],this.Hl=0|tg[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:f,Gh:p,Gl:d,Hh:h,Hl:y}=this;return[e,t,n,r,o,i,a,s,c,u,l,f,p,d,h,y]}set(e,t,n,r,o,i,a,s,c,u,l,f,p,d,h,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|f,this.Gh=0|p,this.Gl=0|d,this.Hh=0|h,this.Hl=0|y}process(e,t){for(let n=0;n<16;n++,t+=4)cg[n]=e.getUint32(t),ug[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|cg[e-15],n=0|ug[e-15],r=dh(t,n,1)^dh(t,n,8)^fh(t,0,7),o=hh(t,n,1)^hh(t,n,8)^ph(t,n,7),i=0|cg[e-2],a=0|ug[e-2],s=dh(i,a,19)^yh(i,a,61)^fh(i,0,6),c=hh(i,a,19)^gh(i,a,61)^ph(i,a,6),u=xh(o,c,ug[e-7],ug[e-16]),l=Th(u,r,s,cg[e-7],cg[e-16]);cg[e]=0|l,ug[e]=0|u}let{Ah:n,Al:r,Bh:o,Bl:i,Ch:a,Cl:s,Dh:c,Dl:u,Eh:l,El:f,Fh:p,Fl:d,Gh:h,Gl:y,Hh:g,Hl:m}=this;for(let e=0;e<80;e++){const t=dh(l,f,14)^dh(l,f,18)^yh(l,f,41),v=hh(l,f,14)^hh(l,f,18)^gh(l,f,41),b=l&p^~l&h,w=kh(m,v,f&d^~f&y,sg[e],ug[e]),S=Oh(w,g,t,b,ag[e],cg[e]),A=0|w,E=dh(n,r,28)^yh(n,r,34)^yh(n,r,39),x=hh(n,r,28)^gh(n,r,34)^gh(n,r,39),T=n&o^n&a^o&a,k=r&i^r&s^i&s;g=0|h,m=0|y,h=0|p,y=0|d,p=0|l,d=0|f,({h:l,l:f}=Sh(0|c,0|u,0|S,0|A)),c=0|a,u=0|s,a=0|o,s=0|i,o=0|n,i=0|r;const O=Ah(A,x,k);n=Eh(O,S,E,T),r=0|O}({h:n,l:r}=Sh(0|this.Ah,0|this.Al,0|n,0|r)),({h:o,l:i}=Sh(0|this.Bh,0|this.Bl,0|o,0|i)),({h:a,l:s}=Sh(0|this.Ch,0|this.Cl,0|a,0|s)),({h:c,l:u}=Sh(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:f}=Sh(0|this.Eh,0|this.El,0|l,0|f)),({h:p,l:d}=Sh(0|this.Fh,0|this.Fl,0|p,0|d)),({h,l:y}=Sh(0|this.Gh,0|this.Gl,0|h,0|y)),({h:g,l:m}=Sh(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(n,r,o,i,a,s,c,u,l,f,p,d,h,y,g,m)}roundClean(){Uh(cg,ug)}destroy(){Uh(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);const fg=ay(()=>new og),pg=ay(()=>new lg);class dg extends iy{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Ph(e);const n=ny(t);if(this.iHash=e.create(),\"function\"!=typeof this.iHash.update)throw new Error(\"Expected instance of class which extends utils.Hash\");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,o=new Uint8Array(r);o.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),Uh(o)}update(e){return Rh(this),this.iHash.update(e),this}digestInto(e){Rh(this),Bh(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:a}=this;return e.finished=r,e.destroyed=o,e.blockLen=i,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const hg=(e,t,n)=>new dg(e,t).update(n).digest();hg.create=(e,t)=>new dg(e,t);const yg=BigInt(0),gg=BigInt(1);function mg(e,t=\"\"){if(\"boolean\"!=typeof e){throw new Error((t&&`\"${t}\"`)+\"expected boolean, got type=\"+typeof e)}return e}function vg(e,t,n=\"\"){const r=Ih(e),o=e?.length,i=void 0!==t;if(!r||i&&o!==t){throw new Error((n&&`\"${n}\" `)+\"expected Uint8Array\"+(i?` of length ${t}`:\"\")+\", got \"+(r?`length=${o}`:\"type=\"+typeof e))}return e}function bg(e){const t=e.toString(16);return 1&t.length?\"0\"+t:t}function wg(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);return\"\"===e?yg:BigInt(\"0x\"+e)}function Sg(e){return wg(Kh(e))}function Ag(e){return Bh(e),wg(Kh(Uint8Array.from(e).reverse()))}function Eg(e,t){return Jh(e.toString(16).padStart(2*t,\"0\"))}function xg(e,t){return Eg(e,t).reverse()}function Tg(e,t,n){let r;if(\"string\"==typeof t)try{r=Jh(t)}catch(t){throw new Error(e+\" must be hex string or Uint8Array, cause: \"+t)}else{if(!Ih(t))throw new Error(e+\" must be hex string or Uint8Array\");r=Uint8Array.from(t)}const o=r.length;if(\"number\"==typeof n&&o!==n)throw new Error(e+\" of length \"+n+\" expected, got \"+o);return r}function kg(e){return Uint8Array.from(e)}const Og=e=>\"bigint\"==typeof e&&yg<=e;function _g(e,t,n,r){if(!function(e,t,n){return Og(e)&&Og(t)&&Og(n)&&t<=e&&e<n}(t,n,r))throw new Error(\"expected valid \"+e+\": \"+n+\" <= n < \"+r+\", got \"+t)}function Ig(e){let t;for(t=0;e>yg;e>>=gg,t+=1);return t}const Cg=e=>(gg<<BigInt(e))-gg;function Bg(e,t,n={}){if(!e||\"object\"!=typeof e)throw new Error(\"expected valid options object\");function r(t,n,r){const o=e[t];if(r&&void 0===o)return;const i=typeof o;if(i!==n||null===o)throw new Error(`param \"${t}\" is invalid: expected ${n}, got ${i}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}const Pg=()=>{throw new Error(\"not implemented\")};function Rg(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(void 0!==o)return o;const i=e(n,...r);return t.set(n,i),i}}const jg=BigInt(0),Ug=BigInt(1),Fg=BigInt(2),Ng=BigInt(3),Lg=BigInt(4),Mg=BigInt(5),Dg=BigInt(7),qg=BigInt(8),Vg=BigInt(9),zg=BigInt(16);function Kg(e,t){const n=e%t;return n>=jg?n:t+n}function Hg(e,t,n){let r=e;for(;t-- >jg;)r*=r,r%=n;return r}function $g(e,t){if(e===jg)throw new Error(\"invert: expected non-zero number\");if(t<=jg)throw new Error(\"invert: expected positive modulus, got \"+t);let n=Kg(e,t),r=t,o=jg,i=Ug,a=Ug,s=jg;for(;n!==jg;){const e=r/n,t=r%n,c=o-a*e,u=i-s*e;r=n,n=t,o=a,i=s,a=c,s=u}if(r!==Ug)throw new Error(\"invert: does not exist\");return Kg(o,t)}function Gg(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error(\"Cannot find square root\")}function Wg(e,t){const n=(e.ORDER+Ug)/Lg,r=e.pow(t,n);return Gg(e,r,t),r}function Xg(e,t){const n=(e.ORDER-Mg)/qg,r=e.mul(t,Fg),o=e.pow(r,n),i=e.mul(t,o),a=e.mul(e.mul(i,Fg),o),s=e.mul(i,e.sub(a,e.ONE));return Gg(e,s,t),s}function Zg(e){if(e<Ng)throw new Error(\"sqrt is not defined for small field\");let t=e-Ug,n=0;for(;t%Fg===jg;)t/=Fg,n++;let r=Fg;const o=om(e);for(;1===nm(o,r);)if(r++>1e3)throw new Error(\"Cannot find square root: probably non-prime P\");if(1===n)return Wg;let i=o.pow(r,t);const a=(t+Ug)/Fg;return function(e,r){if(e.is0(r))return r;if(1!==nm(e,r))throw new Error(\"Cannot find square root\");let o=n,s=e.mul(e.ONE,i),c=e.pow(r,t),u=e.pow(r,a);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===o)throw new Error(\"Cannot find square root\");const r=Ug<<BigInt(o-t-1),i=e.pow(s,r);o=t,s=e.sqr(i),c=e.mul(c,s),u=e.mul(u,i)}return u}}function Yg(e){return e%Lg===Ng?Wg:e%qg===Mg?Xg:e%zg===Vg?function(e){const t=om(e),n=Zg(e),r=n(t,t.neg(t.ONE)),o=n(t,r),i=n(t,t.neg(r)),a=(e+Dg)/zg;return(e,t)=>{let n=e.pow(t,a),s=e.mul(n,r);const c=e.mul(n,o),u=e.mul(n,i),l=e.eql(e.sqr(s),t),f=e.eql(e.sqr(c),t);n=e.cmov(n,s,l),s=e.cmov(u,c,f);const p=e.eql(e.sqr(s),t),d=e.cmov(n,s,p);return Gg(e,d,t),d}}(e):Zg(e)}const Jg=(e,t)=>(Kg(e,t)&Ug)===Ug,Qg=[\"create\",\"isValid\",\"is0\",\"neg\",\"inv\",\"sqrt\",\"sqr\",\"eql\",\"add\",\"sub\",\"mul\",\"pow\",\"div\",\"addN\",\"subN\",\"mulN\",\"sqrN\"];function em(e,t,n){if(n<jg)throw new Error(\"invalid exponent, negatives unsupported\");if(n===jg)return e.ONE;if(n===Ug)return t;let r=e.ONE,o=t;for(;n>jg;)n&Ug&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Ug;return r}function tm(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n)),e.ONE),i=e.inv(o);return t.reduceRight((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n)),i),r}function nm(e,t){const n=(e.ORDER-Ug)/Fg,r=e.pow(t,n),o=e.eql(r,e.ONE),i=e.eql(r,e.ZERO),a=e.eql(r,e.neg(e.ONE));if(!o&&!i&&!a)throw new Error(\"invalid Legendre symbol result\");return o?1:i?0:-1}function rm(e,t){void 0!==t&&Ch(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function om(e,t,n=!1,r={}){if(e<=jg)throw new Error(\"invalid field: expected ORDER > 0, got \"+e);let o,i,a,s=!1;if(\"object\"==typeof t&&null!=t){if(r.sqrt||n)throw new Error(\"cannot specify opts in two arguments\");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(i=e.sqrt),\"boolean\"==typeof e.isLE&&(n=e.isLE),\"boolean\"==typeof e.modFromBytes&&(s=e.modFromBytes),a=e.allowedLengths}else\"number\"==typeof t&&(o=t),r.sqrt&&(i=r.sqrt);const{nBitLength:c,nByteLength:u}=rm(e,o);if(u>2048)throw new Error(\"invalid field: expected ORDER of <= 2048 bytes\");let l;const f=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:u,MASK:Cg(c),ZERO:jg,ONE:Ug,allowedLengths:a,create:t=>Kg(t,e),isValid:t=>{if(\"bigint\"!=typeof t)throw new Error(\"invalid field element: expected bigint, got \"+typeof t);return jg<=t&&t<e},is0:e=>e===jg,isValidNot0:e=>!f.is0(e)&&f.isValid(e),isOdd:e=>(e&Ug)===Ug,neg:t=>Kg(-t,e),eql:(e,t)=>e===t,sqr:t=>Kg(t*t,e),add:(t,n)=>Kg(t+n,e),sub:(t,n)=>Kg(t-n,e),mul:(t,n)=>Kg(t*n,e),pow:(e,t)=>em(f,e,t),div:(t,n)=>Kg(t*$g(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>$g(t,e),sqrt:i||(t=>(l||(l=Yg(e)),l(f,t))),toBytes:e=>n?xg(e,u):Eg(e,u),fromBytes:(t,r=!0)=>{if(a){if(!a.includes(t.length)||t.length>u)throw new Error(\"Field.fromBytes: expected \"+a+\" bytes, got \"+t.length);const e=new Uint8Array(u);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==u)throw new Error(\"Field.fromBytes: expected \"+u+\" bytes, got \"+t.length);let o=n?Ag(t):Sg(t);if(s&&(o=Kg(o,e)),!r&&!f.isValid(o))throw new Error(\"invalid field element: outside of range 0..ORDER\");return o},invertBatch:e=>tm(f,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(f)}function im(e){if(\"bigint\"!=typeof e)throw new Error(\"field order must be bigint\");const t=e.toString(2).length;return Math.ceil(t/8)}function am(e){const t=im(e);return t+Math.ceil(t/2)}const sm=BigInt(0),cm=BigInt(1);function um(e,t){const n=t.negate();return e?n:t}function lm(e,t){const n=tm(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function fm(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error(\"invalid window size, expected [1..\"+t+\"], got W=\"+e)}function pm(e,t){fm(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:Cg(e),maxNumber:n,shiftBy:BigInt(e)}}function dm(e,t,n){const{windowSize:r,mask:o,maxNumber:i,shiftBy:a}=n;let s=Number(e&o),c=e>>a;s>r&&(s-=i,c+=cm);const u=t*r;return{nextN:c,offset:u+Math.abs(s)-1,isZero:0===s,isNeg:s<0,isNegF:t%2!=0,offsetF:u}}function hm(e,t){if(!Array.isArray(e))throw new Error(\"array expected\");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error(\"invalid point at index \"+n)})}function ym(e,t){if(!Array.isArray(e))throw new Error(\"array of scalars expected\");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error(\"invalid scalar at index \"+n)})}const gm=new WeakMap,mm=new WeakMap;function vm(e){return mm.get(e)||1}function bm(e){if(e!==sm)throw new Error(\"invalid wNAF\")}class wm{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>sm;)t&cm&&(n=n.add(r)),r=r.double(),t>>=cm;return n}precomputeWindow(e,t){const{windows:n,windowSize:r}=pm(t,this.bits),o=[];let i=e,a=i;for(let e=0;e<n;e++){a=i,o.push(a);for(let e=1;e<r;e++)a=a.add(i),o.push(a);i=a.double()}return o}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error(\"invalid scalar\");let r=this.ZERO,o=this.BASE;const i=pm(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:a,offset:s,isZero:c,isNeg:u,isNegF:l,offsetF:f}=dm(n,e,i);n=a,c?o=o.add(um(l,t[f])):r=r.add(um(u,t[s]))}return bm(n),{p:r,f:o}}wNAFUnsafe(e,t,n,r=this.ZERO){const o=pm(e,this.bits);for(let e=0;e<o.windows&&n!==sm;e++){const{nextN:i,offset:a,isZero:s,isNeg:c}=dm(n,e,o);if(n=i,!s){const e=t[a];r=r.add(c?e.negate():e)}}return bm(n),r}getPrecomputes(e,t,n){let r=gm.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&(\"function\"==typeof n&&(r=n(r)),gm.set(t,r))),r}cached(e,t,n){const r=vm(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){const o=vm(e);return 1===o?this._unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)}createCache(e,t){fm(t,this.bits),mm.set(e,t),gm.delete(e)}hasCache(e){return 1!==vm(e)}}function Sm(e,t,n,r){hm(n,e),ym(r,t);const o=n.length,i=r.length;if(o!==i)throw new Error(\"arrays of points and scalars must have equal length\");const a=e.ZERO,s=Ig(BigInt(o));let c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);const u=Cg(c),l=new Array(Number(u)+1).fill(a);let f=a;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){l.fill(a);for(let t=0;t<i;t++){const o=r[t],i=Number(o>>BigInt(e)&u);l[i]=l[i].add(n[t])}let t=a;for(let e=l.length-1,n=a;e>0;e--)n=n.add(l[e]),t=t.add(n);if(f=f.add(t),0!==e)for(let e=0;e<c;e++)f=f.double()}return f}function Am(e,t,n){if(t){if(t.ORDER!==e)throw new Error(\"Field.ORDER must match order: Fp == p, Fn == n\");return function(e){const t=Qg.reduce((e,t)=>(e[t]=\"function\",e),{ORDER:\"bigint\",MASK:\"bigint\",BYTES:\"number\",BITS:\"number\"});Bg(e,t)}(t),t}return om(e,{isLE:n})}function Em(e,t,n={},r){if(void 0===r&&(r=\"edwards\"===e),!t||\"object\"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of[\"p\",\"n\",\"h\"]){const n=t[e];if(!(\"bigint\"==typeof n&&n>sm))throw new Error(`CURVE.${e} must be positive bigint`)}const o=Am(t.p,n.Fp,r),i=Am(t.n,n.Fn,r),a=[\"Gx\",\"Gy\",\"a\",\"weierstrass\"===e?\"b\":\"d\"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}}const xm=(e,t)=>(e+(e>=0?t:-t)/Bm)/t;function Tm(e){if(![\"compact\",\"recovered\",\"der\"].includes(e))throw new Error('Signature format must be \"compact\", \"recovered\", or \"der\"');return e}function km(e,t){const n={};for(let r of Object.keys(t))n[r]=void 0===e[r]?t[r]:e[r];return mg(n.lowS,\"lowS\"),mg(n.prehash,\"prehash\"),void 0!==n.format&&Tm(n.format),n}class Om extends Error{constructor(e=\"\"){super(e)}}const _m={Err:Om,_tlv:{encode:(e,t)=>{const{Err:n}=_m;if(e<0||e>256)throw new n(\"tlv.encode: wrong tag\");if(1&t.length)throw new n(\"tlv.encode: unpadded data\");const r=t.length/2,o=bg(r);if(o.length/2&128)throw new n(\"tlv.encode: long form length too big\");const i=r>127?bg(o.length/2|128):\"\";return bg(e)+i+o+t},decode(e,t){const{Err:n}=_m;let r=0;if(e<0||e>256)throw new n(\"tlv.encode: wrong tag\");if(t.length<2||t[r++]!==e)throw new n(\"tlv.decode: wrong tlv\");const o=t[r++];let i=0;if(!!(128&o)){const e=127&o;if(!e)throw new n(\"tlv.decode(long): indefinite length not supported\");if(e>4)throw new n(\"tlv.decode(long): byte length is too big\");const a=t.subarray(r,r+e);if(a.length!==e)throw new n(\"tlv.decode: length bytes not complete\");if(0===a[0])throw new n(\"tlv.decode(long): zero leftmost byte\");for(const e of a)i=i<<8|e;if(r+=e,i<128)throw new n(\"tlv.decode(long): not minimal encoding\")}else i=o;const a=t.subarray(r,r+i);if(a.length!==i)throw new n(\"tlv.decode: wrong value length\");return{v:a,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=_m;if(e<Im)throw new t(\"integer: negative integers are not allowed\");let n=bg(e);if(8&Number.parseInt(n[0],16)&&(n=\"00\"+n),1&n.length)throw new t(\"unexpected DER parsing assertion: unpadded hex\");return n},decode(e){const{Err:t}=_m;if(128&e[0])throw new t(\"invalid signature integer: negative\");if(0===e[0]&&!(128&e[1]))throw new t(\"invalid signature integer: unnecessary leading zero\");return Sg(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=_m,o=Tg(\"signature\",e),{v:i,l:a}=r.decode(48,o);if(a.length)throw new t(\"invalid signature: left bytes after parsing\");const{v:s,l:c}=r.decode(2,i),{v:u,l}=r.decode(2,c);if(l.length)throw new t(\"invalid signature: left bytes after parsing\");return{r:n.decode(s),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=_m,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}},Im=BigInt(0),Cm=BigInt(1),Bm=BigInt(2),Pm=BigInt(3),Rm=BigInt(4);function jm(e,t){const{BYTES:n}=e;let r;if(\"bigint\"==typeof t)r=t;else{let o=Tg(\"private key\",t);try{r=e.fromBytes(o)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw new Error(\"invalid private key: out of range [1..N-1]\");return r}function Um(e,t={}){const n=Em(\"weierstrass\",e,t),{Fp:r,Fn:o}=n;let i=n.CURVE;const{h:a,n:s}=i;Bg(t,{},{allowInfinityPoint:\"boolean\",clearCofactor:\"function\",isTorsionFree:\"function\",fromBytes:\"function\",toBytes:\"function\",endo:\"object\",wrapPrivateKey:\"boolean\"});const{endo:c}=t;if(c&&(!r.is0(i.a)||\"bigint\"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected \"beta\": bigint and \"basises\": array');const u=Nm(r,o);function l(){if(!r.isOdd)throw new Error(\"compression is not supported: Field does not have .isOdd()\")}const f=t.toBytes||function(e,t,n){const{x:o,y:i}=t.toAffine(),a=r.toBytes(o);if(mg(n,\"isCompressed\"),n){l();return oy(Fm(!r.isOdd(i)),a)}return oy(Uint8Array.of(4),a,r.toBytes(i))},p=t.fromBytes||function(e){vg(e,void 0,\"Point\");const{publicKey:t,publicKeyUncompressed:n}=u,o=e.length,i=e[0],a=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===n&&4===i){const e=r.BYTES,t=r.fromBytes(a.subarray(0,e)),n=r.fromBytes(a.subarray(e,2*e));if(!h(t,n))throw new Error(\"bad point: is not on curve\");return{x:t,y:n}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${n}`)}{const e=r.fromBytes(a);if(!r.isValid(e))throw new Error(\"bad point: is not on curve, wrong x\");const t=d(e);let n;try{n=r.sqrt(t)}catch(e){const t=e instanceof Error?\": \"+e.message:\"\";throw new Error(\"bad point: is not on curve, sqrt error\"+t)}l();return!(1&~i)!==r.isOdd(n)&&(n=r.neg(n)),{x:e,y:n}}};function d(e){const t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,i.a)),i.b)}function h(e,t){const n=r.sqr(t),o=d(e);return r.eql(n,o)}if(!h(i.Gx,i.Gy))throw new Error(\"bad curve params: generator point\");const y=r.mul(r.pow(i.a,Pm),Rm),g=r.mul(r.sqr(i.b),BigInt(27));if(r.is0(r.add(y,g)))throw new Error(\"bad curve params: a or b\");function m(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function v(e){if(!(e instanceof E))throw new Error(\"ProjectivePoint expected\")}function b(e){if(!c||!c.basises)throw new Error(\"no endo\");return function(e,t,n){const[[r,o],[i,a]]=t,s=xm(a*e,n),c=xm(-o*e,n);let u=e-s*r-c*i,l=-s*o-c*a;const f=u<Im,p=l<Im;f&&(u=-u),p&&(l=-l);const d=Cg(Math.ceil(Ig(n)/2))+Cm;if(u<Im||u>=d||l<Im||l>=d)throw new Error(\"splitScalar (endomorphism): failed, k=\"+e);return{k1neg:f,k1:u,k2neg:p,k2:l}}(e,c.basises,o.ORDER)}const w=Rg((e,t)=>{const{X:n,Y:o,Z:i}=e;if(r.eql(i,r.ONE))return{x:n,y:o};const a=e.is0();null==t&&(t=a?r.ONE:r.inv(i));const s=r.mul(n,t),c=r.mul(o,t),u=r.mul(i,t);if(a)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error(\"invZ was invalid\");return{x:s,y:c}}),S=Rg(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw new Error(\"bad point: ZERO\")}const{x:n,y:o}=e.toAffine();if(!r.isValid(n)||!r.isValid(o))throw new Error(\"bad point: x or y not field elements\");if(!h(n,o))throw new Error(\"bad point: equation left != right\");if(!e.isTorsionFree())throw new Error(\"bad point: not in prime-order subgroup\");return!0});function A(e,t,n,o,i){return n=new E(r.mul(n.X,e),n.Y,n.Z),t=um(o,t),n=um(i,n),t.add(n)}class E{constructor(e,t,n){this.X=m(\"x\",e),this.Y=m(\"y\",t,!0),this.Z=m(\"z\",n),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error(\"invalid affine point\");if(e instanceof E)throw new Error(\"projective point not allowed\");return r.is0(t)&&r.is0(n)?E.ZERO:new E(t,n,r.ONE)}static fromBytes(e){const t=E.fromAffine(p(vg(e,void 0,\"point\")));return t.assertValidity(),t}static fromHex(e){return E.fromBytes(Tg(\"pointHex\",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return T.createCache(this,e),t||this.multiply(Pm),this}assertValidity(){S(this)}hasEvenY(){const{y:e}=this.toAffine();if(!r.isOdd)throw new Error(\"Field doesn't support isOdd\");return!r.isOdd(e)}equals(e){v(e);const{X:t,Y:n,Z:o}=this,{X:i,Y:a,Z:s}=e,c=r.eql(r.mul(t,s),r.mul(i,o)),u=r.eql(r.mul(n,s),r.mul(a,o));return c&&u}negate(){return new E(this.X,r.neg(this.Y),this.Z)}double(){const{a:e,b:t}=i,n=r.mul(t,Pm),{X:o,Y:a,Z:s}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,f=r.mul(o,o),p=r.mul(a,a),d=r.mul(s,s),h=r.mul(o,a);return h=r.add(h,h),l=r.mul(o,s),l=r.add(l,l),c=r.mul(e,l),u=r.mul(n,d),u=r.add(c,u),c=r.sub(p,u),u=r.add(p,u),u=r.mul(c,u),c=r.mul(h,c),l=r.mul(n,l),d=r.mul(e,d),h=r.sub(f,d),h=r.mul(e,h),h=r.add(h,l),l=r.add(f,f),f=r.add(l,f),f=r.add(f,d),f=r.mul(f,h),u=r.add(u,f),d=r.mul(a,s),d=r.add(d,d),f=r.mul(d,h),c=r.sub(c,f),l=r.mul(d,p),l=r.add(l,l),l=r.add(l,l),new E(c,u,l)}add(e){v(e);const{X:t,Y:n,Z:o}=this,{X:a,Y:s,Z:c}=e;let u=r.ZERO,l=r.ZERO,f=r.ZERO;const p=i.a,d=r.mul(i.b,Pm);let h=r.mul(t,a),y=r.mul(n,s),g=r.mul(o,c),m=r.add(t,n),b=r.add(a,s);m=r.mul(m,b),b=r.add(h,y),m=r.sub(m,b),b=r.add(t,o);let w=r.add(a,c);return b=r.mul(b,w),w=r.add(h,g),b=r.sub(b,w),w=r.add(n,o),u=r.add(s,c),w=r.mul(w,u),u=r.add(y,g),w=r.sub(w,u),f=r.mul(p,b),u=r.mul(d,g),f=r.add(u,f),u=r.sub(y,f),f=r.add(y,f),l=r.mul(u,f),y=r.add(h,h),y=r.add(y,h),g=r.mul(p,g),b=r.mul(d,b),y=r.add(y,g),g=r.sub(h,g),g=r.mul(p,g),b=r.add(b,g),h=r.mul(y,b),l=r.add(l,h),h=r.mul(w,b),u=r.mul(m,u),u=r.sub(u,h),h=r.mul(m,y),f=r.mul(w,f),f=r.add(f,h),new E(u,l,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(E.ZERO)}multiply(e){const{endo:n}=t;if(!o.isValidNot0(e))throw new Error(\"invalid scalar: out of range\");let r,i;const a=e=>T.cached(this,e,e=>lm(E,e));if(n){const{k1neg:t,k1:o,k2neg:s,k2:c}=b(e),{p:u,f:l}=a(o),{p:f,f:p}=a(c);i=l.add(p),r=A(n.beta,u,f,t,s)}else{const{p:t,f:n}=a(e);r=t,i=n}return lm(E,[r,i])[0]}multiplyUnsafe(e){const{endo:n}=t,r=this;if(!o.isValid(e))throw new Error(\"invalid scalar: out of range\");if(e===Im||r.is0())return E.ZERO;if(e===Cm)return r;if(T.hasCache(this))return this.multiply(e);if(n){const{k1neg:t,k1:o,k2neg:i,k2:a}=b(e),{p1:s,p2:c}=function(e,t,n,r){let o=t,i=e.ZERO,a=e.ZERO;for(;n>sm||r>sm;)n&cm&&(i=i.add(o)),r&cm&&(a=a.add(o)),o=o.double(),n>>=cm,r>>=cm;return{p1:i,p2:a}}(E,r,o,a);return A(n.beta,s,c,t,i)}return T.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){const r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return w(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return a===Cm||(e?e(E,this):T.unsafe(this,s).is0())}clearCofactor(){const{clearCofactor:e}=t;return a===Cm?this:e?e(E,this):this.multiplyUnsafe(a)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}toBytes(e=!0){return mg(e,\"isCompressed\"),this.assertValidity(),f(E,this,e)}toHex(e=!0){return Kh(this.toBytes(e))}toString(){return`<Point ${this.is0()?\"ZERO\":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return lm(E,e)}static msm(e,t){return Sm(E,o,e,t)}static fromPrivateKey(e){return E.BASE.multiply(jm(o,e))}}E.BASE=new E(i.Gx,i.Gy,r.ONE),E.ZERO=new E(r.ZERO,r.ONE,r.ZERO),E.Fp=r,E.Fn=o;const x=o.BITS,T=new wm(E,t.endo?Math.ceil(x/2):x);return E.BASE.precompute(8),E}function Fm(e){return Uint8Array.of(e?2:3)}function Nm(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Lm(e,t={}){const{Fn:n}=e,r=t.randomBytes||sy,o=Object.assign(Nm(e.Fp,n),{seed:am(n.ORDER)});function i(e){try{return!!jm(n,e)}catch(e){return!1}}function a(e=r(o.seed)){return function(e,t,n=!1){const r=e.length,o=im(t),i=am(t);if(r<16||r<i||r>1024)throw new Error(\"expected \"+i+\"-1024 bytes of input, got \"+r);const a=Kg(n?Ag(e):Sg(e),t-Ug)+Ug;return n?xg(a,o):Eg(a,o)}(vg(e,o.seed,\"seed\"),n.ORDER)}function s(t,r=!0){return e.BASE.multiply(jm(n,t)).toBytes(r)}function c(t){if(\"bigint\"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:r,publicKey:i,publicKeyUncompressed:a}=o;if(n.allowedLengths||r===i)return;const s=Tg(\"key\",t).length;return s===i||s===a}const u={isValidSecretKey:i,isValidPublicKey:function(t,n){const{publicKey:r,publicKeyUncompressed:i}=o;try{const o=t.length;return(!0!==n||o===r)&&((!1!==n||o===i)&&!!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:a,isValidPrivateKey:i,randomPrivateKey:a,normPrivateKeyToScalar:e=>jm(n,e),precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({getPublicKey:s,getSharedSecret:function(t,r,o=!0){if(!0===c(t))throw new Error(\"first arg must be private key\");if(!1===c(r))throw new Error(\"second arg must be public key\");const i=jm(n,t);return e.fromHex(r).multiply(i).toBytes(o)},keygen:function(e){const t=a(e);return{secretKey:t,publicKey:s(t)}},Point:e,utils:u,lengths:o})}function Mm(e,t,n={}){Ph(t),Bg(n,{},{hmac:\"function\",lowS:\"boolean\",randomBytes:\"function\",bits2int:\"function\",bits2int_modN:\"function\"});const r=n.randomBytes||sy,o=n.hmac||((e,...n)=>hg(t,e,oy(...n))),{Fp:i,Fn:a}=e,{ORDER:s,BITS:c}=a,{keygen:u,getPublicKey:l,getSharedSecret:f,utils:p,lengths:d}=Lm(e,n),h={prehash:!1,lowS:\"boolean\"==typeof n.lowS&&n.lowS,format:void 0,extraEntropy:!1},y=\"compact\";function g(e){return e>s>>Cm}function m(e,t){if(!a.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class v{constructor(e,t,n){this.r=m(\"r\",e),this.s=m(\"s\",t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,t=y){let n;if(function(e,t){Tm(t);const n=d.signature;vg(e,\"compact\"===t?n:\"recovered\"===t?n+1:void 0,`${t} signature`)}(e,t),\"der\"===t){const{r:t,s:n}=_m.toSig(vg(e));return new v(t,n)}\"recovered\"===t&&(n=e[0],t=\"compact\",e=e.subarray(1));const r=a.BYTES,o=e.subarray(0,r),i=e.subarray(r,2*r);return new v(a.fromBytes(o),a.fromBytes(i),n)}static fromHex(e,t){return this.fromBytes(Jh(e),t)}addRecoveryBit(e){return new v(this.r,this.s,e)}recoverPublicKey(t){const n=i.ORDER,{r,s:o,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error(\"recovery id invalid\");if(s*Bm<n&&c>1)throw new Error(\"recovery id is ambiguous for h>1 curve\");const u=2===c||3===c?r+s:r;if(!i.isValid(u))throw new Error(\"recovery id 2 or 3 invalid\");const l=i.toBytes(u),f=e.fromBytes(oy(Fm(!(1&c)),l)),p=a.inv(u),d=w(Tg(\"msgHash\",t)),h=a.create(-d*p),y=a.create(o*p),g=e.BASE.multiplyUnsafe(h).add(f.multiplyUnsafe(y));if(g.is0())throw new Error(\"point at infinify\");return g.assertValidity(),g}hasHighS(){return g(this.s)}toBytes(e=y){if(Tm(e),\"der\"===e)return Jh(_m.hexFromSig(this));const t=a.toBytes(this.r),n=a.toBytes(this.s);if(\"recovered\"===e){if(null==this.recovery)throw new Error(\"recovery bit must be present\");return oy(Uint8Array.of(this.recovery),t,n)}return oy(t,n)}toHex(e){return Kh(this.toBytes(e))}assertValidity(){}static fromCompact(e){return v.fromBytes(Tg(\"sig\",e),\"compact\")}static fromDER(e){return v.fromBytes(Tg(\"sig\",e),\"der\")}normalizeS(){return this.hasHighS()?new v(this.r,a.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes(\"der\")}toDERHex(){return Kh(this.toBytes(\"der\"))}toCompactRawBytes(){return this.toBytes(\"compact\")}toCompactHex(){return Kh(this.toBytes(\"compact\"))}}const b=n.bits2int||function(e){if(e.length>8192)throw new Error(\"input is too large\");const t=Sg(e),n=8*e.length-c;return n>0?t>>BigInt(n):t},w=n.bits2int_modN||function(e){return a.create(b(e))},S=Cg(c);function A(e){return _g(\"num < 2^\"+c,e,Im,S),a.toBytes(e)}function E(e,n){return vg(e,void 0,\"message\"),n?vg(t(e),void 0,\"prehashed message\"):e}return Object.freeze({keygen:u,getPublicKey:l,getSharedSecret:f,utils:p,lengths:d,Point:e,sign:function(n,i,s={}){n=Tg(\"message\",n);const{seed:c,k2sig:u}=function(t,n,o){if([\"recovered\",\"canonical\"].some(e=>e in o))throw new Error(\"sign() legacy options not supported\");const{lowS:i,prehash:s,extraEntropy:c}=km(o,h);t=E(t,s);const u=w(t),l=jm(a,n),f=[A(l),A(u)];if(null!=c&&!1!==c){const e=!0===c?r(d.secretKey):c;f.push(Tg(\"extraEntropy\",e))}const p=oy(...f),y=u;return{seed:p,k2sig:function(t){const n=b(t);if(!a.isValidNot0(n))return;const r=a.inv(n),o=e.BASE.multiply(n).toAffine(),s=a.create(o.x);if(s===Im)return;const c=a.create(r*a.create(y+s*l));if(c===Im)return;let u=(o.x===s?0:2)|Number(o.y&Cm),f=c;return i&&g(c)&&(f=a.neg(c),u^=1),new v(s,f,u)}}}(n,i,s),l=function(e,t,n){if(\"number\"!=typeof e||e<2)throw new Error(\"hashLen must be a number\");if(\"number\"!=typeof t||t<2)throw new Error(\"qByteLen must be a number\");if(\"function\"!=typeof n)throw new Error(\"hmacFn must be a function\");const r=e=>new Uint8Array(e),o=e=>Uint8Array.of(e);let i=r(e),a=r(e),s=0;const c=()=>{i.fill(1),a.fill(0),s=0},u=(...e)=>n(a,i,...e),l=(e=r(0))=>{a=u(o(0),e),i=u(),0!==e.length&&(a=u(o(1),e),i=u())},f=()=>{if(s++>=1e3)throw new Error(\"drbg: tried 1000 values\");let e=0;const n=[];for(;e<t;){i=u();const t=i.slice();n.push(t),e+=i.length}return oy(...n)};return(e,t)=>{let n;for(c(),l(e);!(n=t(f()));)l();return c(),n}}(t.outputLen,a.BYTES,o);return l(c,u)},verify:function(t,n,r,o={}){const{lowS:i,prehash:s,format:c}=km(o,h);if(r=Tg(\"publicKey\",r),n=E(Tg(\"message\",n),s),\"strict\"in o)throw new Error(\"options.strict was renamed to lowS\");const u=void 0===c?function(e){let t;const n=\"string\"==typeof e||Ih(e),r=!n&&null!==e&&\"object\"==typeof e&&\"bigint\"==typeof e.r&&\"bigint\"==typeof e.s;if(!n&&!r)throw new Error(\"invalid signature, expected Uint8Array, hex string or Signature instance\");if(r)t=new v(e.r,e.s);else if(n){try{t=v.fromBytes(Tg(\"sig\",e),\"der\")}catch(e){if(!(e instanceof _m.Err))throw e}if(!t)try{t=v.fromBytes(Tg(\"sig\",e),\"compact\")}catch(e){return!1}}return t||!1}(t):v.fromBytes(Tg(\"sig\",t),c);if(!1===u)return!1;try{const t=e.fromBytes(r);if(i&&u.hasHighS())return!1;const{r:o,s}=u,c=w(n),l=a.inv(s),f=a.create(c*l),p=a.create(o*l),d=e.BASE.multiplyUnsafe(f).add(t.multiplyUnsafe(p));if(d.is0())return!1;return a.create(d.x)===o}catch(e){return!1}},recoverPublicKey:function(e,t,n={}){const{prehash:r}=km(n,h);return t=E(t,r),v.fromBytes(e,\"recovered\").recoverPublicKey(t).toBytes()},Signature:v,hash:t})}function Dm(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:om(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function qm(e){const{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:o}=function(e){const{CURVE:t,curveOpts:n}=Dm(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}(e);return function(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,rm(n.Fn.ORDER,n.Fn.BITS))})}(e,Mm(Um(t,n),r,o))}const Vm={p:BigInt(\"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f\"),n:BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt(\"0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\"),Gy:BigInt(\"0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\")},zm={beta:BigInt(\"0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\"),basises:[[BigInt(\"0x3086d221a7d46bcde86c90e49284eb15\"),-BigInt(\"0xe4437ed6010e88286f547fa90abfe4c3\")],[BigInt(\"0x114ca50f7a8e2f3f657c1108d9d44cfd8\"),BigInt(\"0x3086d221a7d46bcde86c90e49284eb15\")]]},Km=BigInt(2);const Hm=om(Vm.p,{sqrt:function(e){const t=Vm.p,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,f=Hg(l,n,t)*l%t,p=Hg(f,n,t)*l%t,d=Hg(p,Km,t)*u%t,h=Hg(d,o,t)*d%t,y=Hg(h,i,t)*h%t,g=Hg(y,s,t)*y%t,m=Hg(g,c,t)*g%t,v=Hg(m,s,t)*y%t,b=Hg(v,n,t)*l%t,w=Hg(b,a,t)*h%t,S=Hg(w,r,t)*u%t,A=Hg(S,Km,t);if(!Hm.eql(Hm.sqr(A),e))throw new Error(\"Cannot find square root\");return A}}),$m=function(e,t){const n=t=>qm({...e,hash:t});return{...n(t),create:n}}({...Vm,Fp:Hm,lowS:!0,endo:zm},fg);var Gm=n(6925);function Wm(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function Xm(e,...t){if(!Wm(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function Zm(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>\"string\"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function Ym(e){if(\"function\"!=typeof e)throw new Error(\"function expected\");return!0}function Jm(e,t){if(\"string\"!=typeof t)throw new Error(`${e}: string expected`);return!0}function Qm(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function ev(e){if(!Array.isArray(e))throw new Error(\"array expected\")}function tv(e,t){if(!Zm(!0,t))throw new Error(`${e}: array of strings expected`)}function nv(e,t){if(!Zm(!1,t))throw new Error(`${e}: array of numbers expected`)}function rv(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function ov(e){const t=\"string\"==typeof e?e.split(\"\"):e,n=t.length;tv(\"alphabet\",t);const r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(ev(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet \"${r}\". Allowed: ${e}`);return t[r]})),decode:t=>(ev(t),t.map(t=>{Jm(\"alphabet.decode\",t);const n=r.get(t);if(void 0===n)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return n}))}}function iv(e=\"\"){return Jm(\"join\",e),{encode:t=>(tv(\"join.decode\",t),t.join(e)),decode:t=>(Jm(\"join.decode\",t),t.split(e))}}function av(e,t=\"=\"){return Qm(e),Jm(\"padding\",t),{encode(n){for(tv(\"padding.encode\",n);n.length*e%8;)n.push(t);return n},decode(n){tv(\"padding.decode\",n);let r=n.length;if(r*e%8)throw new Error(\"padding: invalid, string should have whole number of bytes\");for(;r>0&&n[r-1]===t;r--){if((r-1)*e%8==0)throw new Error(\"padding: invalid, string has too much padding\")}return n.slice(0,r)}}}function sv(e){return Ym(e),{encode:e=>e,decode:t=>e(t)}}function cv(e,t,n){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(ev(e),!e.length)return[];let r=0;const o=[],i=Array.from(e,e=>{if(Qm(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),a=i.length;for(;;){let e=0,s=!0;for(let o=r;o<a;o++){const a=i[o],c=t*e,u=c+a;if(!Number.isSafeInteger(u)||c/t!==e||u-a!==c)throw new Error(\"convertRadix: carry overflow\");const l=u/n;e=u%n;const f=Math.floor(l);if(i[o]=f,!Number.isSafeInteger(f)||f*n+e!==u)throw new Error(\"convertRadix: carry overflow\");s&&(f?s=!1:r=o)}if(o.push(e),s)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}const uv=(e,t)=>0===t?e:uv(t,e%t),lv=(e,t)=>e+(t-uv(e,t)),fv=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function pv(e,t,n,r){if(ev(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(lv(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${lv(t,n)}`);let o=0,i=0;const a=fv[t],s=fv[n]-1,c=[];for(const r of e){if(Qm(r),r>=a)throw new Error(`convertRadix2: invalid data word=${r} from=${t}`);if(o=o<<t|r,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=n;i-=n)c.push((o>>i-n&s)>>>0);const e=fv[i];if(void 0===e)throw new Error(\"invalid carry\");o&=e-1}if(o=o<<n-i&s,!r&&i>=t)throw new Error(\"Excess padding\");if(!r&&o>0)throw new Error(`Non-zero padding: ${o}`);return r&&i>0&&c.push(o>>>0),c}function dv(e){Qm(e);return{encode:t=>{if(!Wm(t))throw new Error(\"radix.encode input should be Uint8Array\");return cv(Array.from(t),256,e)},decode:t=>(nv(\"radix.decode\",t),Uint8Array.from(cv(t,e,256)))}}function hv(e,t=!1){if(Qm(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if(lv(8,e)>32||lv(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:n=>{if(!Wm(n))throw new Error(\"radix2.encode input should be Uint8Array\");return pv(Array.from(n),8,e,!t)},decode:n=>(nv(\"radix2.decode\",n),Uint8Array.from(pv(n,e,8,t)))}}function yv(e){return Ym(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function gv(e,t){return Qm(e),Ym(t),{encode(n){if(!Wm(n))throw new Error(\"checksum.encode: input should be Uint8Array\");const r=t(n).slice(0,e),o=new Uint8Array(n.length+e);return o.set(n),o.set(r,n.length),o},decode(n){if(!Wm(n))throw new Error(\"checksum.decode: input should be Uint8Array\");const r=n.slice(0,-e),o=n.slice(-e),i=t(r).slice(0,e);for(let t=0;t<e;t++)if(i[t]!==o[t])throw new Error(\"Invalid checksum\");return r}}}rv(hv(4),ov(\"0123456789ABCDEF\"),iv(\"\")),rv(hv(5),ov(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),av(5),iv(\"\")),rv(hv(5),ov(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),iv(\"\")),rv(hv(5),ov(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),av(5),iv(\"\")),rv(hv(5),ov(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),iv(\"\")),rv(hv(5),ov(\"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"),iv(\"\"),sv(e=>e.toUpperCase().replace(/O/g,\"0\").replace(/[IL]/g,\"1\")));const mv=\"function\"==typeof Uint8Array.from([]).toBase64&&\"function\"==typeof Uint8Array.fromBase64,vv=(e,t)=>{Jm(\"base64\",e);const n=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=t?\"base64url\":\"base64\";if(e.length>0&&!n.test(e))throw new Error(\"invalid base64\");return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:\"strict\"})},bv=(mv||rv(hv(6),ov(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),av(6),iv(\"\")),rv(hv(6),ov(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),iv(\"\")),mv||rv(hv(6),ov(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),av(6),iv(\"\")),rv(hv(6),ov(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),iv(\"\")),e=>rv(dv(58),ov(e),iv(\"\"))),wv=bv(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"),Sv=e=>rv(gv(4,t=>e(e(t))),wv),Av=rv(ov(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),iv(\"\")),Ev=[996825010,642813549,513874426,1027748829,705979059];function xv(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<Ev.length;e++)1==(t>>e&1)&&(n^=Ev[e]);return n}function Tv(e,t,n=1){const r=e.length;let o=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);o=xv(o)^n>>5}o=xv(o);for(let t=0;t<r;t++)o=xv(o)^31&e.charCodeAt(t);for(let e of t)o=xv(o)^e;for(let e=0;e<6;e++)o=xv(o);return o^=n,Av.encode(pv([o%fv[30]],30,5,!1))}function kv(e){const t=\"bech32\"===e?1:734539939,n=hv(5),r=n.decode,o=n.encode,i=yv(r);function a(e,n,r=90){Jm(\"bech32.encode prefix\",e),Wm(n)&&(n=Array.from(n)),nv(\"bech32.encode\",n);const o=e.length;if(0===o)throw new TypeError(`Invalid prefix length ${o}`);const i=o+7+n.length;if(!1!==r&&i>r)throw new TypeError(`Length ${i} exceeds limit ${r}`);const a=e.toLowerCase(),s=Tv(a,n,t);return`${a}1${Av.encode(n)}${s}`}function s(e,n=90){Jm(\"bech32.decode input\",e);const r=e.length;if(r<8||!1!==n&&r>n)throw new TypeError(`invalid string length: ${r} (${e}). Expected (8..${n})`);const o=e.toLowerCase();if(e!==o&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const i=o.lastIndexOf(\"1\");if(0===i||-1===i)throw new Error('Letter \"1\" must be present between prefix and data only');const a=o.slice(0,i),s=o.slice(i+1);if(s.length<6)throw new Error(\"Data must be at least 6 characters long\");const c=Av.decode(s).slice(0,-6),u=Tv(a,c,t);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected \"${u}\"`);return{prefix:a,words:c}}return{encode:a,decode:s,encodeFromBytes:function(e,t){return a(e,o(t))},decodeToBytes:function(e){const{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}},decodeUnsafe:yv(s),fromWords:r,fromWordsUnsafe:i,toWords:o}}kv(\"bech32\"),kv(\"bech32m\"),\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex||rv(hv(4),ov(\"0123456789abcdef\"),iv(\"\"),sv(e=>{if(\"string\"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const Ov=BigInt(0),_v=BigInt(1),Iv=BigInt(2),Cv=BigInt(8);class Bv{constructor(e){this.ep=e}static fromBytes(e){Pg()}static fromHex(e){Pg()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return Kh(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.init(this.ep.precompute(e,t))}toRawBytes(){return this.toBytes()}}function Pv(e,t,n={}){if(\"function\"!=typeof t)throw new Error('\"hash\" function param is required');Bg(n,{},{adjustScalarBytes:\"function\",randomBytes:\"function\",domain:\"function\",prehash:\"function\",mapToCurve:\"function\"});const{prehash:r}=n,{BASE:o,Fp:i,Fn:a}=e,s=n.randomBytes||sy,c=n.adjustScalarBytes||(e=>e),u=n.domain||((e,t,n)=>{if(mg(n,\"phflag\"),t.length||n)throw new Error(\"Contexts/pre-hash are not supported\");return e});function l(e){return a.create(Ag(e))}function f(e){const{head:n,prefix:r,scalar:i}=function(e){const n=g.secretKey;e=Tg(\"private key\",e,n);const r=Tg(\"hashed private key\",t(e),2*n),o=c(r.slice(0,n));return{head:o,prefix:r.slice(n,2*n),scalar:l(o)}}(e),a=o.multiply(i),s=a.toBytes();return{head:n,prefix:r,scalar:i,point:a,pointBytes:s}}function p(e){return f(e).pointBytes}function d(e=Uint8Array.of(),...n){const o=oy(...n);return l(t(u(o,Tg(\"context\",e),!!r)))}const h={zip215:!0};const y=i.BYTES,g={secretKey:y,publicKey:y,signature:2*y,seed:y};function m(e=s(g.seed)){return vg(e,g.seed,\"seed\")}const v={getExtendedPublicKey:f,randomSecretKey:m,isValidSecretKey:function(e){return Ih(e)&&e.length===a.BYTES},isValidPublicKey:function(t,n){try{return!!e.fromBytes(t,n)}catch(e){return!1}},toMontgomery(t){const{y:n}=e.fromBytes(t),r=g.publicKey,o=32===r;if(!o&&57!==r)throw new Error(\"only defined for 25519 and 448\");const a=o?i.div(_v+n,_v-n):i.div(n-_v,n+_v);return i.toBytes(a)},toMontgomerySecret(e){const n=g.secretKey;vg(e,n);const r=t(e.subarray(0,n));return c(r).subarray(0,n)},randomPrivateKey:m,precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({keygen:function(e){const t=v.randomSecretKey(e);return{secretKey:t,publicKey:p(t)}},getPublicKey:p,sign:function(e,t,n={}){e=Tg(\"message\",e),r&&(e=r(e));const{prefix:i,scalar:s,pointBytes:c}=f(t),u=d(n.context,i,e),l=o.multiply(u).toBytes(),p=d(n.context,l,c,e),h=a.create(u+p*s);if(!a.isValid(h))throw new Error(\"sign failed: invalid s\");return vg(oy(l,a.toBytes(h)),g.signature,\"result\")},verify:function(t,n,i,a=h){const{context:s,zip215:c}=a,u=g.signature;t=Tg(\"signature\",t,u),n=Tg(\"message\",n),i=Tg(\"publicKey\",i,g.publicKey),void 0!==c&&mg(c,\"zip215\"),r&&(n=r(n));const l=u/2,f=t.subarray(0,l),p=Ag(t.subarray(l,u));let y,m,v;try{y=e.fromBytes(i,c),m=e.fromBytes(f,c),v=o.multiplyUnsafe(p)}catch(e){return!1}if(!c&&y.isSmallOrder())return!1;const b=d(s,m.toBytes(),y.toBytes(),n);return m.add(y.multiplyUnsafe(b)).subtract(v).clearCofactor().is0()},utils:v,Point:e,lengths:g})}function Rv(e){const{CURVE:t,curveOpts:n,hash:r,eddsaOpts:o}=function(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n={Fp:e.Fp,Fn:om(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},r={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:n,hash:e.hash,eddsaOpts:r}}(e),i=function(e,t={}){const n=Em(\"edwards\",e,t,t.FpFnLE),{Fp:r,Fn:o}=n;let i=n.CURVE;const{h:a}=i;Bg(t,{},{uvRatio:\"function\"});const s=Iv<<BigInt(8*o.BYTES)-_v,c=e=>r.create(e),u=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(r.div(e,t))}}catch(e){return{isValid:!1,value:Ov}}});if(!function(e,t,n,r){const o=e.sqr(n),i=e.sqr(r),a=e.add(e.mul(t.a,o),i),s=e.add(e.ONE,e.mul(t.d,e.mul(o,i)));return e.eql(a,s)}(r,i,i.Gx,i.Gy))throw new Error(\"bad curve params: generator point\");function l(e,t,n=!1){return _g(\"coordinate \"+e,t,n?_v:Ov,s),t}function f(e){if(!(e instanceof h))throw new Error(\"ExtendedPoint expected\")}const p=Rg((e,t)=>{const{X:n,Y:o,Z:i}=e,a=e.is0();null==t&&(t=a?Cv:r.inv(i));const s=c(n*t),u=c(o*t),l=r.mul(i,t);if(a)return{x:Ov,y:_v};if(l!==_v)throw new Error(\"invZ was invalid\");return{x:s,y:u}}),d=Rg(e=>{const{a:t,d:n}=i;if(e.is0())throw new Error(\"bad point: ZERO\");const{X:r,Y:o,Z:a,T:s}=e,u=c(r*r),l=c(o*o),f=c(a*a),p=c(f*f),d=c(u*t);if(c(f*c(d+l))!==c(p+c(n*c(u*l))))throw new Error(\"bad point: equation left != right (1)\");if(c(r*o)!==c(a*s))throw new Error(\"bad point: equation left != right (2)\");return!0});class h{constructor(e,t,n,r){this.X=l(\"x\",e),this.Y=l(\"y\",t),this.Z=l(\"z\",n,!0),this.T=l(\"t\",r),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){if(e instanceof h)throw new Error(\"extended point not allowed\");const{x:t,y:n}=e||{};return l(\"x\",t),l(\"y\",n),new h(t,n,_v,c(t*n))}static fromBytes(e,t=!1){const n=r.BYTES,{a:o,d:a}=i;e=kg(vg(e,n,\"point\")),mg(t,\"zip215\");const l=kg(e),f=e[n-1];l[n-1]=-129&f;const p=Ag(l),d=t?s:r.ORDER;_g(\"point.y\",p,Ov,d);const y=c(p*p),g=c(y-_v),m=c(a*y-o);let{isValid:v,value:b}=u(g,m);if(!v)throw new Error(\"bad point: invalid y coordinate\");const w=(b&_v)===_v,S=!!(128&f);if(!t&&b===Ov&&S)throw new Error(\"bad point: x=0 and x_0=1\");return S!==w&&(b=c(-b)),h.fromAffine({x:b,y:p})}static fromHex(e,t=!1){return h.fromBytes(Tg(\"point\",e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return y.createCache(this,e),t||this.multiply(Iv),this}assertValidity(){d(this)}equals(e){f(e);const{X:t,Y:n,Z:r}=this,{X:o,Y:i,Z:a}=e,s=c(t*a),u=c(o*r),l=c(n*a),p=c(i*r);return s===u&&l===p}is0(){return this.equals(h.ZERO)}negate(){return new h(c(-this.X),this.Y,this.Z,c(-this.T))}double(){const{a:e}=i,{X:t,Y:n,Z:r}=this,o=c(t*t),a=c(n*n),s=c(Iv*c(r*r)),u=c(e*o),l=t+n,f=c(c(l*l)-o-a),p=u+a,d=p-s,y=u-a,g=c(f*d),m=c(p*y),v=c(f*y),b=c(d*p);return new h(g,m,b,v)}add(e){f(e);const{a:t,d:n}=i,{X:r,Y:o,Z:a,T:s}=this,{X:u,Y:l,Z:p,T:d}=e,y=c(r*u),g=c(o*l),m=c(s*n*d),v=c(a*p),b=c((r+o)*(u+l)-y-g),w=v-m,S=v+m,A=c(g-t*y),E=c(b*w),x=c(S*A),T=c(b*A),k=c(w*S);return new h(E,x,k,T)}subtract(e){return this.add(e.negate())}multiply(e){if(!o.isValidNot0(e))throw new Error(\"invalid scalar: expected 1 <= sc < curve.n\");const{p:t,f:n}=y.cached(this,e,e=>lm(h,e));return lm(h,[t,n])[0]}multiplyUnsafe(e,t=h.ZERO){if(!o.isValid(e))throw new Error(\"invalid scalar: expected 0 <= sc < curve.n\");return e===Ov?h.ZERO:this.is0()||e===_v?this:y.unsafe(this,e,e=>lm(h,e),t)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return y.unsafe(this,i.n).is0()}toAffine(e){return p(this,e)}clearCofactor(){return a===_v?this:this.multiplyUnsafe(a)}toBytes(){const{x:e,y:t}=this.toAffine(),n=r.toBytes(t);return n[n.length-1]|=e&_v?128:0,n}toHex(){return Kh(this.toBytes())}toString(){return`<Point ${this.is0()?\"ZERO\":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(e){return lm(h,e)}static msm(e,t){return Sm(h,o,e,t)}_setWindowSize(e){this.precompute(e)}toRawBytes(){return this.toBytes()}}h.BASE=new h(i.Gx,i.Gy,_v,c(i.Gx*i.Gy)),h.ZERO=new h(Ov,_v,_v,Ov),h.Fp=r,h.Fn=o;const y=new wm(h,o.BITS);return h.BASE.precompute(8),h}(t,n);return function(e,t){const n=t.Point;return Object.assign({},t,{ExtendedPoint:n,CURVE:e,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}(e,Pv(i,r,o))}const jv=BigInt(0),Uv=BigInt(1),Fv=BigInt(2),Nv=(BigInt(3),BigInt(5)),Lv=BigInt(8),Mv=BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed\"),Dv={p:Mv,n:BigInt(\"0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed\"),h:Lv,a:BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec\"),d:BigInt(\"0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3\"),Gx:BigInt(\"0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\"),Gy:BigInt(\"0x6666666666666666666666666666666666666666666666666666666666666658\")};function qv(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),o=BigInt(80),i=Mv,a=e*e%i*e%i,s=Hg(a,Fv,i)*a%i,c=Hg(s,Uv,i)*e%i,u=Hg(c,Nv,i)*c%i,l=Hg(u,t,i)*u%i,f=Hg(l,n,i)*l%i,p=Hg(f,r,i)*f%i,d=Hg(p,o,i)*p%i,h=Hg(d,o,i)*p%i,y=Hg(h,t,i)*u%i;return{pow_p_5_8:Hg(y,Fv,i)*e%i,b2:a}}function Vv(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const zv=BigInt(\"19681161376707505956807079304988542015446066515923890162744021073123829784752\");function Kv(e,t){const n=Mv,r=Kg(t*t*t,n),o=Kg(r*r*t,n);let i=Kg(e*r*qv(e*o).pow_p_5_8,n);const a=Kg(t*i*i,n),s=i,c=Kg(i*zv,n),u=a===e,l=a===Kg(-e,n),f=a===Kg(-e*zv,n);return u&&(i=s),(l||f)&&(i=c),Jg(i,n)&&(i=Kg(-i,n)),{isValid:u||l,value:i}}const Hv=om(Dv.p,{isLE:!0}),$v=om(Dv.n,{isLE:!0}),Gv={...Dv,Fp:Hv,hash:pg,adjustScalarBytes:Vv,uvRatio:Kv},Wv=Rv(Gv);const Xv=zv,Zv=BigInt(\"25063068953384623474111414158702152701244531502492656460079210482610430750235\"),Yv=BigInt(\"54469307008909316920995813868745141605393597292927456921205312896311721017578\"),Jv=BigInt(\"1159843021668779879193775521855586647937357759715417654439879720876111806838\"),Qv=BigInt(\"40440834346308536858101042469323190826248399146238708352240133220865137265952\"),eb=e=>Kv(Uv,e),tb=BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"),nb=e=>Wv.Point.Fp.create(Ag(e)&tb);function rb(e){const{d:t}=Dv,n=Mv,r=e=>Hv.create(e),o=r(Xv*e*e),i=r((o+Uv)*Jv);let a=BigInt(-1);const s=r((a-t*o)*r(o+t));let{isValid:c,value:u}=Kv(i,s),l=r(u*e);Jg(l,n)||(l=r(-l)),c||(u=l),c||(a=o);const f=r(a*(o-Uv)*Qv-s),p=u*u,d=r((u+u)*s),h=r(f*Zv),y=r(Uv-p),g=r(Uv+p);return new Wv.Point(r(d*g),r(y*h),r(h*g),r(d*y))}function ob(e){Bh(e,64);const t=rb(nb(e.subarray(0,32))),n=rb(nb(e.subarray(32,64)));return new ib(t.add(n))}class ib extends Bv{constructor(e){super(e)}static fromAffine(e){return new ib(Wv.Point.fromAffine(e))}assertSame(e){if(!(e instanceof ib))throw new Error(\"RistrettoPoint expected\")}init(e){return new ib(e)}static hashToCurve(e){return ob(Tg(\"ristrettoHash\",e,64))}static fromBytes(e){Bh(e,32);const{a:t,d:n}=Dv,r=Mv,o=e=>Hv.create(e),i=nb(e);if(!function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n}(Hv.toBytes(i),e)||Jg(i,r))throw new Error(\"invalid ristretto255 encoding 1\");const a=o(i*i),s=o(Uv+t*a),c=o(Uv-t*a),u=o(s*s),l=o(c*c),f=o(t*n*u-l),{isValid:p,value:d}=eb(o(f*l)),h=o(d*c),y=o(d*h*f);let g=o((i+i)*h);Jg(g,r)&&(g=o(-g));const m=o(s*y),v=o(g*m);if(!p||Jg(v,r)||m===jv)throw new Error(\"invalid ristretto255 encoding 2\");return new ib(new Wv.Point(g,m,Uv,v))}static fromHex(e){return ib.fromBytes(Tg(\"ristrettoHex\",e,32))}static msm(e,t){return Sm(ib,Wv.Point.Fn,e,t)}toBytes(){let{X:e,Y:t,Z:n,T:r}=this.ep;const o=Mv,i=e=>Hv.create(e),a=i(i(n+t)*i(n-t)),s=i(e*t),c=i(s*s),{value:u}=eb(i(a*c)),l=i(u*a),f=i(u*s),p=i(l*f*r);let d;if(Jg(r*p,o)){let n=i(t*Xv),r=i(e*Xv);e=n,t=r,d=i(l*Yv)}else d=f;Jg(e*p,o)&&(t=i(-t));let h=i((n-t)*d);return Jg(h,o)&&(h=i(-h)),Hv.toBytes(h)}equals(e){this.assertSame(e);const{X:t,Y:n}=this.ep,{X:r,Y:o}=e.ep,i=e=>Hv.create(e),a=i(t*o)===i(n*r),s=i(n*o)===i(t*r);return a||s}is0(){return this.equals(ib.ZERO)}}ib.BASE=new ib(Wv.Point.BASE),ib.ZERO=new ib(Wv.Point.ZERO),ib.Fp=Hv,ib.Fn=$v;const ab=Wv.CURVE,sb=\"ed25519\",cb=Gy(\"ed25519 seed\"),ub=e=>!0,lb=!1,fb=33,pb=(()=>{let e=!1;return(t,n)=>{e||(Wv.ExtendedPoint.BASE._setWindowSize(4),e=!0);const r=Wv.getPublicKey(t);return Xy([new Uint8Array([0]),r])}})(),db=(e,t)=>{throw new Error(\"Ed25519 does not support public key derivation.\")},hb=e=>e,yb=e=>e,gb=32,mb=\"slip10\",vb=33;const bb=Wv.CURVE,wb=\"ed25519Bip32\",Sb=Gy(\"\");function Ab(e,t){const n=e[t];return _n(void 0!==n,\"Private key is too short.\"),n}const Eb=e=>!(7&Ab(e,0))&&(!(128&Ab(e,31))&&!(64&~Ab(e,31))),xb=!0,Tb=32,kb=e=>{return Py(t=Ky(Uint8Array.from(e).reverse())),BigInt(Uy(t));var t},Ob=e=>{const t=Kg(kb(e),bb.n);return Wv.ExtendedPoint.BASE.multiply(t).toRawBytes()},_b=(e,t)=>Ob(e.slice(0,32)),Ib=(e,t)=>Wv.ExtendedPoint.fromHex(Fy(Ky(e))).add(Wv.ExtendedPoint.fromHex(Fy(Ky(t)))).toRawBytes(),Cb=e=>e,Bb=e=>e,Pb=64,Rb=\"cip3\",jb=32,Ub={secp256k1:c,ed25519:e,ed25519Bip32:t};function Fb(e){return Ub[e]}function Nb(e,t,n,r){Ph(e);const o=function(e,t){if(void 0!==t&&\"[object Object]\"!=={}.toString.call(t))throw new Error(\"options should be object or undefined\");return Object.assign(e,t)}({dkLen:32,asyncTick:10},r),{c:i,dkLen:a,asyncTick:s}=o;if(Ch(i),Ch(a),Ch(s),i<1)throw new Error(\"iterations (c) should be >= 1\");const c=ry(t),u=ry(n),l=new Uint8Array(a),f=hg.create(e,c),p=f._cloneInto().update(u);return{c:i,dkLen:a,asyncTick:s,DK:l,PRF:f,PRFSalt:p}}function Lb(e,t,n,r,o){return e.destroy(),t.destroy(),r&&r.destroy(),Uh(o),n}const Mb=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]);new Uint32Array(80);const Db=Math.pow(2,32);Array.from({length:64},(e,t)=>Math.floor(Db*Math.abs(Math.sin(t+1)))),Mb.slice(0,4),new Uint32Array(16);const qb=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Vb=Uint8Array.from(new Array(16).fill(0).map((e,t)=>t)),zb=Vb.map(e=>(9*e+5)%16),Kb=(()=>{const e=[[Vb],[zb]];for(let t=0;t<4;t++)for(let n of e)n.push(n[t].map(e=>qb[e]));return e})(),Hb=Kb[0],$b=Kb[1],Gb=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),Wb=Hb.map((e,t)=>e.map(e=>Gb[t][e])),Xb=$b.map((e,t)=>e.map(e=>Gb[t][e])),Zb=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),Yb=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function Jb(e,t,n,r){return 0===e?t^n^r:1===e?t&n|~t&r:2===e?(t|~n)^r:3===e?t&r|n&~r:t^(n|~r)}const Qb=new Uint32Array(16);class ew extends Qy{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:n,h3:r,h4:o}=this;return[e,t,n,r,o]}set(e,t,n,r,o){this.h0=0|e,this.h1=0|t,this.h2=0|n,this.h3=0|r,this.h4=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)Qb[n]=e.getUint32(t,!0);let n=0|this.h0,r=n,o=0|this.h1,i=o,a=0|this.h2,s=a,c=0|this.h3,u=c,l=0|this.h4,f=l;for(let e=0;e<5;e++){const t=4-e,p=Zb[e],d=Yb[e],h=Hb[e],y=$b[e],g=Wb[e],m=Xb[e];for(let t=0;t<16;t++){const r=Lh(n+Jb(e,o,a,c)+Qb[h[t]]+p,g[t])+l|0;n=l,l=c,c=0|Lh(a,10),a=o,o=r}for(let e=0;e<16;e++){const n=Lh(r+Jb(t,i,s,u)+Qb[y[e]]+d,m[e])+f|0;r=f,f=u,u=0|Lh(s,10),s=i,i=n}}this.set(this.h1+a+u|0,this.h2+c+f|0,this.h3+l+r|0,this.h4+n+i|0,this.h0+o+s|0)}roundClean(){Uh(Qb)}destroy(){this.destroyed=!0,Uh(this.buffer),this.set(0,0,0,0,0)}}const tw=ay(()=>new ew);const nw=fg;const rw=pg;async function ow(e,t,n={}){if(n.hmacSha512)return await n.hmacSha512(e,t);if(kS()){const n=await crypto.subtle.importKey(\"raw\",e,{name:\"HMAC\",hash:\"SHA-512\"},!1,[\"sign\"]),r=await crypto.subtle.sign(\"HMAC\",n,t);return new Uint8Array(r)}return hg(rw,e,t)}async function iw(e,t,n,r,o={}){if(o.pbkdf2Sha512)return await o.pbkdf2Sha512(e,t,n,r);if(kS()){const o=await crypto.subtle.importKey(\"raw\",e,{name:\"PBKDF2\"},!1,[\"deriveBits\"]),i=await crypto.subtle.deriveBits({name:\"PBKDF2\",salt:t,iterations:n,hash:{name:\"SHA-512\"}},o,8*r);return new Uint8Array(i)}return await async function(e,t,n,r){const{c:o,dkLen:i,asyncTick:a,DK:s,PRF:c,PRFSalt:u}=Nb(e,t,n,r);let l;const f=new Uint8Array(4),p=Fh(f),d=new Uint8Array(c.outputLen);for(let e=1,t=0;t<i;e++,t+=c.outputLen){const n=s.subarray(t,t+c.outputLen);p.setInt32(0,e,!1),(l=u._cloneInto(l)).update(f).digestInto(d),n.set(d.subarray(0,n.length)),await ey(o-1,a,()=>{c._cloneInto(l).update(d).digestInto(d);for(let e=0;e<n.length;e++)n[e]^=d[e]})}return Lb(c,u,s,l,d)}(rw,e,t,{c:n,dkLen:r})}function aw(e){return nw(e)}const sw=Symbol(\"Public key guard. Do not export this from the module.\");async function cw({path:e,node:t,curve:n,network:r},o,i){dw(t);const{childIndex:a,isHardened:s}=hw(e,t,n),c={chainCode:t.chainCodeBytes,childIndex:a,isHardened:s,depth:t.depth,parentFingerprint:t.fingerprint,masterFingerprint:t.masterFingerprint,curve:n,network:r};if(t.privateKeyBytes){const e=await lw({privateKey:t.privateKeyBytes,get publicKey(){return t.compressedPublicKeyBytes},childIndex:a,isHardened:s,curve:n}),r=await pw({chainCode:t.chainCodeBytes,extension:e},i);return await uw({privateKey:t.privateKeyBytes,get publicKey(){return t.publicKeyBytes},entropy:r,...c},o,i)}const u=fw({parentPublicKey:t.compressedPublicKeyBytes,childIndex:a}),l=await pw({chainCode:t.chainCodeBytes,extension:u},i);return await uw({publicKey:t.compressedPublicKeyBytes,entropy:l,...c},o,i)}async function uw(e,t,n){const{privateKey:r,publicKey:o,entropy:i,childIndex:a,isHardened:s,depth:c,parentFingerprint:u,masterFingerprint:l,curve:f,network:p}=e;try{return r?await async function({entropy:e,privateKey:t,depth:n,masterFingerprint:r,parentFingerprint:o,childIndex:i,isHardened:a,curve:s,network:c},u){const l=i+(a?ah:0),{privateKey:f,chainCode:p}=function({privateKey:e,entropy:t,curve:n}){const r=t.slice(0,32),o=t.slice(32);if(\"ed25519\"===n.name)return{privateKey:r,chainCode:o};const i=function(e,t,n){_n(vS(t,32),\"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.\");const r=Hy(e),o=Hy(t);if(o>=n.curve.n)throw new Error(\"Invalid tweak: Tweak is larger than the curve order.\");const i=Kg(r+o,n.curve.n),a=$y(i.toString(16).padStart(64,\"0\"));if(!n.isValidPrivateKey(a))throw new Error(\"Invalid private key or tweak: The resulting private key is invalid.\");return a}(e,r,n);return{privateKey:i,chainCode:o}}({privateKey:t,entropy:e,curve:s});return await rS.fromExtendedKey({privateKey:f,chainCode:p,depth:n+1,masterFingerprint:r,parentFingerprint:o,index:l,curve:s.name,network:c,guard:sw},u)}({entropy:i,privateKey:r,depth:c,masterFingerprint:l,parentFingerprint:u,childIndex:a,isHardened:s,curve:f,network:p},n):await async function({entropy:e,publicKey:t,depth:n,masterFingerprint:r,parentFingerprint:o,childIndex:i,curve:a,network:s},c){const{publicKey:u,chainCode:l}=function({publicKey:e,entropy:t,curve:n}){const r=t.slice(0,32),o=t.slice(32),i=n.publicAdd(e,r);return{publicKey:i,chainCode:o}}({publicKey:t,entropy:e,curve:a});return await rS.fromExtendedKey({publicKey:u,chainCode:l,depth:n+1,masterFingerprint:r,parentFingerprint:o,index:i,curve:a.name,network:s},c)}({entropy:i,publicKey:o,depth:c,masterFingerprint:l,parentFingerprint:u,childIndex:a,curve:f,network:p},n)}catch(r){return await uw(await t(r,e,n),t,n)}}async function lw({privateKey:e,publicKey:t,childIndex:n,isHardened:r,curve:o}){return r?Xy([new Uint8Array([0]),e,TS(n+ah)]):(AS(t,o.compressedPublicKeyLength),fw({parentPublicKey:t,childIndex:n}))}function fw({parentPublicKey:e,childIndex:t}){return Xy([e,TS(t)])}async function pw({chainCode:e,extension:t},n){return await ow(e,t,n)}function dw(e){_n(e,\"Invalid parameters: Must specify a node to derive from.\")}function hw(e,t,n){!function(e,t,n){_n(\"string\"==typeof e,\"Invalid path: Must be a string.\");const r=e.endsWith(\"'\");_n(!r||t.privateKey,\"Invalid parameters: Cannot derive hardened child keys without a private key.\"),_n(r||n.deriveUnhardenedKeys,`Invalid path: Cannot derive unhardened child keys with ${n.name}.`)}(e,t,n);const r=e.split(\"'\")[0];_n(r);const o=parseInt(r,10);if(!th.test(r)||!Number.isInteger(o)||o<0||o>=ah)throw new Error(`Invalid path: The index must be a non-negative decimal integer less than ${ah}.`);return{childIndex:o,isHardened:e.includes(\"'\")}}function yw(e){_n(e instanceof Uint8Array&&vS(e,Jd),\"Invalid key: The key must be a 32-byte, non-zero Uint8Array.\");return gw(jS(e,!1))}function gw(e){return _n(e instanceof Uint8Array&&vS(e,PS),\"Invalid key: The key must be a 65-byte, non-zero Uint8Array.\"),(t=e.slice(1),xy(t)).slice(-20);var t}async function mw(e,t){return _n(\"secp256k1\"===e.curve.name,\"Invalid curve: Only secp256k1 is supported by BIP-32.\"),cw(e,vw,t)}async function vw(e,t,n){const{childIndex:r,privateKey:o,publicKey:i,isHardened:a,chainCode:s,curve:c}=t;if(hS(r+1),o){const e=await lw({privateKey:o,publicKey:c.compressPublicKey(i),childIndex:r+1,isHardened:a,curve:c}),u=await pw({chainCode:s,extension:e},n);return{...t,childIndex:r+1,entropy:u}}const u=fw({parentPublicKey:i,childIndex:r+1}),l=await pw({chainCode:s,extension:u});return{...t,childIndex:r+1,entropy:l}}var bw=n(2091);const ww=[12,15,18,21,24];function Sw(e){const t=e.split(\" \");_n(ww.includes(t.length),\"Invalid mnemonic phrase: The mnemonic phrase must consist of 12, 15, 18, 21, or 24 words.\"),_n(t.every(e=>Gm.p.includes(e)),\"Invalid mnemonic phrase: The mnemonic phrase contains an unknown word.\")}async function Aw(e,t=\"\",n){const r=`mnemonic${t}`.normalize(\"NFKD\");return await iw(function(e,t){if(\"string\"==typeof e)return Sw(e),Gy(e.normalize(\"NFKD\"));const n=Array.from(new Uint16Array(e.buffer)).map(e=>t[e]).join(\" \");return Sw(n),Gy(n)}(e,Gm.p),Gy(r),2048,64,n)}function Ew(e){return`bip39:${e.toLowerCase().trim()}`}function xw(e){return e instanceof Uint8Array?e:(_n(e.startsWith(\"bip39:\"),'Invalid HD path segment: The BIP-39 path must start with \"bip39:\".'),e.slice(6))}async function Tw({path:e,curve:t},n){const[r,...o]=e,i=xw(r),a=Fb(t);switch(a.masterNodeGenerationSpec){case\"slip10\":return[await Aw(i,\"\",n),...o];case\"cip3\":return[(0,bw.x2)(i,Gm.p),...o];default:return In()}}async function kw({path:e,curve:t,network:n},r){switch(_n(e instanceof Uint8Array,\"Invalid path: The path must be a Uint8Array.\"),t.masterNodeGenerationSpec){case\"slip10\":return Ow(e,t,n,r);case\"cip3\":return _w(e,t,n,r);default:throw new Error(\"Unsupported master node generation spec.\")}}async function Ow(e,t,n,r){_n(e.length>=16&&e.length<=64,\"Invalid seed: The seed must be between 16 and 64 bytes long.\");const o=await ow(t.secret,e,r),i=o.slice(0,Jd),a=o.slice(Jd);_n(t.isValidPrivateKey(i),\"Invalid private key: The private key must greater than 0 and less than the curve order.\");const s=t.getPublicKey(i,!1),c=ES(t.compressPublicKey(s),t.compressedPublicKeyLength);return rS.fromExtendedKey({privateKey:i,publicKey:s,chainCode:a,masterFingerprint:c,network:n,depth:0,parentFingerprint:0,index:0,curve:t.name,guard:sw},r)}async function _w(e,t,n,r){_n(e.length>=16&&e.length<=64,\"Invalid entropy: The entropy must be between 16 and 64 bytes long.\");const o=await iw(t.secret,e,4096,96,r);o[0]&=248,o[31]&=31,o[31]|=64;const i=o.slice(0,t.privateKeyLength),a=o.slice(t.privateKeyLength);_n(t.isValidPrivateKey(i),\"Invalid private key.\");const s=t.getPublicKey(i,!1),c=ES(t.compressPublicKey(s),t.compressedPublicKeyLength);return rS.fromExtendedKey({privateKey:i,publicKey:s,chainCode:a,masterFingerprint:c,network:n,depth:0,parentFingerprint:0,index:0,curve:t.name,guard:sw},r)}const Iw=e=>e.slice().reverse(),Cw=e=>{const t=Ky(Iw(e));return BigInt(t)},Bw=e=>{const t=e.toString(16);return Iw($y(t))},Pw=e=>Xy([e,new Uint8Array(Math.max(32-e.length,0)).fill(0)]),Rw=e=>{const t=Cw(e.slice(0,28))*BigInt(8);return Pw(Bw(t))},jw=e=>Pw(Bw(Kg(Cw(e),BigInt(2)**BigInt(256)))),Uw=(e,t)=>{const n=Cw(e)+Cw(t);return Pw(Bw(n)).slice(0,32)},Fw=(e,t,n)=>Xy([new Uint8Array([e]),t,TS(n,!0)]),Nw=2,Lw=0,Mw=async({parentNode:e,childIndex:t,isHardened:n},r)=>{const o=n?Fw(Lw,e.privateKeyBytes,t+ah):Fw(Nw,e.publicKeyBytes,t),i=await pw({chainCode:e.chainCodeBytes,extension:o},r),a=i.subarray(0,32),s=i.subarray(32),c=e.privateKeyBytes.subarray(0,32),u=e.privateKeyBytes.subarray(32);return Xy([Uw(Rw(a),c),Uw(s,u)])},Dw=3,qw=1,Vw=async({parentNode:e,childIndex:t,isHardened:n},r)=>{const o=n?Fw(qw,e.privateKeyBytes,t+ah):Fw(Dw,e.publicKeyBytes,t);return(await pw({chainCode:e.chainCodeBytes,extension:o},r)).subarray(32)},zw=2,Kw=async({parentNode:e,childIndex:t,curve:n},r)=>{const o=Fw(zw,e.publicKeyBytes,t),i=(await pw({chainCode:e.chainCodeBytes,extension:o},r)).slice(0,32),a=n.getPublicKey(Rw(i));return n.publicAdd(e.publicKeyBytes,a)};async function Hw(e,t){const{curve:n,node:r,path:o}=e;dw(r);const{childIndex:i,isHardened:a}=hw(o,r,n);if(\"ed25519Bip32\"!==n.name||!r)throw new Error(\"Unsupported curve: Only ed25519Bip32 is supported by CIP3.\");const s=i+(a?ah:0),{privateKeyBytes:c,chainCodeBytes:u,publicKeyBytes:l,masterFingerprint:f,depth:p,fingerprint:d}=r;if(c){const e={privateKeyBytes:c,chainCodeBytes:u,publicKeyBytes:l},r=await Mw({parentNode:e,childIndex:i,isHardened:a},t),o=await Vw({parentNode:e,childIndex:i,isHardened:a},t);return rS.fromExtendedKey({privateKey:Ky(r),chainCode:Ky(o),masterFingerprint:f,depth:p+1,parentFingerprint:d,index:s,curve:n.name},t)}_n(!a,\"Invalid parameters: Cannot derive hardened child keys without a private key.\");const h={chainCodeBytes:u,publicKeyBytes:l},y=await Kw({parentNode:h,childIndex:i,isHardened:!1,curve:n},t),g=await Vw({parentNode:h,childIndex:i,isHardened:!1},t);return rS.fromExtendedKey({publicKey:Ky(y),chainCode:Ky(g),masterFingerprint:f,depth:p+1,parentFingerprint:d,index:s,curve:n.name},t)}async function $w(e,t){return await cw(e,Gw,t)}async function Gw(e,t,n){const{curve:r,isHardened:o,childIndex:i,entropy:a,chainCode:s}=t;if(\"ed25519\"===r.name)throw e;const c=o?i+ah:i,u=await pw({chainCode:s,extension:Xy([1,a.slice(32,64),TS(c)])},n);return{...t,entropy:u}}const Ww={bip32:o,bip39:i,slip10:s,cip3:a};async function Xw(e,t){const{path:n,depth:r=n.length}=e,o=\"node\"in e?e.node:void 0,i=\"network\"in e?e.network:o?.network,a=\"curve\"in e?e.curve:o?.curve;if(o&&!(o instanceof rS)&&!(o instanceof ZS)&&!(o instanceof cS))throw new Error(\"Invalid arguments: Node must be a SLIP-10 node or a BIP-44 node when provided.\");if(!a)throw new Error(\"Invalid arguments: Must specify either a parent node or curve.\");return function(e,t,n){if(0===e.length)throw new Error(\"Invalid HD path segment: The segment must not be empty.\");let r=!1;if(e.forEach((e,t)=>{if(0===t){if(r=e instanceof Uint8Array||ih.test(e),!(e instanceof Uint8Array||r||nh.test(e)||rh.test(e)||oh.test(e)))throw Zw()}else if(e instanceof Uint8Array||!nh.test(e)&&!rh.test(e)&&!oh.test(e))throw Zw()}),0===n&&(!r||1!==e.length))throw new Error(`Invalid HD path segment: The segment must consist of a single BIP-39 node for depths of 0. Received: \"${String(e)}\".`);if(!t&&!r)throw new Error(\"Invalid derivation parameters: Must specify parent key if the first node of the path segment is not a BIP-39 node.\");if(t&&r)throw new Error(\"Invalid derivation parameters: May not specify parent key if the path segment starts with a BIP-39 node.\");const o=r?e.slice(1):e;if(o.length>0){const e=o[0]?.split(\":\")[0];_n(e),_n(o.every(t=>t.startsWith(`${e}:`)),\"Invalid HD path segment: Cannot mix 'bip32' and 'slip10' path segments.\")}}(n,Boolean(o?.privateKey)||Boolean(o?.publicKey),r),await n.reduce(async(e,n,r)=>{const o=await e;if(\"string\"==typeof n){const[e,r]=n.split(\":\");_n(e),_n(r),_n(function(e){return e in Ww}(e),`Unknown derivation type: \"${e}\".`);const s=Ww[e];return await s.deriveChildKey({path:r,node:o,curve:Fb(a),network:i},t)}return _n(0===r,Zw()),await Ww.bip39.deriveChildKey({path:n,node:o,curve:Fb(a),network:i},t)},Promise.resolve(o))}function Zw(){return new Error(\"Invalid HD path segment: The path segment is malformed.\")}var Yw,Jw,Qw,eS,tS=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)},nS=function(e,t,n,r,o){if(\"m\"===r)throw new TypeError(\"Private method is not writable\");if(\"a\"===r&&!o)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!o:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===r?o.call(e,n):o?o.value=n:t.set(e,n),n};class rS{static async fromJSON(e,t){return Yw.fromExtendedKey(e,t)}static async fromExtendedKey(e,t){if(\"string\"==typeof e){const n=HS(e),{chainCode:r,depth:o,parentFingerprint:i,index:a}=n;if(\"private\"===n.type){const{privateKey:e}=n;return Yw.fromExtendedKey({depth:o,parentFingerprint:i,index:a,privateKey:e,chainCode:r,curve:\"secp256k1\"},t)}const{publicKey:s}=n;return Yw.fromExtendedKey({depth:o,parentFingerprint:i,index:a,publicKey:s,chainCode:r,curve:\"secp256k1\"},t)}const{depth:n,masterFingerprint:r,parentFingerprint:o,index:i,network:a,privateKey:s,publicKey:c,chainCode:u,curve:l,guard:f}=e,p=wS(u,Jd);xS(l),oS(n),hS(i),function(e,t){if(0===t&&0!==e)throw new Error(`Invalid index: The index of the root node must be 0. Received: \"${String(e)}\".`)}(i,n),function(e){if(void 0===e)return;if(\"string\"!=typeof e)throw new Error(\"Invalid network: Must be a string if specified.\");if(![\"mainnet\",\"testnet\"].includes(e))throw new Error('Invalid network: Must be either \"mainnet\" or \"testnet\" if specified.')}(a),function(e,t){if(!bS(e))throw new Error(`Invalid parent fingerprint: The fingerprint must be a positive integer. Received: \"${String(e)}\".`);if(0===t&&0!==e)throw new Error(`Invalid parent fingerprint: The fingerprint of the root node must be 0. Received: \"${String(e)}\".`);if(t>0&&0===e)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node must not be 0. Received: \"${String(e)}\".`)}(o,n),function(e,t,n){if(!e)return;if(n>=2&&e===t)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node cannot be equal to the master fingerprint. Received: \"${String(t)}\".`)}(r,o,n);const d=Fb(l);if(s){const e=SS(s,d.privateKeyLength);_n(d.isValidPrivateKey(e),`Invalid private key: Value is not a valid ${l} private key.`);const u=f===sw&&c?wS(c,d.publicKeyLength):void 0;return new Yw({depth:n,masterFingerprint:r,parentFingerprint:o,index:i,network:a,chainCode:p,privateKey:e,publicKey:u,curve:l},t,tS(this,Yw,\"f\",Jw))}if(c){const e=wS(c,d.publicKeyLength);return new Yw({depth:n,masterFingerprint:r,parentFingerprint:o,index:i,network:a,chainCode:p,publicKey:e,curve:l},t,tS(this,Yw,\"f\",Jw))}throw new Error(\"Invalid options: Must provide either a private key or a public key.\")}static async fromDerivationPath({derivationPath:e,network:t,curve:n},r){if(xS(n),!e)throw new Error(\"Invalid options: Must provide a derivation path.\");if(0===e.length)throw new Error(\"Invalid derivation path: May not specify an empty derivation path.\");const o=await Tw({path:e,curve:n},r);return await Xw({path:o,depth:e.length-1,network:t,curve:n},r)}static async fromSeed({derivationPath:e,network:t,curve:n},r){if(xS(n),\"ed25519Bip32\"===n)throw new Error('Invalid curve: The curve \"ed25519Bip32\" is not supported by the `fromSeed` function.');if(!e)throw new Error(\"Invalid options: Must provide a derivation path.\");if(0===e.length)throw new Error(\"Invalid derivation path: May not specify an empty derivation path.\");return await Xw({path:e,depth:e.length-1,network:t,curve:n},r)}constructor({depth:e,masterFingerprint:t,parentFingerprint:n,index:r,network:o=\"mainnet\",chainCode:i,privateKey:a,publicKey:s,curve:c},u={},l){Qw.set(this,void 0),eS.set(this,void 0),_n(l===tS(Yw,Yw,\"f\",Jw),\"SLIP10Node can only be constructed using `SLIP10Node.fromJSON`, `SLIP10Node.fromExtendedKey`, `SLIP10Node.fromDerivationPath`, or `SLIP10Node.fromSeed`.\"),_n(void 0!==a||void 0!==s,\"SLIP10Node requires either a private key or a public key to be set.\"),this.depth=e,this.masterFingerprint=t,this.parentFingerprint=n,this.index=r,this.network=o,this.chainCodeBytes=i,this.privateKeyBytes=a,this.curve=c,nS(this,Qw,s,\"f\"),nS(this,eS,u,\"f\"),Object.freeze(this)}get chainCode(){return Ky(this.chainCodeBytes)}get privateKey(){if(this.privateKeyBytes)return Ky(this.privateKeyBytes)}get publicKey(){return Ky(this.publicKeyBytes)}get publicKeyBytes(){return void 0!==tS(this,Qw,\"f\")||(_n(this.privateKeyBytes,\"Either a private key or public key is required.\"),nS(this,Qw,Fb(this.curve).getPublicKey(this.privateKeyBytes),\"f\")),tS(this,Qw,\"f\")}get compressedPublicKeyBytes(){return Fb(this.curve).compressPublicKey(this.publicKeyBytes)}get compressedPublicKey(){return Ky(this.compressedPublicKeyBytes)}get address(){if(\"secp256k1\"!==this.curve)throw new Error(\"Unable to get address for this node: Only secp256k1 is supported.\");return Ky(gw(this.publicKeyBytes))}get fingerprint(){return ES(this.compressedPublicKeyBytes,Fb(this.curve).compressedPublicKeyLength)}get extendedKey(){_n(\"secp256k1\"===this.curve,\"Unable to get extended key for this node: Only secp256k1 is supported.\");const e={depth:this.depth,parentFingerprint:this.parentFingerprint,index:this.index,network:this.network,chainCode:this.chainCodeBytes};return this.privateKeyBytes?$S({...e,type:\"private\",privateKey:this.privateKeyBytes}):$S({...e,type:\"public\",publicKey:this.publicKeyBytes})}neuter(){return new Yw({depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes,publicKey:this.publicKeyBytes,curve:this.curve,network:this.network},tS(this,eS,\"f\"),tS(Yw,Yw,\"f\",Jw))}async derive(e){return await async function({path:e,node:t},n){if(0===e.length)throw new Error(\"Invalid HD tree derivation path: Deriving a path of length 0 is not defined.\");const r=t.depth+e.length;return oS(r),await Xw({path:e,node:t,depth:r},n)}({path:e,node:this},tS(this,eS,\"f\"))}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,network:this.network,curve:this.curve,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function oS(e){if(!bS(e))throw new Error(`Invalid HD tree path depth: The depth must be a positive integer. Received: \"${String(e)}\".`)}Yw=rS,Qw=new WeakMap,eS=new WeakMap,Jw={value:Symbol(\"SLIP10Node.constructor\")};var iS,aS=function(e,t,n,r,o){if(\"m\"===r)throw new TypeError(\"Private method is not writable\");if(\"a\"===r&&!o)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!o:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},sS=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)};class cS{static async fromJSON(e,t,n){lS(t),uS(e.depth);const r=await ZS.fromExtendedKey({depth:e.depth,index:e.index,network:e.network,parentFingerprint:e.parentFingerprint,chainCode:gS(e.chainCode),privateKey:mS(e.privateKey),publicKey:gS(e.publicKey)},n);return new cS(r,t)}static async fromDerivationPath(e,t,n){uS(e.length-1);const r=await ZS.fromDerivationPath({derivationPath:e,network:t},n),o=OS(e);return new cS(r,o)}static async fromSeed({derivationPath:e,network:t},n){uS(e.length-1);const r=await ZS.fromSeed({derivationPath:e,network:t},n),o=OS(e);return new cS(r,o)}static async fromNode(e,t){if(!(e instanceof ZS))throw new Error(\"Invalid node: Expected an instance of BIP44Node.\");return lS(t),uS(e.depth),Promise.resolve(new cS(e,t))}constructor(e,t){iS.set(this,void 0),aS(this,iS,e,\"f\"),this.coin_type=t,this.path=function(e){return`m / ${eh} / ${fS(e)}`}(t),Object.freeze(this)}get depth(){return sS(this,iS,\"f\").depth}get privateKeyBytes(){return sS(this,iS,\"f\").privateKeyBytes}get publicKeyBytes(){return sS(this,iS,\"f\").publicKeyBytes}get chainCodeBytes(){return sS(this,iS,\"f\").chainCodeBytes}get privateKey(){return sS(this,iS,\"f\").privateKey}get publicKey(){return sS(this,iS,\"f\").publicKey}get compressedPublicKey(){return sS(this,iS,\"f\").compressedPublicKey}get compressedPublicKeyBytes(){return sS(this,iS,\"f\").compressedPublicKeyBytes}get chainCode(){return sS(this,iS,\"f\").chainCode}get address(){return sS(this,iS,\"f\").address}get masterFingerprint(){return sS(this,iS,\"f\").masterFingerprint}get parentFingerprint(){return sS(this,iS,\"f\").parentFingerprint}get fingerprint(){return sS(this,iS,\"f\").fingerprint}get index(){return sS(this,iS,\"f\").index}get network(){return sS(this,iS,\"f\").network}get curve(){return sS(this,iS,\"f\").curve}get extendedKey(){return sS(this,iS,\"f\").extendedKey}async deriveBIP44AddressKey({account:e=0,change:t=0,address_index:n}){return await sS(this,iS,\"f\").derive(function({account:e=0,change:t=0,address_index:n}){return[fS(e),dS(t),dS(n)]}({account:e,change:t,address_index:n}))}toJSON(){return{...sS(this,iS,\"f\").toJSON(),coin_type:this.coin_type,path:this.path}}}function uS(e){if(2!==e)throw new Error(`Invalid depth: Coin type nodes must be of depth 2. Received: \"${e}\"`)}function lS(e){if(\"number\"!=typeof e||!Number.isInteger(e)||e<0)throw new Error(\"Invalid coin type: The specified coin type must be a non-negative integer number.\")}function fS(e){return hS(e),`${pS(e)}'`}function pS(e){return hS(e),`bip32:${e}`}function dS(e){if(\"number\"==typeof e)return pS(e);if(!e||!Number.isInteger(e.index)||\"boolean\"!=typeof e.hardened)throw new Error(\"Invalid BIP-32 index: Must be an object containing the index and whether it is hardened.\");return e.hardened?fS(e.index):pS(e.index)}function hS(e){if(!(bS(t=e)&&t<=Qd))throw new Error(\"Invalid BIP-32 index: Must be a non-negative integer.\");var t}function yS(e){return e.endsWith(\"'\")}function gS(e){return e instanceof Uint8Array?e:$y(e)}function mS(e){if(void 0!==e)return gS(e)}function vS(e,t){if(e.length!==t)return!1;for(const t of e)if(0!==t)return!0;return!1}function bS(e){return\"number\"==typeof e&&Number.isInteger(e)&&e>=0}function wS(e,t){if(e instanceof Uint8Array)return AS(e,t),e;if(\"string\"==typeof e){const n=$y(e);return AS(n,t),n}throw new Error(\"Invalid value: Expected an instance of Uint8Array or hexadecimal string.\")}function SS(e,t){if(e instanceof Uint8Array)return _n(e.length===t,`Invalid value: Must be a ${t}-byte byte array.`),e;if(\"string\"==typeof e)return SS($y(e),t);throw new Error(\"Invalid value: Expected an instance of Uint8Array or hexadecimal string.\")}function AS(e,t){if(!vS(e,t))throw new Error(`Invalid value: Must be a non-zero ${t}-byte byte array.`)}iS=new WeakMap;const ES=(e,t)=>{if(!vS(e,t))throw new Error(`Invalid public key: The key must be a ${t}-byte, non-zero byte array.`);var n;return Zy((n=aw(e),tw(n))).getUint32(0,!1)};function xS(e){if(!e||\"string\"!=typeof e)throw new Error(\"Invalid curve: Must specify a curve.\");if(!Object.keys(Ub).includes(e))throw new Error(`Invalid curve: Only the following curves are supported: ${Object.keys(Ub).join(\", \")}.`)}function TS(e,t=!1){const n=new Uint8Array(4);return Zy(n).setUint32(0,e,t),n}function kS(){return Boolean(globalThis.crypto?.subtle)}function OS(e){const t=e[2].split(\":\")[1]?.replace(\"'\",\"\");_n(t,\"Invalid derivation path: Coin type is not specified.\");const n=Number.parseInt(t,10);return _n(bS(n),\"Invalid derivation path: Coin type is not a valid integer.\"),n}const _S=$m.CURVE,IS=\"secp256k1\",CS=Gy(\"Bitcoin seed\"),BS=!0,PS=65,RS=e=>$m.utils.isValidPrivateKey(e),jS=(()=>{let e=!1;return(t,n=!1)=>(e||($m.ProjectivePoint.BASE._setWindowSize(4),e=!0),$m.getPublicKey(t,n))})(),US=(e,t)=>{_n(vS(t,32),\"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.\");const n=$m.ProjectivePoint.fromHex(e).add($m.ProjectivePoint.fromPrivateKey(t));return n.assertValidity(),n.toRawBytes(!1)},FS=e=>$m.ProjectivePoint.fromHex(e).toRawBytes(!0),NS=e=>$m.ProjectivePoint.fromHex(e).toRawBytes(!1),LS=32,MS=\"slip10\",DS=33,qS=76067358,VS=76066276,zS=70617039,KS=70615956;const HS=e=>{const t=(e=>{const t=Sv(aw);try{return t.decode(e)}catch{throw new Error(\"Invalid extended key: Value is not base58-encoded, or the checksum is invalid.\")}})(e);if(78!==t.length)throw new Error(`Invalid extended key: Expected a length of 78, got ${t.length}.`);const n=Zy(t),r=n.getUint32(0,!1),{network:o,type:i}=function(e){switch(e){case qS:return{type:\"public\",network:\"mainnet\"};case zS:return{type:\"public\",network:\"testnet\"};case VS:return{type:\"private\",network:\"mainnet\"};case KS:return{type:\"private\",network:\"testnet\"};default:throw new Error(\"Invalid extended key: Expected a public (xpub) or private key (xprv) version.\")}}(r),a=n.getUint8(4);YS(a);const s=n.getUint32(5,!1),c=n.getUint32(9,!1),u=t.slice(13,45);if(!vS(u,32))throw new Error(\"Invalid extended key: Chain code must be a 32-byte non-zero byte array.\");const l=t.slice(45,78);if(!vS(l,33))throw new Error(\"Invalid extended key: Key must be a 33-byte non-zero byte array.\");const f=Zy(l);if(\"public\"===i){if(2!==f.getUint8(0)&&3!==f.getUint8(0))throw new Error(\"Invalid extended key: Public key must start with 0x02 or 0x03.\");return{type:i,depth:a,parentFingerprint:s,index:c,network:o,chainCode:u,publicKey:NS(l)}}if(0!==f.getUint8(0))throw new Error(\"Invalid extended key: Private key must start with 0x00.\");return{type:i,depth:a,parentFingerprint:s,index:c,network:o,chainCode:u,privateKey:l.slice(1)}},$S=e=>{const{type:t,depth:n,parentFingerprint:r,index:o,network:i,chainCode:a}=e,s=new Uint8Array(78),c=Zy(s),u=function(e,t){switch(e){case\"mainnet\":return\"public\"===t?qS:VS;case\"testnet\":return\"public\"===t?zS:KS;default:return In()}}(i,t);if(c.setUint32(0,u,!1),c.setUint8(4,n),c.setUint32(5,r,!1),c.setUint32(9,o,!1),s.set(a,13),\"public\"===t){const{publicKey:t}=e,n=FS(t);s.set(n,45)}if(\"private\"===t){const{privateKey:t}=e;s.set(t,46)}return l=s,Sv(aw).encode(l);var l};var GS,WS=function(e,t,n,r){if(\"a\"===n&&!r)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?r:\"a\"===n?r.call(e):r?r.value:t.get(e)},XS=function(e,t,n,r,o){if(\"m\"===r)throw new TypeError(\"Private method is not writable\");if(\"a\"===r&&!o)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!o:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===r?o.call(e,n):o?o.value=n:t.set(e,n),n};class ZS{static async fromJSON(e,t){return ZS.fromExtendedKey(e,t)}static async fromExtendedKey(e,t){if(\"string\"==typeof e){const n=HS(e),{type:r,chainCode:o,depth:i,parentFingerprint:a,index:s,network:c}=n;if(\"private\"===r){const{privateKey:e}=n;return ZS.fromExtendedKey({depth:i,parentFingerprint:a,index:s,network:c,privateKey:e,chainCode:o},t)}const{publicKey:u}=n;return ZS.fromExtendedKey({depth:i,parentFingerprint:a,index:s,network:c,publicKey:u,chainCode:o},t)}const{privateKey:n,publicKey:r,chainCode:o,depth:i,parentFingerprint:a,index:s,network:c}=e;YS(i);const u=await rS.fromExtendedKey({privateKey:n,publicKey:r,chainCode:o,depth:i,parentFingerprint:a,index:s,network:c,curve:\"secp256k1\"},t);return new ZS(u)}static async fromDerivationPath({derivationPath:e,network:t},n){YS(e.length-1),JS(e,0);const r=await rS.fromDerivationPath({derivationPath:e,network:t,curve:\"secp256k1\"},n);return new ZS(r)}static async fromSeed({derivationPath:e,network:t},n){YS(e.length-1),JS(e,0);const r=await rS.fromSeed({derivationPath:e,network:t,curve:\"secp256k1\"},n);return new ZS(r)}get depth(){return WS(this,GS,\"f\").depth}get privateKeyBytes(){return WS(this,GS,\"f\").privateKeyBytes}get publicKeyBytes(){return WS(this,GS,\"f\").publicKeyBytes}get chainCodeBytes(){return WS(this,GS,\"f\").chainCodeBytes}get privateKey(){return WS(this,GS,\"f\").privateKey}get publicKey(){return WS(this,GS,\"f\").publicKey}get compressedPublicKey(){return WS(this,GS,\"f\").compressedPublicKey}get compressedPublicKeyBytes(){return WS(this,GS,\"f\").compressedPublicKeyBytes}get chainCode(){return WS(this,GS,\"f\").chainCode}get address(){return WS(this,GS,\"f\").address}get masterFingerprint(){return WS(this,GS,\"f\").masterFingerprint}get parentFingerprint(){return WS(this,GS,\"f\").parentFingerprint}get fingerprint(){return WS(this,GS,\"f\").fingerprint}get index(){return WS(this,GS,\"f\").index}get network(){return WS(this,GS,\"f\").network}get extendedKey(){return WS(this,GS,\"f\").extendedKey}get curve(){return WS(this,GS,\"f\").curve}constructor(e){GS.set(this,void 0),XS(this,GS,e,\"f\"),Object.freeze(this)}neuter(){const e=WS(this,GS,\"f\").neuter();return new ZS(e)}async derive(e){if(5===this.depth)throw new Error(\"Illegal operation: This HD tree node is already a leaf node.\");YS(this.depth+e.length),JS(e,this.depth+1);const t=await WS(this,GS,\"f\").derive(e);return new ZS(t)}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,network:this.network,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function YS(e){if(oS(e),e<0||e>5)throw new Error(`Invalid HD tree path depth: The depth must be a positive integer N such that 0 <= N <= 5. Received: \"${e}\"`)}function JS(e,t){e.forEach((e,n)=>{const r=t+n;if(0!==r)switch(_n(\"string\"==typeof e),r){case 1:if(e!==eh)throw new Error(`Invalid derivation path: The \"purpose\" node (depth 1) must be the string \"${eh}\".`);break;case 2:if(!nh.test(e)||!yS(e))throw new Error('Invalid derivation path: The \"coin_type\" node (depth 2) must be a hardened BIP-32 node.');break;case 3:if(!nh.test(e)||!yS(e))throw new Error('Invalid derivation path: The \"account\" node (depth 3) must be a hardened BIP-32 node.');break;case 4:if(!nh.test(e))throw new Error('Invalid derivation path: The \"change\" node (depth 4) must be a BIP-32 node.');break;case 5:if(!nh.test(e))throw new Error('Invalid derivation path: The \"address_index\" node (depth 5) must be a BIP-32 node.')}else if(!(e instanceof Uint8Array||ih.test(e)))throw new Error('Invalid derivation path: The \"m\" / seed node (depth 0) must be a BIP-39 node.')})}function QS(e){return void 0===e?`${Yt}`:`${Yt}/${e}'`}GS=new WeakMap;const eA=\"on-chain\",tA={onChainAccount:{load:!0,source:eA},wallet:!0},nA={onChainAccount:{load:!1,source:eA},wallet:!0},rA={onChainAccount:{load:!0,source:\"state\"},wallet:!0};const oA=function(e,t){let n=e;const r=uA[t];let o=null,i=0,a=null;const s=[],c={},u=function(e,t){i=4*n+17,o=function(e){const t=new Array(e);for(let n=0;n<e;n+=1){t[n]=new Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(i),l(0,0),l(i-7,0),l(0,i-7),p(),f(),h(e,t),n>=7&&d(e),null==a&&(a=g(n,r,s)),y(a,t)},l=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||i<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||i<=t+r||(o[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},f=function(){for(let e=8;e<i-8;e+=1)null==o[e][6]&&(o[e][6]=e%2==0);for(let e=8;e<i-8;e+=1)null==o[6][e]&&(o[6][e]=e%2==0)},p=function(){const e=vA.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){const r=e[t],i=e[n];if(null==o[r][i])for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)o[r+e][i+t]=-2==e||2==e||-2==t||2==t||0==e&&0==t}},d=function(e){const t=vA.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){const r=!e&&1==(t>>n&1);o[Math.floor(n/3)][n%3+i-8-3]=r}for(let n=0;n<18;n+=1){const r=!e&&1==(t>>n&1);o[n%3+i-8-3][Math.floor(n/3)]=r}},h=function(e,t){const n=r<<3|t,a=vA.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){const n=!e&&1==(a>>t&1);t<6?o[t][8]=n:t<8?o[t+1][8]=n:o[i-15+t][8]=n}for(let t=0;t<15;t+=1){const n=!e&&1==(a>>t&1);t<8?o[8][i-t-1]=n:t<9?o[8][15-t-1+1]=n:o[8][15-t-1]=n}o[i-8][8]=!e},y=function(e,t){let n=-1,r=i-1,a=7,s=0;const c=vA.getMaskFunction(t);for(let t=i-1;t>0;t-=2)for(6==t&&(t-=1);;){for(let n=0;n<2;n+=1)if(null==o[r][t-n]){let i=!1;s<e.length&&(i=1==(e[s]>>>a&1));c(r,t-n)&&(i=!i),o[r][t-n]=i,a-=1,-1==a&&(s+=1,a=7)}if(r+=n,r<0||i<=r){r-=n,n=-n;break}}},g=function(e,t,n){const r=SA.getRSBlocks(e,t),o=AA();for(let t=0;t<n.length;t+=1){const r=n[t];o.put(r.getMode(),4),o.put(r.getLength(),vA.getLengthInBits(r.getMode(),e)),r.write(o)}let i=0;for(let e=0;e<r.length;e+=1)i+=r[e].dataCount;if(o.getLengthInBits()>8*i)throw\"code length overflow. (\"+o.getLengthInBits()+\">\"+8*i+\")\";for(o.getLengthInBits()+4<=8*i&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*i||(o.put(236,8),o.getLengthInBits()>=8*i));)o.put(17,8);return function(e,t){let n=0,r=0,o=0;const i=new Array(t.length),a=new Array(t.length);for(let s=0;s<t.length;s+=1){const c=t[s].dataCount,u=t[s].totalCount-c;r=Math.max(r,c),o=Math.max(o,u),i[s]=new Array(c);for(let t=0;t<i[s].length;t+=1)i[s][t]=255&e.getBuffer()[t+n];n+=c;const l=vA.getErrorCorrectPolynomial(u),f=wA(i[s],l.getLength()-1).mod(l);a[s]=new Array(l.getLength()-1);for(let e=0;e<a[s].length;e+=1){const t=e+f.getLength()-a[s].length;a[s][e]=t>=0?f.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;const c=new Array(s);let u=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<i[n].length&&(c[u]=i[n][e],u+=1);for(let e=0;e<o;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[u]=a[n][e],u+=1);return c}(o,r)};c.addData=function(e,t){let n=null;switch(t=t||\"Byte\"){case\"Numeric\":n=EA(e);break;case\"Alphanumeric\":n=xA(e);break;case\"Byte\":n=TA(e);break;case\"Kanji\":n=kA(e);break;default:throw\"mode:\"+t}s.push(n),a=null},c.isDark=function(e,t){if(e<0||i<=e||t<0||i<=t)throw e+\",\"+t;return o[e][t]},c.getModuleCount=function(){return i},c.make=function(){if(n<1){let e=1;for(;e<40;e++){const t=SA.getRSBlocks(e,r),n=AA();for(let t=0;t<s.length;t++){const r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),vA.getLengthInBits(r.getMode(),e)),r.write(n)}let o=0;for(let e=0;e<t.length;e++)o+=t[e].dataCount;if(n.getLengthInBits()<=8*o)break}n=e}u(!1,function(){let e=0,t=0;for(let n=0;n<8;n+=1){u(!0,n);const r=vA.getLostPoint(c);(0==n||e>r)&&(e=r,t=n)}return t}())},c.createTableTag=function(e,t){e=e||2;let n=\"\";n+='<table style=\"',n+=\" border-width: 0px; border-style: none;\",n+=\" border-collapse: collapse;\",n+=\" padding: 0px; margin: \"+(t=void 0===t?4*e:t)+\"px;\",n+='\">',n+=\"<tbody>\";for(let t=0;t<c.getModuleCount();t+=1){n+=\"<tr>\";for(let r=0;r<c.getModuleCount();r+=1)n+='<td style=\"',n+=\" border-width: 0px; border-style: none;\",n+=\" border-collapse: collapse;\",n+=\" padding: 0px; margin: 0px;\",n+=\" width: \"+e+\"px;\",n+=\" height: \"+e+\"px;\",n+=\" background-color: \",n+=c.isDark(t,r)?\"#000000\":\"#ffffff\",n+=\";\",n+='\"/>';n+=\"</tr>\"}return n+=\"</tbody>\",n+=\"</table>\",n},c.createSvgTag=function(e,t,n,r){let o={};\"object\"==typeof arguments[0]&&(o=arguments[0],e=o.cellSize,t=o.margin,n=o.alt,r=o.title),e=e||2,t=void 0===t?4*e:t,(n=\"string\"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||\"qrcode-description\":null,(r=\"string\"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||\"qrcode-title\":null;const i=c.getModuleCount()*e+2*t;let a,s,u,l,f,p=\"\";for(f=\"l\"+e+\",0 0,\"+e+\" -\"+e+\",0 0,-\"+e+\"z \",p+='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"',p+=o.scalable?\"\":' width=\"'+i+'px\" height=\"'+i+'px\"',p+=' viewBox=\"0 0 '+i+\" \"+i+'\" ',p+=' preserveAspectRatio=\"xMinYMin meet\"',p+=r.text||n.text?' role=\"img\" aria-labelledby=\"'+m([r.id,n.id].join(\" \").trim())+'\"':\"\",p+=\">\",p+=r.text?'<title id=\"'+m(r.id)+'\">'+m(r.text)+\"</title>\":\"\",p+=n.text?'<description id=\"'+m(n.id)+'\">'+m(n.text)+\"</description>\":\"\",p+='<rect width=\"100%\" height=\"100%\" fill=\"white\" cx=\"0\" cy=\"0\"/>',p+='<path d=\"',u=0;u<c.getModuleCount();u+=1)for(l=u*e+t,a=0;a<c.getModuleCount();a+=1)c.isDark(u,a)&&(s=a*e+t,p+=\"M\"+s+\",\"+l+f);return p+='\" stroke=\"transparent\" fill=\"black\"/>',p+=\"</svg>\",p},c.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;const n=c.getModuleCount()*e+2*t,r=t,o=n-t;return IA(n,n,function(t,n){if(r<=t&&t<o&&r<=n&&n<o){const o=Math.floor((t-r)/e),i=Math.floor((n-r)/e);return c.isDark(i,o)?0:1}return 1})},c.createImgTag=function(e,t,n){e=e||2,t=void 0===t?4*e:t;const r=c.getModuleCount()*e+2*t;let o=\"\";return o+=\"<img\",o+=' src=\"',o+=c.createDataURL(e,t),o+='\"',o+=' width=\"',o+=r,o+='\"',o+=' height=\"',o+=r,o+='\"',n&&(o+=' alt=\"',o+=m(n),o+='\"'),o+=\"/>\",o};const m=function(e){let t=\"\";for(let n=0;n<e.length;n+=1){const r=e.charAt(n);switch(r){case\"<\":t+=\"&lt;\";break;case\">\":t+=\"&gt;\";break;case\"&\":t+=\"&amp;\";break;case'\"':t+=\"&quot;\";break;default:t+=r}}return t};return c.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;const t=1*c.getModuleCount()+2*e,n=e,r=t-e;let o,i,a,s,u;const l={\"██\":\"█\",\"█ \":\"▀\",\" █\":\"▄\",\"  \":\" \"},f={\"██\":\"▀\",\"█ \":\"▀\",\" █\":\" \",\"  \":\" \"};let p=\"\";for(o=0;o<t;o+=2){for(a=Math.floor((o-n)/1),s=Math.floor((o+1-n)/1),i=0;i<t;i+=1)u=\"█\",n<=i&&i<r&&n<=o&&o<r&&c.isDark(a,Math.floor((i-n)/1))&&(u=\" \"),n<=i&&i<r&&n<=o+1&&o+1<r&&c.isDark(s,Math.floor((i-n)/1))?u+=\" \":u+=\"█\",p+=e<1&&o+1>=r?f[u]:l[u];p+=\"\\n\"}return t%2&&e>0?p.substring(0,p.length-t-1)+Array(t+1).join(\"▀\"):p.substring(0,p.length-1)}(t);e-=1,t=void 0===t?2*e:t;const n=c.getModuleCount()*e+2*t,r=t,o=n-t;let i,a,s,u;const l=Array(e+1).join(\"██\"),f=Array(e+1).join(\"  \");let p=\"\",d=\"\";for(i=0;i<n;i+=1){for(s=Math.floor((i-r)/e),d=\"\",a=0;a<n;a+=1)u=1,r<=a&&a<o&&r<=i&&i<o&&c.isDark(s,Math.floor((a-r)/e))&&(u=0),d+=u?l:f;for(s=0;s<e;s+=1)p+=d+\"\\n\"}return p.substring(0,p.length-1)},c.renderTo2dContext=function(e,t){t=t||2;const n=c.getModuleCount();for(let r=0;r<n;r++)for(let o=0;o<n;o++)e.fillStyle=c.isDark(r,o)?\"black\":\"white\",e.fillRect(o*t,r*t,t,t)},c};oA.stringToBytes=function(e){const t=[];for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t.push(255&r)}return t},oA.createStringToBytes=function(e,t){const n=function(){const n=_A(e),r=function(){const e=n.read();if(-1==e)throw\"eof\";return e};let o=0;const i={};for(;;){const e=n.read();if(-1==e)break;const t=r(),a=r()<<8|r();i[String.fromCharCode(e<<8|t)]=a,o+=1}if(o!=t)throw o+\" != \"+t;return i}(),r=\"?\".charCodeAt(0);return function(e){const t=[];for(let o=0;o<e.length;o+=1){const i=e.charCodeAt(o);if(i<128)t.push(i);else{const i=n[e.charAt(o)];\"number\"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(r)}}return t}};const iA=1,aA=2,sA=4,cA=8,uA={L:1,M:0,Q:3,H:2},lA=0,fA=1,pA=2,dA=3,hA=4,yA=5,gA=6,mA=7,vA=function(){const e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},o=function(e){let t=0;for(;0!=e;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;o(n)-o(t)>=0;)n^=t<<o(n)-o(t);return 21522^(e<<10|n)},r.getBCHTypeNumber=function(e){let t=e<<12;for(;o(t)-o(n)>=0;)t^=n<<o(t)-o(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case lA:return function(e,t){return(e+t)%2==0};case fA:return function(e,t){return e%2==0};case pA:return function(e,t){return t%3==0};case dA:return function(e,t){return(e+t)%3==0};case hA:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case yA:return function(e,t){return e*t%2+e*t%3==0};case gA:return function(e,t){return(e*t%2+e*t%3)%2==0};case mA:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw\"bad maskPattern:\"+e}},r.getErrorCorrectPolynomial=function(e){let t=wA([1],0);for(let n=0;n<e;n+=1)t=t.multiply(wA([1,bA.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case iA:return 10;case aA:return 9;case sA:case cA:return 8;default:throw\"mode:\"+e}else if(t<27)switch(e){case iA:return 12;case aA:return 11;case sA:return 16;case cA:return 10;default:throw\"mode:\"+e}else{if(!(t<41))throw\"type:\"+t;switch(e){case iA:return 14;case aA:return 13;case sA:return 16;case cA:return 12;default:throw\"mode:\"+e}}},r.getLostPoint=function(e){const t=e.getModuleCount();let n=0;for(let r=0;r<t;r+=1)for(let o=0;o<t;o+=1){let i=0;const a=e.isDark(r,o);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)o+s<0||t<=o+s||0==n&&0==s||a==e.isDark(r+n,o+s)&&(i+=1);i>5&&(n+=3+i-5)}for(let r=0;r<t-1;r+=1)for(let o=0;o<t-1;o+=1){let t=0;e.isDark(r,o)&&(t+=1),e.isDark(r+1,o)&&(t+=1),e.isDark(r,o+1)&&(t+=1),e.isDark(r+1,o+1)&&(t+=1),0!=t&&4!=t||(n+=3)}for(let r=0;r<t;r+=1)for(let o=0;o<t-6;o+=1)e.isDark(r,o)&&!e.isDark(r,o+1)&&e.isDark(r,o+2)&&e.isDark(r,o+3)&&e.isDark(r,o+4)&&!e.isDark(r,o+5)&&e.isDark(r,o+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let o=0;o<t-6;o+=1)e.isDark(o,r)&&!e.isDark(o+1,r)&&e.isDark(o+2,r)&&e.isDark(o+3,r)&&e.isDark(o+4,r)&&!e.isDark(o+5,r)&&e.isDark(o+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let o=0;o<t;o+=1)e.isDark(o,n)&&(r+=1);return n+=10*(Math.abs(100*r/t/t-50)/5),n},r}(),bA=function(){const e=new Array(256),t=new Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;const n={glog:function(e){if(e<1)throw\"glog(\"+e+\")\";return t[e]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]}};return n}(),wA=function(e,t){if(void 0===e.length)throw e.length+\"/\"+t;const n=function(){let n=0;for(;n<e.length&&0==e[n];)n+=1;const r=new Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={getAt:function(e){return n[e]},getLength:function(){return n.length},multiply:function(e){const t=new Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let o=0;o<e.getLength();o+=1)t[n+o]^=bA.gexp(bA.glog(r.getAt(n))+bA.glog(e.getAt(o)));return wA(t,0)},mod:function(e){if(r.getLength()-e.getLength()<0)return r;const t=bA.glog(r.getAt(0))-bA.glog(e.getAt(0)),n=new Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=bA.gexp(bA.glog(e.getAt(r))+t);return wA(n,0).mod(e)}};return r},SA=function(){const e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){const n={};return n.totalCount=e,n.dataCount=t,n},n={};return n.getRSBlocks=function(n,r){const o=function(t,n){switch(n){case uA.L:return e[4*(t-1)+0];case uA.M:return e[4*(t-1)+1];case uA.Q:return e[4*(t-1)+2];case uA.H:return e[4*(t-1)+3];default:return}}(n,r);if(void 0===o)throw\"bad rs block @ typeNumber:\"+n+\"/errorCorrectionLevel:\"+r;const i=o.length/3,a=[];for(let e=0;e<i;e+=1){const n=o[3*e+0],r=o[3*e+1],i=o[3*e+2];for(let e=0;e<n;e+=1)a.push(t(r,i))}return a},n}(),AA=function(){const e=[];let t=0;const n={getBuffer:function(){return e},getAt:function(t){const n=Math.floor(t/8);return 1==(e[n]>>>7-t%8&1)},put:function(e,t){for(let r=0;r<t;r+=1)n.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return t},putBit:function(n){const r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n},EA=function(e){const t=iA,n=e,r={getMode:function(){return t},getLength:function(e){return n.length},write:function(e){const t=n;let r=0;for(;r+2<t.length;)e.put(o(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(o(t.substring(r,r+1)),4):t.length-r==2&&e.put(o(t.substring(r,r+2)),7))}},o=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=10*t+i(e.charAt(n));return t},i=function(e){if(\"0\"<=e&&e<=\"9\")return e.charCodeAt(0)-\"0\".charCodeAt(0);throw\"illegal char :\"+e};return r},xA=function(e){const t=aA,n=e,r={getMode:function(){return t},getLength:function(e){return n.length},write:function(e){const t=n;let r=0;for(;r+1<t.length;)e.put(45*o(t.charAt(r))+o(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(o(t.charAt(r)),6)}},o=function(e){if(\"0\"<=e&&e<=\"9\")return e.charCodeAt(0)-\"0\".charCodeAt(0);if(\"A\"<=e&&e<=\"Z\")return e.charCodeAt(0)-\"A\".charCodeAt(0)+10;switch(e){case\" \":return 36;case\"$\":return 37;case\"%\":return 38;case\"*\":return 39;case\"+\":return 40;case\"-\":return 41;case\".\":return 42;case\"/\":return 43;case\":\":return 44;default:throw\"illegal char :\"+e}};return r},TA=function(e){const t=sA,n=oA.stringToBytes(e),r={getMode:function(){return t},getLength:function(e){return n.length},write:function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)}};return r},kA=function(e){const t=cA,n=oA.stringToBytes;!function(){const e=n(\"友\");if(2!=e.length||38726!=(e[0]<<8|e[1]))throw\"sjis not supported.\"}();const r=n(e),o={getMode:function(){return t},getLength:function(e){return~~(r.length/2)},write:function(e){const t=r;let n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw\"illegal char at \"+(n+1)+\"/\"+r;r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13),n+=2}if(n<t.length)throw\"illegal char at \"+(n+1)}};return o},OA=function(){const e=[],t={writeByte:function(t){e.push(255&t)},writeShort:function(e){t.writeByte(e),t.writeByte(e>>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(let o=0;o<r;o+=1)t.writeByte(e[o+n])},writeString:function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},toByteArray:function(){return e},toString:function(){let t=\"\";t+=\"[\";for(let n=0;n<e.length;n+=1)n>0&&(t+=\",\"),t+=e[n];return t+=\"]\",t}};return t},_A=function(e){const t=e;let n=0,r=0,o=0;const i={read:function(){for(;o<8;){if(n>=t.length){if(0==o)return-1;throw\"unexpected end of file./\"+o}const e=t.charAt(n);if(n+=1,\"=\"==e)return o=0,-1;e.match(/^\\s$/)||(r=r<<6|a(e.charCodeAt(0)),o+=6)}const e=r>>>o-8&255;return o-=8,e}},a=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw\"c:\"+e};return i},IA=function(e,t,n){const r=function(e,t){const n=e,r=t,o=new Array(e*t),i={setPixel:function(e,t,r){o[t*n+e]=r},write:function(e){e.writeString(\"GIF87a\"),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(\",\"),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);const t=a(2);e.writeByte(2);let o=0;for(;t.length-o>255;)e.writeByte(255),e.writeBytes(t,o,255),o+=255;e.writeByte(t.length-o),e.writeBytes(t,o,t.length-o),e.writeByte(0),e.writeString(\";\")}},a=function(e){const t=1<<e,n=1+(1<<e);let r=e+1;const i=s();for(let e=0;e<t;e+=1)i.add(String.fromCharCode(e));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(n));const a=OA(),c=function(e){const t=e;let n=0,r=0;return{write:function(e,o){if(e>>>o!=0)throw\"length over\";for(;n+o>=8;)t.writeByte(255&(e<<n|r)),o-=8-n,e>>>=8-n,r=0,n=0;r|=e<<n,n+=o},flush:function(){n>0&&t.writeByte(r)}}}(a);c.write(t,r);let u=0,l=String.fromCharCode(o[u]);for(u+=1;u<o.length;){const e=String.fromCharCode(o[u]);u+=1,i.contains(l+e)?l+=e:(c.write(i.indexOf(l),r),i.size()<4095&&(i.size()==1<<r&&(r+=1),i.add(l+e)),l=e)}return c.write(i.indexOf(l),r),c.write(n,r),c.flush(),a.toByteArray()},s=function(){const e={};let t=0;const n={add:function(r){if(n.contains(r))throw\"dup key:\"+r;e[r]=t,t+=1},size:function(){return t},indexOf:function(t){return e[t]},contains:function(t){return void 0!==e[t]}};return n};return i}(e,t);for(let o=0;o<t;o+=1)for(let t=0;t<e;t+=1)r.setPixel(t,o,n(t,o));const o=OA();r.write(o);const i=function(){let e=0,t=0,n=0,r=\"\";const o={},i=function(e){r+=String.fromCharCode(a(63&e))},a=function(e){if(e<0)throw\"n:\"+e;if(e<26)return 65+e;if(e<52)return e-26+97;if(e<62)return e-52+48;if(62==e)return 43;if(63==e)return 47;throw\"n:\"+e};return o.writeByte=function(r){for(e=e<<8|255&r,t+=8,n+=1;t>=6;)i(e>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0){const e=3-n%3;for(let t=0;t<e;t+=1)r+=\"=\"}},o.toString=function(){return r},o}(),a=o.toByteArray();for(let e=0;e<a.length;e+=1)i.writeByte(a[e]);return i.flush(),\"data:image/gif;base64,\"+i},CA=oA;const BA=({accountAddress:e,locale:t})=>{const n=Ua(t),r=function(e){try{const t=CA(4,\"M\");return t.addData(e),t.make(),t.createSvgTag(5,16)}catch{return null}}(e);return Bp(Up,{children:Pp(Fp,{children:[Pp(Fp,{alignment:\"center\",center:!0,children:[Bp(Fp,{children:null}),Bp(Np,{size:\"lg\",children:n(\"confirmation.accountActivation.title\")}),Bp(Fp,{children:null}),Bp(Fp,{children:null}),Bp(Fp,{children:null})]}),Bp(Lp,{children:Pp(Fp,{direction:\"vertical\",center:!0,children:[r?Bp($p,{src:r,width:230}):null,Bp(Mp,{fontWeight:\"bold\",color:\"alternative\",alignment:\"center\",children:n(\"confirmation.accountActivation.address\")}),Bp(Fp,{children:null}),Bp(bd,{value:e}),Bp(Fp,{children:null}),Bp(Fp,{children:null}),Bp(Mp,{color:\"alternative\",alignment:\"center\",children:n(\"confirmation.accountActivation.description\")}),Bp(Fp,{children:null}),Bp(Fp,{children:null}),Bp(Mp,{color:\"alternative\",alignment:\"center\",children:n(\"confirmation.accountActivation.callToAction\")})]})})]})})};async function PA(e){const t=await async function(){return await Zi().then(e=>e.locale).catch(()=>ja)??ja}();return Wi(await $i(Bp(BA,{accountAddress:e,locale:t}),{}),\"alert\")}class RA extends mf{static async scheduleBackgroundEvent(e,t=Ui){await Ki({method:of.TrackTransaction,params:e,duration:t})}#q;#gt;#Je;constructor({logger:e,networkService:t,synchronizeService:n,accountService:r}){super({logger:e.withPrefix(\"[TrackTransactionHandler]\"),requestStruct:ff}),this.#q=t,this.#gt=n,this.#Je=r}async handleCronJobRequest(e){const{scope:t,txId:n,accountIdsOrAddresses:r,attempt:o=0}=e.params;this.logger.debug(\"Tracking transaction\",{txId:n,scope:t,attempt:o});try{const e=await this.#q.getTransaction(n,t);(i=e.status)===`${Ms.Failed}`||i===`${Ms.Confirmed}`?await this.#bt(t,r):this.logger.warn(\"Transaction is neither confirmed nor failed; skipping synchronization\",{txId:n,scope:t,status:e.status})}catch(e){if(e instanceof rs||e instanceof Ja)return void await this.#wt({txId:n,scope:t,accountIdsOrAddresses:r,attempt:o});this.logger.warn(\"Unexpected error when tracking transaction\",{error:e,txId:n,scope:t,attempt:o}),await ya(e)}var i}async#wt(e){const{txId:t,scope:n,attempt:r=0,accountIdsOrAddresses:o}=e,i=Ar.transaction.trackTransactionMaxReschedules;if(r<i)return this.logger.debug(\"Retrying transaction tracking job\",{txId:t,scope:n,attempt:r,maxReschedules:i}),void await RA.scheduleBackgroundEvent({txId:t,scope:n,accountIdsOrAddresses:o,attempt:r+1},ji);this.logger.warn(\"Max tracking attempts reached\",{txId:t,scope:n,attempt:r,maxReschedules:i})}async#bt(e,t){const n=t[0],r=await this.#Je.findById(n);if(!r)return void this.logger.warn(\"Sender account not found, skipping synchronization\",{scope:e,senderAccountId:n});await async function(e){await Yi(qi,{message:\"Snap transaction finalized\",origin:e.origin,account_type:e.accountType,chain_id_caip:e.chainIdCaip})}({origin:tn,accountType:r.type,chainIdCaip:e});const o=[r],i=t[1];if(i&&i!==r.address){const t=await this.#Je.findByAddressAndScope(i,e);t&&o.push(t)}await this.#gt.synchronize(o,{scope:e})}}class jA extends gf{getAccountId(e){return e.params.accountId}getScope(e){return e.params.scope}#St;#At;constructor({logger:e,accountResolver:t,resolveAccountOptions:n=tA,requestStruct:r,responseStruct:o}){super({logger:e,requestStruct:r,responseStruct:o}),this.#St=t,this.#At=n}async handleRequest(e){try{const t=await this.resolveAccount(e);return await this.execute(t,e)}catch(t){if(t instanceof es)return this.handleAccountNotActivatedError(t,e);throw t}}async resolveAccount(e){return this.#St.resolveAccount({accountId:this.getAccountId(e),scope:this.getScope(e),options:this.#At})}async#Et(e){await PA(e)}async handleAccountNotActivatedError(e,t){throw await this.#Et(e.address),e}}class UA extends mf{#xt;#Tt;static async scheduleBackgroundEvent(e,t=Fi){await Ki({method:of.RefreshConfirmationContext,params:e,duration:t})}constructor({logger:e,confirmationUIController:t,refreshers:n}){if(super({logger:e.withPrefix(\"[🔄 RefreshConfirmationContextHandler]\"),requestStruct:cf}),this.#xt=new Map(n.map(e=>[e.key,e])),this.#xt.size!==n.length)throw new Error(\"Duplicate confirmation context refresher key registered\");this.#Tt=t}async handleCronJobRequest(e){this.logger.info(\"Refreshing confirmation context...\");const{interfaceId:t,scope:n,interfaceKey:r,refresherKeys:o}=e.params,i=this.#kt(o);if(0===i.length)return void this.logger.warn(\"No matching refreshers for requested keys, skipping\");const a=await this.#Ot({interfaceId:t,activeRefreshers:i});if(null===a)return;const s=await this.#_t(a,i);if(s.every(e=>null===e))return void this.logger.info(\"No data sources to refresh or recover; cron will not be rescheduled\");const c=await this.#Ot({interfaceId:t,activeRefreshers:i});if(null===c)return;const u=s.reduce((e,t)=>({...e,...t?.result??{}}),{}),l={...c,...u};await this.#It({interfaceId:t,interfaceKey:r,updatedContext:l}),s.some(e=>e?.halt)?this.logger.info(\"Confirmation refresh halted; cron will not be rescheduled\"):s.some(e=>e?.reschedule)&&await UA.scheduleBackgroundEvent({scope:n,interfaceId:t,interfaceKey:r,refresherKeys:o})}#kt(e){const t=[];for(const n of e){const e=this.#xt.get(n);e?t.push(e):this.logger.warn(`Unknown confirmation context refresher key: ${n}`)}return t}async#_t(e,t){const n=new Map(t.map(e=>[e.key,e])),r=[];let o=e;const i=n.get(nf.Transaction);if(i){n.delete(nf.Transaction);const e=await this.#Ct(i,o);r.push(e),e?.result&&(o={...o,...e.result}),e?.halt&&n.delete(nf.Scan)}const a=await Promise.all([...n.values()].map(async e=>this.#Ct(e,o)));return[...r,...a]}async#Ct(e,t){try{return await this.#Bt(e,t)}catch(t){return this.logger.error(`Refresher \"${e.key}\" rejected unexpectedly`,t),null}}async#Bt(e,t){return e.shouldFetch(t)?e.refresh(t):e.recoveryResult(t)}async#It(e){await this.#Tt.updateConfirmation(e)}async#Ot(e){const{interfaceId:t,activeRefreshers:n}=e,r=await async function(e){try{return await Vi().request({method:\"snap_getInterfaceContext\",params:{id:e}})||null}catch(e){if(Hi(e))return null;throw e}}(t);return r?\"object\"!=typeof(o=r)||null===o||Array.isArray(o)?(this.logger.warn(\"Interface context is not an object, skipping refresh\"),null):n.some(e=>!e.isValidContext(r))?(this.logger.warn(\"Interface context does not match an enabled refresher shape, skipping refresh\"),null):r:(this.logger.info(\"Interface no longer exists, cleaning up\"),null);var o}}class FA extends gf{#St;constructor({logger:e,accountResolver:t,loggerPrefix:n,requestStruct:r,responseStruct:o}){super({logger:e.withPrefix(n),requestStruct:r,responseStruct:o}),this.#St=t}async handle(e){let t=\"\";try{const n=xi(e,this.requestStruct),{account:r,wallet:o}=await this.resolveAccount(n);t=r.address;const i=await this.execute(n,{account:r,wallet:o});return Ti(i,this.responseStruct),i}catch(e){const n=function(e){return e instanceof Xf?e:new Xf(e instanceof mi?{code:Gf}:e instanceof oi||e instanceof $||e instanceof Na||e instanceof La||e instanceof fs||e instanceof ps?{code:$f,ext:[e.message]}:e instanceof Ja||e instanceof sa?{code:Hf,ext:[e.message]}:{code:Kf})}(e);return await this.#Pt(e,n),this.toErrorResponse(t,n)}}async#Pt(e,t){t.code===Kf&&await ya(e)}async handleRequest(e){const{account:t,wallet:n}=await this.resolveAccount(e);return await this.execute(e,{account:t,wallet:n})}async resolveAccount(e){const{account:t}=e;return await this.#St.resolveAccount({accountId:t,options:nA})}}class NA extends na{}const LA=Ie({decimals:ve(),assetId:Ce([ln,fn,cn]),name:xe(je(Oe())),symbol:xe(je(Oe())),iconUrl:xe(Ne)}),MA=ye(LA),DA=Ee({data:ye(LA),count:Ae(),totalCount:Ae(),pageInfo:xe(Ee())});class qA extends na{}class VA{#Rt;#jt;constructor({baseUrl:e},t=globalThis.fetch){this.#Rt=t,this.#jt=e}async getAssetsByAssetIds(e){try{fa(e,ye(pn));const t=Vl({baseUrl:this.#jt,path:\"/v3/assets\",queryParams:{assetIds:e.join(\",\")}}),n=await this.#Rt(t);if(!n.ok)throw new ca(n.status);const r=await n.json();return pa(r,MA),r}catch(e){return this.#Ut({error:e,fallbackError:\"Failed to fetch token metadata by asset ids\"})}}async getAssetsByChainId(e){try{fa(e,ut);const t=Vl({baseUrl:this.#jt,path:`/v3/chains/${e}/assets`,queryParams:{first:\"1000\",includeIconUrl:\"true\",includeDuplicateSymbolAssets:\"true\",useAggregatorIcons:\"true\"}}),n=await this.#Rt(t);if(!n.ok)throw new ca(n.status);const r=await n.json();return pa(r,DA),r}catch(e){return this.#Ut({error:e,fallbackError:\"Failed to fetch token metadata by chain id\"})}}#Ut({error:e,exceptionClasses:t,fallbackError:n}){const r=ha(e);if(r instanceof sa)throw r;return ta(r,[qA,ua,la,...t??[]],n instanceof Error?n:new qA(String(n),{cause:e}))}}const zA=Ie({id:Oe(),price:Re(Ae(),0)}),KA=Ce([me([\"btc\",\"eth\",\"ltc\",\"bch\",\"bnb\",\"eos\",\"xrp\",\"xlm\",\"link\",\"dot\",\"yfi\",\"bits\",\"sats\",\"sol\",\"sei\",\"sonic\"]),me([\"usd\",\"aed\",\"amd\",\"ars\",\"aud\",\"bam\",\"bdt\",\"bhd\",\"bmd\",\"brl\",\"cad\",\"chf\",\"clp\",\"cny\",\"cop\",\"crc\",\"czk\",\"dkk\",\"dop\",\"eur\",\"gbp\",\"gel\",\"gtq\",\"hkd\",\"hnl\",\"huf\",\"idr\",\"ils\",\"inr\",\"jpy\",\"kes\",\"krw\",\"kwd\",\"lbp\",\"lkr\",\"mmk\",\"mxn\",\"myr\",\"ngn\",\"nok\",\"nzd\",\"pen\",\"php\",\"pkr\",\"pln\",\"ron\",\"rub\",\"sar\",\"sek\",\"sgd\",\"svc\",\"thb\",\"try\",\"twd\",\"uah\",\"vef\",\"vnd\",\"xdr\",\"zar\",\"zmw\"]),me([\"xag\",\"xau\"])]),HA=ke(rt,Se(zA)),$A=KA,GA=Ee({assetIds:ye(rt),vsCurrency:$A});class WA extends na{}class XA{#Rt;#jt;constructor({baseUrl:e},t=globalThis.fetch){ne(e,Ne),this.#Rt=t,this.#jt=e}async getSpotPrices(e,t=\"usd\"){try{fa({assetIds:e,vsCurrency:t},GA);const n=Vl({baseUrl:this.#jt,path:\"/v3/spot-prices\",queryParams:{vsCurrency:t,assetIds:e.join(\",\"),includeMarketData:\"true\"}}),r=await this.#Rt(n);if(!r.ok)throw new ca(r.status);const o=await r.json();return pa(o,HA),o}catch(e){return this.#Ut({error:e,fallbackError:\"Error fetching spot prices\"})}}#Ut({error:e,exceptionClasses:t,fallbackError:n}){const r=ha(e);if(r instanceof sa)throw r;return ta(r,[WA,ua,la,...t??[]],n instanceof Error?n:new WA(String(n),{cause:e}))}}ne(Ar,Ee());const ZA=new class{#Ft=new H;#Nt;constructor(e){this.#Nt=e}async#Lt(e){const t=await K()({method:\"snap_getState\",params:{...void 0===e?{}:{key:e},encrypted:this.#Nt.encrypted}});return null==t?void 0:(n=t,JSON.parse(JSON.stringify(n),(e,t)=>{if(!t)return t;if(\"undefined\"!==t.__type){if(\"BigNumber\"===t.__type)return new M(t.value);if(\"bigint\"===t.__type)return BigInt(t.value);if(\"Uint8Array\"===t.__type){const e=atob(t.value),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}return t}}));var n}async#u(e,t){await K()({method:\"snap_setState\",params:{key:e,value:q(t),encrypted:this.#Nt.encrypted}})}async#Mt(){const e=await this.#Lt()??{};return t=V(this.#Nt.defaultState),n=e,{...t,...Object.fromEntries(Object.entries(n).filter(([e,t])=>null!=t&&(!t||\"object\"!=typeof t||Object.keys(t).length>0)))};var t,n}async get(){return this.#Ft.wrapRegularStateOperation(async()=>this.#Mt())}async getKey(e){return this.#Ft.wrapRegularStateOperation(async()=>this.#Lt(e))}async setKey(e,t){await this.#Ft.wrapRegularStateWriteOperation(async()=>this.#u(e,t))}async setKeyWith(e,t){await this.#Ft.wrapRegularStateWriteOperation(async()=>this.#u(e,t(await this.#Lt(e))))}async update(e){return await this.#Ft.wrapManageStateOperation(async()=>{const t=e(await this.#Mt());return await K()({method:\"snap_manageState\",params:{operation:\"update\",newState:q(t),encrypted:this.#Nt.encrypted}}),t})}async deleteKey(e){await this.deleteKeys([e])}async deleteKeys(e){await this.update(t=>(e.forEach(e=>{z(t,e)}),t))}}({encrypted:!1,defaultState:{keyringAccounts:{},assets:{},transactions:{},lastScanTokens:{},onChainAccounts:{}}}),YA=new class{#Dt=\"keyringAccounts\";#qt;constructor(e){this.#qt=e}async getAll(){const e=await this.#qt.getKey(this.#Dt);return Object.values(e??{})}async findById(e){return(await this.getAll()).find(t=>Ia(t.id,e))??null}async findByIds(e){const t=await this.getAll(),n=new Set(e.map(e=>e.toLowerCase()));return t.filter(e=>n.has(e.id.toLowerCase()))}async findByAddress(e){return(await this.getAll()).find(t=>Ia(t.address,e))??null}async findByAddressAndScope(e,t){return(await this.getAll()).find(n=>Ia(n.address,e)&&n.scopes.includes(t))??null}async save(e){await this.#qt.setKey(`${this.#Dt}.${e.id}`,e)}async saveMany(e){0!==e.length&&await this.#qt.update(t=>{const n=(0,w.cloneDeep)(t);n[this.#Dt]||(n[this.#Dt]={});for(const t of e)n[this.#Dt][t.id]=t;return n})}async delete(e){await this.#qt.deleteKey(`${this.#Dt}.${e}`)}}(ZA),JA=new class{#qt;#Vt=\"transactions\";#zt=\"lastScanTokens\";constructor(e){this.#qt=e}async getAll(){const e=await this.#qt.getKey(this.#Vt);return lc(Object.values(e??{}).flat())}async findByAccountIds(e,t){return lc(await this.findStellarTransactionsByAccountIds(e,t))}async findStellarTransactionsByAccountIds(e,t){const n=await this.#qt.getKey(this.#Vt),r=[];for(const o of e){const e=n?.[o]??[];r.push(...e.filter(e=>!t||e.chain===t))}return r}async findByAccountId(e){const t=await this.#qt.getKey(this.#Vt);return lc(t?.[e]??[])}async findLastScanTokenByAccountIds(e,t){const n=await this.#qt.getKey(this.#zt),r={};for(const o of e)r[o]=n?.[o]?.[t]??null;return r}async save(e){await this.saveMany([e])}async saveMany(e,t){(0!==e.length||t)&&await this.#qt.update(n=>{n[this.#Vt]||(n[this.#Vt]={}),n[this.#zt]||(n[this.#zt]={});const r=n[this.#Vt],o=n[this.#zt];if(t)for(const[e,r]of Object.entries(t))n[this.#zt][e]={...o[e]??{},...r};if(e.length>0){const t=(0,w.groupBy)(e,\"account\");for(const[e,o]of Object.entries(t)){const t=r[e]??[];n[this.#Vt][e]=this.#Kt(t,o)}}return n})}#Kt(e,t){const n=[...t,...e];return fu()(du()(n,\"id\"),e=>-(e.timestamp??0)).filter(e=>this.#Ht(e))}#Ht(e){return cc(e.status)&&!fc(e)}}(ZA),QA=new class{#qt;#Vt=\"assets\";constructor(e){this.#qt=e}async getByAssetId(e){return(await this.#qt.getKey(this.#Vt)??{})[e]??null}async getByAssetIds(e){const t=await this.#qt.getKey(this.#Vt)??{},n=[];for(const r of e){const e=t[r];void 0!==e&&n.push(e)}return n}async getAll(){const e=await this.#qt.getKey(this.#Vt)??{};return Object.values(e).filter(e=>void 0!==e)}async getAllByScope(e){const t=await this.#qt.getKey(this.#Vt)??{};return Object.values(t).filter(t=>t?.chainId===e)}async getByAssetType(e,t){const n=await this.#qt.getKey(this.#Vt)??{};return Object.values(n).filter(n=>n?.assetType===e&&n?.chainId===t)}async saveMany(e){if(0===e.length)return;const t=Date.now();await this.#qt.update(n=>{const r=(0,w.cloneDeep)(n);for(const n of e)r.assets[n.assetId]={...n,persistedAt:t};return r})}}(ZA),eE=new is(Ei),tE=new class{#k;#T;#$t=new Map;#Gt=new Map;constructor({logger:e,cache:t}){this.#k=e.withPrefix(\"[🌐 NetworkService]\"),this.#T=t}#Wt(e){let t=this.#$t.get(e);return t||(t=new dn.Horizon.Server(this.#Xt(e).horizonUrl),this.#$t.set(e,t)),t}#Zt(e){let t=this.#Gt.get(e);return t||(t=new dn.rpc.Server(this.#Xt(e).rpcUrl),this.#Gt.set(e,t)),t}#Xt(e){const t=Ar.networks[e];if(!t)throw new Ja(`Network not found for scope: ${e}`);return t}async getBaseFee(e){try{const t=this.#Wt(e);return Bc(await t.fetchBaseFee())}catch(t){return this.#Ut({error:t,fallbackError:`Failed to get base fee for scope: ${e}`})}}async getBaseFeeWithCache(e,t=!1){return cs(this.getBaseFee.bind(this),this.#T,{functionName:\"NetworkService:getBaseFeeWithCache\",ttlMilliseconds:Ar.cache.ttlMilliseconds.baseFee,refreshCache:t})(e)}async getHorizonTransactionInclusionStatus(e,t){try{const n=this.#Wt(t);return(await n.transactions().transaction(e).call()).successful?\"success\":\"failed\"}catch(e){return e instanceof dn.NotFoundError?\"pending\":this.#Ut({error:e,fallbackError:\"Failed to load transaction from Horizon\"})}}async pollTransaction(e,t){try{const n=this.#Zt(t),r=await n.pollTransaction(e,{attempts:Ar.transaction.pollingAttempts});if(r.status===dn.rpc.Api.GetTransactionStatus.SUCCESS)return r.txHash;throw new Qa(e,r.status,t)}catch(e){return this.#Ut({error:e,fallbackError:\"Failed to poll transaction\"})}}async loadOnChainAccount(e,t){try{const n=this.#Wt(t);return Za.fromHorizon(await n.loadAccount(e),t)}catch(n){if(Cc(n,e))throw new es(e,t,{cause:n});return this.#Ut({error:n,fallbackError:\"Failed to load an account\"})}}async loadOnChainAccountWithCache(e,t,n=!1){const r=await cs(async(n,r)=>(await this.loadOnChainAccount(e,t)).toSerializableFull(),this.#T,{functionName:\"NetworkService:loadOnChainAccount\",ttlMilliseconds:Ar.cache.ttlMilliseconds.loadOnChainAccount,refreshCache:n})(e,t);return Za.fromSerializable(r)}async loadOnChainAccountsSafe(e,t,n=5){try{const r=await _a(e,n,async e=>this.loadOnChainAccount(e,t)),o=[];let i=0;for(const t of r)\"fulfilled\"===t.status?o.push(t.value):(this.#k.warn(\"Failed to preload participating account\",{accountId:e[i],error:t.reason}),o.push(null)),i+=1;return o}catch(e){return this.#Ut({error:e,fallbackError:\"Failed to load on-chain accounts\"})}}async getAccount(e,t){try{const n=this.#Zt(t),r=await n.getAccount(e);return new Za(r,t)}catch(n){if(Cc(n,e))throw new es(e,t,{cause:n});return this.#Ut({error:n,fallbackError:\"Failed to get account\"})}}async getSep41AssetsData(e,t){try{const n=this.#Zt(t);return(await n.getLedgerEntries(...e.map(e=>new dn.Contract(st(e).assetReference).getFootprint()))).entries.map(e=>{const n=yc(e.val.contractData().contract()),r=function(e,t){try{const n=e.val().instance(),r=\"contractExecutableStellarAsset\"===n.executable().switch().name,o={symbol:\"\",decimals:-1,name:\"\",isStellarClassicAsset:r};for(const e of n?.storage()??[]){const n=e.key();if(\"scvSymbol\"===n.switch().name&&\"METADATA\"===n.sym().toString())for(const n of e.val().map()??[]){const e=n.key().sym().toString(),i=n.val();switch(e){case\"name\":o.name=r?i.str().toString():t;break;case\"symbol\":o.symbol=i.str().toString();break;case\"decimal\":o.decimals=i.u32()}}}if(\"\"===o.name)throw new Bs(`Name is empty for contract ${t}`);if(\"\"===o.symbol)throw new Bs(`Symbol is empty for contract ${t}`);if(-1===o.decimals)throw new Bs(`Decimals is empty for contract ${t}`);return o}catch(e){return ta(e,[Bs],new Bs(`Error extracting asset data from contract ${t}`,{cause:e}))}}(e.val.contractData(),n);if(r.isStellarClassicAsset){const{assetCode:e,assetIssuer:n}=xa(r.name);return{assetId:va(t,e,n),symbol:r.symbol,decimals:r.decimals,name:e}}return{assetId:ba(t,r.name),name:r.name,symbol:r.symbol,decimals:r.decimals}})}catch(e){return this.#Ut({error:e,fallbackError:\"Failed to get assets data from Soroban\"})}}async getClassicAssetData(e,t){try{const n=this.#Wt(t),{assetCode:r,assetIssuer:o}=xa(st(e).assetReference),i=await n.assets().forCode(r).forIssuer(o).call();if(!i||0===i.records.length||i.records[0]?.asset_code!==r||i.records[0]?.asset_issuer!==o)throw new Ja(`Failed to get assets data from Horizon for asset id: ${e}`);return{assetId:e,symbol:r,decimals:7,name:r}}catch(e){return this.#Ut({error:e,fallbackError:\"Failed to get assets data from Horizon\"})}}async getSep41AssetBalances(e){const{accounts:t,assetIds:n,scope:r}=e;if(0===t.length||0===n.length)return{};if(r===ct.Testnet)return{};try{const e=new Lc({rpcClient:this.#Zt(r),routerContract:Fc,simulationAccount:t[0]??jc}),o=[];for(const e of t)for(const t of n)o.push(new Nc({contract:st(t).assetReference,method:\"balance\",args:[new dn.Address(e).toScVal()],canFail:!0}));const i=t.length*n.length,a=await e.simResult(o,{scope:r});if(a.length!==i)throw new Ja(`Failed to load SEP-41 token balance - multicall result length: ${a.length} does not match the expected number of records: ${i}`);const s={};let c=0;for(const e of t)for(const t of n){const n=a[c];s[e]??={},s[e][t]=Ic(n),c+=1}return s}catch(e){return this.#Ut({error:e,fallbackError:\"Failed to load SEP-41 token balance\"})}}async getSep41AssetBalancesWithCache(e){return cs(this.getSep41AssetBalances.bind(this),this.#T,{functionName:\"NetworkService:getSep41AssetBalancesWithCache\",ttlMilliseconds:Ar.cache.ttlMilliseconds.sep41AssetBalance})(e)}async send({transaction:e,scope:t,pollTransaction:n=!1}){try{const r=this.#Zt(t),o=await r.sendTransaction(e.getRaw());if(\"ERROR\"===o.status){const e=this.#Yt(o);if(Ia(e,Rc))throw new ns(t,e);throw new ts(t,e)}return n?await this.pollTransaction(o.hash,t):o.hash}catch(e){return this.#Ut({error:e,fallbackError:new ts(t,\"unknown\",{cause:e})})}}async simulateTransaction(e,t){try{if(!e.hasInvokeHostFunction)throw new os(\"Transaction is not a valid contract invoke transaction\");Qs(e);const n=this.#Zt(t),r=e.getRaw(),o=await n.simulateTransaction(r);if(dn.rpc.Api.isSimulationError(o))throw new os(\"string\"==typeof o.error?o.error:JSON.stringify(o.error));const i=dn.rpc.assembleTransaction(r,o);return Pc.fromRaw(i.build())}catch(e){return this.#Ut({error:e,exceptionClasses:[_s],fallbackError:new os(\"Failed to simulate transaction\",{cause:e})})}}async simulateSep41TransferWithCache({transaction:e,scope:t,assetId:n,fromAccountId:r,toAccountId:o,refreshCache:i=!1}){const a=await cs(async()=>(await this.simulateTransaction(e,t)).getRaw().toXDR(),this.#T,{functionName:\"NetworkService:simulateSep41TransferWithCache\",ttlMilliseconds:Ar.cache.ttlMilliseconds.simulateTransaction,refreshCache:i,generateCacheKey:(e,i)=>`${e}:${n}:${r}:${o}:${t}`})();return Pc.fromXdr({xdr:a,scope:t})}async getTransaction(e,t){try{const n=this.#Wt(t),r=await n.transactions().transaction(e).call();return this.#Jt(r,t)}catch(t){if(t instanceof dn.NotFoundError)throw new rs(e,{cause:t});return this.#Ut({error:t,fallbackError:\"Failed to fetch transaction\"})}}async getTransactions(e){const{accountAddress:t,lastScanToken:n,scope:r,order:o=\"asc\",pageSize:i=nn,maxScan:a=rn,includeSelfTransactionsOnly:s=!0,includeFailed:c=!0}=e;let u=Math.max(a,1);try{const e=this.#Wt(r),a=await e.transactions().forAccount(t).order(o).cursor(n??\"\").limit(i).includeFailed(c).call();let l=this.#Qt(a.records,r,t,s);u-=1;let f=a;for(;u>0&&f.records.length===i&&(f=await f.next(),0!==f.records.length);)l=l.concat(this.#Qt(f.records,r,t,s)),u-=1;return l}catch(e){return this.#Ut({error:e,fallbackError:\"Failed to fetch transactions\"})}}#Qt(e,t,n,r){const o=[];for(const i of e)(r&&i.source_account===n||!r)&&o.push(this.#Jt(i,t));return o}#Jt(e,t){return Pc.fromHorizon({horizonTransaction:e,scope:t})}#Yt(e){try{return e.errorResult?.result().switch().name??\"unknown\"}catch(e){return this.#k.warn(\"Failed to parse send error code\",{error:e}),\"unknown\"}}#Ut({error:e,exceptionClasses:t,fallbackError:n}){return ta(e,[Ja,...t??[]],n instanceof Error?n:new Ja(String(n),{cause:e}))}}({logger:Ai,cache:eE}),nE=new class{#en=5;#tn=10;#nn=10;#q;#rn;#on;#k;constructor({networkService:e,assetMetadataRepository:t,logger:n}){this.#q=e,this.#rn=new VA({baseUrl:Ar.api.tokenApi.baseUrl}),this.#on=t,this.#k=n.withPrefix(\"[🪙 AssetMetadataService]\")}async resolve(e){const t=(await this.#in([e])).find(t=>t.assetId===e);if(!t)throw new NA(`Asset metadata not found for asset id: ${e}`);return t}async getPersistedSep41AssetsMetadata(e){return await this.#on.getByAssetType(sn,e)}async getAllByScope(e){return this.#on.getAllByScope(e)}async fetchSep41AssetsOrSyncOnce(e){0===(await this.getAllByScope(e)).length&&(this.#k.debug(\"No assets found in the state, synchronizing assets\"),await this.synchronize(e));const t=await this.getPersistedSep41AssetsMetadata(e);return this.#k.debug(\"SEP-41 assets found in the state\",{noOfAssets:t.length}),t}async synchronize(e){const t=await this.#an(e);await this.#on.saveMany(t)}async#in(e){const{nativeAssets:t,assets:n}=Wl(e),r=[];for(const[e]of t)r.push(Gl(e));const o=[...n.values()].flat(),{assets:i,missingAssetIds:a}=await this.#sn(o);if(0===a.length)return r.concat(i);const s=[],{assets:c}=Wl(a);for(const[e,t]of c){const n=await this.#cn(t,e);s.push(...n)}return s.length>0&&await this.#on.saveMany(s),r.concat(i,s)}async#sn(e){const t=await this.#on.getByAssetIds(e),{hits:n,missing:r}=this.#un(e,t);return{assets:n,missingAssetIds:r}}async#cn(e,t){let n=[],r=[];if(t===ct.Mainnet){const t=await this.#ln(e);r=t.assets,n=t.missingAssetIds}else n=e;const o=[],i=[];for(const e of n)Sa(e)?o.push(e):Aa(e)&&i.push(e);const[a,s]=await Promise.all([this.#fn(o,t),this.#pn(i,t)]);return[...r,...a,...s]}async#ln(e){if(0===e.length)return{assets:[],missingAssetIds:[]};this.#k.debug(\"Fetching token assets from API\",{assetIds:e});const t=await this.#dn(e),{hits:n,missing:r}=this.#un(e,t);return this.#k.debug(\"Token assets from API\",{missingAssetIds:r}),{assets:n,missingAssetIds:r}}async#fn(e,t){if(0===e.length)return[];this.#k.debug(\"Fetching SEP-41 token assets from RPC\",{assetIds:e});const n=await async function(e,t,n,r){return _a(ka(e,t),n,async(e,t)=>r(e,t))}(e,this.#tn,this.#en,async e=>this.#q.getSep41AssetsData(e,t)),{assets:r,missingAssetIds:o}=this.#hn(n,e);return o.length>0&&this.#k.warn(`Failed to fetch token metadata for assets: ${Array.from(o).join(\", \")}`),r}async#pn(e,t){if(0===e.length)return[];this.#k.debug(\"Fetching Classic token assets from Horizon\",{assetIds:e});const n=await _a(e,this.#nn,async e=>this.#q.getClassicAssetData(e,t)),{assets:r,missingAssetIds:o}=this.#hn(n,e);return o.length>0&&this.#k.warn(`Failed to fetch token metadata for assets: ${Array.from(o).join(\", \")}`),r}#hn(e,t){const n=[],r=new Set(t);for(const t of e)if(\"rejected\"!==t.status)if(Array.isArray(t.value))for(const e of t.value)n.push($l(e)),r.delete(e.assetId);else n.push($l(t.value)),r.delete(t.value.assetId);else this.#k.warn(\"Failed to fetch assets metadata\",{error:t.reason});return{assets:n,missingAssetIds:Array.from(r)}}async#dn(e){return(await this.#rn.getAssetsByAssetIds(e)).map(e=>this.#yn(e))}async#an(e){return(await this.#rn.getAssetsByChainId(e)).data.map(e=>this.#yn(e))}#yn(e){const t=e.name??\"UNKNOWN\",n=e.symbol??\"UNKNOWN\",{decimals:r}=e,{assetId:o}=e,i=[{name:t,symbol:n,decimals:r}],{assetNamespace:a,chainId:s}=st(o);return{name:t,symbol:n,assetId:o,chainId:s,assetType:a,fungible:!0,iconUrl:e.iconUrl??Hl(o),units:i}}#un(e,t){const n=new Map(t.map(e=>[e.assetId,e])),r=[],o=[];for(const t of e){const e=n.get(t);void 0===e?o.push(t):r.push(e)}return{hits:r,missing:o}}}({networkService:tE,assetMetadataRepository:QA,logger:Ai}),rE=new class{#k;constructor({logger:e}){this.#k=e.withPrefix(\"[💰 TransactionBuilder]\")}changeTrust({baseFee:e,scope:t,assetId:n,onChainAccount:r,limit:o}){ec(n,t);try{const i={asset:Ys(n)};return void 0!==o&&(i.limit=o),this.#gn({onChainAccount:r,operations:[dn.Operation.changeTrust(i)],timeout:this.#mn(),scope:t,fee:e})}catch(e){throw new ls(\"Failed to build change trust transaction\",{cause:e})}}sep41Transfer(e){const{scope:t,onChainAccount:n,assetId:r,destination:o,amount:i,baseFee:a}=e;ec(r,t);try{const{assetReference:e}=st(r),s=new dn.Contract(e),c=new dn.ScInt(i.toFixed(0),{type:\"i128\"}).toScVal(),u=s.call(\"transfer\",dn.Address.fromString(n.accountId).toScVal(),dn.Address.fromString(o).toScVal(),c);return this.#gn({onChainAccount:n,operations:[u],timeout:this.#mn(),scope:t,fee:a.toString()})}catch(e){throw new ls(\"Failed to build sep41 transfer transaction\",{cause:e})}}#vn(e){const{amount:t,baseFee:n,scope:r,asset:o,onChainAccount:i,destination:a}=e;return this.#gn({onChainAccount:i,operations:[dn.Operation.payment({asset:Ys(o),amount:t.toString(),destination:a})],timeout:this.#mn(),scope:r,fee:n})}#bn(e){const{amount:t,baseFee:n,scope:r,onChainAccount:o,destination:i}=e;return this.#gn({onChainAccount:o,operations:[dn.Operation.createAccount({startingBalance:t.toString(),destination:i})],timeout:this.#mn(),scope:r,fee:n})}transfer(e){const{onChainAccount:t,scope:n,amount:r,assetId:o,destination:i,baseFee:a}=e,{address:s,isActivated:c}=i;ec(o,n);try{if(Sa(o))return this.sep41Transfer({scope:n,onChainAccount:t,assetId:o,destination:s,amount:r,baseFee:a});const e=wn(r);if(c)return this.#vn({baseFee:a.toString(),onChainAccount:t,scope:n,asset:o,destination:s,amount:e});if(!wa(o))throw new gs(o);return this.#bn({baseFee:a.toString(),onChainAccount:t,scope:n,amount:e,destination:s})}catch(e){if(e instanceof gs)throw e;return ta(e,[ls],new ls(\"Failed to build transfer transaction\",{cause:e}))}}rebuildTxnWithNewSeq(e){const{transaction:t,sequenceNumber:n}=e;try{const e=t.getRaw();if(e instanceof dn.FeeBumpTransaction)throw new ls(\"Rebuilding fee bump transactions is not supported\");if(0===t.operationCount)throw new ls(\"No operations in transaction\");let r=new M(e.fee).dividedBy(e.operations.length).integerValue(M.ROUND_FLOOR);r.isFinite()&&!r.isLessThanOrEqualTo(0)||(this.#k.warn(\"Invalid fee amount, falling back to configured inclusion fee\"),r=Bc());const o=new dn.TransactionBuilder(new dn.Account(t.sourceAccount,n),{fee:r.toString(),memo:e.memo,networkPassphrase:e.networkPassphrase,timebounds:e.timeBounds,ledgerbounds:e.ledgerBounds,minAccountSequence:e.minAccountSequence,minAccountSequenceAge:e.minAccountSequenceAge,minAccountSequenceLedgerGap:e.minAccountSequenceLedgerGap});if(!(\"tx\"in e))throw new ls(\"Failed to clone the transaction, it is not a compatible transaction\");e.tx.operations().forEach(e=>o.addOperation(e));return new Pc(o.build())}catch(e){return ta(e,[ls],new ls(\"Failed to rebuild transaction\",{cause:e}))}}#gn({onChainAccount:e,operations:t,timeout:n,scope:r,fee:o}){const i=new dn.Account(e.accountId,e.sequenceNumber),a=Oc(r),s=new dn.TransactionBuilder(i,{fee:o,networkPassphrase:a});for(const e of t)s.addOperation(e);const c=s.setTimeout(n).build();return new Pc(c)}#mn(){return Ar.transaction.timeout}}({logger:Ai}),oE=new class{async deriveAddress(e){const{index:t,entropySource:n}=e;return(await this.#wn({index:t,entropySource:n})).publicKey()}async resolveWallet(e){const t=await this.#wn({index:e.index,entropySource:e.entropySource});return Ya(e.address,t.publicKey()),new Yd(t)}async getWalletResolver(e){const t=await this.#Sn(e);return async e=>{const n=await this.#An(t,e);return new Yd(n)}}async#wn({index:e,entropySource:t}){try{const n=await this.#En(t,e);return this.#xn(n),this.#Tn(n.privateKey)}catch(e){return ta(e,[na,$d],new $d(\"Unable to derive keypair from entropy\"))}}async#Sn(e){try{const t=await this.#En(e);return await rS.fromJSON(t)}catch(e){return ta(e,[na,$d],new $d(\"Unable to load coin-type derivation node\"))}}async#An(e,t){try{const n=await e.derive([`slip10:${t}'`]);return this.#xn(n),this.#Tn(n.privateKey)}catch(e){return ta(e,[$d],new $d(\"Unable to derive keypair at account index\"))}}async#En(e,t){return async function({entropySource:e,path:t,curve:n}){try{return await Vi().request({method:\"snap_getBip32Entropy\",params:{path:t,curve:n,...e?{source:e}:{}}})}catch{throw new na(\"Failed to get BIP32 entropy from Snap\")}}({entropySource:e,path:this.#kn(t),curve:\"ed25519\"})}#kn(e){return QS(e).split(\"/\")}#xn(e){if(!e.privateKey||!e.publicKey)throw new $d(\"Derived node is missing key material\")}#Tn(e){try{const t=$y(e);return dn.Keypair.fromRawEd25519Seed(sr(t))}catch{throw new $d(\"Unable to build Stellar keypair from derived material\")}}},iE=new class{#k;#On;#_n;constructor({logger:e,accountsRepository:t,walletService:n}){this.#k=e.withPrefix(\"[🔑 AccountService]\"),this.#On=n,this.#_n=t}async deriveKeyringAccount({entropySource:e,index:t}){return await this.#In({entropySource:e,index:t})}async resolveAccount({scope:e,accountId:t,accountAddress:n}){let r;if(t)r=await this.#Cn(t);else{if(!n)throw new oi(\"Either accountId or accountAddress is required\");if(!e)throw new oi(\"Scope is required when resolving by address\");r=await this.#Bn({scope:e,address:n})}const{entropySource:o,index:i,address:a}=r;return Ya(a,await this.#On.deriveAddress({entropySource:o,index:i})),{account:r}}async batchCreate(e){const{fromIndex:t,toIndex:n}=e,r=await this.#_n.getAll(),o=e.entropySource??await zi(),i=new Map;for(const e of r)e.entropySource===o&&e.index>=t&&e.index<=n&&i.set(e.index,e);const a=await this.#On.getWalletResolver(o),s=Math.max(0,n-t+1),c=Array.from({length:s},(e,n)=>t+n),u=await Oa(c,15,async e=>{let t=i.get(e);if(void 0===t){const n=await a(e);t=this.#Pn({entropySource:o,derivationPath:QS(e),index:e,address:n.address})}return t}),l=u.filter(e=>!i.has(e.index));return await this.#_n.saveMany(l),u}async delete(e){await this.#_n.delete(e)}async listAccounts(){return await this.#_n.getAll()}async listAccountsByScope(e){return(await this.#_n.getAll()).filter(t=>t.scopes.includes(e))}async findByIds(e){return await this.#_n.findByIds(e)}async findByAddressAndScope(e,t){return await this.#_n.findByAddressAndScope(e,t)}async findById(e){return await this.#_n.findById(e)??void 0}async getAllSelected(){const[e,t]=await Promise.all([this.#_n.getAll(),Zs(Vi())]);this.#k.debug(\"getAllSelected:\",\"selectedAccountIds\",t);const n=new Set(t);return e.filter(e=>n.has(e.id))}async#Bn({scope:e,address:t}){const n=await this.#_n.findByAddressAndScope(t,e);if(!n)throw new Na(t);return n}async#Cn(e){const t=await this.#_n.findById(e);if(!t)throw new Na(e);return t}async#In({entropySource:e,index:t}){const n=QS(t),r=await this.#On.deriveAddress({entropySource:e,index:t});return this.#Pn({entropySource:e,derivationPath:n,index:t,address:r})}#Pn({entropySource:e,derivationPath:t,index:n,address:r,id:o=globalThis.crypto.randomUUID()}){return{id:o,entropySource:e,derivationPath:t,index:n,type:en,address:r,scopes:hr(),options:{entropy:{type:\"mnemonic\",id:e,derivationPath:t,groupIndex:n},exportable:!0},methods:[wf.SignMessage,wf.SignTransaction,wf.SignAuthEntry]}}}({logger:Ai,accountsRepository:YA,walletService:oE}),aE=new class{#qt;#Vt=\"onChainAccounts\";constructor(e){this.#qt=e}async findByKeyringAccountId(e,t){return(await this.findByKeyringAccountIds([e],t))[e]??null}async findByKeyringAccountIds(e,t){const n=await this.#qt.getKey(this.#Vt)??{},r={};for(const o of e)r[o]=n[o]?.[t]??null;return r}async save(e,t){await this.#qt.update(n=>{const r=(0,w.cloneDeep)(n);r[this.#Vt]||(r[this.#Vt]={});const o=r[this.#Vt];return o[e]??={},o[e][t.scope]=t,r})}async saveMany(e){0!==Object.keys(e).length&&await this.#qt.update(t=>{const n=(0,w.cloneDeep)(t);n[this.#Vt]||(n[this.#Vt]={});const r=n[this.#Vt];for(const[t,n]of Object.entries(e))r[t]??={},r[t][n.scope]=n;return n})}}(ZA),sE=new class{#q;#Rn;#V;constructor({networkService:e,onChainAccountRepository:t,logger:n}){this.#q=e,this.#Rn=new Hc({networkService:e,onChainAccountRepository:t,logger:n}),this.#V=t}async isAccountActivated(e){const{accountAddress:t,scope:n}=e;try{return await this.#q.getAccount(t,n),!0}catch(e){if(e instanceof es)return!1;throw e}}async resolveOnChainAccount(e,t){const n=await this.#q.loadOnChainAccount(e,t);return Ya(e,n.accountId),n}async resolveOnChainAccountByKeyringAccountId(e,t){const n=await this.#V.findByKeyringAccountId(e,t);return n?Za.fromSerializable(n):null}async synchronize(e,t,n){await this.#Rn.synchronize(e,t,n)}}({logger:Ai,networkService:tE,onChainAccountRepository:aE}),cE=new class{#k;#Ye;#q;#jn;#fe;#Un;constructor({logger:e,transactionRepository:t,networkService:n,transactionBuilder:r,accountService:o}){this.#k=e.withPrefix(\"[🧾 TransactionService]\"),this.#Ye=t,this.#q=n,this.#jn=r,this.#fe=new Eu;const i=new xu({keyringTransactionBuilder:this.#fe,logger:e});this.#Un=new Du({networkService:n,transactionRepository:t,transactionMapper:i,accountService:o,logger:e})}get keyringTransactionBuilder(){return this.#fe}async getBaseFee(e){return this.#q.getBaseFeeWithCache(e)}async createValidatedChangeTrustTransaction(e){const{onChainAccount:t,scope:n,assetId:r,limit:o}=e,i=await this.getBaseFee(n),a=this.#jn.changeTrust({onChainAccount:t,assetId:r,scope:n,baseFee:i.toString(),limit:o});return this.validateTransaction(a,t,{expectedOPTypes:[Lu.ChangeTrust]}),a}async createValidatedSendTransaction(e){const{onChainAccount:t,scope:n,assetId:r,amount:o,destination:i,useCache:a=!1}=e;let s=null;s=t.accountId===i?t:await this.#Fn(i,n,a);if(Sa(r)){if(null===s)throw new gs(r);return this.#Nn({onChainAccount:t,scope:n,assetId:r,amount:o,destination:i,destinationAccount:s,useCache:a})}return this.#Ln({onChainAccount:t,scope:n,assetId:r,amount:o,destination:i,destinationAccount:s})}async#Nn(e){const{onChainAccount:t,scope:n,assetId:r,amount:o,destination:i,destinationAccount:a,useCache:s}=e,c=await this.getBaseFee(n);let u=this.#jn.sep41Transfer({onChainAccount:t,scope:n,assetId:r,amount:o,destination:i,baseFee:c});if(!t.getRawAsset(r)){const e=await this.#q.getSep41AssetBalances({accounts:[t.accountId],assetIds:[r],scope:n});t.setAsset(r,{balance:e?.[t.accountId]?.[r]??new BigNumber(0),symbol:\"\",decimals:0})}if(t.getRawAsset(r)?.balance.lt(o))throw new Os(t.getRawAsset(r)?.balance.toString()??\"0\",o.toString(),r);return u=await this.#q.simulateSep41TransferWithCache({transaction:u,scope:n,assetId:r,fromAccountId:t.accountId,toAccountId:i,refreshCache:!s}),this.validateTransaction(u,t,{expectedOPTypes:[Lu.InvokeHostFunction],preloadedAccounts:a?[a]:void 0}),u}async#Ln(e){const{onChainAccount:t,scope:n,assetId:r,amount:o,destinationAccount:i,destination:a}=e,s=null!==i;if(!s&&!wa(r))throw new gs(r);const c=await this.getBaseFee(n),u=this.#jn.transfer({onChainAccount:t,scope:n,assetId:r,amount:o,destination:{address:a,isActivated:s},baseFee:c});return this.validateTransaction(u,t,{expectedOPTypes:s?[Lu.Payment]:[Lu.CreateAccount],preloadedAccounts:i?[i]:void 0}),u}async createValidatedSwapTransaction(e){const{onChainAccount:t,scope:n,xdr:r}=e,o=Pc.fromXdr({xdr:r,scope:n});await this.computingFee(o);const i=await this.#Mn(o,t);return this.validateTransaction(o,t,{expectedOPTypes:[Lu.Payment,Lu.PathPayment,Lu.InvokeHostFunction,Lu.ChangeTrust],preloadedAccounts:i}),o}async#Mn(e,t){const n=e.hasInvokeHostFunction?[]:e.participatingAccounts.filter(e=>e!==t.accountId);return(await this.#q.loadOnChainAccountsSafe(n,e.scope)).filter(e=>null!==e)}async#Fn(e,t,n=!1){try{return await this.#q.loadOnChainAccountWithCache(e,t,!n)}catch(e){if(e instanceof es)return null;throw e}}async savePendingKeyringTransaction(e){const t=this.#fe.createTransaction(e);return this.#k.debug(\"Creating pending transaction\",{transaction:t}),await this.#nt(t),t}async savePendingKeyringTransactionSafe(e){try{return await this.savePendingKeyringTransaction(e)}catch(e){return await ya(e),this.#k.warn(\"Failed to save pending transaction\",{error:e}),null}}async computingFee(e){if(e.hasInvokeHostFunction){return await this.#q.simulateTransaction(e,e.scope)}return e}validateTransaction(e,t,n){(new Mu).simulate(e,t,n)}async sendTransaction(e){const{wallet:t,onChainAccount:n,scope:r,transaction:o}=e;Js(o,r);const i=e.pollTransaction??!1,a=async e=>this.#q.send({transaction:e,scope:r,pollTransaction:i});try{return await a(o)}catch(e){if(e instanceof ns){if(o.sourceAccount!==n.accountId)throw this.#k.warn(\"transaction failed with txBadSeq but transaction source does not match wallet; cannot bump sequence.\"),e;const i=await this.#q.getAccount(n.accountId,r),s=this.#jn.rebuildTxnWithNewSeq({transaction:o,sequenceNumber:i.sequenceNumber});return t.signTransaction(s),await a(s)}throw e}}async findByAccountId(e){return this.#Ye.findByAccountId(e)}async#nt(e){await pc([e]),await this.#Ye.save(e)}async synchronize(e,t,n){await this.#Un.synchronize(e,t,n)}}({logger:Ai,transactionRepository:JA,networkService:tE,transactionBuilder:rE,accountService:iE}),uE=new class{#Dn;#k;#T;constructor({cache:e,logger:t}){this.#Dn=new XA({baseUrl:Ar.api.priceApi.baseUrl}),this.#T=e,this.#k=t.withPrefix(\"[🪙 PriceService]\")}async getSpotPrices({assetIds:e,vsCurrency:t=\"usd\"},n=!1){return this.#qn(e,t,n)}async#qn(e,t=\"usd\",n=!1){const r=[...new Set(e)],o=e=>`PriceService:getSpotPrices:${e}:${t}`;let i={};try{i=n?{}:await this.#T.mget(r.map(o))}catch(e){this.#k.warn(\"Error fetching cached spot prices\",e),await ya(e)}const a={},s=[];for(const e of r){const t=i[o(e)];void 0===t?s.push(e):a[e]=t}if(0===s.length)return a;let c={};try{c=await this.#Vn(s,t),await this.#T.mset(Object.entries(c).map(([e,t])=>({key:o(e),value:t,ttlMilliseconds:Ar.cache.ttlMilliseconds.spotPrices})))}catch(e){this.#k.warn(\"Error caching spot prices\",e),await ya(e)}return{...a,...c}}async#Vn(e,t=\"usd\"){if(0===e.length)return{};const n=[...new Set(e)];return await this.#Dn.getSpotPrices(n,t)}}({cache:new is(Ei),logger:Ai}),lE=new class{#zn;#k;constructor({securityAlertsApiClient:e,logger:t}){this.#zn=e,this.#k=t.withPrefix(\"[🛡️ TransactionScanService]\")}async scanTransactionSafe({accountAddress:e,origin:t,scope:n,transaction:r,options:o}){try{const i=o.includes(wl.Simulation)?this.#Fe(r,n):null,a=await this.#zn.scanTransaction({accountAddress:e,origin:t,scope:n,transaction:r,options:o});return this.#Kn(a,i,o,n,e)}catch(e){return this.#k.warn(\"Error scanning Stellar transaction\",{reason:e}),await ya(e),null}}#Fe(e,t){try{return tc(Pc.fromXdr({xdr:e,scope:t})),null}catch(e){return e instanceof hs?{type:wl.Simulation,code:bl,message:\"Transaction expired\"}:null}}#Kn(e,t,n,r,o){const i=e.simulation??null,a=e.validation??null,s=\"Error\"===i?.status?this.#Hn(wl.Simulation,i.error):null,c=t??null,u=\"Error\"===a?.status?this.#Hn(wl.Validation,a.error):null,l=this.#$n({simulation:i,validation:a,options:n}),f=s??c??u??l;return{status:f?\"ERROR\":\"SUCCESS\",estimatedChanges:{assets:\"Success\"===i?.status?this.#Gn(this.#Wn(i,o),r):[]},validation:\"Success\"===a?.status?this.#Xn(a):null,error:f}}#Wn(e,t){return e.assets_diffs?.[t]??[]}#Gn(e,t){return e.flatMap(e=>{const n=[];return e.out&&n.push(this.#Zn(e,Al.Out,t)),e.in&&n.push(this.#Zn(e,Al.In,t)),n}).filter(e=>null!==e)}#Zn(e,t,n){const{asset:r}=e,o=e[t],i=null!=o,a=i&&void 0!==o.raw_value&&null!==o.raw_value,s=i&&void 0!==o.usd_price?o.usd_price:null;return Ol.is(r)?{type:t,symbol:r.code,name:r.code,logo:Kl,value:a?Sn(new M(o.raw_value)):null,price:s}:kl.is(r)?{type:t,symbol:r.code,name:r.code,logo:Hl(va(n,r.code,r.issuer)),value:a?Sn(new M(o.raw_value)):null,price:s}:_l.is(r)?{type:t,symbol:r.symbol,name:r.name,logo:Hl(ba(n,r.address)),value:a?Sn(new M(o.raw_value),r.decimals):null,price:s}:null}#Xn(e){return{type:e.result_type,reason:e.reason??null,description:e.description??null}}#Hn(e,t){return{type:e,code:this.#Yn(t),message:t}}#Yn(e){return e.toLowerCase().includes(\"insufficient balance\")?gl:e.toLowerCase().includes(\"no trustline\")?vl:this.#Jn(e)??ml}#$n({simulation:e,validation:t,options:n}){const r=n.includes(wl.Simulation),o=n.includes(wl.Validation);return(r||o)&&(!r||null===e)&&(!o||null===t)?{type:\"response\",code:\"empty\",message:\"No scan results returned\"}:null}#Jn(e){return/^[a-zA-Z0-9_:-]{1,80}$/u.test(e)?e:null}}({securityAlertsApiClient:new class{#Rt;#jt;constructor({baseUrl:e},t=globalThis.fetch){ne(e,Ne),this.#Rt=t,this.#jt=e}async scanTransaction({accountAddress:e,origin:t,scope:n,transaction:r,options:o}){try{fa({accountAddress:e,origin:t,scope:n,transaction:r,options:o},xl);const i=Vl({baseUrl:this.#jt,path:\"/stellar/transaction/scan\"}),a={account_address:e,chain:zl[n],metadata:this.#Qn(t),transaction:r,options:o},s=await this.#Rt(i,{headers:{\"Content-Type\":\"application/json\",accept:\"application/json\"},method:\"POST\",body:JSON.stringify(a)});if(!s.ok)throw new ca(s.status);const c=await s.json();return pa(c,Ul),c}catch(e){return this.#Ut({error:e,fallbackError:\"Error scanning Stellar transaction\"})}}#Qn(e){try{return{type:\"wallet\",url:new URL(e).origin}}catch{return{type:\"in_app\"}}}#Ut({error:e,exceptionClasses:t,fallbackError:n}){const r=ha(e);if(r instanceof sa)throw r;return ta(r,[Dl,ua,la,...t??[]],n instanceof Error?n:new Dl(String(n),{cause:e}))}}(Ar.api.securityAlertsApi),logger:Ai}),fE=new class{#k;#er;#tr;#nr;#rr=new g;#or=new Set;constructor({logger:e,onChainAccountService:t,assetMetadataService:n,transactionService:r}){this.#k=e.withPrefix(\"[🔄 SynchronizeService]\"),this.#er=t,this.#tr=r,this.#nr=n}async synchronize(e,t){const{syncAccounts:n=!0,syncTransactions:r=!0,scope:o=Ar.selectedNetwork}=t??{};if(0===e.length)return void this.#k.debug(\"No accounts to synchronize\");if(!n&&!r)return void this.#k.debug(\"No sync steps to run\");const i=Date.now();try{await b(this.#rr).runExclusive(async()=>{this.#k.debug(\"Synchronize started\",{startTime:i});for(const t of e)this.#or.add(t.id);try{const[t,i]=await Promise.all([this.#ir(e,o),this.#ar(o)]),a=[];n&&a.push({name:\"synchronize accounts\",task:this.#er.synchronize(t,o,i)}),r&&a.push({name:\"synchronize transactions\",task:this.#tr.synchronize(t,o,i)});const s=await Promise.allSettled(a.map(async({task:e})=>e));for(const[e,t]of s.entries())if(\"rejected\"===t.status){await ya(t.reason);const n=a[e]?.name??\"synchronize\";this.#k.warn(`Failed to ${n}`,{error:t.reason})}}finally{this.#or.clear(),this.#k.debug(\"Synchronize finished\",{duration:Date.now()-i})}})}catch(t){if(t===l)return void await this.#sr(e);this.#k.error(\"Synchronize failed\",{error:t}),await ya(t)}}async#sr(e){const t=e.filter(e=>!this.#or.has(e.id));if(0===t.length)return void this.#k.debug(\"Synchronize already in progress for requested accounts, skipping\");const n=t.map(e=>e.id);this.#k.debug(\"Synchronize already in progress for other accounts; scheduling delayed sync\"),await Ki({method:of.SynchronizeAccounts,params:{accountIds:n},duration:ji})}async synchronizeAssets(e){try{await this.#nr.synchronize(e)}catch(e){await ya(e),this.#k.warn(\"Failed to synchronize assets\",{error:e})}}async#ar(e){try{return await this.#nr.fetchSep41AssetsOrSyncOnce(e)}catch(e){return await ya(e),this.#k.warn(\"Failed to load SEP-41 assets\",{error:e}),[]}}async#ir(e,t){this.#k.debug(\"number of accounts to synchronize\",{noOfAccounts:e.length});const n=(await Promise.all(e.map(async e=>{try{return{keyringAccount:e,onChainAccount:await this.#er.resolveOnChainAccount(e.address,t)}}catch(n){return n instanceof es||(await ya(n),this.#k.warn(\"Failed to load account for sync\",{error:n,accountAddress:e.address,scope:t})),null}}))).filter(e=>null!==e);return this.#k.debug(\"number of activated account pairs\",{noOfAccounts:n.length}),n}}({logger:Ai,onChainAccountService:sE,assetMetadataService:nE,transactionService:cE}),pE=new class{#cr={loadPrice:!1,securityScanning:!1,localSimulation:!1,remoteSimulation:!1};async renderConfirmationDialog(e){const{interfaceKey:t,scope:n,renderContext:r,origin:o=tn,fee:i}=e,a={...this.#cr,...e.renderOptions};if((a.securityScanning||a.remoteSimulation)&&void 0===e.securityScanRequest)throw new na(\"Cannot scan a transaction confirmation without a security scan request.\");if(a.localSimulation&&void 0===e.transactionValidationRequest)throw new na(\"Cannot run local simulation on a transaction confirmation without a transaction validation request.\");const s=await async function(){return Zi().catch(()=>({locale:ja,currency:\"usd\",hideBalances:!1,useSecurityAlerts:!0,simulateOnChainActions:!0,useTokenDetection:!0,batchCheckBalances:!0,displayNftMedia:!0,useNftDetection:!0,useExternalPricingData:!0,showTestnets:!0}))}(),c={...i?{[Ea(n)]:null}:{},...e.tokenPrices},u=a.loadPrice&&s.useExternalPricingData&&void 0!==c,l=Boolean(a.securityScanning)&&s.useSecurityAlerts,f=Boolean(a.remoteSimulation)&&s.simulateOnChainActions,p=void 0!==e.securityScanRequest&&(l||f),d=a.localSimulation&&void 0!==e.transactionValidationRequest,h={...{interfaceKey:t,tokenPricesFetchStatus:u?Xl.Fetching:Xl.Fetched,preferences:s,locale:s.locale,networkImage:Kl,origin:mp(o),currency:s.currency,scope:n,feeData:i?Sp(n,i):{},scan:e.initialScan??null,scanFetchStatus:p?Xl.Fetching:Xl.Fetched,...p?{securityScanRequest:{...e.securityScanRequest,origin:o,scope:n},securityScanning:Boolean(a.securityScanning),remoteSimulation:Boolean(a.remoteSimulation)}:{},...d&&e.transactionValidationRequest?{transactionsFetchStatus:Xl.Fetched,accountId:e.transactionValidationRequest.accountId,transaction:e.transactionValidationRequest.transaction,request:e.transactionValidationRequest.request}:{},tokenPrices:c},...r},y=await $i(Nd(t,h),{}),g=Wi(y);if(!await Gi(y,Nd(t,h),h))return g;const m=[];return u&&m.push(nf.Prices),p&&m.push(nf.Scan),d&&m.push(nf.Transaction),m.length>0&&await UA.scheduleBackgroundEvent({scope:n,interfaceId:y,interfaceKey:t,refresherKeys:m},Ri),g}async updateConfirmation(e){const{interfaceId:t,updatedContext:n,interfaceKey:r}=e;await Gi(t,Nd(r,n),n)}},dE=new class{#Je;#er;#On;constructor({accountService:e,onChainAccountService:t,walletService:n}){this.#Je=e,this.#er=t,this.#On=n}async resolveAccount({accountId:e,scope:t=Ar.selectedNetwork,options:n}){const{onChainAccount:r,wallet:o}=n,{account:i}=await this.#Je.resolveAccount({accountId:e}),a=[];r.load&&a.push(this.#ur(i,t,r.source)),o&&a.push(this.#On.resolveWallet(i));const s=await Promise.all(a),c=s.find(e=>e instanceof Za),u=s.find(e=>e instanceof Yd);return{account:i,...void 0===c?{}:{onChainAccount:c},...void 0===u?{}:{wallet:u}}}async#ur(e,t,n){if(n===eA)return this.#er.resolveOnChainAccount(e.address,t);const r=await this.#er.resolveOnChainAccountByKeyringAccountId(e.id,t);if(null===r)throw new es(e.address,t);return Ya(e.address,r?.accountId),r}}({accountService:iE,onChainAccountService:sE,walletService:oE}),hE=new class extends FA{#Tt;constructor({logger:e,accountResolver:t,confirmationUIController:n}){super({logger:e,accountResolver:t,loggerPrefix:\"[📝 SignTransactionHandler]\",requestStruct:If,responseStruct:Pf}),this.#Tt=n}async execute(e,t){const{account:n,wallet:r}=t,{scope:o}=e,{xdr:i}=e.request.params,a=Pc.fromXdr({xdr:i,scope:o});if(Js(a,o),!await this.#lr(e,a,n))throw new mi;r.signTransaction(a);return{signedTxXdr:a.getRaw().toXDR(),signerAddress:n.address}}toErrorResponse(e,t){return{signedTxXdr:\"\",signerAddress:e,error:t.toJSON()}}async#lr(e,t,n){const r=(new uu).mapTransaction(t),o=Object.fromEntries(function(e,t){const n=new Set;for(const r of t.operations)for(const t of r.params){const r=oc(t);if(null===r)continue;const o=rc(e,r);null!==o&&n.add(o)}return[...n]}(e.scope,r).map(e=>[e,null]));return!0===await this.#Tt.renderConfirmationDialog({scope:e.scope,origin:e.origin,interfaceKey:ef.SignTransaction,fee:r.feeStroops,renderContext:{readableTransaction:r,account:n},renderOptions:{loadPrice:!0,securityScanning:!0,remoteSimulation:!0},securityScanRequest:{accountAddress:n.address,transaction:t.getRaw().toXDR()},tokenPrices:o})}}({logger:Ai,accountResolver:dE,confirmationUIController:pE}),yE=new class extends FA{#Tt;constructor({logger:e,accountResolver:t,confirmationUIController:n}){super({logger:e,accountResolver:t,loggerPrefix:\"[✉️ SignMessageHandler]\",requestStruct:kf,responseStruct:_f}),this.#Tt=n}async execute(e,t){const{account:n,wallet:r}=t,{message:o}=e.request.params;if(!await this.#fr(e,n,o))throw new mi;return{signedMessage:r.signMessage(o),signerAddress:n.address}}toErrorResponse(e,t){return{signedMessage:\"\",signerAddress:e,error:t.toJSON()}}async#fr(e,t,n){return!0===await this.#Tt.renderConfirmationDialog({scope:e.scope,renderContext:{account:t,message:n},origin:e.origin,interfaceKey:ef.SignMessage})}}({logger:Ai,accountResolver:dE,confirmationUIController:pE}),gE=new class extends FA{#Tt;constructor({logger:e,accountResolver:t,confirmationUIController:n}){super({logger:e,accountResolver:t,loggerPrefix:\"[🛂 SignAuthEntryHandler]\",requestStruct:Rf,responseStruct:Uf}),this.#Tt=n}async execute(e,t){const{account:n,wallet:r}=t,{authEntry:o}=e.request.params,i=this.#pr(o);if(!await this.#fr(e,n,i))throw new mi;return{signedAuthEntry:r.signAuthEntry(o),signerAddress:n.address}}toErrorResponse(e,t){return{signedAuthEntry:\"\",signerAddress:e,error:t.toJSON()}}async#fr(e,t,n){return!0===await this.#Tt.renderConfirmationDialog({scope:e.scope,renderContext:{account:t,readableAuthEntry:n},origin:e.origin,interfaceKey:ef.SignAuthEntry})}#pr(e){const t=dn.xdr.HashIdPreimage.fromXDR(e,\"base64\").sorobanAuthorization();return{authorizations:(new cu).mapInvocation(t.invocation()),signatureExpirationLedger:t.signatureExpirationLedger(),nonce:t.nonce().toString()}}}({logger:Ai,accountResolver:dE,confirmationUIController:pE}),mE={[wf.SignTransaction]:hE,[wf.SignMessage]:yE,[wf.SignAuthEntry]:gE},vE=new class{#k;#Je;#er;#tr;#On;#dr;constructor({logger:e,accountService:t,onChainAccountService:n,transactionService:r,walletService:o,handlers:i}){this.#k=e.withPrefix(\"[🔑 KeyringHandler]\"),this.#Je=t,this.#er=n,this.#tr=r,this.#On=o,this.#dr=i}async handle(e,t){const n=await ga(async()=>{this.#k.debug(\"Handle keyring request\",{origin:e,method:t.method}),((e,t,n)=>{if(!e)throw new yi(\"Origin not found\");if(!n.get(e)?.has(t))throw new yi(\"Permission denied\")})(e,t.method,Si);const n=await bi(this,t);return this.#k.debug(\"Keyring request handled\",{origin:e,method:t.method}),n},this.#k.error.bind(this.#k))??null;return n}async getAccount(e){xi(e,Ff);const t=await this.#Je.findById(e);if(!t)throw new Na(e);return this.#hr(t)}async getAccounts(){return(await this.#Je.listAccounts()).map(e=>this.#hr(e))}async createAccounts(e){if(function(e,t){const{type:n}=e;if(!t.includes(n))throw new Error(`Unsupported create account option type: ${n}`)}(e,[`${Pr.Bip44DeriveIndex}`,`${Pr.Bip44DeriveIndexRange}`,`${Pr.Bip44Discover}`]),e.type===Pr.Bip44Discover){const t=await this.#Je.deriveKeyringAccount({entropySource:e.entropySource,index:e.groupIndex});if(!await this.#yr(t,hr()))return[]}let t;t=e.type===Pr.Bip44DeriveIndexRange?e.range:{from:e.groupIndex,to:e.groupIndex};return(await this.#Je.batchCreate({entropySource:e.entropySource,fromIndex:t.from,toIndex:t.to})).map(e=>this.#hr(e))}#hr(e){const{id:t,address:n,type:r,options:o,methods:i,scopes:a}=e;return{id:t,address:n,type:r,options:o,methods:i,scopes:a}}async getAccountAssets(e){xi(e,Mf);const t=Ar.selectedNetwork,{onChainAccount:n}=await this.#gr(e,t);return null===n?[Ea(t)]:n.assetIds}async getAccountTransactions(e,t){xi({accountId:e,pagination:t},Cf);const{limit:n,next:r}=t,{account:o}=await this.#Je.resolveAccount({accountId:e}),i=await this.#tr.findByAccountId(o.id),a=r?i.findIndex(e=>e.id===r):0;if(null!=r&&-1===a)throw new oi(`Invalid transaction pagination cursor ${r}`);return{data:i.slice(a,a+n),next:a+t.limit<i.length?i[a+t.limit]?.id??null:null}}async#yr(e,t){return(await Promise.all(t.map(async t=>this.#er.isAccountActivated({accountAddress:e.address,scope:t})))).some(e=>e)}async getAccountBalances(e,t){const{assets:n}=xi({accountId:e,assets:t},qf),r=Ar.selectedNetwork,o={},{onChainAccount:i}=await this.#gr(e,r);if(null===i){const e=n.find(wa);return void 0!==e&&(o[e]=Vc({nativeBalance:new M(0),spendableBalance:new M(0),minimumReserveBalance:new M(0)})),o}for(const e of n){const t=i.getAsset(e);void 0!==t&&(wa(e)?o[e]=Vc({nativeBalance:i.nativeRawBalance,spendableBalance:i.nativeSpendableBalance,minimumReserveBalance:i.minimumReserveBalance}):Aa(e)?o[e]=zc(t):o[e]=Kc(t))}return o}async resolveAccountAddress(e,t){const{scope:n,request:r}=xi({request:t,scope:e},Ef);try{const{account:e}=await this.#Je.resolveAccount({scope:n,accountAddress:r.params.opts.address});return{address:`${n}:${e.address}`}}catch(e){if(e instanceof Na)return null;throw e}}async exportAccount(e,t){const{options:n}=xi({accountId:e,options:t},Nf),{account:r}=await this.#Je.resolveAccount({accountId:e}),o=await this.#On.resolveWallet(r);try{const e=o.secret;if(!oe(e,yn))throw new zf(\"Derived private key failed encoding validation\");return{type:n.type,encoding:n.encoding,privateKey:e}}catch(e){return ta(e,[zf],new zf(\"Error exporting account\"))}}async deleteAccount(e){xi(e,Lf),await this.#Je.delete(e)}async setSelectedAccounts(e){xi(e,Df);const t=new Set(e),n=Array.from(t);if((await this.#Je.findByIds(n)).length!==n.length)throw new oi(\"Account IDs were not part of existing accounts.\");n.length>0&&await vf.scheduleBackgroundEvent({accountIds:n},Ri)}async submitRequest(e){const{method:t}=e.request;return this.#mr(t),this.#dr[t].handle(e)}#mr(e){xi(e,Sf)}async#gr(e,t){const{account:n}=await this.#Je.resolveAccount({accountId:e});return{account:n,onChainAccount:await this.#er.resolveOnChainAccountByKeyringAccountId(e,t)}}}({logger:Ai,accountService:iE,onChainAccountService:sE,transactionService:cE,walletService:oE,handlers:mE}),bE=new class{#k;constructor({logger:e}){this.#k=e.withPrefix(\"[👵 UserInputHandler]\")}async handle({id:e,event:t,context:n}){if(this.#k.debug(\"[👇 onUserInput]\",e,t),!t.name)return;const r={...lp(),...dp(),...tp(),...op(),...sp(),...Jf(),[hd]:Md,[yd]:Dd,[gd]:qd,[md]:Vd}[t.name];r&&await ga(async()=>r({id:e,event:t,context:n}))}}({logger:Ai}),wE=new class{key=nf.Prices;#vr;#k;constructor({logger:e,priceService:t}){this.#vr=t,this.#k=e.withPrefix(\"[🔄 ConfirmationPriceRefresher]\")}shouldFetch(e){return 0!==Object.keys(e.tokenPrices).length&&e.tokenPricesFetchStatus!==Xl.Error}recoveryResult(e){return e.tokenPricesFetchStatus!==Xl.Fetching?null:{result:{tokenPricesFetchStatus:Xl.Fetched},reschedule:!1}}async refresh(e){try{const t=[...Object.keys(e.tokenPrices)],n=await this.#vr.getSpotPrices({assetIds:t,vsCurrency:e.currency});return{result:{tokenPrices:t.reduce((e,t)=>(e[t]=n[t]?.price.toString()??null,e),{}),tokenPricesFetchStatus:Xl.Fetched},reschedule:!0}}catch(e){return this.#k.error(\"Error refreshing confirmation prices:\",e),{result:{tokenPricesFetchStatus:Xl.Error},reschedule:!1}}}isValidContext(e){return Zl.is(e)}}({logger:Ai,priceService:uE}),SE=new class{key=nf.Scan;#br;#k;constructor({logger:e,transactionScanService:t}){this.#br=t,this.#k=e.withPrefix(\"[🔄 ConfirmationScanRefresher]\")}shouldFetch(e){const t=e;return t.scanFetchStatus!==Xl.Error&&(!!t.securityScanRequest&&this.#wr(t).length>0)}recoveryResult(e){const t=e;if(t.scanFetchStatus!==Xl.Fetching)return null;const n=this.#wr(t).length>0;return{result:{scan:t.scan??null,scanFetchStatus:n?Xl.Error:Xl.Fetched},reschedule:!1}}async refresh(e){const t=e,n=t.securityScanRequest,r=this.#wr(t),o=t.scan?.estimatedChanges??{assets:[]},i=Boolean(t.remoteSimulation);try{const e=await this.#br.scanTransactionSafe({...n,options:r});return{result:{scan:this.#Sr(e,o,i),scanFetchStatus:e?Xl.Fetched:Xl.Error},reschedule:null!==e}}catch(e){return this.#k.error(\"Error refreshing confirmation security scan:\",e),{result:{scan:this.#Sr(null,o,i),scanFetchStatus:Xl.Error},reschedule:!1}}}isValidContext(e){return Jl.is(e)}#Sr(e,t,n){if(e){const r=n&&this.#Ar(e.estimatedChanges)?e.estimatedChanges:t;return{...e,estimatedChanges:r}}return{status:\"ERROR\",estimatedChanges:t,validation:null,error:null}}#Ar(e){return e.assets.length>0}#wr(e){const t=[];return e.remoteSimulation&&e.preferences.simulateOnChainActions&&t.push(wl.Simulation),e.securityScanning&&e.preferences.useSecurityAlerts&&t.push(wl.Validation),t}}({logger:Ai,transactionScanService:lE}),AE=new class{key=nf.Transaction;#tr;#nr;#St;#k;constructor({logger:e,transactionService:t,assetMetadataService:n,accountResolver:r}){this.#tr=t,this.#nr=n,this.#St=r,this.#k=e.withPrefix(\"[🔄 ConfirmationTransactionRefresher]\")}shouldFetch(e){if(!this.isValidContext(e))return!1;return e.transactionsFetchStatus!==Xl.Error}recoveryResult(e){return e.transactionsFetchStatus!==Xl.Fetching?null:{result:{transactionsFetchStatus:Xl.Fetched},reschedule:!1}}async refresh(e){const t=e,{request:n,accountId:r,scope:o,securityScanRequest:i,origin:a}=t;let s=i?.accountAddress??\"\";try{const{onChainAccount:e}=await this.#St.resolveAccount({accountId:r,scope:o,options:{onChainAccount:{load:!0,source:eA},wallet:!1}});let t;switch(s=e.accountId,n.method){case Ku.ConfirmSend:{const r=await this.#nr.resolve(n.params.assetId),{decimals:i}=r.units[0],a=vn(new M(n.params.amount),i);t=await this.#tr.createValidatedSendTransaction({onChainAccount:e,scope:o,assetId:n.params.assetId,destination:n.params.toAddress,amount:a});break}case Ku.ChangeTrustOpt:t=await this.#tr.createValidatedChangeTrustTransaction({onChainAccount:e,scope:o,assetId:n.params.assetId,limit:n.params.action===Wu.Delete?\"0\":n.params.limit});break;default:throw new Error(\"Unsupported request method for transaction refresh\")}const c=t.getRaw().toXDR();return{result:{securityScanRequest:{accountAddress:i?.accountAddress??s,origin:i?.origin??a??\"\",scope:o,transaction:c}},reschedule:!0}}catch(e){return this.#k.error(\"Error re-validating confirmation transaction:\",e),{result:{transactionsFetchStatus:Xl.Error,errorMessage:Vu(e,s),scanFetchStatus:Xl.Error},reschedule:!1,halt:!0}}}isValidContext(e){return Ql.is(e)}}({logger:Ai,transactionService:cE,assetMetadataService:nE,accountResolver:dE}),EE=new UA({logger:Ai,confirmationUIController:pE,refreshers:[wE,SE,AE]}),xE=new RA({logger:Ai,networkService:tE,synchronizeService:fE,accountService:iE}),TE=new vf({logger:Ai,accountService:iE,synchronizeService:fE}),kE=new class extends mf{#gt;constructor({logger:e,synchronizeService:t}){super({logger:e.withPrefix(\"[SyncAssetsHandler]\"),requestStruct:hf}),this.#gt=t}async handleCronJobRequest(e){const t=ct.Mainnet;await this.#gt.synchronizeAssets(t)}}({logger:Ai,synchronizeService:fE}),OE={[of.RefreshConfirmationContext]:EE,[of.TrackTransaction]:xE,[of.SynchronizeAccounts]:TE,[of.SynchronizeAssets]:kE},_E=new class{#dr;constructor({handlers:e}){this.#dr=e}async handle(e){await ga(async()=>{const{active:t,locked:n}=await async function(){return Vi().request({method:\"snap_getClientStatus\"})}();t&&!n&&await this.#Er(e)})}async#Er(e){const{method:t}=e,[n,r]=af.validate(t);if(void 0!==n)throw new Kd(t);const o=this.#dr[r];await o.handle(e)}}({handlers:OE}),IE=new class extends jA{#tr;#nr;#Tt;constructor({logger:e,accountResolver:t,transactionService:n,assetMetadataService:r,confirmationUIController:o}){super({accountResolver:t,logger:e.withPrefix(\"[💼 ChangeTrustOptHandler]\"),requestStruct:Qu,responseStruct:el}),this.#tr=n,this.#nr=r,this.#Tt=o}async handleAccountNotActivatedError(e,t){return await PA(e.address),{status:!1}}async execute(e,t){const{scope:n,assetId:r,action:o}=t.params,{account:i,onChainAccount:a}=e,s=o===Wu.Delete?\"0\":t.params.limit,c=await this.#nr.resolve(r);let u;try{if(!this.#xr(a,t))return{status:!0};u=await this.#Tr({request:t,onChainAccount:a,limit:s})}catch(e){throw await this.#kr({request:t,account:i,assetMetadata:c,error:e}),Oi(new mi)}await Ji({origin:tn,accountType:i.type,chainIdCaip:n});if(!await this.#Or({request:t,account:i,assetMetadata:c,fee:u.totalFee.toString(),action:o,transaction:u}))throw await Qi({origin:tn,accountType:i.type,chainIdCaip:n}),Oi(new mi);await ea({origin:tn,accountType:i.type,chainIdCaip:n});const l=await this.#_r({request:t,confirmedTransaction:u,limit:s});if(null===l)return{status:!0};const{wallet:f,onChainAccount:p,transaction:d}=l;f.signTransaction(d);const h=await this.#tr.sendTransaction({wallet:f,onChainAccount:p,scope:n,transaction:d});return await this.#tr.savePendingKeyringTransactionSafe({type:o===Wu.Add?gu:mu,request:{txId:h,account:i,scope:n,asset:{type:r,unit:c.symbol,amount:\"0\",fungible:!0}}}),await RA.scheduleBackgroundEvent({txId:h,accountIdsOrAddresses:[i.id],scope:n}),{status:!0,transactionId:h}}#xr(e,t){const{assetId:n,action:r}=t.params;if(r===Wu.Add){const t=e.getAsset(n);if(t?.limit?.gt(0))return!1}if(r===Wu.Delete&&!e.hasAsset(n))throw new ws(n,e.accountId);return!0}async#_r(e){const{request:t,confirmedTransaction:n,limit:r}=e,{wallet:o,onChainAccount:i}=await this.resolveAccount(t);if(!this.#xr(i,t))return null;const a=await this.#Tr({request:t,onChainAccount:i,limit:r});return qu({confirmedTransaction:n,refreshedTransaction:a}),{wallet:o,onChainAccount:i,transaction:a}}async#Or(e){return e.action===Wu.Delete?await this.#Ir(e):await this.#Cr(e)}async#Cr(e){return this.#Br({...e,confirmationInterfaceKey:ef.ChangeTrustlineOptIn})}async#Ir(e){return this.#Br({...e,confirmationInterfaceKey:ef.ChangeTrustlineOptOut})}async#Br(e){const{request:t,account:n,assetMetadata:r,fee:o,transaction:i,confirmationInterfaceKey:a}=e,{scope:s}=t.params,c=i.getRaw().toXDR();return!0===await this.#Tt.renderConfirmationDialog({origin:tn,scope:s,renderContext:{account:n,assetMetadata:r},fee:o,interfaceKey:a,renderOptions:{loadPrice:!0,securityScanning:!0,localSimulation:!0},securityScanRequest:{accountAddress:n.address,transaction:c},transactionValidationRequest:{accountId:n.id,transaction:c,request:t}})}async#kr(e){const{request:t,account:n,assetMetadata:r,error:o}=e,{scope:i,action:a}=t.params;await this.#Tt.renderConfirmationDialog({origin:tn,scope:i,renderContext:{account:n,assetMetadata:r,transactionsFetchStatus:Xl.Error,errorMessage:Vu(o,n.address)},fee:\"\",interfaceKey:a===Wu.Delete?ef.ChangeTrustlineOptOut:ef.ChangeTrustlineOptIn,renderOptions:{loadPrice:!1,securityScanning:!1,localSimulation:!1}})}async#Tr(e){const{request:{params:{scope:t,assetId:n}},onChainAccount:r,limit:o}=e;return this.#tr.createValidatedChangeTrustTransaction({onChainAccount:r,assetId:n,scope:t,limit:o})}}({logger:Ai,accountResolver:dE,assetMetadataService:nE,transactionService:cE,confirmationUIController:pE}),CE=new class{async handle(e){try{return xi(e,rl),{valid:!0,errors:[]}}catch{return{valid:!1,errors:[{code:Hu}]}}}},BE=new class extends jA{#nr;#tr;constructor({logger:e,accountResolver:t,assetMetadataService:n,transactionService:r}){super({accountResolver:t,logger:e.withPrefix(\"[💰 OnAmountInputHandler]\"),requestStruct:al,responseStruct:sl,resolveAccountOptions:rA}),this.#nr=n,this.#tr=r}async execute(e,t){try{const{onChainAccount:n}=e,{assetId:r,value:o,scope:i}=t.params,{units:a}=await this.#nr.resolve(r),{decimals:s}=a[0],c=vn(new M(o),s);return bn(c)?{valid:!1,errors:[{code:Hu}]}:(await this.#tr.createValidatedSendTransaction({onChainAccount:n,scope:i,assetId:r,amount:c,destination:n.accountId,useCache:!0}),{valid:!0,errors:[]})}catch(e){return e instanceof Os?{valid:!1,errors:[{code:$u}]}:e instanceof Ts?{valid:!1,errors:[{code:Gu}]}:{valid:!1,errors:[{code:Hu}]}}}async handleAccountNotActivatedError(e,t){return{valid:!1,errors:[{code:Hu}]}}}({logger:Ai,accountResolver:dE,assetMetadataService:nE,transactionService:cE}),PE=new class extends jA{#tr;#nr;constructor({logger:e,accountResolver:t,transactionService:n,assetMetadataService:r}){super({accountResolver:t,logger:e.withPrefix(\"[👋 SignAndSendTransactionHandler]\"),requestStruct:tl,responseStruct:nl}),this.#tr=n,this.#nr=r}async execute(e,t){const{wallet:n,onChainAccount:r,account:o}=e,{transaction:i,scope:a,options:s}=t.params,c=await this.#tr.createValidatedSwapTransaction({xdr:i,scope:a,onChainAccount:r});n.signTransaction(c);const u=await this.#tr.sendTransaction({wallet:n,onChainAccount:r,scope:a,transaction:c,pollTransaction:!1});await async function(e){await Yi(Di,{message:\"Snap transaction submitted\",origin:e.origin,account_type:e.accountType,chain_id_caip:e.chainIdCaip})}({origin:tn,accountType:o.type,chainIdCaip:a});const{sourceAssetId:l,destAssetId:f}=s,p={sourceAssetId:l,destAssetId:f};return await this.#Pr({transactionId:u,account:o,scope:a,transaction:c,swapAssetIds:p}),await RA.scheduleBackgroundEvent({scope:a,txId:u,accountIdsOrAddresses:[o.id]}),{transactionId:u}}#Rr(e){const{chainId:t}=st(e.sourceAssetId),{chainId:n}=st(e.destAssetId);return t!==n}async#Pr(e){try{const{transactionId:t,scope:n,account:r,transaction:o,swapAssetIds:i}=e;if(this.#Rr(i))await this.#tr.savePendingKeyringTransactionSafe({type:yu,request:{fees:this.#tr.keyringTransactionBuilder.getBaseFees(o.totalFee,n),txId:t,account:r,scope:n,transactionType:Ds.BridgeSend,from:[],to:[]}});else{const{sendAmount:e,destAmount:a}=this.#jr(o),{sourceAssetMetadata:s,destAssetMetadata:c}=await this.#Ur(i.sourceAssetId,i.destAssetId,n);await this.#tr.savePendingKeyringTransactionSafe({type:hu,request:{fees:this.#tr.keyringTransactionBuilder.getBaseFees(o.totalFee,n),txId:t,account:r,scope:n,toAddress:r.address,fromAsset:{unit:s.units[0].symbol,type:s.assetId,amount:e,fungible:!0},toAsset:{unit:c.units[0].symbol,type:c.assetId,amount:a,fungible:!0}}})}}catch(e){await ya(e),this.logger.warn(\"Failed to map a transaction for swap and bridge send\",{error:e})}}#jr(e){let t=\"0\",n=\"0\";const r=e.transactionOperations.findIndex(e=>ac(e));if(r>=0){const o=e.transactionOperations[r];o&&ac(o)&&(o.type===er?(n=An(o.destMin),t=An(o.sendAmount)):(n=An(o.destAmount),t=An(o.sendMax)))}return{sendAmount:t,destAmount:n}}async#Ur(e,t,n){const[r,o]=await Promise.all([this.#Fr(e,n),this.#Fr(t,n)]);return{sourceAssetMetadata:r,destAssetMetadata:o}}async#Fr(e,t){if(wa(e))return Gl(t);if(Aa(e)){const{assetReference:t}=st(e),{assetCode:n}=xa(t);return $l({assetId:e,decimals:7,symbol:n,name:n})}try{return await this.#nr.resolve(e)}catch(t){this.logger.warn(\"Failed to resolve asset metadata; using fallback symbol\",{assetId:e,error:t});const{assetReference:n}=st(e);return $l({assetId:e,decimals:7,symbol:n,name:n})}}}({logger:Ai,accountResolver:dE,transactionService:cE,assetMetadataService:nE}),RE=new class extends jA{#tr;#nr;#Tt;#k;constructor({logger:e,accountResolver:t,transactionService:n,assetMetadataService:r,confirmationUIController:o}){const i=e.withPrefix(\"[👍 ConfirmSendHandler]\");super({accountResolver:t,logger:i,requestStruct:ul,responseStruct:ll}),this.#tr=n,this.#nr=r,this.#Tt=o,this.#k=i}async execute(e,t){try{const{onChainAccount:n,account:r}=e,{amount:o,toAddress:i,assetId:a,scope:s}=t.params,c=await this.#nr.resolve(a),{decimals:u,symbol:l}=c.units[0],f=vn(new M(o),u);if(bn(f))return{valid:!1,errors:[{code:Hu}]};let p;try{p=await this.#tr.createValidatedSendTransaction({onChainAccount:n,scope:s,assetId:a,amount:f,destination:i})}catch(e){throw await this.#kr({request:t,account:r,assetMetadata:c,scope:s,error:e}),Oi(new mi)}if(await Ji({origin:tn,accountType:r.type,chainIdCaip:s}),!await this.#Nr({request:t,account:r,assetMetadata:c,scope:s,fee:p.totalFee,transaction:p}))throw await Qi({origin:tn,accountType:r.type,chainIdCaip:s}),Oi(new mi);await ea({origin:tn,accountType:r.type,chainIdCaip:s});const{wallet:d,onChainAccount:h,transaction:y}=await this.#_r({request:t,confirmedTransaction:p,amount:f});d.signTransaction(y);const g=await this.#tr.sendTransaction({wallet:d,onChainAccount:h,scope:s,transaction:y,pollTransaction:!1});return await this.#tr.savePendingKeyringTransactionSafe({type:vu,request:{txId:g,account:r,scope:s,toAddress:i,asset:{type:a,unit:l,amount:o,fungible:!0}}}),await RA.scheduleBackgroundEvent({txId:g,accountIdsOrAddresses:[r.id,i],scope:s}),{valid:!0,errors:[],transactionId:g}}catch(e){if(e instanceof Os)return{valid:!1,errors:[{code:$u}]};if(e instanceof Ts)return{valid:!1,errors:[{code:Gu}]};if(e instanceof ps)return{valid:!1,errors:[{code:Hu}]};if(e instanceof mi)throw e;return await ya(e),this.#k.warn(\"Failed to confirm send transaction due to unexpected issue\",{error:e}),{valid:!1,errors:[{code:Hu}]}}}async#_r(e){const{request:t,confirmedTransaction:n,amount:r}=e,{assetId:o,toAddress:i,scope:a}=t.params,{wallet:s,onChainAccount:c}=await this.resolveAccount(t),u=await this.#tr.createValidatedSendTransaction({onChainAccount:c,scope:a,assetId:o,amount:r,destination:i});return qu({confirmedTransaction:n,refreshedTransaction:u}),{wallet:s,onChainAccount:c,transaction:u}}async#Nr(e){const{request:t,account:n,assetMetadata:r,fee:o,scope:i,transaction:a}=e,{toAddress:s,amount:c,assetId:u}=t.params,l=a.getRaw().toXDR(),f=this.#Lr({amount:c,assetMetadata:r});return!0===await this.#Tt.renderConfirmationDialog({scope:i,origin:tn,renderContext:{account:n,toAddress:s},fee:o.toString(),interfaceKey:ef.ConfirmSendTransaction,renderOptions:{loadPrice:!0,securityScanning:!0,localSimulation:!0},securityScanRequest:{accountAddress:n.address,transaction:l},initialScan:{status:\"SUCCESS\",estimatedChanges:f,validation:null,error:null},transactionValidationRequest:{accountId:n.id,transaction:l,request:t},tokenPrices:{[u]:null}})}async#kr(e){const{request:t,account:n,assetMetadata:r,scope:o,error:i}=e,{toAddress:a,amount:s,assetId:c}=t.params,u=this.#Lr({amount:s,assetMetadata:r});await this.#Tt.renderConfirmationDialog({scope:o,origin:tn,renderContext:{account:n,toAddress:a,transactionsFetchStatus:Xl.Error,errorMessage:Vu(i,n.address)},fee:\"\",interfaceKey:ef.ConfirmSendTransaction,renderOptions:{loadPrice:!1,securityScanning:!1,localSimulation:!1},initialScan:{status:\"ERROR\",estimatedChanges:u,validation:null,error:null},tokenPrices:{[c]:null}})}#Lr({amount:e,assetMetadata:t}){const{assetId:n,symbol:r,iconUrl:o,name:i}=t,a=wa(n)?null:o??null;return{assets:[{type:Al.Out,value:e,price:null,symbol:r,name:i??r,logo:a}]}}}({logger:Ai,accountResolver:dE,transactionService:cE,assetMetadataService:nE,confirmationUIController:pE}),jE=new class extends jA{#tr;constructor({logger:e,accountResolver:t,transactionService:n}){super({accountResolver:t,logger:e.withPrefix(\"[💰 ComputeFeeHandler]\"),requestStruct:fl,responseStruct:pl}),this.#tr=n}async execute(e,t){const{onChainAccount:n}=e,{transaction:r,scope:o}=t.params;try{const e=await this.#tr.createValidatedSwapTransaction({xdr:r,scope:o,onChainAccount:n});return[{type:Ns.Base,asset:{unit:Jt,type:un[o],amount:Sn(e.totalFee),fungible:!0}}]}catch(e){if(e instanceof Os&&wa(e.assetId)||e instanceof Ts||e instanceof ks)return[{type:Ns.Base,asset:{unit:Jt,type:un[o],amount:Sn(n.nativeRawBalance.plus(new M(e.required).minus(new M(e.balance)))),fungible:!0}}];throw e}}}({logger:Ai,accountResolver:dE,transactionService:cE}),UE=new class extends gf{#St;constructor({logger:e,accountResolver:t}){super({logger:e.withPrefix(\"[🔏 SignProofOfOwnershipHandler]\"),requestStruct:hl,responseStruct:yl}),this.#St=t}async handleRequest(e){const{accountId:t,message:n,address:r}=e.params,{account:o,wallet:i}=await this.#St.resolveAccount({accountId:t,options:nA});if(r!==o.address)throw new oi(`Address in proof-of-ownership message (${r}) does not match signing account address (${o.address})`);return{signature:Uy(i.signMessage(n,\"hex\"))}}}({logger:Ai,accountResolver:dE}),FE={[Ku.ChangeTrustOpt]:IE,[Ku.OnAddressInput]:CE,[Ku.OnAmountInput]:BE,[Ku.ConfirmSend]:RE,[Ku.SignAndSendTransaction]:PE,[Ku.ComputeFee]:jE,[Ku.SignProofOfOwnership]:UE},NE=new class{#k;#dr;constructor({logger:e,handlers:t}){this.#k=e.withPrefix(\"[👋 ClientRequestHandler]\"),this.#dr=t}async handle(e){return await ga(async()=>this.#Mr(e),this.#k.error.bind(this.#k))??null}async#Mr(e){const{method:t}=e,[n,r]=Xu.validate(t);if(void 0!==n)throw Oi(new si);return this.#dr[r].handle(e)}}({logger:Ai,handlers:FE}),LE=async()=>({assets:{}}),ME=async()=>({conversionRates:{}}),DE=async()=>null,qE=async()=>({marketData:{}}),VE=async({origin:e,request:t})=>vE.handle(e,t),zE=async e=>bE.handle(e),KE=async({request:e})=>NE.handle(e),HE=async({request:e})=>_E.handle(e)})(),module.exports=r})();"
    },
    {
      "path": "images/icon.svg",
      "value": "<svg width=\"96\" height=\"96\" viewBox=\"0 0 96 96\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><title>Stellar</title><rect width=\"96\" height=\"96\" fill=\"#000000\"/><g transform=\"translate(16 20.92) scale(0.2708)\" fill=\"#FFFFFF\"><path d=\"M203,26.16l-28.46,14.5-137.43,70a82.49,82.49,0,0,1-.7-10.69A81.87,81.87,0,0,1,158.2,28.6l16.29-8.3,2.43-1.24A100,100,0,0,0,18.18,100q0,3.82.29,7.61a18.19,18.19,0,0,1-9.88,17.58L0,129.57V150l25.29-12.89,0,0,8.19-4.18,8.07-4.11v0L186.43,55l16.28-8.29,33.65-17.15V9.14Z\"/><path d=\"M236.36,50,49.78,145,33.5,153.31,0,170.38v20.41l33.27-16.95,28.46-14.5L199.3,89.24A83.45,83.45,0,0,1,200,100,81.87,81.87,0,0,1,78.09,171.36l-1,.53-17.66,9A100,100,0,0,0,218.18,100c0-2.57-.1-5.14-.29-7.68a18.2,18.2,0,0,1,9.87-17.58l8.6-4.38Z\"/></g></svg>\n"
    }
  ],
  "removable": false,
  "hidden": true,
  "hideSnapBranding": true
}