main.js raw
1 (self.webpackChunkfirefox=self.webpackChunkfirefox||[]).push([[792],{1698(Xe,g,L){"use strict";g.cv=g.uz=void 0;const S=L(8737),_=L(8852);L(2354),L(4156);var b=function(z){return z[z.SECRET=0]="SECRET",z[z.BLINDING_FACTOR=1]="BLINDING_FACTOR",z}(b||{});g.uz=(z,W,oe)=>ee(z,W,oe,b.SECRET),g.cv=(z,W,oe)=>ee(z,W,oe,b.BLINDING_FACTOR);const ee=(z,W,oe,me)=>{const fe=S.HDKey.fromMasterSeed(z),ae=(0,_.getKeysetIdInt)(W),ge=fe.derive(`m/129372'/0'/${ae}'/${oe}'/${me}`);if(null===ge.privateKey)throw new Error("Could not derive private key");return ge.privateKey}},6043(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.getSignedProof=g.getSignedOutputs=g.getSignedOutput=g.getSignedProofs=g.signBlindedMessage=g.signP2PKsecret=g.createP2PKsecret=void 0;const B=L(4097),S=L(1806),_=L(1717),I=L(6492),T=L(8205);g.createP2PKsecret=z=>{const W=["P2PK",{nonce:(0,B.bytesToHex)((0,I.randomBytes)(32)),data:z}],oe=JSON.stringify(W);return(new TextEncoder).encode(oe)},g.signP2PKsecret=(z,W)=>{const oe=(0,S.sha256)((new TextDecoder).decode(z));return _.schnorr.sign(oe,W)},g.signBlindedMessage=(z,W)=>{const oe=(0,S.sha256)(z);return _.schnorr.sign(oe,W)},g.getSignedProofs=(z,W)=>z.map(oe=>{try{if("P2PK"!==(0,T.parseSecret)(oe.secret)[0])throw new Error("unknown secret type");return(0,g.getSignedProof)(oe,(0,B.hexToBytes)(W))}catch{return oe}}),g.getSignedOutput=(z,W)=>{const oe=z.B_.toHex(!0),me=(0,g.signBlindedMessage)(oe,W);return z.witness={signatures:[(0,B.bytesToHex)(me)]},z},g.getSignedOutputs=(z,W)=>z.map(oe=>(0,g.getSignedOutput)(oe,W)),g.getSignedProof=(z,W)=>(z.witness||(z.witness={signatures:[(0,B.bytesToHex)((0,g.signP2PKsecret)(z.secret,W))]}),z)},8942(Xe,g,L){"use strict";g.BV=g.I1=void 0;const S=L(8852),_=L(4097),I=L(1717),T=L(4428);g.I1=(ne,ee,Ie,Ae)=>{const z=I.secp256k1.ProjectivePoint.fromPrivateKey((0,_.bytesToHex)(ne.s)),W=Ae.multiply((0,T.bytesToNumber)(ne.e)),oe=ee.multiply((0,T.bytesToNumber)(ne.s)),me=Ie.multiply((0,T.bytesToNumber)(ne.e)),fe=z.subtract(W),ae=oe.subtract(me);return function O(ne,ee){if(ne.length!==ee.length)return!1;for(let Ie=0;Ie<ne.length;Ie++)if(ne[Ie]!==ee[Ie])return!1;return!0}((0,S.hash_e)([fe,ae,Ae,Ie]),ne.e)},g.BV=(ne,ee,Ie,Ae)=>{if(void 0===ee.r)throw new Error("verifyDLEQProof_reblind: Undefined blinding factor");const z=(0,S.hashToCurve)(ne),W=Ie.add(Ae.multiply(ee.r)),oe=I.secp256k1.ProjectivePoint.fromPrivateKey(ee.r),me=z.add(oe);return(0,g.I1)(ee,me,W,Ae)}},3402(Xe,g,L){"use strict";g.R_=g.pK=g.Jr=void 0;const S=L(1717),I=(L(6492),L(4428)),T=L(8852),O=L(6043);g.Jr=function Z(W,oe,me){const fe=(0,T.hashToCurve)(W);oe||(oe=(0,I.bytesToNumber)(S.secp256k1.utils.randomPrivateKey()));const ae=S.secp256k1.ProjectivePoint.BASE.multiply(oe),X=fe.add(ae);return void 0!==me?(0,O.getSignedOutput)({B_:X,r:oe,secret:W},me):{B_:X,r:oe,secret:W}},g.pK=function ee(W,oe,me,fe){const X=function ne(W,oe,me){return W.subtract(me.multiply(oe))}(W.C_,oe,fe);return{id:W.id,amount:W.amount,secret:me,C:X}},g.R_=W=>({amount:W.amount,C:W.C.toHex(!0),id:W.id,secret:(new TextDecoder).decode(W.secret),witness:JSON.stringify(W.witness)})},8205(Xe,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.parseSecret=void 0,g.parseSecret=B=>{try{return B instanceof Uint8Array&&(B=(new TextDecoder).decode(B)),JSON.parse(B)}catch{throw new Error("can't parse secret")}}},8852(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.deriveKeysetId=g.deserializeMintKeys=g.serializeMintKeys=g.createRandomPrivateKey=g.getKeysetIdInt=g.pointFromHex=g.pointFromBytes=g.hash_e=g.hashToCurve=void 0;const B=L(1717),S=L(1806),_=L(4097),I=L(4428),T=L(3838),O=(0,_.hexToBytes)("536563703235366b315f48617368546f43757276655f43617368755f");function ee(fe){return B.secp256k1.ProjectivePoint.fromHex(fe)}function z(fe){const ae={};return Object.keys(fe).forEach(X=>{ae[X]=(0,_.bytesToHex)(fe[X])}),ae}g.hashToCurve=function b(fe){const ae=(0,S.sha256)(T.Buffer.concat([O,fe])),X=new Uint32Array(1);for(let Se=0;Se<65536;Se++){const Te=new Uint8Array(X.buffer),q=(0,S.sha256)(T.Buffer.concat([ae,Te]));try{return ee((0,_.bytesToHex)(T.Buffer.concat([new Uint8Array([2]),q])))}catch{X[0]++}}throw new Error("No valid point found")},g.hash_e=function Z(fe){const X=fe.map(Se=>Se.toHex(!1)).join("");return(0,S.sha256)((new TextEncoder).encode(X))},g.pointFromBytes=function ne(fe){return B.secp256k1.ProjectivePoint.fromHex((0,_.bytesToHex)(fe))},g.pointFromHex=ee,g.getKeysetIdInt=fe=>{let ae;return ae=/^[a-fA-F0-9]+$/.test(fe)?(0,I.hexToNumber)(fe)%BigInt(2**31-1):(0,I.bytesToNumber)((0,I.encodeBase64toUint8)(fe))%BigInt(2**31-1),ae},g.createRandomPrivateKey=function Ae(){return B.secp256k1.utils.randomPrivateKey()},g.serializeMintKeys=z,g.deserializeMintKeys=function W(fe){const ae={};return Object.keys(fe).forEach(X=>{ae[X]=(0,_.hexToBytes)(fe[X])}),ae},g.deriveKeysetId=function oe(fe){const ge=Object.entries(z(fe)).map(q=>[BigInt(q[0]),q[1]]).sort((q,j)=>q[0]<j[0]?-1:q[0]>j[0]?1:0).map(([,q])=>(0,_.hexToBytes)(q)).reduce((q,j)=>function me(fe,ae){const X=new Uint8Array(fe.length+ae.length);return X.set(fe),X.set(ae,fe.length),X}(q,j),new Uint8Array),Se=(0,S.sha256)(ge);return"00"+T.Buffer.from(Se).toString("hex").slice(0,14)}},4428(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.encodeBase64toUint8=g.hexToNumber=g.bytesToNumber=void 0;const B=L(4097),S=L(3838);function I(O){return BigInt(`0x${O}`)}g.bytesToNumber=function _(O){return I((0,B.bytesToHex)(O))},g.hexToNumber=I,g.encodeBase64toUint8=function T(O){return S.Buffer.from(O,"base64")}},2354(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.generateMnemonic=function ne(ae,X=128){if((0,_.anumber)(X),X%32!=0||X>256)throw new TypeError("Invalid entropy");return z((0,_.randomBytes)(X/8),ae)},g.mnemonicToEntropy=Ae,g.entropyToMnemonic=z,g.validateMnemonic=function W(ae,X){try{Ae(ae,X)}catch{return!1}return!0},g.mnemonicToSeed=function me(ae,X=""){return(0,B.pbkdf2Async)(S.sha512,b(ae).nfkd,oe(X),{c:2048,dkLen:64})},g.mnemonicToSeedSync=function fe(ae,X=""){return(0,B.pbkdf2)(S.sha512,b(ae).nfkd,oe(X),{c:2048,dkLen:64})};const B=L(6420),S=L(7361),_=L(6492),I=L(1976);function O(ae){if("string"!=typeof ae)throw new TypeError("invalid mnemonic type: "+typeof ae);return ae.normalize("NFKD")}function b(ae){const X=O(ae),ge=X.split(" ");if(![12,15,18,21,24].includes(ge.length))throw new Error("Invalid mnemonic");return{nfkd:X,words:ge}}function Z(ae){(0,_.abytes)(ae,16,20,24,28,32)}const ee=ae=>{const X=8-ae.length/4;return new Uint8Array([(0,S.sha256)(ae)[0]>>X<<X])};function Ie(ae){if(!Array.isArray(ae)||2048!==ae.length||"string"!=typeof ae[0])throw new Error("Wordlist: expected array of 2048 strings");return ae.forEach(X=>{if("string"!=typeof X)throw new Error("wordlist: non-string element: "+X)}),I.utils.chain(I.utils.checksum(1,ee),I.utils.radix2(11,!0),I.utils.alphabet(ae))}function Ae(ae,X){const{words:ge}=b(ae),Se=Ie(X).decode(ge);return Z(Se),Se}function z(ae,X){return Z(ae),Ie(X).encode(ae).join((ae=>"\u3042\u3044\u3053\u304f\u3057\u3093"===ae[0])(X)?"\u3000":" ")}const oe=ae=>O("mnemonic"+ae)},4156(Xe,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.wordlist=void 0,g.wordlist="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")},6819(Xe,g,L){"use strict";var B={};L.r(B),L.d(B,{OG:()=>kw,My:()=>Eu,Ph:()=>gi,lX:()=>Dw,Id:()=>Qc,fg:()=>E3,qj:()=>Lr,aT:()=>Bu,lq:()=>da,z:()=>Sw,Q5:()=>cf});var S={};function _(e,n,t,r,i,o,s){try{var a=e[o](s),c=a.value}catch(l){return void t(l)}a.done?n(c):Promise.resolve(c).then(r,i)}function I(e){return function(){var n=this,t=arguments;return new Promise(function(r,i){var o=e.apply(n,t);function s(c){_(o,r,i,s,a,"next",c)}function a(c){_(o,r,i,s,a,"throw",c)}s(void 0)})}}function T(e,n){return Object.is(e,n)}L.r(S),L.d(S,{afterMain:()=>mP,afterRead:()=>hP,afterWrite:()=>EP,applyStyles:()=>h_,arrow:()=>SP,auto:()=>sm,basePlacements:()=>Gu,beforeMain:()=>pP,beforeRead:()=>fP,beforeWrite:()=>CP,bottom:()=>ki,clippingParents:()=>dP,computeStyles:()=>C_,createPopper:()=>b_,createPopperBase:()=>tde,createPopperLite:()=>ide,detectOverflow:()=>ju,end:()=>Vu,eventListeners:()=>y_,flip:()=>TP,hide:()=>PP,left:()=>ti,main:()=>IP,modifierPhases:()=>BP,offset:()=>UP,placements:()=>f_,popper:()=>qu,popperGenerator:()=>dm,popperOffsets:()=>__,preventOverflow:()=>HP,read:()=>gP,reference:()=>AP,right:()=>Mi,start:()=>Pc,top:()=>ei,variationPlacements:()=>A_,viewport:()=>d_,write:()=>yP});let O=null,b=!1,Z=1;const ne=Symbol("SIGNAL");function ee(e){const n=O;return O=e,n}const W={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function oe(e){if(b)throw new Error("");if(null===O)return;O.consumerOnSignalRead(e);const n=O.nextProducerIndex++;te(O),n<O.producerNode.length&&O.producerNode[n]!==e&&ce(O)&&$(O.producerNode[n],O.producerIndexOfThis[n]),O.producerNode[n]!==e&&(O.producerNode[n]=e,O.producerIndexOfThis[n]=ce(O)?U(e,O,n):0),O.producerLastReadVersion[n]=e.version}function fe(e){if((!ce(e)||e.dirty)&&(e.dirty||e.lastCleanEpoch!==Z)){if(!e.producerMustRecompute(e)&&!j(e))return void Se(e);e.producerRecomputeValue(e),Se(e)}}function ae(e){if(void 0===e.liveConsumerNode)return;const n=b;b=!0;try{for(const t of e.liveConsumerNode)t.dirty||ge(t)}finally{b=n}}function X(){return!1!==O?.consumerAllowSignalWrites}function ge(e){e.dirty=!0,ae(e),e.consumerMarkedDirty?.(e)}function Se(e){e.dirty=!1,e.lastCleanEpoch=Z}function Te(e){return e&&(e.nextProducerIndex=0),ee(e)}function q(e,n){if(ee(n),e&&void 0!==e.producerNode&&void 0!==e.producerIndexOfThis&&void 0!==e.producerLastReadVersion){if(ce(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)$(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function j(e){te(e);for(let n=0;n<e.producerNode.length;n++){const t=e.producerNode[n],r=e.producerLastReadVersion[n];if(r!==t.version||(fe(t),r!==t.version))return!0}return!1}function H(e){if(te(e),ce(e))for(let n=0;n<e.producerNode.length;n++)$(e.producerNode[n],e.producerIndexOfThis[n]);e.producerNode.length=e.producerLastReadVersion.length=e.producerIndexOfThis.length=0,e.liveConsumerNode&&(e.liveConsumerNode.length=e.liveConsumerIndexOfThis.length=0)}function U(e,n,t){if(K(e),0===e.liveConsumerNode.length&&D(e))for(let r=0;r<e.producerNode.length;r++)e.producerIndexOfThis[r]=U(e.producerNode[r],e,r);return e.liveConsumerIndexOfThis.push(t),e.liveConsumerNode.push(n)-1}function $(e,n){if(K(e),1===e.liveConsumerNode.length&&D(e))for(let r=0;r<e.producerNode.length;r++)$(e.producerNode[r],e.producerIndexOfThis[r]);const t=e.liveConsumerNode.length-1;if(e.liveConsumerNode[n]=e.liveConsumerNode[t],e.liveConsumerIndexOfThis[n]=e.liveConsumerIndexOfThis[t],e.liveConsumerNode.length--,e.liveConsumerIndexOfThis.length--,n<e.liveConsumerNode.length){const r=e.liveConsumerIndexOfThis[n],i=e.liveConsumerNode[n];te(i),i.producerIndexOfThis[r]=n}}function ce(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function te(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function K(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function D(e){return void 0!==e.producerNode}const P=Symbol("UNSET"),k=Symbol("COMPUTING"),pe=Symbol("ERRORED"),Me={...W,value:P,dirty:!0,error:null,equal:T,kind:"computed",producerMustRecompute:e=>e.value===P||e.value===k,producerRecomputeValue(e){if(e.value===k)throw new Error("Detected cycle in computations.");const n=e.value;e.value=k;const t=Te(e);let r,i=!1;try{r=e.computation(),ee(null),i=n!==P&&n!==pe&&r!==pe&&e.equal(n,r)}catch(o){r=pe,e.error=o}finally{q(e,t)}i?e.value=n:(e.value=r,e.version++)}};let N=function G(){throw new Error};function M(e){N(e)}function Ce(e,n){X()||M(e),e.equal(e.value,n)||(e.value=n,function nt(e){e.version++,function me(){Z++}(),ae(e)}(e))}const je={...W,equal:T,value:void 0,kind:"signal"};let In;function wt(){return In}function Zn(e){const n=In;return In=e,n}const Qn=Symbol("NotFound");function Ne(e){return"function"==typeof e}function He(e){const t=e(r=>{Error.call(r),r.stack=(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Error;const w=He(e=>function(t){e(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((r,i)=>`${i+1}) ${r.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t});function h(e,n){if(e){const t=e.indexOf(n);0<=t&&e.splice(t,1)}}class m{constructor(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let n;if(!this.closed){this.closed=!0;const{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(const o of t)o.remove(this);else t.remove(this);const{initialTeardown:r}=this;if(Ne(r))try{r()}catch(o){n=o instanceof w?o.errors:[o]}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const o of i)try{ue(o)}catch(s){n=n??[],s instanceof w?n=[...n,...s.errors]:n.push(s)}}if(n)throw new w(n)}}add(n){var t;if(n&&n!==this)if(this.closed)ue(n);else{if(n instanceof m){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(n)}}_hasParent(n){const{_parentage:t}=this;return t===n||Array.isArray(t)&&t.includes(n)}_addParent(n){const{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n}_removeParent(n){const{_parentage:t}=this;t===n?this._parentage=null:Array.isArray(t)&&h(t,n)}remove(n){const{_finalizers:t}=this;t&&h(t,n),n instanceof m&&n._removeParent(this)}}m.EMPTY=(()=>{const e=new m;return e.closed=!0,e})();const x=m.EMPTY;function Y(e){return e instanceof m||e&&"closed"in e&&Ne(e.remove)&&Ne(e.add)&&Ne(e.unsubscribe)}function ue(e){Ne(e)?e():e.unsubscribe()}const ye={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},at={setTimeout(e,n,...t){const{delegate:r}=at;return r?.setTimeout?r.setTimeout(e,n,...t):setTimeout(e,n,...t)},clearTimeout(e){const{delegate:n}=at;return(n?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Et(e){at.setTimeout(()=>{const{onUnhandledError:n}=ye;if(!n)throw e;n(e)})}function dt(){}const Dt=wn("C",void 0,void 0);function wn(e,n,t){return{kind:e,value:n,error:t}}let Mn=null;function is(e){if(ye.useDeprecatedSynchronousErrorHandling){const n=!Mn;if(n&&(Mn={errorThrown:!1,error:null}),e(),n){const{errorThrown:t,error:r}=Mn;if(Mn=null,t)throw r}}else e()}class Wc extends m{constructor(n){super(),this.isStopped=!1,n?(this.destination=n,Y(n)&&n.add(this)):this.destination=NH}static create(n,t,r){return new Tm(n,t,r)}next(n){this.isStopped?Om(function xr(e){return wn("N",e,void 0)}(n),this):this._next(n)}error(n){this.isStopped?Om(function vt(e){return wn("E",void 0,e)}(n),this):(this.isStopped=!0,this._error(n))}complete(){this.isStopped?Om(Dt,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(n){this.destination.next(n)}_error(n){try{this.destination.error(n)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const kH=Function.prototype.bind;function xm(e,n){return kH.call(e,n)}class MH{constructor(n){this.partialObserver=n}next(n){const{partialObserver:t}=this;if(t.next)try{t.next(n)}catch(r){Lf(r)}}error(n){const{partialObserver:t}=this;if(t.error)try{t.error(n)}catch(r){Lf(r)}else Lf(n)}complete(){const{partialObserver:n}=this;if(n.complete)try{n.complete()}catch(t){Lf(t)}}}class Tm extends Wc{constructor(n,t,r){let i;if(super(),Ne(n)||!n)i={next:n??void 0,error:t??void 0,complete:r??void 0};else{let o;this&&ye.useDeprecatedNextContext?(o=Object.create(n),o.unsubscribe=()=>this.unsubscribe(),i={next:n.next&&xm(n.next,o),error:n.error&&xm(n.error,o),complete:n.complete&&xm(n.complete,o)}):i=n}this.destination=new MH(i)}}function Lf(e){ye.useDeprecatedSynchronousErrorHandling?function Hf(e){ye.useDeprecatedSynchronousErrorHandling&&Mn&&(Mn.errorThrown=!0,Mn.error=e)}(e):Et(e)}function Om(e,n){const{onStoppedNotification:t}=ye;t&&at.setTimeout(()=>t(e,n))}const NH={closed:!0,next:dt,error:function FH(e){throw e},complete:dt},Rm="function"==typeof Symbol&&Symbol.observable||"@@observable";function xa(e){return e}function cb(e){return 0===e.length?xa:1===e.length?e[0]:function(t){return e.reduce((r,i)=>i(r),t)}}let Cr=(()=>{class e{constructor(t){t&&(this._subscribe=t)}lift(t){const r=new e;return r.source=this,r.operator=t,r}subscribe(t,r,i){const o=function OH(e){return e&&e instanceof Wc||function TH(e){return e&&Ne(e.next)&&Ne(e.error)&&Ne(e.complete)}(e)&&Y(e)}(t)?t:new Tm(t,r,i);return is(()=>{const{operator:s,source:a}=this;o.add(s?s.call(o,a):a?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(t){try{return this._subscribe(t)}catch(r){t.error(r)}}forEach(t,r){return new(r=lb(r))((i,o)=>{const s=new Tm({next:a=>{try{t(a)}catch(c){o(c),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(t){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(t)}[Rm](){return this}pipe(...t){return cb(t)(this)}toPromise(t){return new(t=lb(t))((r,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>r(o))})}}return e.create=n=>new e(n),e})();function lb(e){var n;return null!==(n=e??ye.Promise)&&void 0!==n?n:Promise}const RH=He(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let ni=(()=>{class e extends Cr{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const r=new ub(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new RH}next(t){is(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const r of this.currentObservers)r.next(t)}})}error(t){is(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:r}=this;for(;r.length;)r.shift().error(t)}})}complete(){is(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:r,isStopped:i,observers:o}=this;return r||i?x:(this.currentObservers=null,o.push(t),new m(()=>{this.currentObservers=null,h(o,t)}))}_checkFinalizedStatuses(t){const{hasError:r,thrownError:i,isStopped:o}=this;r?t.error(i):o&&t.complete()}asObservable(){const t=new Cr;return t.source=this,t}}return e.create=(n,t)=>new ub(n,t),e})();class ub extends ni{constructor(n,t){super(),this.destination=n,this.source=t}next(n){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,n)}error(n){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,n)}complete(){var n,t;null===(t=null===(n=this.destination)||void 0===n?void 0:n.complete)||void 0===t||t.call(n)}_subscribe(n){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(n))&&void 0!==r?r:x}}class Ii extends ni{constructor(n){super(),this._value=n}get value(){return this.getValue()}_subscribe(n){const t=super._subscribe(n);return!t.closed&&n.next(this._value),t}getValue(){const{hasError:n,thrownError:t,_value:r}=this;if(n)throw t;return this._throwIfClosed(),r}next(n){super.next(this._value=n)}}function db(e){return Ne(e?.lift)}function Dr(e){return n=>{if(db(n))return n.lift(function(t){try{return e(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function dr(e,n,t,r,i){return new PH(e,n,t,r,i)}class PH extends Wc{constructor(n,t,r,i,o,s){super(n),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=t?function(a){try{t(a)}catch(c){n.error(c)}}:super._next,this._error=i?function(a){try{i(a)}catch(c){n.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){n.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:t}=this;super.unsubscribe(),!t&&(null===(n=this.onFinalize)||void 0===n||n.call(this))}}}function cn(e,n){return Dr((t,r)=>{let i=0;t.subscribe(dr(r,o=>{r.next(e.call(n,o,i++))}))})}const hb="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss";class Pe extends Error{code;constructor(n,t){super(function os(e,n){return`${function ZH(e){return`NG0${Math.abs(e)}`}(e)}${n?": "+n:""}`}(n,t)),this.code=n}}const Gf=Symbol("InputSignalNode#UNSET"),pb={...je,transformFn:void 0,applyValueToInputSignal(e,n){Ce(e,n)}};function Ib(e,n){const t=Object.create(pb);function r(){if(oe(t),t.value===Gf)throw new Pe(-950,null);return t.value}return t.value=e,t.transformFn=n?.transform,r[ne]=t,r}function ss(e){return{toString:e}.toString()}const Gn=globalThis;function ln(e){for(let n in e)if(e[n]===ln)return n;throw Error("Could not find renamed property on target object.")}function XH(e,n){for(const t in n)n.hasOwnProperty(t)&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function Ar(e){if("string"==typeof e)return e;if(Array.isArray(e))return`[${e.map(Ar).join(", ")}]`;if(null==e)return""+e;const n=e.overriddenName||e.name;if(n)return`${n}`;const t=e.toString();if(null==t)return""+t;const r=t.indexOf("\n");return r>=0?t.slice(0,r):t}function Hm(e,n){return e?n?`${e} ${n}`:e:n||""}const e8=ln({__forward_ref__:ln});function vn(e){return e.__forward_ref__=vn,e.toString=function(){return Ar(this())},e}function St(e){return Vf(e)?e():e}function Vf(e){return"function"==typeof e&&e.hasOwnProperty(e8)&&e.__forward_ref__===vn}function rt(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Oa(e){return{providers:e.providers||[],imports:e.imports||[]}}function qf(e){return Cb(e,Kf)||Cb(e,yb)}function Cb(e,n){return e.hasOwnProperty(n)?e[n]:null}function zf(e){return e&&(e.hasOwnProperty(Lm)||e.hasOwnProperty(s8))?e[Lm]:null}const Kf=ln({\u0275prov:ln}),Lm=ln({\u0275inj:ln}),yb=ln({ngInjectableDef:ln}),s8=ln({ngInjectorDef:ln});class $e{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(n,t){this._desc=n,this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=rt({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function qm(e){return e&&!!e.\u0275providers}const tl=ln({\u0275cmp:ln}),zm=ln({\u0275dir:ln}),Km=ln({\u0275pipe:ln}),Bb=ln({\u0275mod:ln}),as=ln({\u0275fac:ln}),dd=ln({__NG_ELEMENT_ID__:ln}),wb=ln({__NG_ENV_ID__:ln});function Ot(e){return"string"==typeof e?e:null==e?"":String(e)}function vb(e,n){throw new Pe(-200,e)}function Jm(e,n){throw new Pe(-201,!1)}var Ht=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(Ht||{});let jm;function _b(){return jm}function ii(e){const n=jm;return jm=e,n}function bb(e,n,t){const r=qf(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:t&Ht.Optional?null:void 0!==n?n:void Jm()}const Ra={};class Qb{injector;constructor(n){this.injector=n}retrieve(n,t){return this.injector.get(n,t.optional?Qn:Ra,t)}}const Yf="ngTempTokenPath",d8=/\n/gm,Db="__source";function f8(e,n=Ht.Default){if(void 0===wt())throw new Pe(-203,!1);if(null===wt())return bb(e,void 0,n);{const t=wt();let r;return r=t instanceof Qb?t.injector:t,r.get(e,n&Ht.Optional?null:void 0,n)}}function _t(e,n=Ht.Default){return(_b()||f8)(St(e),n)}function de(e,n=Ht.Default){return _t(e,Wf(n))}function Wf(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function Wm(e){const n=[];for(let t=0;t<e.length;t++){const r=St(e[t]);if(Array.isArray(r)){if(0===r.length)throw new Pe(900,!1);let i,o=Ht.Default;for(let s=0;s<r.length;s++){const a=r[s],c=g8(a);"number"==typeof c?-1===c?i=a.token:o|=c:i=a}n.push(_t(i,o))}else n.push(_t(r))}return n}function g8(e){return e.__NG_DI_FLAG__}function Pa(e,n){return e.hasOwnProperty(as)?e[as]:null}function nl(e,n){e.forEach(t=>Array.isArray(t)?nl(t,n):n(t))}function kb(e,n,t){n>=e.length?e.push(t):e.splice(n,0,t)}function $f(e,n){return n>=e.length-1?e.pop():e.splice(n,1)[0]}function Ci(e,n,t){let r=fd(e,n);return r>=0?e[1|r]=t:(r=~r,function Fb(e,n,t,r){let i=e.length;if(i==n)e.push(t,r);else if(1===i)e.push(r,e[0]),e[0]=t;else{for(i--,e.push(e[i-1],e[i]);i>n;)e[i]=e[i-2],i--;e[n]=t,e[n+1]=r}}(e,r,n,t)),r}function Xm(e,n){const t=fd(e,n);if(t>=0)return e[1|t]}function fd(e,n){return function E8(e,n,t){let r=0,i=e.length>>t;for(;i!==r;){const o=r+(i-r>>1),s=e[o<<t];if(n===s)return o<<t;s>n?i=o:r=o+1}return~(i<<t)}(e,n,1)}const to={},$t=[],xi=new $e(""),Nb=new $e("",-1),eC=new $e("");class Xf{get(n,t=Ra){if(t===Ra){const r=new Error(`NullInjectorError: No provider for ${Ar(n)}!`);throw r.name="NullInjectorError",r}return t}}function yi(e,n){const t=e[Bb]||null;if(!t&&!0===n)throw new Error(`Type ${Ar(e)} does not have '\u0275mod' property.`);return t}function Vt(e){return e[tl]||null}function Ei(e){return e[Km]||null}function Ls(e){return{\u0275providers:e}}function B8(...e){return{\u0275providers:tC(0,e),\u0275fromNgModule:!0}}function tC(e,...n){const t=[],r=new Set;let i;const o=s=>{t.push(s)};return nl(n,s=>{const a=s;eg(a,o,[],r)&&(i||=[],i.push(a))}),void 0!==i&&xb(i,o),t}function xb(e,n){for(let t=0;t<e.length;t++){const{ngModule:r,providers:i}=e[t];nC(i,o=>{n(o,r)})}}function eg(e,n,t,r){if(!(e=St(e)))return!1;let i=null,o=zf(e);const s=!o&&Vt(e);if(o||s){if(s&&!s.standalone)return!1;i=e}else{const c=e.ngModule;if(o=zf(c),!o)return!1;i=c}const a=r.has(i);if(s){if(a)return!1;if(r.add(i),s.dependencies){const c="function"==typeof s.dependencies?s.dependencies():s.dependencies;for(const l of c)eg(l,n,t,r)}}else{if(!o)return!1;{if(null!=o.imports&&!a){let l;r.add(i);try{nl(o.imports,u=>{eg(u,n,t,r)&&(l||=[],l.push(u))})}finally{}void 0!==l&&xb(l,n)}if(!a){const l=Pa(i)||(()=>new i);n({provide:i,useFactory:l,deps:$t},i),n({provide:eC,useValue:i,multi:!0},i),n({provide:xi,useValue:()=>_t(i),multi:!0},i)}const c=o.providers;if(null!=c&&!a){const l=e;nC(c,u=>{n(u,l)})}}}return i!==e&&void 0!==e.providers}function nC(e,n){for(let t of e)qm(t)&&(t=t.\u0275providers),Array.isArray(t)?nC(t,n):n(t)}const w8=ln({provide:String,useValue:ln});function rC(e){return null!==e&&"object"==typeof e&&w8 in e}function Ha(e){return"function"==typeof e}const iC=new $e(""),tg={},Rb={};let oC;function ng(){return void 0===oC&&(oC=new Xf),oC}class si{}class La extends si{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(n,t,r,i){super(),this.parent=t,this.source=r,this.scopes=i,aC(n,s=>this.processProvider(s)),this.records.set(Nb,rl(void 0,this)),i.has("environment")&&this.records.set(si,rl(void 0,this));const o=this.records.get(iC);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(eC,$t,Ht.Self))}retrieve(n,t){return this.get(n,t.optional?Qn:Ra,t)}destroy(){gd(this),this._destroyed=!0;const n=ee(null);try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const t=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of t)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),ee(n)}}onDestroy(n){return gd(this),this._onDestroyHooks.push(n),()=>this.removeOnDestroy(n)}runInContext(n){gd(this);const t=Zn(this),r=ii(void 0);try{return n()}finally{Zn(t),ii(r)}}get(n,t=Ra,r=Ht.Default){if(gd(this),n.hasOwnProperty(wb))return n[wb](this);r=Wf(r);const o=Zn(this),s=ii(void 0);try{if(!(r&Ht.SkipSelf)){let c=this.records.get(n);if(void 0===c){const l=function S8(e){return"function"==typeof e||"object"==typeof e&&e instanceof $e}(n)&&qf(n);c=l&&this.injectableDefInScope(l)?rl(sC(n),tg):null,this.records.set(n,c)}if(null!=c)return this.hydrate(n,c,r)}return(r&Ht.Self?ng():this.parent).get(n,t=r&Ht.Optional&&t===Ra?null:t)}catch(a){if("NullInjectorError"===a.name){if((a[Yf]=a[Yf]||[]).unshift(Ar(n)),o)throw a;return function h8(e,n,t,r){const i=e[Yf];throw n[Db]&&i.unshift(n[Db]),e.message=function p8(e,n,t,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let i=Ar(n);if(Array.isArray(n))i=n.map(Ar).join(" -> ");else if("object"==typeof n){let o=[];for(let s in n)if(n.hasOwnProperty(s)){let a=n[s];o.push(s+":"+("string"==typeof a?JSON.stringify(a):Ar(a)))}i=`{${o.join(", ")}}`}return`${t}${r?"("+r+")":""}[${i}]: ${e.replace(d8,"\n ")}`}("\n"+e.message,i,t,r),e.ngTokenPath=i,e[Yf]=null,e}(a,n,"R3InjectorError",this.source)}throw a}finally{ii(s),Zn(o)}}resolveInjectorInitializers(){const n=ee(null),t=Zn(this),r=ii(void 0);try{const o=this.get(xi,$t,Ht.Self);for(const s of o)s()}finally{Zn(t),ii(r),ee(n)}}toString(){const n=[],t=this.records;for(const r of t.keys())n.push(Ar(r));return`R3Injector[${n.join(", ")}]`}processProvider(n){let t=Ha(n=St(n))?n:St(n&&n.provide);const r=function b8(e){return rC(e)?rl(void 0,e.useValue):rl(Pb(e),tg)}(n);if(!Ha(n)&&!0===n.multi){let i=this.records.get(t);i||(i=rl(void 0,tg,!0),i.factory=()=>Wm(i.multi),this.records.set(t,i)),t=n,i.multi.push(n)}this.records.set(t,r)}hydrate(n,t,r){const i=ee(null);try{return t.value===Rb?vb(Ar(n)):t.value===tg&&(t.value=Rb,t.value=t.factory(void 0,r)),"object"==typeof t.value&&t.value&&function D8(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{ee(i)}}injectableDefInScope(n){if(!n.providedIn)return!1;const t=St(n.providedIn);return"string"==typeof t?"any"===t||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(n){const t=this._onDestroyHooks.indexOf(n);-1!==t&&this._onDestroyHooks.splice(t,1)}}function sC(e){const n=qf(e),t=null!==n?n.factory:Pa(e);if(null!==t)return t;if(e instanceof $e)throw new Pe(204,!1);if(e instanceof Function)return function _8(e){if(e.length>0)throw new Pe(204,!1);const t=function o8(e){return e&&(e[Kf]||e[yb])||null}(e);return null!==t?()=>t.factory(e):()=>new e}(e);throw new Pe(204,!1)}function Pb(e,n,t){let r;if(Ha(e)){const i=St(e);return Pa(i)||sC(i)}if(rC(e))r=()=>St(e.useValue);else if(function Ob(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...Wm(e.deps||[]));else if(function Tb(e){return!(!e||!e.useExisting)}(e))r=(i,o)=>_t(St(e.useExisting),void 0!==o&&o&Ht.Optional?Ht.Optional:void 0);else{const i=St(e&&(e.useClass||e.provide));if(!function Q8(e){return!!e.deps}(e))return Pa(i)||sC(i);r=()=>new i(...Wm(e.deps))}return r}function gd(e){if(e.destroyed)throw new Pe(205,!1)}function rl(e,n,t=!1){return{factory:e,value:n,multi:t?[]:void 0}}function aC(e,n){for(const t of e)Array.isArray(t)?aC(t,n):t&&qm(t)?aC(t.\u0275providers,n):n(t)}function no(e,n){let t;e instanceof La?(gd(e),t=e):t=new Qb(e);const i=Zn(t),o=ii(void 0);try{return n()}finally{Zn(i),ii(o)}}function cC(){return void 0!==_b()||null!=wt()}function Vn(e){return Array.isArray(e)&&"object"==typeof e[1]}function gr(e){return Array.isArray(e)&&!0===e[1]}function dC(e){return!!(4&e.flags)}function io(e){return e.componentOffset>-1}function ag(e){return!(1&~e.flags)}function wi(e){return!!e.template}function ls(e){return!!(512&e[2])}function us(e){return!(256&~e[2])}class L8{previousValue;currentValue;firstChange;constructor(n,t,r){this.previousValue=n,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}}function Kb(e,n,t,r){null!==n?n.applyValueToInputSignal(n,r):e[t]=r}const oo=(()=>{const e=()=>Jb;return e.ngInherit=!0,e})();function Jb(e){return e.type.prototype.ngOnChanges&&(e.setInput=V8),G8}function G8(){const e=Yb(this),n=e?.current;if(n){const t=e.previous;if(t===to)e.previous=n;else for(let r in n)t[r]=n[r];e.current=null,this.ngOnChanges(n)}}function V8(e,n,t,r,i){const o=this.declaredInputs[r],s=Yb(e)||function q8(e,n){return e[jb]=n}(e,{previous:to,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[o];a[o]=new L8(l&&l.currentValue,t,c===to),Kb(e,n,i,t)}const jb="__ngSimpleChanges__";function Yb(e){return e[jb]||null}function Yt(e){for(;Array.isArray(e);)e=e[0];return e}function dl(e,n){return Yt(n[e])}function Vr(e,n){return Yt(n[e.index])}function za(e,n){return e.data[n]}function Ka(e,n){return e[n]}function gC(e,n,t,r){t>=e.data.length&&(e.data[t]=null,e.blueprint[t]=null),n[t]=r}function qr(e,n){const t=n[e];return Vn(t)?t:t[0]}function hC(e){return!(128&~e[2])}function Ti(e,n){return null==n?null:e[n]}function Zb(e){e[17]=0}function pC(e){1024&e[2]||(e[2]|=1024,hC(e)&&Al(e))}function Id(e){return!!(9216&e[2]||e[24]?.dirty)}function IC(e){e[10].changeDetectionScheduler?.notify(8),64&e[2]&&(e[2]|=1024),Id(e)&&Al(e)}function Al(e){e[10].changeDetectionScheduler?.notify(0);let n=ds(e);for(;null!==n&&!(8192&n[2])&&(n[2]|=8192,hC(n));)n=ds(n)}function lg(e,n){if(us(e))throw new Pe(911,!1);null===e[21]&&(e[21]=[]),e[21].push(n)}function ds(e){const n=e[3];return gr(n)?n[3]:n}function CC(e){return e[7]??=[]}function yC(e){return e.cleanup??=[]}const kt={lFrame:cQ(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let BC=!1;function wC(){return kt.bindingsEnabled}function be(){return kt.lFrame.lView}function bt(){return kt.lFrame.tView}function Qe(e){return kt.lFrame.contextLView=e,e[8]}function De(e){return kt.lFrame.contextLView=null,e}function Lt(){let e=eQ();for(;null!==e&&64===e.type;)e=e.parent;return e}function eQ(){return kt.lFrame.currentTNode}function so(e,n){const t=kt.lFrame;t.currentTNode=e,t.isParent=n}function vC(){return kt.lFrame.isParent}function _C(){kt.lFrame.isParent=!1}function tQ(){return kt.lFrame.contextLView}function rQ(){return BC}function dg(e){const n=BC;return BC=e,n}function zr(){const e=kt.lFrame;let n=e.bindingRootIndex;return-1===n&&(n=e.bindingRootIndex=e.tView.bindingStartIndex),n}function Oi(){return kt.lFrame.bindingIndex++}function fs(e){const n=kt.lFrame,t=n.bindingIndex;return n.bindingIndex=n.bindingIndex+e,t}function oL(e,n){const t=kt.lFrame;t.bindingIndex=t.bindingRootIndex=e,bC(n)}function bC(e){kt.lFrame.currentDirectiveIndex=e}function DC(){return kt.lFrame.currentQueryIndex}function Ag(e){kt.lFrame.currentQueryIndex=e}function aL(e){const n=e[1];return 2===n.type?n.declTNode:1===n.type?e[5]:null}function sQ(e,n,t){if(t&Ht.SkipSelf){let i=n,o=e;for(;!(i=i.parent,null!==i||t&Ht.Host||(i=aL(o),null===i||(o=o[14],10&i.type))););if(null===i)return!1;n=i,e=o}const r=kt.lFrame=aQ();return r.currentTNode=n,r.lView=e,!0}function SC(e){const n=aQ(),t=e[1];kt.lFrame=n,n.currentTNode=t.firstChild,n.lView=e,n.tView=t,n.contextLView=e,n.bindingIndex=t.bindingStartIndex,n.inI18n=!1}function aQ(){const e=kt.lFrame,n=null===e?null:e.child;return null===n?cQ(e):n}function cQ(e){const n={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=n),n}function lQ(){const e=kt.lFrame;return kt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const uQ=lQ;function kC(){const e=lQ();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function kr(){return kt.lFrame.selectedIndex}function ja(e){kt.lFrame.selectedIndex=e}function gn(){const e=kt.lFrame;return za(e.tView,e.selectedIndex)}let AQ=!0;function Cd(){return AQ}function Do(e){AQ=e}function MC(e,n){for(let t=n.directiveStart,r=n.directiveEnd;t<r;t++){const o=e.data[t].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:u}=o;s&&(e.contentHooks??=[]).push(-t,s),a&&((e.contentHooks??=[]).push(t,a),(e.contentCheckHooks??=[]).push(t,a)),c&&(e.viewHooks??=[]).push(-t,c),l&&((e.viewHooks??=[]).push(t,l),(e.viewCheckHooks??=[]).push(t,l)),null!=u&&(e.destroyHooks??=[]).push(t,u)}}function fg(e,n,t){fQ(e,n,3,t)}function gg(e,n,t,r){(3&e[2])===t&&fQ(e,n,t,r)}function FC(e,n){let t=e[2];(3&t)===n&&(t&=16383,t+=1,e[2]=t)}function fQ(e,n,t,r){const o=r??-1,s=n.length-1;let a=0;for(let c=void 0!==r?65535&e[17]:0;c<s;c++)if("number"==typeof n[c+1]){if(a=n[c],null!=r&&a>=r)break}else n[c]<0&&(e[17]+=65536),(a<o||-1==o)&&(gL(e,t,n,c),e[17]=(4294901760&e[17])+c+2),c++}function gQ(e,n){const t=ee(null);try{n.call(e)}finally{ee(t)}}function gL(e,n,t,r){const i=t[r]<0,o=t[r+1],a=e[i?-t[r]:t[r]];i?e[2]>>14<e[17]>>16&&(3&e[2])===n&&(e[2]+=16384,gQ(a,o)):gQ(a,o)}class yd{factory;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(n,t,r){this.factory=n,this.canSeeViewProviders=t,this.injectImpl=r}}function hQ(e){return 3===e||4===e||6===e}function pQ(e){return 64===e.charCodeAt(0)}function gl(e,n){if(null!==n&&0!==n.length)if(null===e||0===e.length)e=n.slice();else{let t=-1;for(let r=0;r<n.length;r++){const i=n[r];"number"==typeof i?t=i:0===t||IQ(e,t,i,0,-1===t||2===t?n[++r]:null)}}return e}function IQ(e,n,t,r,i){let o=0,s=e.length;if(-1===n)s=-1;else for(;o<e.length;){const a=e[o++];if("number"==typeof a){if(a===n){s=-1;break}if(a>n){s=o-1;break}}}for(;o<e.length;){const a=e[o];if("number"==typeof a)break;if(a===t)return void(null!==i&&(e[o+1]=i));o++,null!==i&&o++}-1!==s&&(e.splice(s,0,n),o=s+1),e.splice(o++,0,t),null!==i&&e.splice(o++,0,i)}function TC(e){return-1!==e}function Ed(e){return 32767&e}function Bd(e,n){let t=function CL(e){return e>>16}(e),r=n;for(;t>0;)r=r[14],t--;return r}let OC=!0;function hg(e){const n=OC;return OC=e,n}let yL=0;const So={};function pg(e,n){const t=yQ(e,n);if(-1!==t)return t;const r=n[1];r.firstCreatePass&&(e.injectorIndex=n.length,RC(r.data,e),RC(n,null),RC(r.blueprint,null));const i=Ig(e,n),o=e.injectorIndex;if(TC(i)){const s=Ed(i),a=Bd(i,n),c=a[1].data;for(let l=0;l<8;l++)n[o+l]=a[s+l]|c[s+l]}return n[o+8]=i,o}function RC(e,n){e.push(0,0,0,0,0,0,0,0,n)}function yQ(e,n){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===n[e.injectorIndex+8]?-1:e.injectorIndex}function Ig(e,n){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let t=0,r=null,i=n;for(;null!==i;){if(r=QQ(i),null===r)return-1;if(t++,i=i[14],-1!==r.injectorIndex)return r.injectorIndex|t<<16}return-1}function PC(e,n,t){!function EL(e,n,t){let r;"string"==typeof t?r=t.charCodeAt(0)||0:t.hasOwnProperty(dd)&&(r=t[dd]),null==r&&(r=t[dd]=yL++);const i=255&r;n.data[e+(i>>5)]|=1<<i}(e,n,t)}function EQ(e,n,t){if(t&Ht.Optional||void 0!==e)return e;Jm()}function BQ(e,n,t,r){if(t&Ht.Optional&&void 0===r&&(r=null),!(t&(Ht.Self|Ht.Host))){const i=e[9],o=ii(void 0);try{return i?i.get(n,r,t&Ht.Optional):bb(n,r,t&Ht.Optional)}finally{ii(o)}}return EQ(r,0,t)}function wQ(e,n,t,r=Ht.Default,i){if(null!==e){if(2048&n[2]&&!(r&Ht.Self)){const s=function bL(e,n,t,r,i){let o=e,s=n;for(;null!==o&&null!==s&&2048&s[2]&&!ls(s);){const a=vQ(o,s,t,r|Ht.Self,So);if(a!==So)return a;let c=o.parent;if(!c){const l=s[20];if(l){const u=l.get(t,So,r);if(u!==So)return u}c=QQ(s),s=s[14]}o=c}return i}(e,n,t,r,So);if(s!==So)return s}const o=vQ(e,n,t,r,So);if(o!==So)return o}return BQ(n,t,r,i)}function vQ(e,n,t,r,i){const o=function vL(e){if("string"==typeof e)return e.charCodeAt(0)||0;const n=e.hasOwnProperty(dd)?e[dd]:void 0;return"number"==typeof n?n>=0?255&n:_L:n}(t);if("function"==typeof o){if(!sQ(n,e,r))return r&Ht.Host?EQ(i,0,r):BQ(n,t,r,i);try{let s;if(s=o(r),null!=s||r&Ht.Optional)return s;Jm()}finally{uQ()}}else if("number"==typeof o){let s=null,a=yQ(e,n),c=-1,l=r&Ht.Host?n[15][5]:null;for((-1===a||r&Ht.SkipSelf)&&(c=-1===a?Ig(e,n):n[a+8],-1!==c&&bQ(r,!1)?(s=n[1],a=Ed(c),n=Bd(c,n)):a=-1);-1!==a;){const u=n[1];if(_Q(o,a,u.data)){const d=wL(a,n,t,s,r,l);if(d!==So)return d}c=n[a+8],-1!==c&&bQ(r,n[1].data[a+8]===l)&&_Q(o,a,n)?(s=u,a=Ed(c),n=Bd(c,n)):a=-1}}return i}function wL(e,n,t,r,i,o){const s=n[1],a=s.data[e+8],u=mg(a,s,t,null==r?io(a)&&OC:r!=s&&!!(3&a.type),i&Ht.Host&&o===a);return null!==u?wd(n,s,u,a,i):So}function mg(e,n,t,r,i){const o=e.providerIndexes,s=n.data,a=1048575&o,c=e.directiveStart,u=o>>20,f=i?a+u:e.directiveEnd;for(let A=r?a:a+u;A<f;A++){const p=s[A];if(A<c&&t===p||A>=c&&p.type===t)return A}if(i){const A=s[c];if(A&&wi(A)&&A.type===t)return c}return null}function wd(e,n,t,r,i){let o=e[t];const s=n.data;if(o instanceof yd){const a=o;a.resolving&&vb(function en(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():Ot(e)}(s[t]));const c=hg(a.canSeeViewProviders);a.resolving=!0;const u=a.injectImpl?ii(a.injectImpl):null;sQ(e,r,Ht.Default);try{o=e[t]=a.factory(void 0,i,s,e,r),n.firstCreatePass&&t>=r.directiveStart&&function fL(e,n,t){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=n.type.prototype;if(r){const s=Jb(n);(t.preOrderHooks??=[]).push(e,s),(t.preOrderCheckHooks??=[]).push(e,s)}i&&(t.preOrderHooks??=[]).push(0-e,i),o&&((t.preOrderHooks??=[]).push(e,o),(t.preOrderCheckHooks??=[]).push(e,o))}(t,s[t],n)}finally{null!==u&&ii(u),hg(c),a.resolving=!1,uQ()}}return o}function _Q(e,n,t){return!!(t[n+(e>>5)]&1<<e)}function bQ(e,n){return!(e&Ht.Self||e&Ht.Host&&n)}class qn{_tNode;_lView;constructor(n,t){this._tNode=n,this._lView=t}get(n,t,r){return wQ(this._tNode,this._lView,n,Wf(r),t)}}function _L(){return new qn(Lt(),be())}function Jt(e){return ss(()=>{const n=e.prototype.constructor,t=n[as]||UC(n),r=Object.prototype;let i=Object.getPrototypeOf(e.prototype).constructor;for(;i&&i!==r;){const o=i[as]||UC(i);if(o&&o!==t)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function UC(e){return Vf(e)?()=>{const n=UC(St(e));return n&&n()}:Pa(e)}function QQ(e){const n=e[1],t=n.type;return 2===t?n.declTNode:1===t?e[5]:null}function FQ(e,n=null,t=null,r){const i=NQ(e,n,t,r);return i.resolveInjectorInitializers(),i}function NQ(e,n=null,t=null,r,i=new Set){const o=[t||$t,B8(e)];return r=r||("object"==typeof e?void 0:Ar(e)),new La(o,n||ng(),r||null,i)}class hr{static THROW_IF_NOT_FOUND=Ra;static NULL=new Xf;static create(n,t){if(Array.isArray(n))return FQ({name:""},t,n,"");{const r=n.name??"";return FQ({name:r},n.parent,n.providers,r)}}static \u0275prov=rt({token:hr,providedIn:"any",factory:()=>_t(Nb)});static __NG_ELEMENT_ID__=-1}new $e("").__NG_ELEMENT_ID__=e=>{const n=Lt();if(null===n)throw new Pe(204,!1);if(2&n.type)return n.value;if(e&Ht.Optional)return null;throw new Pe(204,!1)};const xQ=!1;let ko=(()=>class e{static __NG_ELEMENT_ID__=TL;static __NG_ENV_ID__=t=>t})();class TQ extends ko{_lView;constructor(n){super(),this._lView=n}onDestroy(n){const t=this._lView;return us(t)?(n(),()=>{}):(lg(t,n),()=>function mC(e,n){if(null===e[21])return;const t=e[21].indexOf(n);-1!==t&&e[21].splice(t,1)}(t,n))}}function TL(){return new TQ(be())}class gs{}const _d=new $e("",{providedIn:"root",factory:()=>!1}),OQ=new $e(""),LC=new $e("");let Wa=(()=>{class e{taskId=0;pendingTasks=new Set;get _hasPendingTasks(){return this.hasPendingTasks.value}hasPendingTasks=new Ii(!1);add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const t=this.taskId++;return this.pendingTasks.add(t),t}has(t){return this.pendingTasks.has(t)}remove(t){this.pendingTasks.delete(t),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static \u0275prov=rt({token:e,providedIn:"root",factory:()=>new e})}return e})();const Pn=class OL extends ni{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(n=!1){super(),this.__isAsync=n,cC()&&(this.destroyRef=de(ko,{optional:!0})??void 0,this.pendingTasks=de(Wa,{optional:!0})??void 0)}emit(n){const t=ee(null);try{super.next(n)}finally{ee(t)}}subscribe(n,t,r){let i=n,o=t||(()=>null),s=r;if(n&&"object"==typeof n){const c=n;i=c.next?.bind(c),o=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(o=this.wrapInTimeout(o),i&&(i=this.wrapInTimeout(i)),s&&(s=this.wrapInTimeout(s)));const a=super.subscribe({next:i,error:o,complete:s});return n instanceof m&&n.add(a),a}wrapInTimeout(n){return t=>{const r=this.pendingTasks?.add();setTimeout(()=>{try{n(t)}finally{void 0!==r&&this.pendingTasks?.remove(r)}})}}};function bd(...e){}function PQ(e){let n,t;function r(){e=bd;try{void 0!==t&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(t),void 0!==n&&clearTimeout(n)}catch{}}return n=setTimeout(()=>{e(),r()}),"function"==typeof requestAnimationFrame&&(t=requestAnimationFrame(()=>{e(),r()})),()=>r()}function UQ(e){return queueMicrotask(()=>e()),()=>{e=bd}}const GC="isAngularZone",yg=GC+"_ID";let RL=0;class tn{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Pn(!1);onMicrotaskEmpty=new Pn(!1);onStable=new Pn(!1);onError=new Pn(!1);constructor(n){const{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:o=xQ}=n;if(typeof Zone>"u")throw new Pe(908,!1);Zone.assertZonePatched();const s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!i&&r,s.shouldCoalesceRunChangeDetection=i,s.callbackScheduled=!1,s.scheduleInRootZone=o,function HL(e){const n=()=>{!function UL(e){function n(){PQ(()=>{e.callbackScheduled=!1,qC(e),e.isCheckStableRunning=!0,VC(e),e.isCheckStableRunning=!1})}e.isCheckStableRunning||e.callbackScheduled||(e.callbackScheduled=!0,e.scheduleInRootZone?Zone.root.run(()=>{n()}):e._outer.run(()=>{n()}),qC(e))}(e)},t=RL++;e._inner=e._inner.fork({name:"angular",properties:{[GC]:!0,[yg]:t,[yg+t]:!0},onInvokeTask:(r,i,o,s,a,c)=>{if(function LL(e){return GQ(e,"__ignore_ng_zone__")}(c))return r.invokeTask(o,s,a,c);try{return HQ(e),r.invokeTask(o,s,a,c)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||e.shouldCoalesceRunChangeDetection)&&n(),LQ(e)}},onInvoke:(r,i,o,s,a,c,l)=>{try{return HQ(e),r.invoke(o,s,a,c,l)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!function GL(e){return GQ(e,"__scheduler_tick__")}(c)&&n(),LQ(e)}},onHasTask:(r,i,o,s)=>{r.hasTask(o,s),i===o&&("microTask"==s.change?(e._hasPendingMicrotasks=s.microTask,qC(e),VC(e)):"macroTask"==s.change&&(e.hasPendingMacrotasks=s.macroTask))},onHandleError:(r,i,o,s)=>(r.handleError(o,s),e.runOutsideAngular(()=>e.onError.emit(s)),!1)})}(s)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get(GC)}static assertInAngularZone(){if(!tn.isInAngularZone())throw new Pe(909,!1)}static assertNotInAngularZone(){if(tn.isInAngularZone())throw new Pe(909,!1)}run(n,t,r){return this._inner.run(n,t,r)}runTask(n,t,r,i){const o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+i,n,PL,bd,bd);try{return o.runTask(s,t,r)}finally{o.cancelTask(s)}}runGuarded(n,t,r){return this._inner.runGuarded(n,t,r)}runOutsideAngular(n){return this._outer.run(n)}}const PL={};function VC(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function qC(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&!0===e.callbackScheduled)}function HQ(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function LQ(e){e._nesting--,VC(e)}class zC{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Pn;onMicrotaskEmpty=new Pn;onStable=new Pn;onError=new Pn;run(n,t,r){return n.apply(t,r)}runGuarded(n,t,r){return n.apply(t,r)}runOutsideAngular(n){return n()}runTask(n,t,r,i){return n.apply(t,r)}}function GQ(e,n){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0]?.data?.[n]}class ao{_console=console;handleError(n){this._console.error("ERROR",n)}}const qL=new $e("",{providedIn:"root",factory:()=>{const e=de(tn),n=de(ao);return t=>e.runOutsideAngular(()=>n.handleError(t))}});function qQ(e,n){return Ib(e,n)}const KL=(qQ.required=function zL(e){return Ib(Gf,e)},qQ);function JL(){return hl(Lt(),be())}function hl(e,n){return new vi(Vr(e,n))}let vi=(()=>class e{nativeElement;constructor(t){this.nativeElement=t}static __NG_ELEMENT_ID__=JL})();function zQ(e){return e instanceof vi?e.nativeElement:e}function Mo(e,n){const t=function ke(e,n){const t=Object.create(je);t.value=e,void 0!==n&&(t.equal=n);const r=()=>(oe(t),t.value);return r[ne]=t,r}(e,n?.equal),r=t[ne];return t.set=i=>Ce(r,i),t.update=i=>function Fe(e,n){X()||M(e),Ce(e,n(e.value))}(r,i),t.asReadonly=Eg.bind(t),t}function Eg(){const e=this[ne];if(void 0===e.readonlyFn){const n=()=>this();n[ne]=e,e.readonlyFn=n}return e.readonlyFn}function JQ(e){return function KQ(e){return"function"==typeof e&&void 0!==e[ne]}(e)&&"function"==typeof e.set}function jL(){return this._results[Symbol.iterator]()}class YL{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new ni}constructor(n=!1){this._emitDistinctChangesOnly=n}get(n){return this._results[n]}map(n){return this._results.map(n)}filter(n){return this._results.filter(n)}find(n){return this._results.find(n)}reduce(n,t){return this._results.reduce(n,t)}forEach(n){this._results.forEach(n)}some(n){return this._results.some(n)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(n,t){this.dirty=!1;const r=function oi(e){return e.flat(Number.POSITIVE_INFINITY)}(n);(this._changesDetected=!function y8(e,n,t){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],o=n[r];if(t&&(i=t(i),o=t(o)),o!==i)return!1}return!0}(this._results,r,t))&&(this._results=r,this.length=r.length,this.last=r[this.length-1],this.first=r[0])}notifyOnChanges(){void 0!==this._changes&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(n){this._onDirty=n}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){void 0!==this._changes&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=jL}function Dd(e){return!(128&~e.flags)}var Bg=function(e){return e[e.OnPush=0]="OnPush",e[e.Default=1]="Default",e}(Bg||{});const wg=new Map;let $L=0;function JC(e){wg.delete(e[19])}const YC="__ngContext__";function ci(e,n){Vn(n)?(e[YC]=n[19],function XL(e){wg.set(e[19],e)}(n)):e[YC]=n}function nD(e){return iD(e[12])}function rD(e){return iD(e[4])}function iD(e){for(;null!==e&&!gr(e);)e=e[4];return e}let $C;const hs=new $e("",{providedIn:"root",factory:()=>m4}),m4="ng",ZC=new $e(""),XC=new $e("",{providedIn:"platform",factory:()=>"unknown"}),dD=new $e("",{providedIn:"root",factory:()=>function Fo(){if(void 0!==$C)return $C;if(typeof document<"u")return document;throw new Pe(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null}),hD=new $e("",{providedIn:"root",factory:()=>!1});var uy=function(e){return e[e.CHANGE_DETECTION=0]="CHANGE_DETECTION",e[e.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",e}(uy||{});const Il=new $e(""),CD=new Set;function li(e){CD.has(e)||(CD.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))}let Sg=(()=>class e{view;node;constructor(t,r){this.view=t,this.node=r}static __NG_ELEMENT_ID__=w4})();function w4(){return new Sg(be(),Lt())}var ml=function(e){return e[e.EarlyRead=0]="EarlyRead",e[e.Write=1]="Write",e[e.MixedReadWrite=2]="MixedReadWrite",e[e.Read=3]="Read",e}(ml||{});let dy=(()=>{class e{impl=null;execute(){this.impl?.execute()}static \u0275prov=rt({token:e,providedIn:"root",factory:()=>new e})}return e})();const yD=[ml.EarlyRead,ml.Write,ml.MixedReadWrite,ml.Read];let ED=(()=>{class e{ngZone=de(tn);scheduler=de(gs);errorHandler=de(ao,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){de(Il,{optional:!0})}execute(){this.executing=!0;for(const r of yD)for(const i of this.sequences)if(!i.erroredOrDestroyed&&i.hooks[r])try{i.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>(0,i.hooks[r])(i.pipelinedValue),i.snapshot))}catch(o){i.erroredOrDestroyed=!0,this.errorHandler?.handleError(o)}this.executing=!1;for(const r of this.sequences)r.afterRun(),r.once&&(this.sequences.delete(r),r.destroy());for(const r of this.deferredRegistrations)this.sequences.add(r);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear()}register(t){const{view:r}=t;void 0!==r?((r[25]??=[]).push(t),Al(r),r[2]|=8192):this.executing?this.deferredRegistrations.add(t):this.addSequence(t)}addSequence(t){this.sequences.add(t),this.scheduler.notify(7)}unregister(t){this.executing&&this.sequences.has(t)?(t.erroredOrDestroyed=!0,t.pipelinedValue=void 0,t.once=!0):(this.sequences.delete(t),this.deferredRegistrations.delete(t))}maybeTrace(t,r){return r?r.run(uy.AFTER_NEXT_RENDER,t):t()}static \u0275prov=rt({token:e,providedIn:"root",factory:()=>new e})}return e})();class BD{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(n,t,r,i,o,s=null){this.impl=n,this.hooks=t,this.view=r,this.once=i,this.snapshot=s,this.unregisterOnDestroy=o?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();const n=this.view?.[25];n&&(this.view[25]=n.filter(t=>t!==this))}}function Ay(e,n){!n?.injector&&function il(e){if(!cC())throw new Pe(-203,!1)}();const t=n?.injector??de(hr);return li("NgAfterNextRender"),function vD(e,n,t,r){const i=n.get(dy);i.impl??=n.get(ED);const o=n.get(Il,null,{optional:!0}),s=t?.phase??ml.MixedReadWrite,a=!0!==t?.manualCleanup?n.get(ko):null,c=n.get(Sg,null,{optional:!0}),l=new BD(i.impl,function v4(e,n){if(e instanceof Function){const t=[void 0,void 0,void 0,void 0];return t[n]=e,t}return[e.earlyRead,e.write,e.mixedReadWrite,e.read]}(e,s),c?.view,r,a,o?.snapshot(null));return i.impl.register(l),l}(e,t,n,!0)}function WD(e,n){const t=e.contentQueries;if(null!==t){const r=ee(null);try{for(let i=0;i<t.length;i+=2){const s=t[i+1];if(-1!==s){const a=e.data[s];Ag(t[i]),a.contentQueries(2,n[s],s)}}}finally{ee(r)}}}function by(e,n,t){Ag(0);const r=ee(null);try{n(e,t)}finally{ee(r)}}function Qy(e,n,t){if(dC(n)){const r=ee(null);try{const o=n.directiveEnd;for(let s=n.directiveStart;s<o;s++){const a=e.data[s];a.contentQueries&&a.contentQueries(1,t[s],s)}}finally{ee(r)}}}var Ri=function(e){return e[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",e}(Ri||{});let Lg;function r1(e){return function ky(){if(void 0===Lg&&(Lg=null,Gn.trustedTypes))try{Lg=Gn.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Lg}()?.createScriptURL(e)||e}class i1{changingThisBreaksApplicationSecurity;constructor(n){this.changingThisBreaksApplicationSecurity=n}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${hb})`}}function zs(e){return e instanceof i1?e.changingThisBreaksApplicationSecurity:e}function Ld(e,n){const t=function IG(e){return e instanceof i1&&e.getTypeName()||null}(e);if(null!=t&&t!==n){if("ResourceURL"===t&&"URL"===n)return!0;throw new Error(`Required a safe ${n}, got a ${t} (see ${hb})`)}return t===n}const EG=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;const MG=/^>|^->|<!--|-->|--!>|<!-$/g,FG=/(<|>)/g;function Ry(e,n){return e.createComment(function A1(e){return e.replace(MG,n=>n.replace(FG,"\u200b$1\u200b"))}(n))}function qg(e,n,t){return e.createElement(n,t)}function Xa(e,n,t,r,i){e.insertBefore(n,t,r,i)}function g1(e,n,t){e.appendChild(n,t)}function h1(e,n,t,r,i){null!==r?Xa(e,n,t,r,i):g1(e,n,t)}function I1(e,n,t){const{mergedAttrs:r,classes:i,styles:o}=t;null!==r&&function mL(e,n,t){let r=0;for(;r<t.length;){const i=t[r];if("number"==typeof i){if(0!==i)break;r++;const o=t[r++],s=t[r++],a=t[r++];e.setAttribute(n,s,a,o)}else{const o=i,s=t[++r];pQ(o)?e.setProperty(n,o,s):e.setAttribute(n,o,s),r++}}}(e,n,r),null!==i&&function TG(e,n,t){""===t?e.removeAttribute(n,"class"):e.setAttribute(n,"class",t)}(e,n,i),null!==o&&function xG(e,n,t){e.setAttribute(n,"style",t)}(e,n,o)}var Dl=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(Dl||{});function ec(e){const n=Vd();return n?n.sanitize(Dl.URL,e)||"":Ld(e,"URL")?zs(e):function Gg(e){return(e=String(e)).match(EG)?e:"unsafe:"+e}(Ot(e))}function m1(e){const n=Vd();if(n)return r1(n.sanitize(Dl.RESOURCE_URL,e)||"");if(Ld(e,"ResourceURL"))return r1(zs(e));throw new Pe(904,!1)}const GG=new Set(["embed","frame","iframe","media","script"]),VG=new Set(["base","link","script"]);function Vd(){const e=be();return e&&e[10].sanitizer}function xo(e){return e instanceof Function?e():e}function eV(e,n,t){let r=e.length;for(;;){const i=e.indexOf(n,t);if(-1===i)return i;if(0===i||e.charCodeAt(i-1)<=32){const o=n.length;if(i+o===r||e.charCodeAt(i+o)<=32)return i}t=i+1}}const v1="ng-template";function tV(e,n,t,r){let i=0;if(r){for(;i<n.length&&"string"==typeof n[i];i+=2)if("class"===n[i]&&-1!==eV(n[i+1].toLowerCase(),t,0))return!0}else if(Py(e))return!1;if(i=n.indexOf(1,i),i>-1){let o;for(;++i<n.length&&"string"==typeof(o=n[i]);)if(o.toLowerCase()===t)return!0}return!1}function Py(e){return 4===e.type&&e.value!==v1}function nV(e,n,t){return n===(4!==e.type||t?e.value:v1)}function rV(e,n,t){let r=4;const i=e.attrs,o=null!==i?function sV(e){for(let n=0;n<e.length;n++)if(hQ(e[n]))return n;return e.length}(i):0;let s=!1;for(let a=0;a<n.length;a++){const c=n[a];if("number"!=typeof c){if(!s)if(4&r){if(r=2|1&r,""!==c&&!nV(e,c,t)||""===c&&1===n.length){if(co(r))return!1;s=!0}}else if(8&r){if(null===i||!tV(e,i,c,t)){if(co(r))return!1;s=!0}}else{const l=n[++a],u=iV(c,i,Py(e),t);if(-1===u){if(co(r))return!1;s=!0;continue}if(""!==l){let d;if(d=u>o?"":i[u+1].toLowerCase(),2&r&&l!==d){if(co(r))return!1;s=!0}}}}else{if(!s&&!co(r)&&!co(c))return!1;if(s&&co(c))continue;s=!1,r=c|1&r}}return co(r)||s}function co(e){return!(1&e)}function iV(e,n,t,r){if(null===n)return-1;let i=0;if(r||!t){let o=!1;for(;i<n.length;){const s=n[i];if(s===e)return i;if(3===s||6===s)o=!0;else{if(1===s||2===s){let a=n[++i];for(;"string"==typeof a;)a=n[++i];continue}if(4===s)break;if(0===s){i+=4;continue}}i+=o?1:2}return-1}return function aV(e,n){let t=e.indexOf(4);if(t>-1)for(t++;t<e.length;){const r=e[t];if("number"==typeof r)return-1;if(r===n)return t;t++}return-1}(n,e)}function _1(e,n,t=!1){for(let r=0;r<n.length;r++)if(rV(e,n[r],t))return!0;return!1}function b1(e,n){return e?":not("+n.trim()+")":n}function lV(e){let n=e[0],t=1,r=2,i="",o=!1;for(;t<e.length;){let s=e[t];if("string"==typeof s)if(2&r){const a=e[++t];i+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else 8&r?i+="."+s:4&r&&(i+=" "+s);else""!==i&&!co(s)&&(n+=b1(o,i),i=""),r=s,o=o||!co(r);t++}return""!==i&&(n+=b1(o,i)),n}const Rt={};function Uy(e,n,t,r,i,o,s,a,c,l,u){const d=26+r,f=d+i,A=function AV(e,n){const t=[];for(let r=0;r<n;r++)t.push(r<e?null:Rt);return t}(d,f),p="function"==typeof l?l():l;return A[1]={type:e,blueprint:A,template:t,queries:null,viewQuery:a,declTNode:n,data:A.slice().fill(null,d),bindingStartIndex:d,expandoStartIndex:f,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof o?o():o,pipeRegistry:"function"==typeof s?s():s,firstChild:null,schemas:c,consts:p,incompleteFirstPass:!1,ssrId:u}}function Kg(e,n,t,r,i,o,s,a,c,l,u){const d=n.blueprint.slice();return d[0]=i,d[2]=1228|r,(null!==l||e&&2048&e[2])&&(d[2]|=2048),Zb(d),d[3]=d[14]=e,d[8]=t,d[10]=s||e&&e[10],d[11]=a||e&&e[11],d[9]=c||e&&e[9]||null,d[5]=o,d[19]=function ZL(){return $L++}(),d[6]=u,d[20]=l,d[15]=2==n.type?e[15]:d,d}function Hy(e){let n=16;return e.signals?n=4096:e.onPush&&(n=64),n}function qd(e,n,t,r){if(0===t)return-1;const i=n.length;for(let o=0;o<t;o++)n.push(r),e.blueprint.push(r),e.data.push(null);return i}function Ly(e,n){return e[12]?e[13][4]=n:e[12]=n,e[13]=n,n}function J(e=1){D1(bt(),be(),kr()+e,!1)}function D1(e,n,t,r){if(!r)if(3&~n[2]){const o=e.preOrderHooks;null!==o&&gg(n,o,0,t)}else{const o=e.preOrderCheckHooks;null!==o&&fg(n,o,t)}ja(t)}var Jg=function(e){return e[e.None=0]="None",e[e.SignalBased=1]="SignalBased",e[e.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",e}(Jg||{});function Gy(e,n,t,r){const i=ee(null);try{const[o,s,a]=e.inputs[t];let c=null;!!(s&Jg.SignalBased)&&(c=n[o][ne]),null!==c&&void 0!==c.transformFn?r=c.transformFn(r):null!==a&&(r=a.call(n,r)),null!==e.setInput?e.setInput(n,c,r,t,o):Kb(n,c,o,r)}finally{ee(i)}}function S1(e,n,t,r,i){const o=kr(),s=2&r;try{ja(-1),s&&n.length>26&&D1(e,n,26,!1),t(r,i)}finally{ja(o)}}function jg(e,n,t){(function yV(e,n,t){const r=t.directiveStart,i=t.directiveEnd;io(t)&&function fV(e,n,t){const r=Vr(n,e),i=function Q1(e){const n=e.tView;return null===n||n.incompleteFirstPass?e.tView=Uy(1,null,e.template,e.decls,e.vars,e.directiveDefs,e.pipeDefs,e.viewQuery,e.schemas,e.consts,e.id):n}(t),o=e[10].rendererFactory,s=Ly(e,Kg(e,i,null,Hy(t),r,n,null,o.createRenderer(r,t),null,null,null));e[n.index]=s}(n,t,e.data[r+t.componentOffset]),e.firstCreatePass||pg(t,n);const o=t.initialInputs;for(let s=r;s<i;s++){const a=e.data[s],c=wd(n,e,s,t);ci(c,n),null!==o&&wV(0,s-r,c,a,0,o),wi(a)&&(qr(t.index,n)[8]=wd(n,e,s,t))}})(e,n,t),!(64&~t.flags)&&function EV(e,n,t){const r=t.directiveStart,i=t.directiveEnd,o=t.index,s=function sL(){return kt.lFrame.currentDirectiveIndex}();try{ja(o);for(let a=r;a<i;a++){const c=e.data[a],l=n[a];bC(a),(null!==c.hostBindings||0!==c.hostVars||null!==c.hostAttrs)&&BV(c,l)}}finally{ja(-1),bC(s)}}(e,n,t)}function Vy(e,n,t=Vr){const r=n.localNames;if(null!==r){let i=n.index+1;for(let o=0;o<r.length;o+=2){const s=r[o+1],a=-1===s?t(n,e):e[s];e[i++]=a}}}let k1=()=>null;function ui(e,n,t,r,i,o,s,a){if(a||!Jy(n,e,t,r,i)){if(3&n.type){const c=Vr(n,t);r=function mV(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(r),i=null!=s?s(i,n.value||"",r):i,o.setProperty(c,r,i)}}else io(n)&&function CV(e,n){const t=qr(n,e);16&t[2]||(t[2]|=64)}(t,n.index)}function BV(e,n){null!==e.hostBindings&&e.hostBindings(1,n)}function qy(e,n){const t=e.directiveRegistry;let r=null;if(t)for(let i=0;i<t.length;i++){const o=t[i];_1(n,o.selectors,!1)&&(r??=[],wi(o)?r.unshift(o):r.push(o))}return r}function To(e,n,t,r,i,o){const s=Vr(e,n);!function zy(e,n,t,r,i,o,s){if(null==o)e.removeAttribute(n,i,t);else{const a=null==s?Ot(o):s(o,r||"",i);e.setAttribute(n,i,a,t)}}(n[11],s,o,e.value,t,r,i)}function wV(e,n,t,r,i,o){const s=o[n];if(null!==s)for(let a=0;a<s.length;a+=2)Gy(r,t,s[a],s[a+1])}function Jy(e,n,t,r,i){const o=e.inputs?.[r],s=e.hostDirectiveInputs?.[r];let a=!1;if(s)for(let c=0;c<s.length;c+=2){const l=s[c];Gy(n.data[l],t[l],s[c+1],i),a=!0}if(o)for(const c of o)Gy(n.data[c],t[c],r,i),a=!0;return a}function vV(e,n){const t=qr(n,e),r=t[1];!function _V(e,n){for(let t=n.length;t<e.blueprint.length;t++)n.push(e.blueprint[t])}(r,t);const i=t[0];null!==i&&null===t[6]&&(t[6]=null),Yg(r,t,t[8])}function Yg(e,n,t){SC(n);try{const r=e.viewQuery;null!==r&&by(1,r,t);const i=e.template;null!==i&&S1(e,n,i,1,t),e.firstCreatePass&&(e.firstCreatePass=!1),n[18]?.finishViewCreation(e),e.staticContentQueries&&WD(e,n),e.staticViewQueries&&by(2,e.viewQuery,t);const o=e.components;null!==o&&function bV(e,n){for(let t=0;t<n.length;t++)vV(e,n[t])}(n,o)}catch(r){throw e.firstCreatePass&&(e.incompleteFirstPass=!0,e.firstCreatePass=!1),r}finally{n[2]&=-5,kC()}}function kl(e,n,t,r){const i=ee(null);try{const o=n.tView,c=Kg(e,o,t,4096&e[2]?4096:16,null,n,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null);c[16]=e[n.index];const u=e[18];return null!==u&&(c[18]=u.createEmbeddedView(o)),Yg(o,c,t),c}finally{ee(i)}}function tc(e,n){return!n||null===n.firstChild||Dd(e)}function Yy(e,n){return undefined(e,n)}var Ks=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(Ks||{});function Js(e){return!(32&~e.flags)}function Ml(e,n,t,r,i){if(null!=r){let o,s=!1;gr(r)?o=r:Vn(r)&&(s=!0,r=r[0]);const a=Yt(r);0===e&&null!==t?null==i?g1(n,t,a):Xa(n,t,a,i||null,!0):1===e&&null!==t?Xa(n,t,a,i||null,!0):2===e?function Gd(e,n,t){e.removeChild(null,n,t)}(n,a,s):3===e&&n.destroyNode(a),null!=o&&function NV(e,n,t,r,i){const o=t[7];o!==Yt(t)&&Ml(n,e,r,o,i);for(let a=10;a<t.length;a++){const c=t[a];$g(c[1],c,e,n,r,o)}}(n,e,o,t,i)}}function x1(e,n){n[10].changeDetectionScheduler?.notify(9),$g(e,n,n[11],2,null,null)}function Wy(e,n){const t=e[9],r=t.indexOf(n);t.splice(r,1)}function zd(e,n){if(us(n))return;const t=n[11];t.destroyNode&&$g(e,n,t,3,null,null),function SV(e){let n=e[12];if(!n)return $y(e[1],e);for(;n;){let t=null;if(Vn(n))t=n[12];else{const r=n[10];r&&(t=r)}if(!t){for(;n&&!n[4]&&n!==e;)Vn(n)&&$y(n[1],n),n=n[3];null===n&&(n=e),Vn(n)&&$y(n[1],n),t=n&&n[4]}n=t}}(n)}function $y(e,n){if(us(n))return;const t=ee(null);try{n[2]&=-129,n[2]|=256,n[24]&&H(n[24]),function MV(e,n){let t;if(null!=e&&null!=(t=e.destroyHooks))for(let r=0;r<t.length;r+=2){const i=n[t[r]];if(!(i instanceof yd)){const o=t[r+1];if(Array.isArray(o))for(let s=0;s<o.length;s+=2){const a=i[o[s]],c=o[s+1];try{c.call(a)}finally{}}else try{o.call(i)}finally{}}}}(e,n),function kV(e,n){const t=e.cleanup,r=n[7];if(null!==t)for(let s=0;s<t.length-1;s+=2)if("string"==typeof t[s]){const a=t[s+3];a>=0?r[a]():r[-a].unsubscribe(),s+=2}else t[s].call(r[t[s+1]]);null!==r&&(n[7]=null);const i=n[21];if(null!==i){n[21]=null;for(let s=0;s<i.length;s++)(0,i[s])()}const o=n[23];if(null!==o){n[23]=null;for(const s of o)s.destroy()}}(e,n),1===n[1].type&&n[11].destroy();const r=n[16];if(null!==r&&gr(n[3])){r!==n[3]&&Wy(r,n);const i=n[18];null!==i&&i.detachView(e)}JC(n)}finally{ee(t)}}function Zy(e,n,t){return function T1(e,n,t){let r=n;for(;null!==r&&168&r.type;)r=(n=r).parent;if(null===r)return t[0];if(io(r)){const{encapsulation:i}=e.data[r.directiveStart+r.componentOffset];if(i===Ri.None||i===Ri.Emulated)return null}return Vr(r,t)}(e,n.parent,t)}let P1=function R1(e,n,t){return 40&e.type?Vr(e,t):null};function Wg(e,n,t,r){const i=Zy(e,r,n),o=n[11],a=function O1(e,n,t){return P1(e,n,t)}(r.parent||n[5],r,n);if(null!=i)if(Array.isArray(t))for(let c=0;c<t.length;c++)h1(o,i,t[c],a,!1);else h1(o,i,t,a,!1)}function nc(e,n){if(null!==n){const t=n.type;if(3&t)return Vr(n,e);if(4&t)return eE(-1,e[n.index]);if(8&t){const r=n.child;if(null!==r)return nc(e,r);{const i=e[n.index];return gr(i)?eE(-1,i):Yt(i)}}if(128&t)return nc(e,n.next);if(32&t)return Yy(n,e)()||Yt(e[n.index]);{const r=H1(e,n);return null!==r?Array.isArray(r)?r[0]:nc(ds(e[15]),r):nc(e,n.next)}}return null}function H1(e,n){return null!==n?e[15][5].projection[n.projection]:null}function eE(e,n){const t=10+e+1;if(t<n.length){const r=n[t],i=r[1].firstChild;if(null!==i)return nc(r,i)}return n[7]}function tE(e,n,t,r,i,o,s){for(;null!=t;){if(128===t.type){t=t.next;continue}const a=r[t.index],c=t.type;if(s&&0===n&&(a&&ci(Yt(a),r),t.flags|=2),!Js(t))if(8&c)tE(e,n,t.child,r,i,o,!1),Ml(n,e,i,a,o);else if(32&c){const l=Yy(t,r);let u;for(;u=l();)Ml(n,e,i,u,o);Ml(n,e,i,a,o)}else 16&c?L1(e,n,r,t,i,o):Ml(n,e,i,a,o);t=s?t.projectionNext:t.next}}function $g(e,n,t,r,i,o){tE(t,r,e.firstChild,n,i,o,!1)}function L1(e,n,t,r,i,o){const s=t[15],c=s[5].projection[r.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++)Ml(n,e,i,c[l],o);else{let l=c;const u=s[3];Dd(r)&&(l.flags|=128),tE(e,n,l,u,i,o,!0)}}function Fl(e,n,t,r,i=!1){for(;null!==t;){if(128===t.type){t=i?t.projectionNext:t.next;continue}const o=n[t.index];null!==o&&r.push(Yt(o)),gr(o)&&nE(o,r);const s=t.type;if(8&s)Fl(e,n,t.child,r);else if(32&s){const a=Yy(t,n);let c;for(;c=a();)r.push(c)}else if(16&s){const a=H1(n,t);if(Array.isArray(a))r.push(...a);else{const c=ds(n[15]);Fl(c[1],c,a,r,!0)}}t=i?t.projectionNext:t.next}return r}function nE(e,n){for(let t=10;t<e.length;t++){const r=e[t],i=r[1].firstChild;null!==i&&Fl(r[1],r,i,n)}e[7]!==e[0]&&n.push(e[7])}function G1(e){if(null!==e[25]){for(const n of e[25])n.impl.addSequence(n);e[25].length=0}}let V1=[];const PV={...W,consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:e=>{Al(e.lView)},consumerOnSignalRead(){this.lView[24]=this}},HV={...W,consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:e=>{let n=ds(e.lView);for(;n&&!q1(n[1]);)n=ds(n);n&&pC(n)},consumerOnSignalRead(){this.lView[24]=this}};function q1(e){return 2!==e.type}function z1(e){if(null===e[23])return;let n=!0;for(;n;){let t=!1;for(const r of e[23])r.dirty&&(t=!0,null===r.zone||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));n=t&&!!(8192&e[2])}}function Zg(e,n=!0,t=0){const i=e[10].rendererFactory;i.begin?.();try{!function GV(e,n){const t=rQ();try{dg(!0),rE(e,n);let r=0;for(;Id(e);){if(100===r)throw new Pe(103,!1);r++,rE(e,1)}}finally{dg(t)}}(e,t)}catch(s){throw n&&function Ky(e,n){const t=e[9],r=t?t.get(ao,null):null;r&&r.handleError(n)}(e,s),s}finally{i.end?.()}}function J1(e,n,t,r){if(us(n))return;const i=n[2];SC(n);let a=!0,c=null,l=null;q1(e)?(l=function TV(e){return e[24]??function OV(e){const n=V1.pop()??Object.create(PV);return n.lView=e,n}(e)}(n),c=Te(l)):null===function Ie(){return O}()?(a=!1,l=function UV(e){const n=e[24]??Object.create(HV);return n.lView=e,n}(n),c=Te(l)):n[24]&&(H(n[24]),n[24]=null);try{Zb(n),function iQ(e){return kt.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==t&&S1(e,n,t,2,r);const u=!(3&~i);if(u){const A=e.preOrderCheckHooks;null!==A&&fg(n,A,null)}else{const A=e.preOrderHooks;null!==A&&gg(n,A,0,null),FC(n,0)}if(function VV(e){for(let n=nD(e);null!==n;n=rD(n)){if(!(2&n[2]))continue;const t=n[9];for(let r=0;r<t.length;r++)pC(t[r])}}(n),z1(n),j1(n,0),null!==e.contentQueries&&WD(e,n),u){const A=e.contentCheckHooks;null!==A&&fg(n,A)}else{const A=e.contentHooks;null!==A&&gg(n,A,1),FC(n,1)}!function zV(e,n){const t=e.hostBindingOpCodes;if(null!==t)try{for(let r=0;r<t.length;r++){const i=t[r];if(i<0)ja(~i);else{const o=i,s=t[++r],a=t[++r];oL(s,o);const c=n[o];a(2,c)}}}finally{ja(-1)}}(e,n);const d=e.components;null!==d&&W1(n,d,0);const f=e.viewQuery;if(null!==f&&by(2,f,r),u){const A=e.viewCheckHooks;null!==A&&fg(n,A)}else{const A=e.viewHooks;null!==A&&gg(n,A,2),FC(n,2)}if(!0===e.firstUpdatePass&&(e.firstUpdatePass=!1),n[22]){for(const A of n[22])A();n[22]=null}G1(n),n[2]&=-73}catch(u){throw Al(n),u}finally{null!==l&&(q(l,c),a&&function RV(e){e.lView[24]!==e&&(e.lView=null,V1.push(e))}(l)),kC()}}function j1(e,n){for(let t=nD(e);null!==t;t=rD(t))for(let r=10;r<t.length;r++)Y1(t[r],n)}function qV(e,n,t){const r=qr(n,e);Y1(r,t)}function Y1(e,n){hC(e)&&rE(e,n)}function rE(e,n){const r=e[1],i=e[2],o=e[24];let s=!!(0===n&&16&i);if(s||=!!(64&i&&0===n),s||=!!(1024&i),s||=!(!o?.dirty||!j(o)),s||=!1,o&&(o.dirty=!1),e[2]&=-9217,s)J1(r,e,r.template,e[8]);else if(8192&i){z1(e),j1(e,1);const a=r.components;null!==a&&W1(e,a,1),G1(e)}}function W1(e,n,t){for(let r=0;r<n.length;r++)qV(e,n[r],t)}function Kd(e,n){const t=rQ()?64:1088;for(e[10].changeDetectionScheduler?.notify(n);e;){e[2]|=t;const r=ds(e);if(ls(e)&&!r)return e;e=r}return null}function $1(e,n,t,r){return[e,!0,0,n,null,r,null,t,null,null]}function Z1(e,n){const t=10+n;if(t<e.length)return e[t]}function Nl(e,n,t,r=!0){const i=n[1];if(function KV(e,n,t,r){const i=10+r,o=t.length;r>0&&(t[i-1][4]=n),r<o-10?(n[4]=t[i],kb(t,10+r,n)):(t.push(n),n[4]=null),n[3]=t;const s=n[16];null!==s&&t!==s&&X1(s,n);const a=n[18];null!==a&&a.insertView(e),IC(n),n[2]|=128}(i,n,e,t),r){const s=eE(t,e),a=n[11],c=a.parentNode(e[7]);null!==c&&function DV(e,n,t,r,i,o){r[0]=i,r[5]=n,$g(e,r,t,1,i,o)}(i,e[5],a,n,c,s)}const o=n[6];null!==o&&null!==o.firstChild&&(o.firstChild=null)}function iE(e,n){const t=Jd(e,n);return void 0!==t&&zd(t[1],t),t}function Jd(e,n){if(e.length<=10)return;const t=10+n,r=e[t];if(r){const i=r[16];null!==i&&i!==e&&Wy(i,r),n>0&&(e[t-1][4]=r[4]);const o=$f(e,10+n);!function N1(e,n){x1(e,n),n[0]=null,n[5]=null}(r[1],r);const s=o[18];null!==s&&s.detachView(o[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function X1(e,n){const t=e[9],r=n[3];(Vn(r)||n[15]!==r[3][15])&&(e[2]|=2),null===t?e[9]=[n]:t.push(n)}let jd=class{_lView;_cdRefInjectingView;notifyErrorHandler;_appRef=null;_attachedToViewContainer=!1;get rootNodes(){const n=this._lView,t=n[1];return Fl(t,n,t.firstChild,[])}constructor(n,t,r=!0){this._lView=n,this._cdRefInjectingView=t,this.notifyErrorHandler=r}get context(){return this._lView[8]}set context(n){this._lView[8]=n}get destroyed(){return us(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const n=this._lView[3];if(gr(n)){const t=n[8],r=t?t.indexOf(this):-1;r>-1&&(Jd(n,r),$f(t,r))}this._attachedToViewContainer=!1}zd(this._lView[1],this._lView)}onDestroy(n){lg(this._lView,n)}markForCheck(){Kd(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[2]&=-129}reattach(){IC(this._lView),this._lView[2]|=128}detectChanges(){this._lView[2]|=1024,Zg(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Pe(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;const n=ls(this._lView),t=this._lView[16];null!==t&&!n&&Wy(t,this._lView),x1(this._lView[1],this._lView)}attachToAppRef(n){if(this._attachedToViewContainer)throw new Pe(902,!1);this._appRef=n;const t=ls(this._lView),r=this._lView[16];null!==r&&!t&&X1(r,this._lView),IC(this._lView)}},ms=(()=>class e{static __NG_ELEMENT_ID__=YV})();const JV=ms,jV=class extends JV{_declarationLView;_declarationTContainer;elementRef;constructor(n,t,r){super(),this._declarationLView=n,this._declarationTContainer=t,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,t){return this.createEmbeddedViewImpl(n,t)}createEmbeddedViewImpl(n,t,r){const i=kl(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:t,dehydratedView:r});return new jd(i)}};function YV(){return Xg(Lt(),be())}function Xg(e,n){return 4&e.type?new jV(n,e,hl(e,n)):null}function xl(e,n,t,r,i){let o=e.data[n];if(null===o)o=function cE(e,n,t,r,i){const o=eQ(),s=vC(),c=e.data[n]=function oq(e,n,t,r,i,o){let s=n?n.injectorIndex:-1,a=0;return function Ja(){return null!==kt.skipHydrationRootTNode}()&&(a|=128),{type:t,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:i,attrs:o,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:n,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,s?o:o&&o.parent,t,n,r,i);return function iq(e,n,t,r){null===e.firstChild&&(e.firstChild=n),null!==t&&(r?null==t.child&&null!==n.parent&&(t.child=n):null===t.next&&(t.next=n,n.prev=t))}(e,c,o,s),c}(e,n,t,r,i),function iL(){return kt.lFrame.inI18n}()&&(o.flags|=32);else if(64&o.type){o.type=t,o.value=r,o.attrs=i;const s=function md(){const e=kt.lFrame,n=e.currentTNode;return e.isParent?n:n.parent}();o.injectorIndex=null===s?-1:s.injectorIndex}return so(o,!0),o}let zq=class{},BS=class{};class Kq{resolveComponentFactory(n){throw Error(`No component factory found for ${Ar(n)}.`)}}let sh=class{static NULL=new Kq};class pE{}let Cs=(()=>class e{destroyNode=null;static __NG_ELEMENT_ID__=()=>function Jq(){const e=be(),t=qr(Lt().index,e);return(Vn(t)?t:e)[11]}()})(),jq=(()=>{class e{static \u0275prov=rt({token:e,providedIn:"root",factory:()=>null})}return e})();const mE={};class Rl{injector;parentInjector;constructor(n,t){this.injector=n,this.parentInjector=t}get(n,t,r){r=Wf(r);const i=this.injector.get(n,mE,r);return i!==mE||t===mE?i:this.parentInjector.get(n,t,r)}}function CE(e,n,t){let r=t?e.styles:null,i=t?e.classes:null,o=0;if(null!==n)for(let s=0;s<n.length;s++){const a=n[s];"number"==typeof a?o=a:1==o?i=Hm(i,a):2==o&&(r=Hm(r,a+": "+n[++s]+";"))}t?e.styles=r:e.stylesWithoutHost=r,t?e.classes=i:e.classesWithoutHost=i}function ze(e,n=Ht.Default){const t=be();return null===t?_t(e,n):wQ(Lt(),t,St(e),n)}function yE(e,n,t,r,i){const o=null===r?null:{"":-1},s=i(e,t);if(null!==s){let a,c=null,l=null;const u=function Xq(e){let n=null,t=!1;for(let s=0;s<e.length;s++){const a=e[s];if(0===s&&wi(a)&&(n=a),null!==a.findHostDirectiveDefs){t=!0;break}}if(!t)return null;let r=null,i=null,o=null;for(const s of e)null!==s.findHostDirectiveDefs&&(r??=[],i??=new Map,o??=new Map,e5(s,r,o,i)),s===n&&(r??=[],r.push(s));return null!==r?(r.push(...null===n?e:e.slice(1)),[r,i,o]):null}(s);null===u?a=s:[a,c,l]=u,function n5(e,n,t,r,i,o,s){const a=r.length;let c=!1;for(let f=0;f<a;f++){const A=r[f];!c&&wi(A)&&(c=!0,t5(e,t,f)),PC(pg(t,n),e,A.type)}!function c5(e,n,t){e.flags|=1,e.directiveStart=n,e.directiveEnd=n+t,e.providerIndexes=n}(t,e.data.length,a);for(let f=0;f<a;f++){const A=r[f];A.providersResolver&&A.providersResolver(A)}let l=!1,u=!1,d=qd(e,n,a,null);a>0&&(t.directiveToIndex=new Map);for(let f=0;f<a;f++){const A=r[f];if(t.mergedAttrs=gl(t.mergedAttrs,A.hostAttrs),i5(e,t,n,d,A),a5(d,A,i),null!==s&&s.has(A)){const[C,E]=s.get(A);t.directiveToIndex.set(A.type,[d,C+t.directiveStart,E+t.directiveStart])}else(null===o||!o.has(A))&&t.directiveToIndex.set(A.type,d);null!==A.contentQueries&&(t.flags|=4),(null!==A.hostBindings||null!==A.hostAttrs||0!==A.hostVars)&&(t.flags|=64);const p=A.type.prototype;!l&&(p.ngOnChanges||p.ngOnInit||p.ngDoCheck)&&((e.preOrderHooks??=[]).push(t.index),l=!0),!u&&(p.ngOnChanges||p.ngDoCheck)&&((e.preOrderCheckHooks??=[]).push(t.index),u=!0),d++}!function r5(e,n,t){for(let r=n.directiveStart;r<n.directiveEnd;r++){const i=e.data[r];if(null!==t&&t.has(i)){const o=t.get(i);bS(0,n,o,r),bS(1,n,o,r),DS(n,r,!0)}else _S(0,n,i,r),_S(1,n,i,r),DS(n,r,!1)}}(e,t,o)}(e,n,t,a,o,c,l)}null!==o&&null!==r&&function Zq(e,n,t){const r=e.localNames=[];for(let i=0;i<n.length;i+=2){const o=t[n[i+1]];if(null==o)throw new Pe(-301,!1);r.push(n[i],o)}}(t,r,o)}function e5(e,n,t,r){const i=n.length;e.findHostDirectiveDefs(e,n,r),t.set(e,[i,n.length-1])}function t5(e,n,t){n.componentOffset=t,(e.components??=[]).push(n.index)}function _S(e,n,t,r){const i=0===e?t.inputs:t.outputs;for(const o in i)if(i.hasOwnProperty(o)){let s;s=0===e?n.inputs??={}:n.outputs??={},s[o]??=[],s[o].push(r),QS(n,o)}}function bS(e,n,t,r){const i=0===e?t.inputs:t.outputs;for(const o in i)if(i.hasOwnProperty(o)){const s=i[o];let a;a=0===e?n.hostDirectiveInputs??={}:n.hostDirectiveOutputs??={},a[s]??=[],a[s].push(r,o),QS(n,s)}}function QS(e,n){"class"===n?e.flags|=8:"style"===n&&(e.flags|=16)}function DS(e,n,t){const{attrs:r,inputs:i,hostDirectiveInputs:o}=e;if(null===r||!t&&null===i||t&&null===o||Py(e))return e.initialInputs??=[],void e.initialInputs.push(null);let s=null,a=0;for(;a<r.length;){const c=r[a];if(0!==c)if(5!==c){if("number"==typeof c)break;if(!t&&i.hasOwnProperty(c)){const l=i[c];for(const u of l)if(u===n){s??=[],s.push(c,r[a+1]);break}}else if(t&&o.hasOwnProperty(c)){const l=o[c];for(let u=0;u<l.length;u+=2)if(l[u]===n){s??=[],s.push(l[u+1],r[a+1]);break}}a+=2}else a+=2;else a+=4}e.initialInputs??=[],e.initialInputs.push(s)}function i5(e,n,t,r,i){e.data[r]=i;const o=i.factory||(i.factory=Pa(i.type)),s=new yd(o,wi(i),ze);e.blueprint[r]=s,t[r]=s,function o5(e,n,t,r,i){const o=i.hostBindings;if(o){let s=e.hostBindingOpCodes;null===s&&(s=e.hostBindingOpCodes=[]);const a=~n.index;(function s5(e){let n=e.length;for(;n>0;){const t=e[--n];if("number"==typeof t&&t<0)return t}return 0})(s)!=a&&s.push(a),s.push(t,r,o)}}(e,n,r,qd(e,t,i.hostVars,Rt),i)}function a5(e,n,t){if(t){if(n.exportAs)for(let r=0;r<n.exportAs.length;r++)t[n.exportAs[r]]=e;wi(n)&&(t[""]=e)}}function SS(e,n,t,r,i,o,s,a){const c=n.consts,u=xl(n,e,2,r,Ti(c,s));return o&&yE(n,t,u,Ti(c,a),i),u.mergedAttrs=gl(u.mergedAttrs,u.attrs),null!==u.attrs&&CE(u,u.attrs,!1),null!==u.mergedAttrs&&CE(u,u.mergedAttrs,!0),null!==n.queries&&n.queries.elementStart(n,u),u}function kS(e,n){MC(e,n),dC(n)&&e.queries.elementEnd(n)}class MS extends sh{ngModule;constructor(n){super(),this.ngModule=n}resolveComponentFactory(n){const t=Vt(n);return new iA(t,this.ngModule)}}class iA extends BS{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=function l5(e){return Object.keys(e).map(n=>{const[t,r,i]=e[n],o={propName:t,templateName:n,isSignal:!!(r&Jg.SignalBased)};return i&&(o.transform=i),o})}(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=function u5(e){return Object.keys(e).map(n=>({propName:e[n],templateName:n}))}(this.componentDef.outputs),this.cachedOutputs}constructor(n,t){super(),this.componentDef=n,this.ngModule=t,this.componentType=n.type,this.selector=function uV(e){return e.map(lV).join(",")}(n.selectors),this.ngContentSelectors=n.ngContentSelectors??[],this.isBoundToModule=!!t}create(n,t,r,i){const o=ee(null);try{const s=this.componentDef,a=r?["ng-version","19.2.20"]:function dV(e){const n=[],t=[];let r=1,i=2;for(;r<e.length;){let o=e[r];if("string"==typeof o)2===i?""!==o&&n.push(o,e[++r]):8===i&&t.push(o);else{if(!co(i))break;i=o}r++}return t.length&&n.push(1,...t),n}(this.componentDef.selectors[0]),c=Uy(0,null,null,1,0,null,null,null,null,[a],null),l=function d5(e,n,t){let r=n instanceof si?n:n?.injector;return r&&null!==e.getStandaloneInjector&&(r=e.getStandaloneInjector(r)||r),r?new Rl(t,r):t}(s,i||this.ngModule,n),u=function A5(e){const n=e.get(pE,null);if(null===n)throw new Pe(407,!1);return{rendererFactory:n,sanitizer:e.get(jq,null),changeDetectionScheduler:e.get(gs,null)}}(l),d=u.rendererFactory.createRenderer(null,s),f=r?function gV(e,n,t,r){const o=r.get(hD,!1)||t===Ri.ShadowDom,s=e.selectRootElement(n,o);return function hV(e){k1(e)}(s),s}(d,r,s.encapsulation,l):function f5(e,n){const t=(e.selectors[0][0]||"div").toLowerCase();return qg(n,t,"svg"===t?"svg":"math"===t?"math":null)}(s,d),A=Kg(null,c,null,512|Hy(s),null,null,u,d,l,null,null);A[26]=f,SC(A);let p=null;try{const C=SS(26,c,A,"#host",()=>[this.componentDef],!0,0);f&&(I1(d,f,C),ci(f,A)),jg(c,A,C),Qy(c,C,A),kS(c,C),void 0!==t&&function h5(e,n,t){const r=e.projection=[];for(let i=0;i<n.length;i++){const o=t[i];r.push(null!=o&&o.length?Array.from(o):null)}}(C,this.ngContentSelectors,t),p=qr(C.index,A),A[8]=p[8],Yg(c,A,null)}catch(C){throw null!==p&&JC(p),JC(A),C}finally{kC()}return new g5(this.componentType,A)}finally{ee(o)}}}class g5 extends zq{_rootLView;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(n,t){super(),this._rootLView=t,this._tNode=za(t[1],26),this.location=hl(this._tNode,t),this.instance=qr(this._tNode.index,t)[8],this.hostView=this.changeDetectorRef=new jd(t,void 0,!1),this.componentType=n}setInput(n,t){const r=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(n)&&Object.is(this.previousInputValues.get(n),t))return;const i=this._rootLView;Jy(r,i[1],i,n,t),this.previousInputValues.set(n,t),Kd(qr(r.index,i),1)}get injector(){return new qn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(n){this.hostView.onDestroy(n)}}let lo=(()=>class e{static __NG_ELEMENT_ID__=p5})();function p5(){return xS(Lt(),be())}const I5=lo,FS=class extends I5{_lContainer;_hostTNode;_hostLView;constructor(n,t,r){super(),this._lContainer=n,this._hostTNode=t,this._hostLView=r}get element(){return hl(this._hostTNode,this._hostLView)}get injector(){return new qn(this._hostTNode,this._hostLView)}get parentInjector(){const n=Ig(this._hostTNode,this._hostLView);if(TC(n)){const t=Bd(n,this._hostLView),r=Ed(n);return new qn(t[1].data[r+8],t)}return new qn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(n){const t=NS(this._lContainer);return null!==t&&t[n]||null}get length(){return this._lContainer.length-10}createEmbeddedView(n,t,r){let i,o;"number"==typeof r?i=r:null!=r&&(i=r.index,o=r.injector);const a=n.createEmbeddedViewImpl(t||{},o,null);return this.insertImpl(a,i,tc(this._hostTNode,null)),a}createComponent(n,t,r,i,o){const s=n&&!function hd(e){return"function"==typeof e}(n);let a;if(s)a=t;else{const p=t||{};a=p.index,r=p.injector,i=p.projectableNodes,o=p.environmentInjector||p.ngModuleRef}const c=s?n:new iA(Vt(n)),l=r||this.parentInjector;if(!o&&null==c.ngModule){const C=(s?l:this.parentInjector).get(si,null);C&&(o=C)}Vt(c.componentType??{});const A=c.create(l,i,null,o);return this.insertImpl(A.hostView,a,tc(this._hostTNode,null)),A}insert(n,t){return this.insertImpl(n,t,!0)}insertImpl(n,t,r){const i=n._lView;if(function j8(e){return gr(e[3])}(i)){const a=this.indexOf(n);if(-1!==a)this.detach(a);else{const c=i[3],l=new FS(c,c[5],c[3]);l.detach(l.indexOf(n))}}const o=this._adjustIndex(t),s=this._lContainer;return Nl(s,i,o,r),n.attachToViewContainerRef(),kb(EE(s),o,n),n}move(n,t){return this.insert(n,t)}indexOf(n){const t=NS(this._lContainer);return null!==t?t.indexOf(n):-1}remove(n){const t=this._adjustIndex(n,-1),r=Jd(this._lContainer,t);r&&($f(EE(this._lContainer),t),zd(r[1],r))}detach(n){const t=this._adjustIndex(n,-1),r=Jd(this._lContainer,t);return r&&null!=$f(EE(this._lContainer),t)?new jd(r):null}_adjustIndex(n,t=0){return n??this.length+t}};function NS(e){return e[8]}function EE(e){return e[8]||(e[8]=[])}function xS(e,n){let t;const r=n[e.index];return gr(r)?t=r:(t=$1(r,n,null,e),n[e.index]=t,Ly(n,t)),TS(t,n,e,r),new FS(t,e,n)}let TS=function RS(e,n,t,r){if(e[7])return;let i;i=8&t.type?Yt(r):function m5(e,n){const t=e[11],r=t.createComment(""),i=Vr(n,e),o=t.parentNode(i);return Xa(t,o,r,t.nextSibling(i),!1),r}(n,t),e[7]=i};class wE{queryList;matches=null;constructor(n){this.queryList=n}clone(){return new wE(this.queryList)}setDirty(){this.queryList.setDirty()}}class vE{queries;constructor(n=[]){this.queries=n}createEmbeddedView(n){const t=n.queries;if(null!==t){const r=null!==n.contentQueries?n.contentQueries[0]:t.length,i=[];for(let o=0;o<r;o++){const s=t.getByIndex(o);i.push(this.queries[s.indexInDeclarationView].clone())}return new vE(i)}return null}insertView(n){this.dirtyQueriesWithMatches(n)}detachView(n){this.dirtyQueriesWithMatches(n)}finishViewCreation(n){this.dirtyQueriesWithMatches(n)}dirtyQueriesWithMatches(n){for(let t=0;t<this.queries.length;t++)null!==SE(n,t).matches&&this.queries[t].setDirty()}}class PS{flags;read;predicate;constructor(n,t,r=null){this.flags=t,this.read=r,this.predicate="string"==typeof n?function b5(e){return e.split(",").map(n=>n.trim())}(n):n}}class _E{queries;constructor(n=[]){this.queries=n}elementStart(n,t){for(let r=0;r<this.queries.length;r++)this.queries[r].elementStart(n,t)}elementEnd(n){for(let t=0;t<this.queries.length;t++)this.queries[t].elementEnd(n)}embeddedTView(n){let t=null;for(let r=0;r<this.length;r++){const i=null!==t?t.length:0,o=this.getByIndex(r).embeddedTView(n,i);o&&(o.indexInDeclarationView=r,null!==t?t.push(o):t=[o])}return null!==t?new _E(t):null}template(n,t){for(let r=0;r<this.queries.length;r++)this.queries[r].template(n,t)}getByIndex(n){return this.queries[n]}get length(){return this.queries.length}track(n){this.queries.push(n)}}class bE{metadata;matches=null;indexInDeclarationView=-1;crossesNgTemplate=!1;_declarationNodeIndex;_appliesToNextNode=!0;constructor(n,t=-1){this.metadata=n,this._declarationNodeIndex=t}elementStart(n,t){this.isApplyingToNode(t)&&this.matchTNode(n,t)}elementEnd(n){this._declarationNodeIndex===n.index&&(this._appliesToNextNode=!1)}template(n,t){this.elementStart(n,t)}embeddedTView(n,t){return this.isApplyingToNode(n)?(this.crossesNgTemplate=!0,this.addMatch(-n.index,t),new bE(this.metadata)):null}isApplyingToNode(n){if(this._appliesToNextNode&&1&~this.metadata.flags){const t=this._declarationNodeIndex;let r=n.parent;for(;null!==r&&8&r.type&&r.index!==t;)r=r.parent;return t===(null!==r?r.index:-1)}return this._appliesToNextNode}matchTNode(n,t){const r=this.metadata.predicate;if(Array.isArray(r))for(let i=0;i<r.length;i++){const o=r[i];this.matchTNodeWithReadOption(n,t,B5(t,o)),this.matchTNodeWithReadOption(n,t,mg(t,n,o,!1,!1))}else r===ms?4&t.type&&this.matchTNodeWithReadOption(n,t,-1):this.matchTNodeWithReadOption(n,t,mg(t,n,r,!1,!1))}matchTNodeWithReadOption(n,t,r){if(null!==r){const i=this.metadata.read;if(null!==i)if(i===vi||i===lo||i===ms&&4&t.type)this.addMatch(t.index,-2);else{const o=mg(t,n,i,!1,!1);null!==o&&this.addMatch(t.index,o)}else this.addMatch(t.index,r)}}addMatch(n,t){null===this.matches?this.matches=[n,t]:this.matches.push(n,t)}}function B5(e,n){const t=e.localNames;if(null!==t)for(let r=0;r<t.length;r+=2)if(t[r]===n)return t[r+1];return null}function v5(e,n,t,r){return-1===t?function w5(e,n){return 11&e.type?hl(e,n):4&e.type?Xg(e,n):null}(n,e):-2===t?function _5(e,n,t){return t===vi?hl(n,e):t===ms?Xg(n,e):t===lo?xS(n,e):void 0}(e,n,r):wd(e,e[1],t,n)}function US(e,n,t,r){const i=n[18].queries[r];if(null===i.matches){const o=e.data,s=t.matches,a=[];for(let c=0;null!==s&&c<s.length;c+=2){const l=s[c];a.push(l<0?null:v5(n,o[l],s[c+1],t.metadata.read))}i.matches=a}return i.matches}function QE(e,n,t,r){const i=e.queries.getByIndex(t),o=i.matches;if(null!==o){const s=US(e,n,i,t);for(let a=0;a<o.length;a+=2){const c=o[a];if(c>0)r.push(s[a/2]);else{const l=o[a+1],u=n[-c];for(let d=10;d<u.length;d++){const f=u[d];f[16]===f[3]&&QE(f[1],f,l,r)}if(null!==u[9]){const d=u[9];for(let f=0;f<d.length;f++){const A=d[f];QE(A[1],A,l,r)}}}}}return r}function HS(e,n,t){const r=new YL(!(4&~t));return function Y8(e,n,t,r){const i=CC(n);i.push(t),e.firstCreatePass&&yC(e).push(r,i.length-1)}(e,n,r,r.destroy),(n[18]??=new vE).queries.push(new wE(r))-1}function VS(e,n,t){null===e.queries&&(e.queries=new _E),e.queries.track(new bE(n,t))}function SE(e,n){return e.queries.getByIndex(n)}function qS(e,n){const t=e[1],r=SE(t,n);return r.crossesNgTemplate?QE(t,e,n,[]):US(t,e,r,n)}let oc=class{},tk=class{};class FE extends oc{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new MS(this);constructor(n,t,r,i=!0){super(),this.ngModuleType=n,this._parent=t;const o=yi(n);this._bootstrapComponents=xo(o.bootstrap),this._r3Injector=NQ(n,t,[{provide:oc,useValue:this},{provide:sh,useValue:this.componentFactoryResolver},...r],Ar(n),new Set(["environment"])),i&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){const n=this._r3Injector;!n.destroyed&&n.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(n){this.destroyCbs.push(n)}}class NE extends tk{moduleType;constructor(n){super(),this.moduleType=n}create(n){return new FE(this.moduleType,n,[])}}class nk extends oc{injector;componentFactoryResolver=new MS(this);instance=null;constructor(n){super();const t=new La([...n.providers,{provide:oc,useValue:this},{provide:sh,useValue:this.componentFactoryResolver}],n.parent||ng(),n.debugName,new Set(["environment"]));this.injector=t,n.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(n){this.injector.onDestroy(n)}}function ch(e,n,t=null){return new nk({providers:e,parent:n,debugName:t,runEnvironmentInitializers:!0}).injector}let P5=(()=>{class e{_injector;cachedInjectors=new Map;constructor(t){this._injector=t}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t)){const r=tC(0,t.type),i=r.length>0?ch([r],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t,i)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(const t of this.cachedInjectors.values())null!==t&&t.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=rt({token:e,providedIn:"environment",factory:()=>new e(_t(si))})}return e})();function Wt(e){return ss(()=>{const n=rk(e),t={...n,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===Bg.OnPush,directiveDefs:null,pipeDefs:null,dependencies:n.standalone&&e.dependencies||null,getStandaloneInjector:n.standalone?i=>i.get(P5).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||Ri.Emulated,styles:e.styles||$t,_:null,schemas:e.schemas||null,tView:null,id:""};n.standalone&&li("NgStandalone"),ik(t);const r=e.dependencies;return t.directiveDefs=lh(r,!1),t.pipeDefs=lh(r,!0),t.id=function q5(e){let n=0;const r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,"function"==typeof e.consts?"":e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery];for(const o of r.join("|"))n=Math.imul(31,n)+o.charCodeAt(0)|0;return n+=2147483648,"c"+n}(t),t})}function U5(e){return Vt(e)||function Sr(e){return e[zm]||null}(e)}function H5(e){return null!==e}function Ul(e){return ss(()=>({type:e.type,bootstrap:e.bootstrap||$t,declarations:e.declarations||$t,imports:e.imports||$t,exports:e.exports||$t,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function L5(e,n){if(null==e)return to;const t={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r];let o,s,a,c;Array.isArray(i)?(a=i[0],o=i[1],s=i[2]??o,c=i[3]||null):(o=i,s=i,a=Jg.None,c=null),t[o]=[r,a,c],n[o]=s}return t}function G5(e){if(null==e)return to;const n={};for(const t in e)e.hasOwnProperty(t)&&(n[e[t]]=t);return n}function Mt(e){return ss(()=>{const n=rk(e);return ik(n),n})}function Or(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:e.standalone??!0,onDestroy:e.type.prototype.ngOnDestroy||null}}function rk(e){const n={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:n,inputConfig:e.inputs||to,exportAs:e.exportAs||null,standalone:e.standalone??!0,signals:!0===e.signals,selectors:e.selectors||$t,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:L5(e.inputs,n),outputs:G5(e.outputs),debugInfo:null}}function ik(e){e.features?.forEach(n=>n(e))}function lh(e,n){if(!e)return null;const t=n?Ei:U5;return()=>("function"==typeof e?e():e).map(r=>t(r)).filter(H5)}function Nt(e){let n=function ok(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),t=!0;const r=[e];for(;n;){let i;if(wi(e))i=n.\u0275cmp||n.\u0275dir;else{if(n.\u0275cmp)throw new Pe(903,!1);i=n.\u0275dir}if(i){if(t){r.push(i);const s=e;s.inputs=xE(e.inputs),s.declaredInputs=xE(e.declaredInputs),s.outputs=xE(e.outputs);const a=i.hostBindings;a&&Y5(e,a);const c=i.viewQuery,l=i.contentQueries;if(c&&J5(e,c),l&&j5(e,l),z5(e,i),XH(e.outputs,i.outputs),wi(i)&&i.data.animation){const u=e.data;u.animation=(u.animation||[]).concat(i.data.animation)}}const o=i.features;if(o)for(let s=0;s<o.length;s++){const a=o[s];a&&a.ngInherit&&a(e),a===Nt&&(t=!1)}}n=Object.getPrototypeOf(n)}!function K5(e){let n=0,t=null;for(let r=e.length-1;r>=0;r--){const i=e[r];i.hostVars=n+=i.hostVars,i.hostAttrs=gl(i.hostAttrs,t=gl(t,i.hostAttrs))}}(r)}function z5(e,n){for(const t in n.inputs){if(!n.inputs.hasOwnProperty(t)||e.inputs.hasOwnProperty(t))continue;const r=n.inputs[t];void 0!==r&&(e.inputs[t]=r,e.declaredInputs[t]=n.declaredInputs[t])}}function xE(e){return e===to?{}:e===$t?[]:e}function J5(e,n){const t=e.viewQuery;e.viewQuery=t?(r,i)=>{n(r,i),t(r,i)}:n}function j5(e,n){const t=e.contentQueries;e.contentQueries=t?(r,i,o)=>{n(r,i,o),t(r,i,o)}:n}function Y5(e,n){const t=e.hostBindings;e.hostBindings=t?(r,i)=>{n(r,i),t(r,i)}:n}function Oo(e,n,t){return e[n]=t}function zn(e,n,t){return!Object.is(e[n],t)&&(e[n]=t,!0)}function aA(e,n,t,r,i,o,s,a,c,l){const u=t+26,d=n.firstCreatePass?function i6(e,n,t,r,i,o,s,a,c){const l=n.consts,u=xl(n,e,4,s||null,a||null);wC()&&yE(n,t,u,Ti(l,c),qy),u.mergedAttrs=gl(u.mergedAttrs,u.attrs),MC(n,u);const d=u.tView=Uy(2,u,r,i,o,n.directiveRegistry,n.pipeRegistry,null,n.schemas,l,null);return null!==n.queries&&(n.queries.template(n,u),d.queries=n.queries.embeddedTView(u)),u}(u,n,e,r,i,o,s,a,c):n.data[u];so(d,!1);const f=uk(n,e,d,t);Cd()&&Wg(n,e,f,d),ci(f,e);const A=$1(f,e,f,d);return e[u]=A,Ly(e,A),ag(d)&&jg(n,e,d),null!=c&&Vy(e,d,l),d}function At(e,n,t,r,i,o,s,a){const c=be(),l=bt();return aA(c,l,e,n,t,r,i,Ti(l.consts,o),s,a),At}let uk=function dk(e,n,t,r){return Do(!0),n[11].createComment("")};let UE=(()=>{class e{log(t){console.log(t)}warn(t){console.warn(t)}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const vk=new $e("");let _k=(()=>{class e{static \u0275prov=rt({token:e,providedIn:"root",factory:()=>new rz})}return e})();class rz{queuedEffectCount=0;queues=new Map;schedule(n){this.enqueue(n)}remove(n){const r=this.queues.get(n.zone);r.has(n)&&(r.delete(n),this.queuedEffectCount--)}enqueue(n){const t=n.zone;this.queues.has(t)||this.queues.set(t,new Set);const r=this.queues.get(t);r.has(n)||(this.queuedEffectCount++,r.add(n))}flush(){for(;this.queuedEffectCount>0;)for(const[n,t]of this.queues)null===n?this.flushQueue(t):n.run(()=>this.flushQueue(t))}flushQueue(n){for(const t of n)n.delete(t),this.queuedEffectCount--,t.run()}}function lA(e){return!!e&&"function"==typeof e.then}function bk(e){return!!e&&"function"==typeof e.subscribe}const Qk=new $e("");function Dk(e){return Ls([{provide:Qk,multi:!0,useValue:e}])}let Sk=(()=>{class e{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((t,r)=>{this.resolve=t,this.reject=r});appInits=de(Qk,{optional:!0})??[];injector=de(hr);constructor(){}runInitializers(){if(this.initialized)return;const t=[];for(const i of this.appInits){const o=no(this.injector,i);if(lA(o))t.push(o);else if(bk(o)){const s=new Promise((a,c)=>{o.subscribe({complete:a,error:c})});t.push(s)}}const r=()=>{this.done=!0,this.resolve()};Promise.all(t).then(()=>{r()}).catch(i=>{this.reject(i)}),0===t.length&&r(),this.initialized=!0}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Gl=new $e("");let _i=(()=>{class e{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=de(qL);afterRenderManager=de(dy);zonelessEnabled=de(_d);rootEffectScheduler=de(_k);dirtyFlags=0;tracingSnapshot=null;externalTestViews=new Set;afterTick=new ni;get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];isStable=de(Wa).hasPendingTasks.pipe(cn(t=>!t));constructor(){de(Il,{optional:!0})}whenStable(){let t;return new Promise(r=>{t=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{t.unsubscribe()})}_injector=de(si);_rendererFactory=null;get injector(){return this._injector}bootstrap(t,r){return this.bootstrapImpl(t,r)}bootstrapImpl(t,r,i=hr.NULL){const o=t instanceof BS;if(!this._injector.get(Sk).done)throw new Pe(405,"");let a;a=o?t:this._injector.get(sh).resolveComponentFactory(t),this.componentTypes.push(a.componentType);const c=function iz(e){return e.isBoundToModule}(a)?void 0:this._injector.get(oc),u=a.create(i,[],r||a.selector,c),d=u.location.nativeElement,f=u.injector.get(vk,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),ph(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),u}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){null!==this.tracingSnapshot?this.tracingSnapshot.run(uy.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new Pe(101,!1);const t=ee(null);try{this._runningTick=!0,this.synchronize()}catch(r){this.internalErrorHandler(r)}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,ee(t),this.afterTick.next()}};synchronize(){null===this._rendererFactory&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(pE,null,{optional:!0}));let t=0;for(;0!==this.dirtyFlags&&t++<10;)this.synchronizeOnce()}synchronizeOnce(){if(16&this.dirtyFlags&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush()),7&this.dirtyFlags){const t=!!(1&this.dirtyFlags);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:r,notifyErrorHandler:i}of this.allViews)sz(r,i,t,this.zonelessEnabled);if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),23&this.dirtyFlags)return}else this._rendererFactory?.begin?.(),this._rendererFactory?.end?.();8&this.dirtyFlags&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){this.allViews.some(({_lView:t})=>Id(t))?this.dirtyFlags|=2:this.dirtyFlags&=-8}attachView(t){const r=t;this._views.push(r),r.attachToAppRef(this)}detachView(t){const r=t;ph(this._views,r),r.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Gl,[]).forEach(i=>i(t))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(t=>t()),this._views.slice().forEach(t=>t.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(t){return this._destroyListeners.push(t),()=>ph(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new Pe(406,!1);const t=this._injector;t.destroy&&!t.destroyed&&t.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function ph(e,n){const t=e.indexOf(n);t>-1&&e.splice(t,1)}function sz(e,n,t,r){(t||Id(e))&&Zg(e,n,t&&!r?0:1)}function Ro(e,n,t,r){const i=be();return zn(i,Oi(),n)&&(bt(),To(gn(),i,e,n,t,r)),Ro}function Ih(e,n){return e<<17|n<<2}function cc(e){return e>>17&32767}function WE(e){return 2|e}function Zl(e){return(131068&e)>>2}function $E(e,n){return-131069&e|n<<2}function ZE(e){return 1|e}function Yk(e,n,t,r){const i=e[t+1],o=null===n;let s=r?cc(i):Zl(i),a=!1;for(;0!==s&&(!1===a||o);){const l=e[s+1];Kz(e[s],n)&&(a=!0,e[s+1]=r?ZE(l):WE(l)),s=r?cc(l):Zl(l)}a&&(e[t+1]=r?WE(i):ZE(i))}function Kz(e,n){return null===e||null==n||(Array.isArray(e)?e[1]:e)===n||!(!Array.isArray(e)||"string"!=typeof n)&&fd(e,n)>=0}const pr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function Wk(e){return e.substring(pr.key,pr.keyEnd)}function $k(e,n){const t=pr.textEnd;return t===n?-1:(n=pr.keyEnd=function Wz(e,n,t){for(;n<t&&e.charCodeAt(n)>32;)n++;return n}(e,pr.key=n,t),Xl(e,n,t))}function Xl(e,n,t){for(;n<t&&e.charCodeAt(n)<=32;)n++;return n}function gt(e,n,t){const r=be();return zn(r,Oi(),n)&&ui(bt(),gn(),r,e,n,r[11],t,!1),gt}function XE(e,n,t,r,i){Jy(n,e,t,i?"class":"style",r)}function dA(e,n,t){return uo(e,n,t,!1),dA}function er(e,n){return uo(e,n,null,!0),er}function mh(e){!function Ao(e,n,t,r){const i=bt(),o=fs(2);i.firstUpdatePass&&rM(i,null,o,r);const s=be();if(t!==Rt&&zn(s,o,t)){const a=i.data[kr()];if(aM(a,r)&&!nM(i,o)){let c=r?a.classesWithoutHost:a.stylesWithoutHost;null!==c&&(t=Hm(c,t||"")),XE(i,a,s,t,r)}else!function sK(e,n,t,r,i,o,s,a){i===Rt&&(i=$t);let c=0,l=0,u=0<i.length?i[0]:null,d=0<o.length?o[0]:null;for(;null!==u||null!==d;){const f=c<i.length?i[c+1]:void 0,A=l<o.length?o[l+1]:void 0;let C,p=null;u===d?(c+=2,l+=2,f!==A&&(p=d,C=A)):null===d||null!==u&&u<d?(c+=2,p=u):(l+=2,p=d,C=A),null!==p&&oM(e,n,t,r,p,C,s,a),u=c<i.length?i[c]:null,d=l<o.length?o[l]:null}}(i,a,s,s[11],s[o+1],s[o+1]=function iK(e,n,t){if(null==t||""===t)return $t;const r=[],i=zs(t);if(Array.isArray(i))for(let o=0;o<i.length;o++)e(r,i[o],!0);else if("object"==typeof i)for(const o in i)i.hasOwnProperty(o)&&e(r,o,i[o]);else"string"==typeof i&&n(r,i);return r}(e,n,t),r,o)}}(oK,Uo,e,!0)}function Uo(e,n){for(let t=function jz(e){return function Xk(e){pr.key=0,pr.keyEnd=0,pr.value=0,pr.valueEnd=0,pr.textEnd=e.length}(e),$k(e,Xl(e,0,pr.textEnd))}(n);t>=0;t=$k(n,t))Ci(e,Wk(n),!0)}function uo(e,n,t,r){const i=be(),o=bt(),s=fs(2);o.firstUpdatePass&&rM(o,e,s,r),n!==Rt&&zn(i,s,n)&&oM(o,o.data[kr()],i,i[11],e,i[s+1]=function aK(e,n){return null==e||""===e||("string"==typeof n?e+=n:"object"==typeof e&&(e=Ar(zs(e)))),e}(n,t),r,s)}function nM(e,n){return n>=e.expandoStartIndex}function rM(e,n,t,r){const i=e.data;if(null===i[t+1]){const o=i[kr()],s=nM(e,t);aM(o,r)&&null===n&&!s&&(n=!1),n=function eK(e,n,t,r){const i=function QC(e){const n=kt.lFrame.currentDirectiveIndex;return-1===n?null:e[n]}(e);let o=r?n.residualClasses:n.residualStyles;if(null===i)0===(r?n.classBindings:n.styleBindings)&&(t=AA(t=eB(null,e,n,t,r),n.attrs,r),o=null);else{const s=n.directiveStylingLast;if(-1===s||e[s]!==i)if(t=eB(i,e,n,t,r),null===o){let c=function tK(e,n,t){const r=t?n.classBindings:n.styleBindings;if(0!==Zl(r))return e[cc(r)]}(e,n,r);void 0!==c&&Array.isArray(c)&&(c=eB(null,e,n,c[1],r),c=AA(c,n.attrs,r),function nK(e,n,t,r){e[cc(t?n.classBindings:n.styleBindings)]=r}(e,n,r,c))}else o=function rK(e,n,t){let r;const i=n.directiveEnd;for(let o=1+n.directiveStylingLast;o<i;o++)r=AA(r,e[o].hostAttrs,t);return AA(r,n.attrs,t)}(e,n,r)}return void 0!==o&&(r?n.residualClasses=o:n.residualStyles=o),t}(i,o,n,r),function qz(e,n,t,r,i,o){let s=o?n.classBindings:n.styleBindings,a=cc(s),c=Zl(s);e[r]=t;let u,l=!1;if(Array.isArray(t)?(u=t[1],(null===u||fd(t,u)>0)&&(l=!0)):u=t,i)if(0!==c){const f=cc(e[a+1]);e[r+1]=Ih(f,a),0!==f&&(e[f+1]=$E(e[f+1],r)),e[a+1]=function Gz(e,n){return 131071&e|n<<17}(e[a+1],r)}else e[r+1]=Ih(a,0),0!==a&&(e[a+1]=$E(e[a+1],r)),a=r;else e[r+1]=Ih(c,0),0===a?a=r:e[c+1]=$E(e[c+1],r),c=r;l&&(e[r+1]=WE(e[r+1])),Yk(e,u,r,!0),Yk(e,u,r,!1),function zz(e,n,t,r,i){const o=i?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof n&&fd(o,n)>=0&&(t[r+1]=ZE(t[r+1]))}(n,u,e,r,o),s=Ih(a,c),o?n.classBindings=s:n.styleBindings=s}(i,o,n,t,s,r)}}function eB(e,n,t,r,i){let o=null;const s=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a<s&&(o=n[a],r=AA(r,o.hostAttrs,i),o!==e);)a++;return null!==e&&(t.directiveStylingLast=a),r}function AA(e,n,t){const r=t?1:2;let i=-1;if(null!==n)for(let o=0;o<n.length;o++){const s=n[o];"number"==typeof s?i=s:i===r&&(Array.isArray(e)||(e=void 0===e?[]:["",e]),Ci(e,s,!!t||n[++o]))}return void 0===e?null:e}function oK(e,n,t){const r=String(n);""!==r&&!r.includes(" ")&&Ci(e,r,t)}function oM(e,n,t,r,i,o,s,a){if(!(3&n.type))return;const c=e.data,l=c[a+1],u=function Vz(e){return!(1&~e)}(l)?sM(c,n,t,i,Zl(l),s):void 0;Ch(u)||(Ch(o)||function Lz(e){return!(2&~e)}(l)&&(o=sM(c,null,t,i,a,s)),function xV(e,n,t,r,i){if(n)i?e.addClass(t,r):e.removeClass(t,r);else{let o=-1===r.indexOf("-")?void 0:Ks.DashCase;null==i?e.removeStyle(t,r,o):("string"==typeof i&&i.endsWith("!important")&&(i=i.slice(0,-10),o|=Ks.Important),e.setStyle(t,r,i,o))}}(r,s,dl(kr(),t),i,o))}function sM(e,n,t,r,i,o){const s=null===n;let a;for(;i>0;){const c=e[i],l=Array.isArray(c),u=l?c[1]:c,d=null===u;let f=t[i+1];f===Rt&&(f=d?$t:void 0);let A=d?Xm(f,r):u===r?f:void 0;if(l&&!Ch(A)&&(A=Xm(c,r)),Ch(A)&&(a=A,s))return a;const p=e[i+1];i=s?cc(p):Zl(p)}if(null!==n){let c=o?n.residualClasses:n.residualStyles;null!=c&&(a=Xm(c,r))}return a}function Ch(e){return void 0!==e}function aM(e,n){return!!(e.flags&(n?8:16))}class mK{destroy(n){}updateValue(n,t){}swap(n,t){const r=Math.min(n,t),i=Math.max(n,t),o=this.detach(i);if(i-r>1){const s=this.detach(r);this.attach(r,o),this.attach(i,s)}else this.attach(r,o)}move(n,t){this.attach(t,this.detach(n))}}function tB(e,n,t,r,i){return e===t&&Object.is(n,r)?1:Object.is(i(e,n),i(t,r))?-1:0}function nB(e,n,t,r){return!(void 0===n||!n.has(r)||(e.attach(t,n.get(r)),n.delete(r),0))}function cM(e,n,t,r,i){if(nB(e,n,r,t(r,i)))e.updateValue(r,i);else{const o=e.create(r,i);e.attach(r,o)}}function lM(e,n,t,r){const i=new Set;for(let o=n;o<=t;o++)i.add(r(o,e.at(o)));return i}class uM{kvMap=new Map;_vMap=void 0;has(n){return this.kvMap.has(n)}delete(n){if(!this.has(n))return!1;const t=this.kvMap.get(n);return void 0!==this._vMap&&this._vMap.has(t)?(this.kvMap.set(n,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(n),!0}get(n){return this.kvMap.get(n)}set(n,t){if(this.kvMap.has(n)){let r=this.kvMap.get(n);void 0===this._vMap&&(this._vMap=new Map);const i=this._vMap;for(;i.has(r);)r=i.get(r);i.set(r,t)}else this.kvMap.set(n,t)}forEach(n){for(let[t,r]of this.kvMap)if(n(r,t),void 0!==this._vMap){const i=this._vMap;for(;i.has(r);)r=i.get(r),n(r,t)}}}function tt(e,n){li("NgControlFlow");const t=be(),r=Oi(),i=t[r]!==Rt?t[r]:-1,o=-1!==i?yh(t,26+i):void 0;if(zn(t,r,e)){const a=ee(null);try{if(void 0!==o&&iE(o,0),-1!==e){const c=26+e,l=yh(t,c),u=rB(t[1],c),d=null;Nl(l,kl(t,u,n,{dehydratedView:d}),0,tc(u,d))}}finally{ee(a)}}else if(void 0!==o){const a=Z1(o,0);void 0!==a&&(a[8]=n)}}class yK{lContainer;$implicit;$index;constructor(n,t,r){this.lContainer=n,this.$implicit=t,this.$index=r}get $count(){return this.lContainer.length-10}}function eu(e,n){return n}class BK{hasEmptyBlock;trackByFn;liveCollection;constructor(n,t,r){this.hasEmptyBlock=n,this.trackByFn=t,this.liveCollection=r}}function Rr(e,n,t,r,i,o,s,a,c,l,u,d,f){li("NgControlFlow");const A=be(),p=bt(),C=void 0!==c,E=be(),Q=a?s.bind(E[15][8]):s,F=new BK(C,Q);E[26+e]=F,aA(A,p,e+1,n,t,r,i,Ti(p.consts,o)),C&&aA(A,p,e+2,c,l,u,d,Ti(p.consts,f))}class wK extends mK{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(n,t,r){super(),this.lContainer=n,this.hostLView=t,this.templateTNode=r}get length(){return this.lContainer.length-10}at(n){return this.getLView(n)[8].$implicit}attach(n,t){const r=t[6];this.needsIndexUpdate||=n!==this.length,Nl(this.lContainer,t,n,tc(this.templateTNode,r))}detach(n){return this.needsIndexUpdate||=n!==this.length-1,function vK(e,n){return Jd(e,n)}(this.lContainer,n)}create(n,t){const i=kl(this.hostLView,this.templateTNode,new yK(this.lContainer,t,n),{dehydratedView:null});return this.operationsCounter?.recordCreate(),i}destroy(n){zd(n[1],n),this.operationsCounter?.recordDestroy()}updateValue(n,t){this.getLView(n)[8].$implicit=t}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let n=0;n<this.length;n++)this.getLView(n)[8].$index=n}getLView(n){return function _K(e,n){return Z1(e,n)}(this.lContainer,n)}}function Pr(e){const n=ee(null),t=kr();try{const r=be(),i=r[1],o=r[t],s=t+1,a=yh(r,s);if(void 0===o.liveCollection){const l=rB(i,s);o.liveCollection=new wK(a,r,l)}else o.liveCollection.reset();const c=o.liveCollection;if(function CK(e,n,t){let r,i,o=0,s=e.length-1;if(Array.isArray(n)){let c=n.length-1;for(;o<=s&&o<=c;){const l=e.at(o),u=n[o],d=tB(o,l,o,u,t);if(0!==d){d<0&&e.updateValue(o,u),o++;continue}const f=e.at(s),A=n[c],p=tB(s,f,c,A,t);if(0!==p){p<0&&e.updateValue(s,A),s--,c--;continue}const C=t(o,l),E=t(s,f),Q=t(o,u);if(Object.is(Q,E)){const F=t(c,A);Object.is(F,C)?(e.swap(o,s),e.updateValue(s,A),c--,s--):e.move(s,o),e.updateValue(o,u),o++}else if(r??=new uM,i??=lM(e,o,s,t),nB(e,r,o,Q))e.updateValue(o,u),o++,s++;else if(i.has(Q))r.set(C,e.detach(o)),s--;else{const F=e.create(o,n[o]);e.attach(o,F),o++,s++}}for(;o<=c;)cM(e,r,t,o,n[o]),o++}else if(null!=n){const c=n[Symbol.iterator]();let l=c.next();for(;!l.done&&o<=s;){const u=e.at(o),d=l.value,f=tB(o,u,o,d,t);if(0!==f)f<0&&e.updateValue(o,d),o++,l=c.next();else{r??=new uM,i??=lM(e,o,s,t);const A=t(o,d);if(nB(e,r,o,A))e.updateValue(o,d),o++,s++,l=c.next();else if(i.has(A)){const p=t(o,u);r.set(p,e.detach(o)),s--}else e.attach(o,e.create(o,d)),o++,s++,l=c.next()}}for(;!l.done;)cM(e,r,t,e.length,l.value),l=c.next()}for(;o<=s;)e.destroy(e.detach(s--));r?.forEach(c=>{e.destroy(c)})}(c,e,o.trackByFn),c.updateIndexes(),o.hasEmptyBlock){const l=Oi(),u=0===c.length;if(zn(r,l,u)){const d=t+2,f=yh(r,d);if(u){const A=rB(i,d),p=null;Nl(f,kl(r,A,void 0,{dehydratedView:p}),0,tc(A,p))}else iE(f,0)}}}finally{ee(n)}}function yh(e,n){return e[n]}function rB(e,n){return za(e,n)}function y(e,n,t,r){const i=be(),o=bt(),s=26+e,a=i[11],c=o.firstCreatePass?SS(s,o,i,n,qy,wC(),t,r):o.data[s],l=dM(o,i,c,a,n,e);i[s]=l;const u=ag(c);return so(c,!0),I1(a,l,c),!Js(c)&&Cd()&&Wg(o,i,l,c),(0===function W8(){return kt.lFrame.elementDepthCount}()||u)&&ci(l,i),function $8(){kt.lFrame.elementDepthCount++}(),u&&(jg(o,i,c),Qy(o,c,i)),null!==r&&Vy(i,c),y}function v(){let e=Lt();vC()?_C():(e=e.parent,so(e,!1));const n=e;(function X8(e){return kt.skipHydrationRootTNode===e})(n)&&function rL(){kt.skipHydrationRootTNode=null}(),function Z8(){kt.lFrame.elementDepthCount--}();const t=bt();return t.firstCreatePass&&kS(t,n),null!=n.classesWithoutHost&&function pL(e){return!!(8&e.flags)}(n)&&XE(t,n,be(),n.classesWithoutHost,!0),null!=n.stylesWithoutHost&&function IL(e){return!!(16&e.flags)}(n)&&XE(t,n,be(),n.stylesWithoutHost,!1),v}function ot(e,n,t,r){return y(e,n,t,r),v(),ot}let dM=(e,n,t,r,i,o)=>(Do(!0),qg(r,i,function dQ(){return kt.lFrame.currentNamespace}()));function iB(e,n,t){const r=be(),i=bt(),o=e+26,s=i.firstCreatePass?function DK(e,n,t,r,i){const o=n.consts,s=Ti(o,r),a=xl(n,e,8,"ng-container",s);null!==s&&CE(a,s,!0);const c=Ti(o,i);return wC()&&yE(n,t,a,c,qy),a.mergedAttrs=gl(a.mergedAttrs,a.attrs),null!==n.queries&&n.queries.elementStart(n,a),a}(o,i,r,n,t):i.data[o];so(s,!0);const a=AM(i,r,s,e);return r[o]=a,Cd()&&Wg(i,r,a,s),ci(a,r),ag(s)&&(jg(i,r,s),Qy(i,s,r)),null!=t&&Vy(r,s),iB}function oB(){let e=Lt();const n=bt();return vC()?_C():(e=e.parent,so(e,!1)),n.firstCreatePass&&(MC(n,e),dC(e)&&n.queries.elementEnd(e)),oB}function sB(e,n,t){return iB(e,n,t),oB(),sB}let AM=(e,n,t,r)=>(Do(!0),Ry(n[11],""));function pt(){return be()}const lc=void 0;var FK=["en",[["a","p"],["AM","PM"],lc],[["AM","PM"],lc,lc],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],lc,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],lc,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",lc,"{1} 'at' {0}",lc],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function MK(e){const n=Math.floor(Math.abs(e)),t=e.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===t?1:5}];let tu={};function Jr(e){const n=function NK(e){return e.toLowerCase().replace(/_/g,"-")}(e);let t=pM(n);if(t)return t;const r=n.split("-")[0];if(t=pM(r),t)return t;if("en"===r)return FK;throw new Pe(701,!1)}function pM(e){return e in tu||(tu[e]=Gn.ng&&Gn.ng.common&&Gn.ng.common.locales&&Gn.ng.common.locales[e]),tu[e]}var _n=function(e){return e[e.LocaleId=0]="LocaleId",e[e.DayPeriodsFormat=1]="DayPeriodsFormat",e[e.DayPeriodsStandalone=2]="DayPeriodsStandalone",e[e.DaysFormat=3]="DaysFormat",e[e.DaysStandalone=4]="DaysStandalone",e[e.MonthsFormat=5]="MonthsFormat",e[e.MonthsStandalone=6]="MonthsStandalone",e[e.Eras=7]="Eras",e[e.FirstDayOfWeek=8]="FirstDayOfWeek",e[e.WeekendRange=9]="WeekendRange",e[e.DateFormat=10]="DateFormat",e[e.TimeFormat=11]="TimeFormat",e[e.DateTimeFormat=12]="DateTimeFormat",e[e.NumberSymbols=13]="NumberSymbols",e[e.NumberFormats=14]="NumberFormats",e[e.CurrencyCode=15]="CurrencyCode",e[e.CurrencySymbol=16]="CurrencySymbol",e[e.CurrencyName=17]="CurrencyName",e[e.Currencies=18]="Currencies",e[e.Directionality=19]="Directionality",e[e.PluralCase=20]="PluralCase",e[e.ExtraData=21]="ExtraData",e}(_n||{});const Eh="en-US";let IM=Eh;function OM(e,n,t){return function r(i){if(i===Function)return t;Kd(io(e)?qr(e.index,n):n,5);const s=n[8];let a=RM(n,s,t,i),c=r.__ngNextListenerFn__;for(;c;)a=RM(n,s,c,i)&&a,c=c.__ngNextListenerFn__;return a}}function RM(e,n,t,r){const i=ee(null);try{return!1!==t(r)}catch(o){return function yJ(e,n){const t=e[9],r=t?t.get(ao,null):null;r&&r.handleError(n)}(e,o),!1}finally{ee(i)}}function PM(e,n,t,r,i,o){const a=n[1],u=n[t][a.data[t].outputs[r]],d=a.firstCreatePass?yC(a):null,f=CC(n),A=u.subscribe(o),p=f.length;f.push(o,A),d&&d.push(i,e.index,p,-(p+1))}function _e(e,n,t,r){const i=be(),o=bt(),s=Lt();return lB(o,i,i[11],s,e,n,r),_e}function lB(e,n,t,r,i,o,s){const a=ag(r),l=e.firstCreatePass?yC(e):null,u=CC(n);let d=!0;if(3&r.type||s){const f=Vr(r,n),A=s?s(f):f,p=u.length,C=s?Q=>s(Yt(Q[r.index])):r.index;let E=null;if(!s&&a&&(E=function EJ(e,n,t,r){const i=e.cleanup;if(null!=i)for(let o=0;o<i.length-1;o+=2){const s=i[o];if(s===t&&i[o+1]===r){const a=n[7],c=i[o+2];return a.length>c?a[c]:null}"string"==typeof s&&(o+=2)}return null}(e,n,i,r.index)),null!==E)(E.__ngLastListenerFn__||E).__ngNextListenerFn__=o,E.__ngLastListenerFn__=o,d=!1;else{o=OM(r,n,o);const Q=t.listen(A,i,o);u.push(o,Q),l&&l.push(i,C,p,p+1)}}else o=OM(r,n,o);if(d){const f=r.outputs?.[i],A=r.hostDirectiveOutputs?.[i];if(A&&A.length)for(let p=0;p<A.length;p+=2)PM(r,n,A[p],A[p+1],i,o);if(f&&f.length)for(const p of f)PM(r,n,p,i,i,o)}}function Ee(e=1){return function cL(e){return(kt.lFrame.contextLView=function Xb(e,n){for(;e>0;)n=n[14],e--;return n}(e,kt.lFrame.contextLView))[8]}(e)}function YM(e,n,t,r){!function GS(e,n,t,r){const i=bt();if(i.firstCreatePass){const o=Lt();VS(i,new PS(n,t,r),o.index),function Q5(e,n){const t=e.contentQueries||(e.contentQueries=[]);n!==(t.length?t[t.length-1]:-1)&&t.push(e.queries.length-1,n)}(i,e),!(2&~t)&&(i.staticContentQueries=!0)}return HS(i,be(),t)}(e,n,t,r)}function uc(e,n,t){!function LS(e,n,t){const r=bt();return r.firstCreatePass&&(VS(r,new PS(e,n,t),-1),!(2&~n)&&(r.staticViewQueries=!0)),HS(r,be(),n)}(e,n,t)}function Zs(e){const n=be(),t=bt(),r=DC();Ag(r+1);const i=SE(t,r);if(e.dirty&&function J8(e){return!(4&~e[2])}(n)===!(2&~i.metadata.flags)){if(null===i.matches)e.reset([]);else{const o=qS(n,r);e.reset(o,zQ),e.notifyOnChanges()}return!0}return!1}function Xs(){return function DE(e,n){return e[18].queries[n].queryList}(be(),DC())}function Dn(e){return Ka(tQ(),26+e)}function R(e,n=""){const t=be(),r=bt(),i=e+26,o=r.firstCreatePass?xl(r,i,1,n,null):r.data[i],s=oF(r,t,o,n,e);t[i]=s,Cd()&&Wg(r,t,s,o),so(o,!1)}let oF=(e,n,t,r,i)=>(Do(!0),function Oy(e,n){return e.createText(n)}(n[11],r));function ft(e){return Zt("",e,""),ft}function Zt(e,n,t){const r=be(),i=function ql(e,n,t,r){return zn(e,Oi(),t)?n+Ot(t)+r:Rt}(r,e,n,t);return i!==Rt&&function ys(e,n,t){const r=dl(n,e);!function f1(e,n,t){e.setValue(n,t)}(e[11],r,t)}(r,kr(),i),Zt}function sn(e,n,t){JQ(n)&&(n=n());const r=be();return zn(r,Oi(),n)&&ui(bt(),gn(),r,e,n,r[11],t,!1),sn}function dn(e,n){const t=JQ(e);return t&&e.set(n),t}function an(e,n){const t=be(),r=bt(),i=Lt();return lB(r,t,t[11],i,e,n),an}const gF={};function bh(e){const n=bt(),t=be(),r=e+26;return so(xl(n,r,128,null,null),!1),gC(n,t,r,gF),bh}function dB(e,n,t,r,i){if(e=St(e),Array.isArray(e))for(let o=0;o<e.length;o++)dB(e[o],n,t,r,i);else{const o=bt(),s=be(),a=Lt();let c=Ha(e)?e:St(e.provide);const l=Pb(e),u=1048575&a.providerIndexes,d=a.directiveStart,f=a.providerIndexes>>20;if(Ha(e)||!e.multi){const A=new yd(l,i,ze),p=fB(c,n,i?u:u+f,d);-1===p?(PC(pg(a,s),o,c),AB(o,e,n.length),n.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(A),s.push(A)):(t[p]=A,s[p]=A)}else{const A=fB(c,n,u+f,d),p=fB(c,n,u,u+f),E=p>=0&&t[p];if(i&&!E||!i&&!(A>=0&&t[A])){PC(pg(a,s),o,c);const Q=function qJ(e,n,t,r,i){const o=new yd(e,t,ze);return o.multi=[],o.index=n,o.componentProviders=0,IF(o,i,r&&!t),o}(i?VJ:GJ,t.length,i,r,l);!i&&E&&(t[p].providerFactory=Q),AB(o,e,n.length,0),n.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(Q),s.push(Q)}else AB(o,e,A>-1?A:p,IF(t[i?p:A],l,!i&&r));!i&&r&&E&&t[p].componentProviders++}}}function AB(e,n,t,r){const i=Ha(n),o=function v8(e){return!!e.useClass}(n);if(i||o){const c=(o?St(n.useClass):n).prototype.ngOnDestroy;if(c){const l=e.destroyHooks||(e.destroyHooks=[]);if(!i&&n.multi){const u=l.indexOf(t);-1===u?l.push(t,[r,c]):l[u+1].push(r,c)}else l.push(t,c)}}}function IF(e,n,t){return t&&e.componentProviders++,e.multi.push(n)-1}function fB(e,n,t,r){for(let i=t;i<r;i++)if(n[i]===e)return i;return-1}function GJ(e,n,t,r,i){return gB(this.multi,[])}function VJ(e,n,t,r,i){const o=this.multi;let s;if(this.providerFactory){const a=this.providerFactory.componentProviders,c=wd(r,r[1],this.providerFactory.index,i);s=c.slice(0,a),gB(o,s);for(let l=a;l<c.length;l++)s.push(c[l])}else s=[],gB(o,s);return s}function gB(e,n){for(let t=0;t<e.length;t++)n.push((0,e[t])());return n}function xn(e,n=[]){return t=>{t.providersResolver=(r,i)=>function LJ(e,n,t){const r=bt();if(r.firstCreatePass){const i=wi(e);dB(t,r.data,r.blueprint,i,!0),dB(n,r.data,r.blueprint,i,!1)}}(r,i?i(e):e,n)}}function IA(e,n){const t=e[n];return t===Rt?void 0:t}function EF(e,n,t,r,i,o){const s=n+t;return zn(e,s,i)?Oo(e,s+1,o?r.call(o,i):r(i)):IA(e,s+1)}function BF(e,n,t,r,i,o,s){const a=n+t;return function sc(e,n,t,r){const i=zn(e,n,t);return zn(e,n+1,r)||i}(e,a,i,o)?Oo(e,a+2,s?r.call(s,i,o):r(i,o)):IA(e,a+2)}function mA(e,n){const t=bt();let r;const i=e+26;t.firstCreatePass?(r=function nj(e,n){if(n)for(let t=n.length-1;t>=0;t--){const r=n[t];if(e===r.name)return r}}(n,t.pipeRegistry),t.data[i]=r,r.onDestroy&&(t.destroyHooks??=[]).push(i,r.onDestroy)):r=t.data[i];const o=r.factory||(r.factory=Pa(r.type)),a=ii(ze);try{const c=hg(!1),l=o();return hg(c),gC(t,be(),i,l),l}finally{ii(a)}}function hB(e,n,t){const r=e+26,i=be(),o=Ka(i,r);return CA(i,r)?EF(i,zr(),n,o.transform,t,o):o.transform(t)}function pB(e,n,t,r){const i=e+26,o=be(),s=Ka(o,i);return CA(o,i)?BF(o,zr(),n,s.transform,t,r,s):s.transform(t,r)}function CA(e,n){return e[1].data[n].pure}function bF(e,n){return Xg(e,n)}class Nj{ngModuleFactory;componentFactories;constructor(n,t){this.ngModuleFactory=n,this.componentFactories=t}}let xj=(()=>{class e{compileModuleSync(t){return new NE(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){const r=this.compileModuleSync(t),o=xo(yi(t).declarations).reduce((s,a)=>{const c=Vt(a);return c&&s.push(new iA(c)),s},[]);return new Nj(r,o)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Rj=(()=>{class e{zone=de(tn);changeDetectionScheduler=de(gs);applicationRef=de(_i);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Pj=new $e("",{factory:()=>!1});function EB({ngZoneFactory:e,ignoreChangesOutsideZone:n,scheduleInRootZone:t}){return e??=()=>new tn({...BB(),scheduleInRootZone:t}),[{provide:tn,useFactory:e},{provide:xi,multi:!0,useFactory:()=>{const r=de(Rj,{optional:!0});return()=>r.initialize()}},{provide:xi,multi:!0,useFactory:()=>{const r=de(Hj);return()=>{r.initialize()}}},!0===n?{provide:OQ,useValue:!0}:[],{provide:LC,useValue:t??xQ}]}function BB(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}let Hj=(()=>{class e{subscription=new m;initialized=!1;zone=de(tn);pendingTasks=de(Wa);initialize(){if(this.initialized)return;this.initialized=!0;let t=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(t=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{tn.assertNotInAngularZone(),queueMicrotask(()=>{null!==t&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(t),t=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{tn.assertInAngularZone(),t??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),EA=(()=>{class e{appRef=de(_i);taskService=de(Wa);ngZone=de(tn);zonelessEnabled=de(_d);tracing=de(Il,{optional:!0});disableScheduling=de(OQ,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new m;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(yg):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(de(LC,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof zC||!this.zoneIsDefined)}notify(t){if(!this.zonelessEnabled&&5===t)return;let r=!1;switch(t){case 0:this.appRef.dirtyFlags|=2;break;case 3:case 2:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 6:case 13:this.appRef.dirtyFlags|=2,r=!0;break;case 12:this.appRef.dirtyFlags|=16,r=!0;break;case 11:r=!0;break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(r))return;const i=this.useMicrotaskScheduler?UQ:PQ;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>i(()=>this.tick())):this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(t){return!(this.disableScheduling&&!t||this.appRef.destroyed||null!==this.pendingRenderTaskId||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(yg+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(0===this.appRef.dirtyFlags)return void this.cleanup();!this.zonelessEnabled&&7&this.appRef.dirtyFlags&&(this.appRef.dirtyFlags|=1);const t=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(r){throw this.taskService.remove(t),r}finally{this.cleanup()}this.useMicrotaskScheduler=!0,UQ(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(t)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,null!==this.pendingRenderTaskId){const t=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(t)}}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const ea=new $e("",{providedIn:"root",factory:()=>de(ea,Ht.Optional|Ht.SkipSelf)||function Lj(){return typeof $localize<"u"&&$localize.locale||Eh}()}),Mh=new $e(""),Jj=new $e("");function BA(e){return!e.moduleRef}let ru=null;let wA=(()=>class e{static __NG_ELEMENT_ID__=Xj})();function Xj(e){return function eY(e,n,t){if(io(e)&&!t){const r=qr(e.index,n);return new jd(r,r)}return 175&e.type?new jd(n[15],n):null}(Lt(),be(),!(16&~e))}function AY(e){const{rootComponent:n,appProviders:t,platformProviders:r,platformRef:i}=e;try{const o=i?.injector??function Zj(e=[]){if(ru)return ru;const n=function WF(e=[],n){return hr.create({name:n,providers:[{provide:iC,useValue:"platform"},{provide:Mh,useValue:new Set([()=>ru=null])},...e]})}(e);return ru=n,function kk(){!function V(e){N=e}(()=>{throw new Pe(600,!1)})}(),function $F(e){const n=e.get(ZC,null);no(e,()=>{n?.forEach(t=>t())})}(n),n}(r),s=[EB({}),{provide:gs,useExisting:EA},...t||[]];return function jF(e){const n=BA(e)?e.r3Injector:e.moduleRef.injector,t=n.get(tn);return t.run(()=>{BA(e)?e.r3Injector.resolveInjectorInitializers():e.moduleRef.resolveInjectorInitializers();const r=n.get(ao,null);let i;if(t.runOutsideAngular(()=>{i=t.onError.subscribe({next:o=>{r.handleError(o)}})}),BA(e)){const o=()=>n.destroy(),s=e.platformInjector.get(Mh);s.add(o),n.onDestroy(()=>{i.unsubscribe(),s.delete(o)})}else{const o=()=>e.moduleRef.destroy(),s=e.platformInjector.get(Mh);s.add(o),e.moduleRef.onDestroy(()=>{ph(e.allPlatformModules,e.moduleRef),i.unsubscribe(),s.delete(o)})}return function Yj(e,n,t){try{const r=t();return lA(r)?r.catch(i=>{throw n.runOutsideAngular(()=>e.handleError(i)),i}):r}catch(r){throw n.runOutsideAngular(()=>e.handleError(r)),r}}(r,t,()=>{const o=n.get(Sk);return o.runInitializers(),o.donePromise.then(()=>{if(function RK(e){"string"==typeof e&&(IM=e.toLowerCase().replace(/_/g,"-"))}(n.get(ea,Eh)||Eh),!n.get(Jj,!0))return BA(e)?n.get(_i):(e.allPlatformModules.push(e.moduleRef),e.moduleRef);if(BA(e)){const c=n.get(_i);return void 0!==e.rootComponent&&c.bootstrap(e.rootComponent),c}return function jj(e,n){const t=e.injector.get(_i);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(r=>t.bootstrap(r));else{if(!e.instance.ngDoBootstrap)throw new Pe(-403,!1);e.instance.ngDoBootstrap(t)}n.push(e)}(e.moduleRef,e.allPlatformModules),e.moduleRef})})})}({r3Injector:new nk({providers:s,parent:o,debugName:"",runEnvironmentInitializers:!1}).injector,platformInjector:o,rootComponent:n})}catch(o){return Promise.reject(o)}}function iu(e){return"boolean"==typeof e?e:null!=e&&"false"!==e}function or(e){return function fn(e){const n=ee(null);try{return e()}finally{ee(n)}}(e)}function Es(e,n){return function re(e,n){const t=Object.create(Me);t.computation=e,void 0!==n&&(t.equal=n);const r=()=>{if(fe(t),oe(t),t.value===pe)throw t.error;return t.value};return r[ne]=t,r}(e,n?.equal)}const Ui=new $e("");let QN=null;function ta(){return QN}class nW{}let MB=(()=>{class e{historyGo(t){throw new Error("")}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:()=>de(iW),providedIn:"platform"})}return e})();const rW=new $e("");let iW=(()=>{class e extends MB{_location;_history;_doc=de(Ui);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ta().getBaseHref(this._doc)}onPopState(t){const r=ta().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",t,!1),()=>r.removeEventListener("popstate",t)}onHashChange(t){const r=ta().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",t,!1),()=>r.removeEventListener("hashchange",t)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(t){this._location.pathname=t}pushState(t,r,i){this._history.pushState(t,r,i)}replaceState(t,r,i){this._history.replaceState(t,r,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:()=>new e,providedIn:"platform"})}return e})();function FB(e,n){return e?n?e.endsWith("/")?n.startsWith("/")?e+n.slice(1):e+n:n.startsWith("/")?e+n:`${e}/${n}`:e:n}function DN(e){const n=e.search(/#|\?|$/);return"/"===e[n-1]?e.slice(0,n-1)+e.slice(n):e}function Bs(e){return e&&"?"!==e[0]?`?${e}`:e}let Ac=(()=>{class e{historyGo(t){throw new Error("")}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:()=>de(kN),providedIn:"root"})}return e})();const SN=new $e("");let kN=(()=>{class e extends Ac{_platformLocation;_baseHref;_removeListenerFns=[];constructor(t,r){super(),this._platformLocation=t,this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??de(Ui).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return FB(this._baseHref,t)}path(t=!1){const r=this._platformLocation.pathname+Bs(this._platformLocation.search),i=this._platformLocation.hash;return i&&t?`${r}${i}`:r}pushState(t,r,i,o){const s=this.prepareExternalUrl(i+Bs(o));this._platformLocation.pushState(t,r,s)}replaceState(t,r,i,o){const s=this.prepareExternalUrl(i+Bs(o));this._platformLocation.replaceState(t,r,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(r){return new(r||e)(_t(MB),_t(SN,8))};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),_A=(()=>{class e{_subject=new ni;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(t){this._locationStrategy=t;const r=this._locationStrategy.getBaseHref();this._basePath=function aW(e){if(new RegExp("^(https?:)?//").test(e)){const[,t]=e.split(/\/\/[^\/]+/);return t}return e}(DN(MN(r))),this._locationStrategy.onPopState(i=>{this._subject.next({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,r=""){return this.path()==this.normalize(t+Bs(r))}normalize(t){return e.stripTrailingSlash(function sW(e,n){if(!e||!n.startsWith(e))return n;const t=n.substring(e.length);return""===t||["/",";","?","#"].includes(t[0])?t:n}(this._basePath,MN(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,r="",i=null){this._locationStrategy.pushState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Bs(r)),i)}replaceState(t,r="",i=null){this._locationStrategy.replaceState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Bs(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(t=0){this._locationStrategy.historyGo?.(t)}onUrlChange(t){return this._urlChangeListeners.push(t),this._urlChangeSubscription??=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}),()=>{const r=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(r,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",r){this._urlChangeListeners.forEach(i=>i(t,r))}subscribe(t,r,i){return this._subject.subscribe({next:t,error:r??void 0,complete:i??void 0})}static normalizeQueryParams=Bs;static joinWithSlash=FB;static stripTrailingSlash=DN;static \u0275fac=function(r){return new(r||e)(_t(Ac))};static \u0275prov=rt({token:e,factory:()=>function oW(){return new _A(_t(Ac))}(),providedIn:"root"})}return e})();function MN(e){return e.replace(/\/index.html$/,"")}function NN(e){return"server"===e}const NB=new $e("");let xN=(()=>{class e{_zone;_plugins;_eventNameToPlugin=new Map;constructor(t,r){this._zone=r,t.forEach(i=>{i.manager=this}),this._plugins=t.slice().reverse()}addEventListener(t,r,i,o){return this._findPluginFor(r).addEventListener(t,r,i,o)}getZone(){return this._zone}_findPluginFor(t){let r=this._eventNameToPlugin.get(t);if(r)return r;if(r=this._plugins.find(o=>o.supports(t)),!r)throw new Pe(5101,!1);return this._eventNameToPlugin.set(t,r),r}static \u0275fac=function(r){return new(r||e)(_t(NB),_t(tn))};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})();class TN{_doc;constructor(n){this._doc=n}manager}const Hh="ng-app-id";function ON(e){for(const n of e)n.remove()}function RN(e,n){const t=n.createElement("style");return t.textContent=e,t}function xB(e,n){const t=n.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",e),t}let PN=(()=>{class e{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(t,r,i,o={}){this.doc=t,this.appId=r,this.nonce=i,this.isServer=NN(o),function dW(e,n,t,r){const i=e.head?.querySelectorAll(`style[${Hh}="${n}"],link[${Hh}="${n}"]`);if(i)for(const o of i)o.removeAttribute(Hh),o instanceof HTMLLinkElement?r.set(o.href.slice(o.href.lastIndexOf("/")+1),{usage:0,elements:[o]}):o.textContent&&t.set(o.textContent,{usage:0,elements:[o]})}(t,r,this.inline,this.external),this.hosts.add(t.head)}addStyles(t,r){for(const i of t)this.addUsage(i,this.inline,RN);r?.forEach(i=>this.addUsage(i,this.external,xB))}removeStyles(t,r){for(const i of t)this.removeUsage(i,this.inline);r?.forEach(i=>this.removeUsage(i,this.external))}addUsage(t,r,i){const o=r.get(t);o?o.usage++:r.set(t,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,i(t,this.doc)))})}removeUsage(t,r){const i=r.get(t);i&&(i.usage--,i.usage<=0&&(ON(i.elements),r.delete(t)))}ngOnDestroy(){for(const[,{elements:t}]of[...this.inline,...this.external])ON(t);this.hosts.clear()}addHost(t){this.hosts.add(t);for(const[r,{elements:i}]of this.inline)i.push(this.addElement(t,RN(r,this.doc)));for(const[r,{elements:i}]of this.external)i.push(this.addElement(t,xB(r,this.doc)))}removeHost(t){this.hosts.delete(t)}addElement(t,r){return this.nonce&&r.setAttribute("nonce",this.nonce),this.isServer&&r.setAttribute(Hh,this.appId),t.appendChild(r)}static \u0275fac=function(r){return new(r||e)(_t(Ui),_t(hs),_t(dD,8),_t(XC))};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})();const TB={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},OB=/%COMP%/g,IW=new $e("",{providedIn:"root",factory:()=>!0});function HN(e,n){return n.map(t=>t.replace(OB,e))}let LN=(()=>{class e{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(t,r,i,o,s,a,c,l=null,u=null){this.eventManager=t,this.sharedStylesHost=r,this.appId=i,this.removeStylesOnCompDestroy=o,this.doc=s,this.platformId=a,this.ngZone=c,this.nonce=l,this.tracingService=u,this.platformIsServer=NN(a),this.defaultRenderer=new RB(t,s,c,this.platformIsServer,this.tracingService)}createRenderer(t,r){if(!t||!r)return this.defaultRenderer;this.platformIsServer&&r.encapsulation===Ri.ShadowDom&&(r={...r,encapsulation:Ri.Emulated});const i=this.getOrCreateRenderer(t,r);return i instanceof VN?i.applyToHost(t):i instanceof PB&&i.applyStyles(),i}getOrCreateRenderer(t,r){const i=this.rendererByCompId;let o=i.get(r.id);if(!o){const s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,u=this.removeStylesOnCompDestroy,d=this.platformIsServer,f=this.tracingService;switch(r.encapsulation){case Ri.Emulated:o=new VN(c,l,r,this.appId,u,s,a,d,f);break;case Ri.ShadowDom:return new EW(c,l,t,r,s,a,this.nonce,d,f);default:o=new PB(c,l,r,u,s,a,d,f)}i.set(r.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(t){this.rendererByCompId.delete(t)}static \u0275fac=function(r){return new(r||e)(_t(xN),_t(PN),_t(hs),_t(IW),_t(Ui),_t(XC),_t(tn),_t(dD),_t(Il,8))};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})();class RB{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(n,t,r,i,o){this.eventManager=n,this.doc=t,this.ngZone=r,this.platformIsServer=i,this.tracingService=o}destroy(){}destroyNode=null;createElement(n,t){return t?this.doc.createElementNS(TB[t]||t,n):this.doc.createElement(n)}createComment(n){return this.doc.createComment(n)}createText(n){return this.doc.createTextNode(n)}appendChild(n,t){(GN(n)?n.content:n).appendChild(t)}insertBefore(n,t,r){n&&(GN(n)?n.content:n).insertBefore(t,r)}removeChild(n,t){t.remove()}selectRootElement(n,t){let r="string"==typeof n?this.doc.querySelector(n):n;if(!r)throw new Pe(-5104,!1);return t||(r.textContent=""),r}parentNode(n){return n.parentNode}nextSibling(n){return n.nextSibling}setAttribute(n,t,r,i){if(i){t=i+":"+t;const o=TB[i];o?n.setAttributeNS(o,t,r):n.setAttribute(t,r)}else n.setAttribute(t,r)}removeAttribute(n,t,r){if(r){const i=TB[r];i?n.removeAttributeNS(i,t):n.removeAttribute(`${r}:${t}`)}else n.removeAttribute(t)}addClass(n,t){n.classList.add(t)}removeClass(n,t){n.classList.remove(t)}setStyle(n,t,r,i){i&(Ks.DashCase|Ks.Important)?n.style.setProperty(t,r,i&Ks.Important?"important":""):n.style[t]=r}removeStyle(n,t,r){r&Ks.DashCase?n.style.removeProperty(t):n.style[t]=""}setProperty(n,t,r){null!=n&&(n[t]=r)}setValue(n,t){n.nodeValue=t}listen(n,t,r,i){if("string"==typeof n&&!(n=ta().getGlobalEventTarget(this.doc,n)))throw new Pe(5102,!1);let o=this.decoratePreventDefault(r);return this.tracingService?.wrapEventListener&&(o=this.tracingService.wrapEventListener(n,t,o)),this.eventManager.addEventListener(n,t,o,i)}decoratePreventDefault(n){return t=>{if("__ngUnwrap__"===t)return n;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>n(t)):n(t))&&t.preventDefault()}}}function GN(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class EW extends RB{sharedStylesHost;hostEl;shadowRoot;constructor(n,t,r,i,o,s,a,c,l){super(n,o,s,c,l),this.sharedStylesHost=t,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let u=i.styles;u=HN(i.id,u);for(const f of u){const A=document.createElement("style");a&&A.setAttribute("nonce",a),A.textContent=f,this.shadowRoot.appendChild(A)}const d=i.getExternalStyles?.();if(d)for(const f of d){const A=xB(f,o);a&&A.setAttribute("nonce",a),this.shadowRoot.appendChild(A)}}nodeOrShadowRoot(n){return n===this.hostEl?this.shadowRoot:n}appendChild(n,t){return super.appendChild(this.nodeOrShadowRoot(n),t)}insertBefore(n,t,r){return super.insertBefore(this.nodeOrShadowRoot(n),t,r)}removeChild(n,t){return super.removeChild(null,t)}parentNode(n){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(n)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class PB extends RB{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(n,t,r,i,o,s,a,c,l){super(n,o,s,a,c),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=i;let u=r.styles;this.styles=l?HN(l,u):u,this.styleUrls=r.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}}class VN extends PB{contentAttr;hostAttr;constructor(n,t,r,i,o,s,a,c,l){const u=i+"-"+r.id;super(n,t,r,o,s,a,c,l,u),this.contentAttr=function mW(e){return"_ngcontent-%COMP%".replace(OB,e)}(u),this.hostAttr=function CW(e){return"_nghost-%COMP%".replace(OB,e)}(u)}applyToHost(n){this.applyStyles(),this.setAttribute(n,this.hostAttr,"")}createElement(n,t){const r=super.createElement(n,t);return super.setAttribute(r,this.contentAttr,""),r}}class UB extends nW{supportsDOMEvents=!0;static makeCurrent(){!function tW(e){QN??=e}(new UB)}onAndCancel(n,t,r,i){return n.addEventListener(t,r,i),()=>{n.removeEventListener(t,r,i)}}dispatchEvent(n,t){n.dispatchEvent(t)}remove(n){n.remove()}createElement(n,t){return(t=t||this.getDefaultDocument()).createElement(n)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(n){return n.nodeType===Node.ELEMENT_NODE}isShadowRoot(n){return n instanceof DocumentFragment}getGlobalEventTarget(n,t){return"window"===t?window:"document"===t?n:"body"===t?n.body:null}getBaseHref(n){const t=function wW(){return bA=bA||document.head.querySelector("base"),bA?bA.getAttribute("href"):null}();return null==t?null:function vW(e){return new URL(e,document.baseURI).pathname}(t)}resetBaseElement(){bA=null}getUserAgent(){return window.navigator.userAgent}getCookie(n){return function cW(e,n){n=encodeURIComponent(n);for(const t of e.split(";")){const r=t.indexOf("="),[i,o]=-1==r?[t,""]:[t.slice(0,r),t.slice(r+1)];if(i.trim()===n)return decodeURIComponent(o)}return null}(document.cookie,n)}}let bA=null,bW=(()=>{class e{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})();const qN=["alt","control","meta","shift"],DW={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},SW={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};function zN(e){return{appProviders:[...RW,...e?.providers??[]],platformProviders:TW}}const TW=[{provide:XC,useValue:"browser"},{provide:ZC,useValue:function FW(){UB.makeCurrent()},multi:!0},{provide:Ui,useFactory:function xW(){return function I4(e){$C=e}(document),document}}],RW=[{provide:iC,useValue:"root"},{provide:ao,useFactory:function NW(){return new ao}},{provide:NB,useClass:(()=>{class e extends TN{constructor(t){super(t)}supports(t){return!0}addEventListener(t,r,i,o){return t.addEventListener(r,i,o),()=>this.removeEventListener(t,r,i,o)}removeEventListener(t,r,i,o){return t.removeEventListener(r,i,o)}static \u0275fac=function(r){return new(r||e)(_t(Ui))};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})(),multi:!0,deps:[Ui]},{provide:NB,useClass:(()=>{class e extends TN{constructor(t){super(t)}supports(t){return null!=e.parseEventName(t)}addEventListener(t,r,i,o){const s=e.parseEventName(r),a=e.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ta().onAndCancel(t,s.domEventName,a,o))}static parseEventName(t){const r=t.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const o=e._normalizeKey(r.pop());let s="",a=r.indexOf("code");if(a>-1&&(r.splice(a,1),s="code."),qN.forEach(l=>{const u=r.indexOf(l);u>-1&&(r.splice(u,1),s+=l+".")}),s+=o,0!=r.length||0===o.length)return null;const c={};return c.domEventName=i,c.fullKey=s,c}static matchEventFullKeyCode(t,r){let i=DW[t.key]||t.key,o="";return r.indexOf("code.")>-1&&(i=t.code,o="code."),!(null==i||!i)&&(i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),qN.forEach(s=>{s!==i&&(0,SW[s])(t)&&(o+=s+".")}),o+=i,o===r)}static eventCallback(t,r,i){return o=>{e.matchEventFullKeyCode(o,t)&&i.runGuarded(()=>r(o))}}static _normalizeKey(t){return"esc"===t?"escape":t}static \u0275fac=function(r){return new(r||e)(_t(Ui))};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})(),multi:!0,deps:[Ui]},LN,PN,xN,{provide:pE,useExisting:LN},{provide:class uW{},useClass:bW},[]];let VW=(()=>{class e{static \u0275prov=rt({token:e,providedIn:"root",factory:()=>new qW(de(Ui),window)})}return e})();class qW{document;window;offset=()=>[0,0];constructor(n,t){this.document=n,this.window=t}setOffset(n){this.offset=Array.isArray(n)?()=>n:n}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(n){this.window.scrollTo(n[0],n[1])}scrollToAnchor(n){const t=function zW(e,n){const t=e.getElementById(n)||e.getElementsByName(n)[0];if(t)return t;if("function"==typeof e.createTreeWalker&&e.body&&"function"==typeof e.body.attachShadow){const r=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let i=r.currentNode;for(;i;){const o=i.shadowRoot;if(o){const s=o.getElementById(n)||o.querySelector(`[name="${n}"]`);if(s)return s}i=r.nextNode()}}return null}(this.document,n);t&&(this.scrollToElement(t),t.focus())}setHistoryScrollRestoration(n){this.window.history.scrollRestoration=n}scrollToElement(n){const t=n.getBoundingClientRect(),r=t.left+this.window.pageXOffset,i=t.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(r-o[0],i-o[1])}}let y9=(()=>{class e extends Ac{_platformLocation;_baseHref="";_removeListenerFns=[];constructor(t,r){super(),this._platformLocation=t,null!=r&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}path(t=!1){const r=this._platformLocation.hash??"#";return r.length>0?r.substring(1):r}prepareExternalUrl(t){const r=FB(this._baseHref,t);return r.length>0?"#"+r:r}pushState(t,r,i,o){const s=this.prepareExternalUrl(i+Bs(o))||this._platformLocation.pathname;this._platformLocation.pushState(t,r,s)}replaceState(t,r,i,o){const s=this.prepareExternalUrl(i+Bs(o))||this._platformLocation.pathname;this._platformLocation.replaceState(t,r,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(r){return new(r||e)(_t(MB),_t(SN,8))};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})();var Yr=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}(Yr||{}),Cn=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}(Cn||{}),bi=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}(bi||{});function zh(e,n){return Gi(Jr(e)[_n.DateFormat],n)}function Kh(e,n){return Gi(Jr(e)[_n.TimeFormat],n)}function Jh(e,n){return Gi(Jr(e)[_n.DateTimeFormat],n)}function Li(e,n){const t=Jr(e),r=t[_n.NumberSymbols][n];if(typeof r>"u"){if(12===n)return t[_n.NumberSymbols][0];if(13===n)return t[_n.NumberSymbols][1]}return r}function r2(e){if(!e[_n.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[_n.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Gi(e,n){for(let t=n;t>-1;t--)if(typeof e[t]<"u")return e[t];throw new Error("Locale data API: locale data undefined")}function qB(e){const[n,t]=e.split(":");return{hours:+n,minutes:+t}}const x9=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,jh={},T9=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;function O9(e,n,t,r){let i=function z9(e){if(s2(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[i,o=1,s=1]=e.split("-").map(a=>+a);return Yh(i,o-1,s)}const t=parseFloat(e);if(!isNaN(e-t))return new Date(t);let r;if(r=e.match(x9))return function K9(e){const n=new Date(0);let t=0,r=0;const i=e[8]?n.setUTCFullYear:n.setFullYear,o=e[8]?n.setUTCHours:n.setHours;e[9]&&(t=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(n,Number(e[1]),Number(e[2])-1,Number(e[3]));const s=Number(e[4]||0)-t,a=Number(e[5]||0)-r,c=Number(e[6]||0),l=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return o.call(n,s,a,c,l),n}(r)}const n=new Date(e);if(!s2(n))throw new Error(`Unable to convert "${e}" into a date`);return n}(e);n=ws(t,n)||n;let a,s=[];for(;n;){if(a=T9.exec(n),!a){s.push(n);break}{s=s.concat(a.slice(1));const u=s.pop();if(!u)break;n=u}}let c=i.getTimezoneOffset();r&&(c=o2(r,c),i=function q9(e,n){const i=e.getTimezoneOffset();return function V9(e,n){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+n),e}(e,-1*(o2(n,i)-i))}(i,r));let l="";return s.forEach(u=>{const d=function G9(e){if(KB[e])return KB[e];let n;switch(e){case"G":case"GG":case"GGG":n=bn(3,Cn.Abbreviated);break;case"GGGG":n=bn(3,Cn.Wide);break;case"GGGGG":n=bn(3,Cn.Narrow);break;case"y":n=ar(0,1,0,!1,!0);break;case"yy":n=ar(0,2,0,!0,!0);break;case"yyy":n=ar(0,3,0,!1,!0);break;case"yyyy":n=ar(0,4,0,!1,!0);break;case"Y":n=Xh(1);break;case"YY":n=Xh(2,!0);break;case"YYY":n=Xh(3);break;case"YYYY":n=Xh(4);break;case"M":case"L":n=ar(1,1,1);break;case"MM":case"LL":n=ar(1,2,1);break;case"MMM":n=bn(2,Cn.Abbreviated);break;case"MMMM":n=bn(2,Cn.Wide);break;case"MMMMM":n=bn(2,Cn.Narrow);break;case"LLL":n=bn(2,Cn.Abbreviated,Yr.Standalone);break;case"LLLL":n=bn(2,Cn.Wide,Yr.Standalone);break;case"LLLLL":n=bn(2,Cn.Narrow,Yr.Standalone);break;case"w":n=zB(1);break;case"ww":n=zB(2);break;case"W":n=zB(1,!0);break;case"d":n=ar(2,1);break;case"dd":n=ar(2,2);break;case"c":case"cc":n=ar(7,1);break;case"ccc":n=bn(1,Cn.Abbreviated,Yr.Standalone);break;case"cccc":n=bn(1,Cn.Wide,Yr.Standalone);break;case"ccccc":n=bn(1,Cn.Narrow,Yr.Standalone);break;case"cccccc":n=bn(1,Cn.Short,Yr.Standalone);break;case"E":case"EE":case"EEE":n=bn(1,Cn.Abbreviated);break;case"EEEE":n=bn(1,Cn.Wide);break;case"EEEEE":n=bn(1,Cn.Narrow);break;case"EEEEEE":n=bn(1,Cn.Short);break;case"a":case"aa":case"aaa":n=bn(0,Cn.Abbreviated);break;case"aaaa":n=bn(0,Cn.Wide);break;case"aaaaa":n=bn(0,Cn.Narrow);break;case"b":case"bb":case"bbb":n=bn(0,Cn.Abbreviated,Yr.Standalone,!0);break;case"bbbb":n=bn(0,Cn.Wide,Yr.Standalone,!0);break;case"bbbbb":n=bn(0,Cn.Narrow,Yr.Standalone,!0);break;case"B":case"BB":case"BBB":n=bn(0,Cn.Abbreviated,Yr.Format,!0);break;case"BBBB":n=bn(0,Cn.Wide,Yr.Format,!0);break;case"BBBBB":n=bn(0,Cn.Narrow,Yr.Format,!0);break;case"h":n=ar(3,1,-12);break;case"hh":n=ar(3,2,-12);break;case"H":n=ar(3,1);break;case"HH":n=ar(3,2);break;case"m":n=ar(4,1);break;case"mm":n=ar(4,2);break;case"s":n=ar(5,1);break;case"ss":n=ar(5,2);break;case"S":n=ar(6,1);break;case"SS":n=ar(6,2);break;case"SSS":n=ar(6,3);break;case"Z":case"ZZ":case"ZZZ":n=$h(0);break;case"ZZZZZ":n=$h(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":n=$h(1);break;case"OOOO":case"ZZZZ":case"zzzz":n=$h(2);break;default:return null}return KB[e]=n,n}(u);l+=d?d(i,t,c):"''"===u?"'":u.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}function Yh(e,n,t){const r=new Date(0);return r.setFullYear(e,n,t),r.setHours(0,0,0),r}function ws(e,n){const t=function B9(e){return Jr(e)[_n.LocaleId]}(e);if(jh[t]??={},jh[t][n])return jh[t][n];let r="";switch(n){case"shortDate":r=zh(e,bi.Short);break;case"mediumDate":r=zh(e,bi.Medium);break;case"longDate":r=zh(e,bi.Long);break;case"fullDate":r=zh(e,bi.Full);break;case"shortTime":r=Kh(e,bi.Short);break;case"mediumTime":r=Kh(e,bi.Medium);break;case"longTime":r=Kh(e,bi.Long);break;case"fullTime":r=Kh(e,bi.Full);break;case"short":const i=ws(e,"shortTime"),o=ws(e,"shortDate");r=Wh(Jh(e,bi.Short),[i,o]);break;case"medium":const s=ws(e,"mediumTime"),a=ws(e,"mediumDate");r=Wh(Jh(e,bi.Medium),[s,a]);break;case"long":const c=ws(e,"longTime"),l=ws(e,"longDate");r=Wh(Jh(e,bi.Long),[c,l]);break;case"full":const u=ws(e,"fullTime"),d=ws(e,"fullDate");r=Wh(Jh(e,bi.Full),[u,d])}return r&&(jh[t][n]=r),r}function Wh(e,n){return n&&(e=e.replace(/\{([^}]+)}/g,function(t,r){return null!=n&&r in n?n[r]:t})),e}function fo(e,n,t="-",r,i){let o="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,o=t));let s=String(e);for(;s.length<n;)s="0"+s;return r&&(s=s.slice(s.length-n)),o+s}function ar(e,n,t=0,r=!1,i=!1){return function(o,s){let a=function P9(e,n){switch(e){case 0:return n.getFullYear();case 1:return n.getMonth();case 2:return n.getDate();case 3:return n.getHours();case 4:return n.getMinutes();case 5:return n.getSeconds();case 6:return n.getMilliseconds();case 7:return n.getDay();default:throw new Error(`Unknown DateType value "${e}".`)}}(e,o);if((t>0||a>-t)&&(a+=t),3===e)0===a&&-12===t&&(a=12);else if(6===e)return function R9(e,n){return fo(e,3).substring(0,n)}(a,n);const c=Li(s,5);return fo(a,n,c,r,i)}}function bn(e,n,t=Yr.Format,r=!1){return function(i,o){return function U9(e,n,t,r,i,o){switch(t){case 2:return function _9(e,n,t){const r=Jr(e),o=Gi([r[_n.MonthsFormat],r[_n.MonthsStandalone]],n);return Gi(o,t)}(n,i,r)[e.getMonth()];case 1:return function v9(e,n,t){const r=Jr(e),o=Gi([r[_n.DaysFormat],r[_n.DaysStandalone]],n);return Gi(o,t)}(n,i,r)[e.getDay()];case 0:const s=e.getHours(),a=e.getMinutes();if(o){const l=function S9(e){const n=Jr(e);return r2(n),(n[_n.ExtraData][2]||[]).map(r=>"string"==typeof r?qB(r):[qB(r[0]),qB(r[1])])}(n),u=function k9(e,n,t){const r=Jr(e);r2(r);const o=Gi([r[_n.ExtraData][0],r[_n.ExtraData][1]],n)||[];return Gi(o,t)||[]}(n,i,r),d=l.findIndex(f=>{if(Array.isArray(f)){const[A,p]=f,C=s>=A.hours&&a>=A.minutes,E=s<p.hours||s===p.hours&&a<p.minutes;if(A.hours<p.hours){if(C&&E)return!0}else if(C||E)return!0}else if(f.hours===s&&f.minutes===a)return!0;return!1});if(-1!==d)return u[d]}return function w9(e,n,t){const r=Jr(e),o=Gi([r[_n.DayPeriodsFormat],r[_n.DayPeriodsStandalone]],n);return Gi(o,t)}(n,i,r)[s<12?0:1];case 3:return function b9(e,n){return Gi(Jr(e)[_n.Eras],n)}(n,r)[e.getFullYear()<=0?0:1];default:throw new Error(`unexpected translation type ${t}`)}}(i,o,e,n,t,r)}}function $h(e){return function(n,t,r){const i=-1*r,o=Li(t,5),s=i>0?Math.floor(i/60):Math.ceil(i/60);switch(e){case 0:return(i>=0?"+":"")+fo(s,2,o)+fo(Math.abs(i%60),2,o);case 1:return"GMT"+(i>=0?"+":"")+fo(s,1,o);case 2:return"GMT"+(i>=0?"+":"")+fo(s,2,o)+":"+fo(Math.abs(i%60),2,o);case 3:return 0===r?"Z":(i>=0?"+":"")+fo(s,2,o)+":"+fo(Math.abs(i%60),2,o);default:throw new Error(`Unknown zone width "${e}"`)}}}function i2(e){const n=e.getDay(),t=0===n?-3:4-n;return Yh(e.getFullYear(),e.getMonth(),e.getDate()+t)}function zB(e,n=!1){return function(t,r){let i;if(n){const o=new Date(t.getFullYear(),t.getMonth(),1).getDay()-1,s=t.getDate();i=1+Math.floor((s+o)/7)}else{const o=i2(t),s=function L9(e){const n=Yh(e,0,1).getDay();return Yh(e,0,1+(n<=4?4:11)-n)}(o.getFullYear()),a=o.getTime()-s.getTime();i=1+Math.round(a/6048e5)}return fo(i,e,Li(r,5))}}function Xh(e,n=!1){return function(t,r){return fo(i2(t).getFullYear(),e,Li(r,5),n)}}const KB={};function o2(e,n){e=e.replace(/:/g,"");const t=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(t)?n:t}function s2(e){return e instanceof Date&&!isNaN(e.valueOf())}let h2=(()=>{class e{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;constructor(t){this._viewContainerRef=t}ngOnChanges(t){if(this._shouldRecreateView(t)){const r=this._viewContainerRef;if(this._viewRef&&r.remove(r.indexOf(this._viewRef)),!this.ngTemplateOutlet)return void(this._viewRef=null);const i=this._createContextForwardProxy();this._viewRef=r.createEmbeddedView(this.ngTemplateOutlet,i,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(t){return!!t.ngTemplateOutlet||!!t.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(t,r,i)=>!!this.ngTemplateOutletContext&&Reflect.set(this.ngTemplateOutletContext,r,i),get:(t,r,i)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,r,i)}})}static \u0275fac=function(r){return new(r||e)(ze(lo))};static \u0275dir=Mt({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[oo]})}return e})();const v$=new $e(""),_$=new $e("");let t0=(()=>{class e{locale;defaultTimezone;defaultOptions;constructor(t,r,i){this.locale=t,this.defaultTimezone=r,this.defaultOptions=i}transform(t,r,i,o){if(null==t||""===t||t!=t)return null;try{return O9(t,r??this.defaultOptions?.dateFormat??"mediumDate",o||this.locale,i??this.defaultOptions?.timezone??this.defaultTimezone??void 0)}catch(s){throw function go(e,n){return new Pe(2100,!1)}()}}static \u0275fac=function(r){return new(r||e)(ze(ea,16),ze(v$,24),ze(_$,24))};static \u0275pipe=Or({name:"date",type:e,pure:!0})}return e})(),T$=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=Ul({type:e});static \u0275inj=Oa({})}return e})();function na(e){return this instanceof na?(this.v=e,this):new na(e)}function y2(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=function a0(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(o){t[o]=e[o]&&function(s){return new Promise(function(a,c){!function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}(a,c,(s=e[o](s)).done,s.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const E2=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function B2(e){return Ne(e?.then)}function w2(e){return Ne(e[Rm])}function v2(e){return Symbol.asyncIterator&&Ne(e?.[Symbol.asyncIterator])}function _2(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const b2=function l7(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function Q2(e){return Ne(e?.[b2])}function D2(e){return function C2(e,n,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=t.apply(e,n||[]),o=[];return i=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function s(A){return function(p){return Promise.resolve(p).then(A,d)}}),i[Symbol.asyncIterator]=function(){return this},i;function a(A,p){r[A]&&(i[A]=function(C){return new Promise(function(E,Q){o.push([A,C,E,Q])>1||c(A,C)})},p&&(i[A]=p(i[A])))}function c(A,p){try{!function l(A){A.value instanceof na?Promise.resolve(A.value.v).then(u,d):f(o[0][2],A)}(r[A](p))}catch(C){f(o[0][3],C)}}function u(A){c("next",A)}function d(A){c("throw",A)}function f(A,p){A(p),o.shift(),o.length&&c(o[0][0],o[0][1])}}(this,arguments,function*(){const t=e.getReader();try{for(;;){const{value:r,done:i}=yield na(t.read());if(i)return yield na(void 0);yield yield na(r)}}finally{t.releaseLock()}})}function S2(e){return Ne(e?.getReader)}function Ho(e){if(e instanceof Cr)return e;if(null!=e){if(w2(e))return function u7(e){return new Cr(n=>{const t=e[Rm]();if(Ne(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(E2(e))return function d7(e){return new Cr(n=>{for(let t=0;t<e.length&&!n.closed;t++)n.next(e[t]);n.complete()})}(e);if(B2(e))return function A7(e){return new Cr(n=>{e.then(t=>{n.closed||(n.next(t),n.complete())},t=>n.error(t)).then(null,Et)})}(e);if(v2(e))return k2(e);if(Q2(e))return function f7(e){return new Cr(n=>{for(const t of e)if(n.next(t),n.closed)return;n.complete()})}(e);if(S2(e))return function g7(e){return k2(D2(e))}(e)}throw _2(e)}function k2(e){return new Cr(n=>{(function h7(e,n){var t,r,i,o;return function I2(e,n,t,r){return new(t||(t=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):function i(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,c)}l((r=r.apply(e,n||[])).next())})}(this,void 0,void 0,function*(){try{for(t=y2(e);!(r=yield t.next()).done;)if(n.next(r.value),n.closed)return}catch(s){i={error:s}}finally{try{r&&!r.done&&(o=t.return)&&(yield o.call(t))}finally{if(i)throw i.error}}n.complete()})})(e,n).catch(t=>n.error(t))})}function vs(e,n,t,r=0,i=!1){const o=n.schedule(function(){t(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function M2(e,n=0){return Dr((t,r)=>{t.subscribe(dr(r,i=>vs(r,e,()=>r.next(i),n),()=>vs(r,e,()=>r.complete(),n),i=>vs(r,e,()=>r.error(i),n)))})}function F2(e,n=0){return Dr((t,r)=>{r.add(e.schedule(()=>t.subscribe(r),n))})}function N2(e,n){if(!e)throw new Error("Iterable cannot be null");return new Cr(t=>{vs(t,n,()=>{const r=e[Symbol.asyncIterator]();vs(t,n,()=>{r.next().then(i=>{i.done?t.complete():t.next(i.value)})},0,!0)})})}function Br(e,n){return n?function E7(e,n){if(null!=e){if(w2(e))return function p7(e,n){return Ho(e).pipe(F2(n),M2(n))}(e,n);if(E2(e))return function m7(e,n){return new Cr(t=>{let r=0;return n.schedule(function(){r===e.length?t.complete():(t.next(e[r++]),t.closed||this.schedule())})})}(e,n);if(B2(e))return function I7(e,n){return Ho(e).pipe(F2(n),M2(n))}(e,n);if(v2(e))return N2(e,n);if(Q2(e))return function C7(e,n){return new Cr(t=>{let r;return vs(t,n,()=>{r=e[b2](),vs(t,n,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(s){return void t.error(s)}o?t.complete():t.next(i)},0,!0)}),()=>Ne(r?.return)&&r.return()})}(e,n);if(S2(e))return function y7(e,n){return N2(D2(e),n)}(e,n)}throw _2(e)}(e,n):Ho(e)}function l0(e){return e[e.length-1]}function x2(e){return Ne(l0(e))?e.pop():void 0}function tp(e){return function B7(e){return e&&Ne(e.schedule)}(l0(e))?e.pop():void 0}function xt(...e){return Br(e,tp(e))}const{isArray:w7}=Array,{getPrototypeOf:v7,prototype:_7,keys:b7}=Object;function T2(e){if(1===e.length){const n=e[0];if(w7(n))return{args:n,keys:null};if(function Q7(e){return e&&"object"==typeof e&&v7(e)===_7}(n)){const t=b7(n);return{args:t.map(r=>n[r]),keys:t}}}return{args:e,keys:null}}const{isArray:D7}=Array;function O2(e){return cn(n=>function S7(e,n){return D7(n)?e(...n):e(n)}(e,n))}function R2(e,n){return e.reduce((t,r,i)=>(t[r]=n[i],t),{})}function u0(...e){const n=tp(e),t=x2(e),{args:r,keys:i}=T2(e);if(0===r.length)return Br([],n);const o=new Cr(function k7(e,n,t=xa){return r=>{P2(n,()=>{const{length:i}=e,o=new Array(i);let s=i,a=i;for(let c=0;c<i;c++)P2(n,()=>{const l=Br(e[c],n);let u=!1;l.subscribe(dr(r,d=>{o[c]=d,u||(u=!0,a--),a||r.next(t(o.slice()))},()=>{--s||r.complete()}))},r)},r)}}(r,n,i?s=>R2(i,s):xa));return t?o.pipe(O2(t)):o}function P2(e,n,t){e?vs(t,e,n):n()}const np=He(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function Ur(e,n,t=1/0){return Ne(n)?Ur((r,i)=>cn((o,s)=>n(r,o,i,s))(Ho(e(r,i))),t):("number"==typeof n&&(t=n),Dr((r,i)=>function M7(e,n,t,r,i,o,s,a){const c=[];let l=0,u=0,d=!1;const f=()=>{d&&!c.length&&!l&&n.complete()},A=C=>l<r?p(C):c.push(C),p=C=>{o&&n.next(C),l++;let E=!1;Ho(t(C,u++)).subscribe(dr(n,Q=>{i?.(Q),o?A(Q):n.next(Q)},()=>{E=!0},void 0,()=>{if(E)try{for(l--;c.length&&l<r;){const Q=c.shift();s?vs(n,s,()=>p(Q)):p(Q)}f()}catch(Q){n.error(Q)}}))};return e.subscribe(dr(n,A,()=>{d=!0,f()})),()=>{a?.()}}(r,i,e,t)))}function NA(e=1/0){return Ur(xa,e)}function d0(...e){return function F7(){return NA(1)}()(Br(e,tp(e)))}function U2(e){return new Cr(n=>{Ho(e()).subscribe(n)})}function rp(e,n){const t=Ne(e)?e:()=>e,r=i=>i.error(t());return new Cr(n?i=>n.schedule(r,0,i):r)}const ho=new Cr(e=>e.complete());function A0(){return Dr((e,n)=>{let t=null;e._refCount++;const r=dr(n,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(t=null);const i=e._connection,o=t;t=null,i&&(!o||i===o)&&i.unsubscribe(),n.unsubscribe()});e.subscribe(r),r.closed||(t=e.connect())})}class H2 extends Cr{constructor(n,t){super(),this.source=n,this.subjectFactory=t,this._subject=null,this._refCount=0,this._connection=null,db(n)&&(this.lift=n.lift)}_subscribe(n){return this.getSubject().subscribe(n)}getSubject(){const n=this._subject;return(!n||n.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:n}=this;this._subject=this._connection=null,n?.unsubscribe()}connect(){let n=this._connection;if(!n){n=this._connection=new m;const t=this.getSubject();n.add(this.source.subscribe(dr(t,void 0,()=>{this._teardown(),t.complete()},r=>{this._teardown(),t.error(r)},()=>this._teardown()))),n.closed&&(this._connection=null,n=m.EMPTY)}return n}refCount(){return A0()(this)}}function Lo(e,n){return Dr((t,r)=>{let i=null,o=0,s=!1;const a=()=>s&&!i&&r.complete();t.subscribe(dr(r,c=>{i?.unsubscribe();let l=0;const u=o++;Ho(e(c,u)).subscribe(i=dr(r,d=>r.next(n?n(c,d,u,l++):d),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function su(e){return e<=0?()=>ho:Dr((n,t)=>{let r=0;n.subscribe(dr(t,i=>{++r<=e&&(t.next(i),e<=r&&t.complete())}))})}function ra(e,n){return Dr((t,r)=>{let i=0;t.subscribe(dr(r,o=>e.call(n,o,i++)&&r.next(o)))})}function ip(e){return Dr((n,t)=>{let r=!1;n.subscribe(dr(t,i=>{r=!0,t.next(i)},()=>{r||t.next(e),t.complete()}))})}function L2(e=O7){return Dr((n,t)=>{let r=!1;n.subscribe(dr(t,i=>{r=!0,t.next(i)},()=>r?t.complete():t.error(e())))})}function O7(){return new np}function fc(e,n){const t=arguments.length>=2;return r=>r.pipe(e?ra((i,o)=>e(i,o,r)):xa,su(1),t?ip(n):L2(()=>new np))}function xA(e,n){return Ne(n)?Ur(e,n,1):Ur(e,1)}function Wr(e,n,t){const r=Ne(e)||n||t?{next:e,error:n,complete:t}:e;return r?Dr((i,o)=>{var s;null===(s=r.subscribe)||void 0===s||s.call(r);let a=!0;i.subscribe(dr(o,c=>{var l;null===(l=r.next)||void 0===l||l.call(r,c),o.next(c)},()=>{var c;a=!1,null===(c=r.complete)||void 0===c||c.call(r),o.complete()},c=>{var l;a=!1,null===(l=r.error)||void 0===l||l.call(r,c),o.error(c)},()=>{var c,l;a&&(null===(c=r.unsubscribe)||void 0===c||c.call(r)),null===(l=r.finalize)||void 0===l||l.call(r)}))}):xa}function au(e){return Dr((n,t)=>{let o,r=null,i=!1;r=n.subscribe(dr(t,void 0,void 0,s=>{o=Ho(e(s,au(e)(n))),r?(r.unsubscribe(),r=null,o.subscribe(t)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(t))})}function f0(e){return e<=0?()=>ho:Dr((n,t)=>{let r=[];n.subscribe(dr(t,i=>{r.push(i),e<r.length&&r.shift()},()=>{for(const i of r)t.next(i);t.complete()},void 0,()=>{r=null}))})}function g0(e){return Dr((n,t)=>{try{n.subscribe(t)}finally{t.add(e)}})}let Z7=(()=>{class e{_doc;constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}static \u0275fac=function(r){return new(r||e)(_t(Ui))};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Ut="primary",OA=Symbol("RouteTitle");class nZ{params;constructor(n){this.params=n||{}}has(n){return Object.prototype.hasOwnProperty.call(this.params,n)}get(n){if(this.has(n)){const t=this.params[n];return Array.isArray(t)?t[0]:t}return null}getAll(n){if(this.has(n)){const t=this.params[n];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function cu(e){return new nZ(e)}function rZ(e,n,t){const r=t.path.split("/");if(r.length>e.length||"full"===t.pathMatch&&(n.hasChildren()||r.length<e.length))return null;const i={};for(let o=0;o<r.length;o++){const s=r[o],a=e[o];if(":"===s[0])i[s.substring(1)]=a;else if(s!==a.path)return null}return{consumed:e.slice(0,r.length),posParams:i}}function Go(e,n){const t=e?p0(e):void 0,r=n?p0(n):void 0;if(!t||!r||t.length!=r.length)return!1;let i;for(let o=0;o<t.length;o++)if(i=t[o],!J2(e[i],n[i]))return!1;return!0}function p0(e){return[...Object.keys(e),...Object.getOwnPropertySymbols(e)]}function J2(e,n){if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;const t=[...e].sort(),r=[...n].sort();return t.every((i,o)=>r[o]===i)}return e===n}function j2(e){return e.length>0?e[e.length-1]:null}function oa(e){return function O$(e){return!!e&&(e instanceof Cr||Ne(e.lift)&&Ne(e.subscribe))}(e)?e:lA(e)?Br(Promise.resolve(e)):xt(e)}const oZ={exact:function $2(e,n,t){if(!hc(e.segments,n.segments)||!op(e.segments,n.segments,t)||e.numberOfChildren!==n.numberOfChildren)return!1;for(const r in n.children)if(!e.children[r]||!$2(e.children[r],n.children[r],t))return!1;return!0},subset:Z2},Y2={exact:function sZ(e,n){return Go(e,n)},subset:function aZ(e,n){return Object.keys(n).length<=Object.keys(e).length&&Object.keys(n).every(t=>J2(e[t],n[t]))},ignored:()=>!0};function W2(e,n,t){return oZ[t.paths](e.root,n.root,t.matrixParams)&&Y2[t.queryParams](e.queryParams,n.queryParams)&&!("exact"===t.fragment&&e.fragment!==n.fragment)}function Z2(e,n,t){return X2(e,n,n.segments,t)}function X2(e,n,t,r){if(e.segments.length>t.length){const i=e.segments.slice(0,t.length);return!(!hc(i,t)||n.hasChildren()||!op(i,t,r))}if(e.segments.length===t.length){if(!hc(e.segments,t)||!op(e.segments,t,r))return!1;for(const i in n.children)if(!e.children[i]||!Z2(e.children[i],n.children[i],r))return!1;return!0}{const i=t.slice(0,e.segments.length),o=t.slice(e.segments.length);return!!(hc(e.segments,i)&&op(e.segments,i,r)&&e.children[Ut])&&X2(e.children[Ut],n,o,r)}}function op(e,n,t){return n.every((r,i)=>Y2[t](e[i].parameters,r.parameters))}class gc{root;queryParams;fragment;_queryParamMap;constructor(n=new pn([],{}),t={},r=null){this.root=n,this.queryParams=t,this.fragment=r}get queryParamMap(){return this._queryParamMap??=cu(this.queryParams),this._queryParamMap}toString(){return uZ.serialize(this)}}class pn{segments;children;parent=null;constructor(n,t){this.segments=n,this.children=t,Object.values(t).forEach(r=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return ap(this)}}class RA{path;parameters;_parameterMap;constructor(n,t){this.path=n,this.parameters=t}get parameterMap(){return this._parameterMap??=cu(this.parameters),this._parameterMap}toString(){return nx(this)}}function hc(e,n){return e.length===n.length&&e.every((t,r)=>t.path===n[r].path)}let PA=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:()=>new sp,providedIn:"root"})}return e})();class sp{parse(n){const t=new EZ(n);return new gc(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(n){const t=`/${UA(n.root,!0)}`,r=function fZ(e){const n=Object.entries(e).map(([t,r])=>Array.isArray(r)?r.map(i=>`${cp(t)}=${cp(i)}`).join("&"):`${cp(t)}=${cp(r)}`).filter(t=>t);return n.length?`?${n.join("&")}`:""}(n.queryParams);return`${t}${r}${"string"==typeof n.fragment?`#${function dZ(e){return encodeURI(e)}(n.fragment)}`:""}`}}const uZ=new sp;function ap(e){return e.segments.map(n=>nx(n)).join("/")}function UA(e,n){if(!e.hasChildren())return ap(e);if(n){const t=e.children[Ut]?UA(e.children[Ut],!1):"",r=[];return Object.entries(e.children).forEach(([i,o])=>{i!==Ut&&r.push(`${i}:${UA(o,!1)}`)}),r.length>0?`${t}(${r.join("//")})`:t}{const t=function lZ(e,n){let t=[];return Object.entries(e.children).forEach(([r,i])=>{r===Ut&&(t=t.concat(n(i,r)))}),Object.entries(e.children).forEach(([r,i])=>{r!==Ut&&(t=t.concat(n(i,r)))}),t}(e,(r,i)=>i===Ut?[UA(e.children[Ut],!1)]:[`${i}:${UA(r,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[Ut]?`${ap(e)}/${t[0]}`:`${ap(e)}/(${t.join("//")})`}}function ex(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function cp(e){return ex(e).replace(/%3B/gi,";")}function I0(e){return ex(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function lp(e){return decodeURIComponent(e)}function tx(e){return lp(e.replace(/\+/g,"%20"))}function nx(e){return`${I0(e.path)}${function AZ(e){return Object.entries(e).map(([n,t])=>`;${I0(n)}=${I0(t)}`).join("")}(e.parameters)}`}const gZ=/^[^\/()?;#]+/;function m0(e){const n=e.match(gZ);return n?n[0]:""}const hZ=/^[^\/()?;=#]+/,IZ=/^[^=?&#]+/,CZ=/^[^&#]+/;class EZ{url;remaining;constructor(n){this.url=n,this.remaining=n}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new pn([],{}):new pn([],this.parseChildren())}parseQueryParams(){const n={};if(this.consumeOptional("?"))do{this.parseQueryParam(n)}while(this.consumeOptional("&"));return n}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const n=[];for(this.peekStartsWith("(")||n.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),n.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(n.length>0||Object.keys(t).length>0)&&(r[Ut]=new pn(n,t)),r}parseSegment(){const n=m0(this.remaining);if(""===n&&this.peekStartsWith(";"))throw new Pe(4009,!1);return this.capture(n),new RA(lp(n),this.parseMatrixParams())}parseMatrixParams(){const n={};for(;this.consumeOptional(";");)this.parseParam(n);return n}parseParam(n){const t=function pZ(e){const n=e.match(hZ);return n?n[0]:""}(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const i=m0(this.remaining);i&&(r=i,this.capture(r))}n[lp(t)]=lp(r)}parseQueryParam(n){const t=function mZ(e){const n=e.match(IZ);return n?n[0]:""}(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const s=function yZ(e){const n=e.match(CZ);return n?n[0]:""}(this.remaining);s&&(r=s,this.capture(r))}const i=tx(t),o=tx(r);if(n.hasOwnProperty(i)){let s=n[i];Array.isArray(s)||(s=[s],n[i]=s),s.push(o)}else n[i]=o}parseParens(n){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=m0(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new Pe(4010,!1);let o;r.indexOf(":")>-1?(o=r.slice(0,r.indexOf(":")),this.capture(o),this.capture(":")):n&&(o=Ut);const s=this.parseChildren();t[o]=1===Object.keys(s).length?s[Ut]:new pn([],s),this.consumeOptional("//")}return t}peekStartsWith(n){return this.remaining.startsWith(n)}consumeOptional(n){return!!this.peekStartsWith(n)&&(this.remaining=this.remaining.substring(n.length),!0)}capture(n){if(!this.consumeOptional(n))throw new Pe(4011,!1)}}function rx(e){return e.segments.length>0?new pn([],{[Ut]:e}):e}function ix(e){const n={};for(const[r,i]of Object.entries(e.children)){const o=ix(i);if(r===Ut&&0===o.segments.length&&o.hasChildren())for(const[s,a]of Object.entries(o.children))n[s]=a;else(o.segments.length>0||o.hasChildren())&&(n[r]=o)}return function BZ(e){if(1===e.numberOfChildren&&e.children[Ut]){const n=e.children[Ut];return new pn(e.segments.concat(n.segments),n.children)}return e}(new pn(e.segments,n))}function pc(e){return e instanceof gc}function ox(e){let n;const i=rx(function t(o){const s={};for(const c of o.children){const l=t(c);s[c.outlet]=l}const a=new pn(o.url,s);return o===e&&(n=a),a}(e.root));return n??i}function sx(e,n,t,r){let i=e;for(;i.parent;)i=i.parent;if(0===n.length)return C0(i,i,i,t,r);const o=function vZ(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new cx(!0,0,e);let n=0,t=!1;const r=e.reduce((i,o,s)=>{if("object"==typeof o&&null!=o){if(o.outlets){const a={};return Object.entries(o.outlets).forEach(([c,l])=>{a[c]="string"==typeof l?l.split("/"):l}),[...i,{outlets:a}]}if(o.segmentPath)return[...i,o.segmentPath]}return"string"!=typeof o?[...i,o]:0===s?(o.split("/").forEach((a,c)=>{0==c&&"."===a||(0==c&&""===a?t=!0:".."===a?n++:""!=a&&i.push(a))}),i):[...i,o]},[]);return new cx(t,n,r)}(n);if(o.toRoot())return C0(i,i,new pn([],{}),t,r);const s=function _Z(e,n,t){if(e.isAbsolute)return new dp(n,!0,0);if(!t)return new dp(n,!1,NaN);if(null===t.parent)return new dp(t,!0,0);const r=up(e.commands[0])?0:1;return function bZ(e,n,t){let r=e,i=n,o=t;for(;o>i;){if(o-=i,r=r.parent,!r)throw new Pe(4005,!1);i=r.segments.length}return new dp(r,!1,i-o)}(t,t.segments.length-1+r,e.numberOfDoubleDots)}(o,i,e),a=s.processChildren?LA(s.segmentGroup,s.index,o.commands):lx(s.segmentGroup,s.index,o.commands);return C0(i,s.segmentGroup,a,t,r)}function up(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function HA(e){return"object"==typeof e&&null!=e&&e.outlets}function C0(e,n,t,r,i){let s,o={};r&&Object.entries(r).forEach(([c,l])=>{o[c]=Array.isArray(l)?l.map(u=>`${u}`):`${l}`}),s=e===n?t:ax(e,n,t);const a=rx(ix(s));return new gc(a,o,i)}function ax(e,n,t){const r={};return Object.entries(e.children).forEach(([i,o])=>{r[i]=o===n?t:ax(o,n,t)}),new pn(e.segments,r)}class cx{isAbsolute;numberOfDoubleDots;commands;constructor(n,t,r){if(this.isAbsolute=n,this.numberOfDoubleDots=t,this.commands=r,n&&r.length>0&&up(r[0]))throw new Pe(4003,!1);const i=r.find(HA);if(i&&i!==j2(r))throw new Pe(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class dp{segmentGroup;processChildren;index;constructor(n,t,r){this.segmentGroup=n,this.processChildren=t,this.index=r}}function lx(e,n,t){if(e??=new pn([],{}),0===e.segments.length&&e.hasChildren())return LA(e,n,t);const r=function DZ(e,n,t){let r=0,i=n;const o={match:!1,pathIndex:0,commandIndex:0};for(;i<e.segments.length;){if(r>=t.length)return o;const s=e.segments[i],a=t[r];if(HA(a))break;const c=`${a}`,l=r<t.length-1?t[r+1]:null;if(i>0&&void 0===c)break;if(c&&l&&"object"==typeof l&&void 0===l.outlets){if(!dx(c,l,s))return o;r+=2}else{if(!dx(c,{},s))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(e,n,t),i=t.slice(r.commandIndex);if(r.match&&r.pathIndex<e.segments.length){const o=new pn(e.segments.slice(0,r.pathIndex),{});return o.children[Ut]=new pn(e.segments.slice(r.pathIndex),e.children),LA(o,0,i)}return r.match&&0===i.length?new pn(e.segments,{}):r.match&&!e.hasChildren()?y0(e,n,t):r.match?LA(e,0,i):y0(e,n,t)}function LA(e,n,t){if(0===t.length)return new pn(e.segments,{});{const r=function QZ(e){return HA(e[0])?e[0].outlets:{[Ut]:e}}(t),i={};if(Object.keys(r).some(o=>o!==Ut)&&e.children[Ut]&&1===e.numberOfChildren&&0===e.children[Ut].segments.length){const o=LA(e.children[Ut],n,t);return new pn(e.segments,o.children)}return Object.entries(r).forEach(([o,s])=>{"string"==typeof s&&(s=[s]),null!==s&&(i[o]=lx(e.children[o],n,s))}),Object.entries(e.children).forEach(([o,s])=>{void 0===r[o]&&(i[o]=s)}),new pn(e.segments,i)}}function y0(e,n,t){const r=e.segments.slice(0,n);let i=0;for(;i<t.length;){const o=t[i];if(HA(o)){const c=SZ(o.outlets);return new pn(r,c)}if(0===i&&up(t[0])){r.push(new RA(e.segments[n].path,ux(t[0]))),i++;continue}const s=HA(o)?o.outlets[Ut]:`${o}`,a=i<t.length-1?t[i+1]:null;s&&a&&up(a)?(r.push(new RA(s,ux(a))),i+=2):(r.push(new RA(s,{})),i++)}return new pn(r,{})}function SZ(e){const n={};return Object.entries(e).forEach(([t,r])=>{"string"==typeof r&&(r=[r]),null!==r&&(n[t]=y0(new pn([],{}),0,r))}),n}function ux(e){const n={};return Object.entries(e).forEach(([t,r])=>n[t]=`${r}`),n}function dx(e,n,t){return e==t.path&&Go(n,t.parameters)}const Ap="imperative";var jt=function(e){return e[e.NavigationStart=0]="NavigationStart",e[e.NavigationEnd=1]="NavigationEnd",e[e.NavigationCancel=2]="NavigationCancel",e[e.NavigationError=3]="NavigationError",e[e.RoutesRecognized=4]="RoutesRecognized",e[e.ResolveStart=5]="ResolveStart",e[e.ResolveEnd=6]="ResolveEnd",e[e.GuardsCheckStart=7]="GuardsCheckStart",e[e.GuardsCheckEnd=8]="GuardsCheckEnd",e[e.RouteConfigLoadStart=9]="RouteConfigLoadStart",e[e.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",e[e.ChildActivationStart=11]="ChildActivationStart",e[e.ChildActivationEnd=12]="ChildActivationEnd",e[e.ActivationStart=13]="ActivationStart",e[e.ActivationEnd=14]="ActivationEnd",e[e.Scroll=15]="Scroll",e[e.NavigationSkipped=16]="NavigationSkipped",e}(jt||{});class Vo{id;url;constructor(n,t){this.id=n,this.url=t}}class fp extends Vo{type=jt.NavigationStart;navigationTrigger;restoredState;constructor(n,t,r="imperative",i=null){super(n,t),this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class _s extends Vo{urlAfterRedirects;type=jt.NavigationEnd;constructor(n,t,r){super(n,t),this.urlAfterRedirects=r}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Qi=function(e){return e[e.Redirect=0]="Redirect",e[e.SupersededByNewNavigation=1]="SupersededByNewNavigation",e[e.NoDataFromResolver=2]="NoDataFromResolver",e[e.GuardRejected=3]="GuardRejected",e}(Qi||{}),gp=function(e){return e[e.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",e[e.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",e}(gp||{});class Ic extends Vo{reason;code;type=jt.NavigationCancel;constructor(n,t,r,i){super(n,t),this.reason=r,this.code=i}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class lu extends Vo{reason;code;type=jt.NavigationSkipped;constructor(n,t,r,i){super(n,t),this.reason=r,this.code=i}}class E0 extends Vo{error;target;type=jt.NavigationError;constructor(n,t,r,i){super(n,t),this.error=r,this.target=i}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Ax extends Vo{urlAfterRedirects;state;type=jt.RoutesRecognized;constructor(n,t,r,i){super(n,t),this.urlAfterRedirects=r,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class kZ extends Vo{urlAfterRedirects;state;type=jt.GuardsCheckStart;constructor(n,t,r,i){super(n,t),this.urlAfterRedirects=r,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class MZ extends Vo{urlAfterRedirects;state;shouldActivate;type=jt.GuardsCheckEnd;constructor(n,t,r,i,o){super(n,t),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=o}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class FZ extends Vo{urlAfterRedirects;state;type=jt.ResolveStart;constructor(n,t,r,i){super(n,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class NZ extends Vo{urlAfterRedirects;state;type=jt.ResolveEnd;constructor(n,t,r,i){super(n,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class xZ{route;type=jt.RouteConfigLoadStart;constructor(n){this.route=n}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class TZ{route;type=jt.RouteConfigLoadEnd;constructor(n){this.route=n}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class OZ{snapshot;type=jt.ChildActivationStart;constructor(n){this.snapshot=n}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class RZ{snapshot;type=jt.ChildActivationEnd;constructor(n){this.snapshot=n}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class PZ{snapshot;type=jt.ActivationStart;constructor(n){this.snapshot=n}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class UZ{snapshot;type=jt.ActivationEnd;constructor(n){this.snapshot=n}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class fx{routerEvent;position;anchor;type=jt.Scroll;constructor(n,t,r){this.routerEvent=n,this.position=t,this.anchor=r}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class B0{}class hp{url;navigationBehaviorOptions;constructor(n,t){this.url=n,this.navigationBehaviorOptions=t}}function po(e){return e.outlet||Ut}function GA(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let n=e.parent;n;n=n.parent){const t=n.routeConfig;if(t?._loadedInjector)return t._loadedInjector;if(t?._injector)return t._injector}return null}class zZ{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return GA(this.route?.snapshot)??this.rootInjector}constructor(n){this.rootInjector=n,this.children=new VA(this.rootInjector)}}let VA=(()=>{class e{rootInjector;contexts=new Map;constructor(t){this.rootInjector=t}onChildOutletCreated(t,r){const i=this.getOrCreateContext(t);i.outlet=r,this.contexts.set(t,i)}onChildOutletDestroyed(t){const r=this.getContext(t);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let r=this.getContext(t);return r||(r=new zZ(this.rootInjector),this.contexts.set(t,r)),r}getContext(t){return this.contexts.get(t)||null}static \u0275fac=function(r){return new(r||e)(_t(si))};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class gx{_root;constructor(n){this._root=n}get root(){return this._root.value}parent(n){const t=this.pathFromRoot(n);return t.length>1?t[t.length-2]:null}children(n){const t=w0(n,this._root);return t?t.children.map(r=>r.value):[]}firstChild(n){const t=w0(n,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(n){const t=v0(n,this._root);return t.length<2?[]:t[t.length-2].children.map(i=>i.value).filter(i=>i!==n)}pathFromRoot(n){return v0(n,this._root).map(t=>t.value)}}function w0(e,n){if(e===n.value)return n;for(const t of n.children){const r=w0(e,t);if(r)return r}return null}function v0(e,n){if(e===n.value)return[n];for(const t of n.children){const r=v0(e,t);if(r.length)return r.unshift(n),r}return[]}class Io{value;children;constructor(n,t){this.value=n,this.children=t}toString(){return`TreeNode(${this.value})`}}function uu(e){const n={};return e&&e.children.forEach(t=>n[t.value.outlet]=t),n}class hx extends gx{snapshot;constructor(n,t){super(n),this.snapshot=t,_0(this,n)}toString(){return this.snapshot.toString()}}function px(e){const n=function KZ(e){const o=new Ip([],{},{},"",{},Ut,e,null,{});return new Ix("",new Io(o,[]))}(e),t=new Ii([new RA("",{})]),r=new Ii({}),i=new Ii({}),o=new Ii({}),s=new Ii(""),a=new Vi(t,r,o,s,i,Ut,e,n.root);return a.snapshot=n.root,new hx(new Io(a,[]),n)}class Vi{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(n,t,r,i,o,s,a,c){this.urlSubject=n,this.paramsSubject=t,this.queryParamsSubject=r,this.fragmentSubject=i,this.dataSubject=o,this.outlet=s,this.component=a,this._futureSnapshot=c,this.title=this.dataSubject?.pipe(cn(l=>l[OA]))??xt(void 0),this.url=n,this.params=t,this.queryParams=r,this.fragment=i,this.data=o}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(cn(n=>cu(n))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(cn(n=>cu(n))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function pp(e,n,t="emptyOnly"){let r;const{routeConfig:i}=e;return r=null===n||"always"!==t&&""!==i?.path&&(n.component||n.routeConfig?.loadComponent)?{params:{...e.params},data:{...e.data},resolve:{...e.data,...e._resolvedData??{}}}:{params:{...n.params,...e.params},data:{...n.data,...e.data},resolve:{...e.data,...n.data,...i?.data,...e._resolvedData}},i&&Cx(i)&&(r.resolve[OA]=i.title),r}class Ip{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[OA]}constructor(n,t,r,i,o,s,a,c,l){this.url=n,this.params=t,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=s,this.component=a,this.routeConfig=c,this._resolve=l}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=cu(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=cu(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class Ix extends gx{url;constructor(n,t){super(t),this.url=n,_0(this,t)}toString(){return mx(this._root)}}function _0(e,n){n.value._routerState=e,n.children.forEach(t=>_0(e,t))}function mx(e){const n=e.children.length>0?` { ${e.children.map(mx).join(", ")} } `:"";return`${e.value}${n}`}function b0(e){if(e.snapshot){const n=e.snapshot,t=e._futureSnapshot;e.snapshot=t,Go(n.queryParams,t.queryParams)||e.queryParamsSubject.next(t.queryParams),n.fragment!==t.fragment&&e.fragmentSubject.next(t.fragment),Go(n.params,t.params)||e.paramsSubject.next(t.params),function iZ(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;++t)if(!Go(e[t],n[t]))return!1;return!0}(n.url,t.url)||e.urlSubject.next(t.url),Go(n.data,t.data)||e.dataSubject.next(t.data)}else e.snapshot=e._futureSnapshot,e.dataSubject.next(e._futureSnapshot.data)}function Q0(e,n){const t=Go(e.params,n.params)&&function cZ(e,n){return hc(e,n)&&e.every((t,r)=>Go(t.parameters,n[r].parameters))}(e.url,n.url);return t&&!(!e.parent!=!n.parent)&&(!e.parent||Q0(e.parent,n.parent))}function Cx(e){return"string"==typeof e.title||null===e.title}const JZ=new $e("");let du=(()=>{class e{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=Ut;activateEvents=new Pn;deactivateEvents=new Pn;attachEvents=new Pn;detachEvents=new Pn;routerOutletData=KL(void 0);parentContexts=de(VA);location=de(lo);changeDetector=de(wA);inputBinder=de(mp,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(t){if(t.name){const{firstChange:r,previousValue:i}=t.name;if(r)return;this.isTrackedInParentContexts(i)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(i)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Pe(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Pe(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Pe(4012,!1);this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,r){this.activated=t,this._activatedRoute=r,this.location.insert(t.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,r){if(this.isActivated)throw new Pe(4013,!1);this._activatedRoute=t;const i=this.location,s=t.snapshot.component,a=this.parentContexts.getOrCreateContext(this.name).children,c=new jZ(t,a,i.injector,this.routerOutletData);this.activated=i.createComponent(s,{index:i.length,injector:c,environmentInjector:r}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(r){return new(r||e)};static \u0275dir=Mt({type:e,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],features:[oo]})}return e})();class jZ{route;childContexts;parent;outletData;constructor(n,t,r,i){this.route=n,this.childContexts=t,this.parent=r,this.outletData=i}get(n,t){return n===Vi?this.route:n===VA?this.childContexts:n===JZ?this.outletData:this.parent.get(n,t)}}const mp=new $e("");let yx=(()=>{class e{outletDataSubscriptions=new Map;bindActivatedRouteToOutletComponent(t){this.unsubscribeFromRouteData(t),this.subscribeToRouteData(t)}unsubscribeFromRouteData(t){this.outletDataSubscriptions.get(t)?.unsubscribe(),this.outletDataSubscriptions.delete(t)}subscribeToRouteData(t){const{activatedRoute:r}=t,i=u0([r.queryParams,r.params,r.data]).pipe(Lo(([o,s,a],c)=>(a={...o,...s,...a},0===c?xt(a):Promise.resolve(a)))).subscribe(o=>{if(!t.isActivated||!t.activatedComponentRef||t.activatedRoute!==r||null===r.component)return void this.unsubscribeFromRouteData(t);const s=function eW(e){const n=Vt(e);if(!n)return null;const t=new iA(n);return{get selector(){return t.selector},get type(){return t.componentType},get inputs(){return t.inputs},get outputs(){return t.outputs},get ngContentSelectors(){return t.ngContentSelectors},get isStandalone(){return n.standalone},get isSignal(){return n.signals}}}(r.component);if(s)for(const{templateName:a}of s.inputs)t.activatedComponentRef.setInput(a,o[a]);else this.unsubscribeFromRouteData(t)});this.outletDataSubscriptions.set(t,i)}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})(),Ex=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(r,i){1&r&&ot(0,"router-outlet")},dependencies:[du],encapsulation:2})}return e})();function D0(e){const n=e.children&&e.children.map(D0),t=n?{...e,children:n}:{...e};return!t.component&&!t.loadComponent&&(n||t.loadChildren)&&t.outlet&&t.outlet!==Ut&&(t.component=Ex),t}function qA(e,n,t){if(t&&e.shouldReuseRoute(n.value,t.value.snapshot)){const r=t.value;r._futureSnapshot=n.value;const i=function WZ(e,n,t){return n.children.map(r=>{for(const i of t.children)if(e.shouldReuseRoute(r.value,i.value.snapshot))return qA(e,r,i);return qA(e,r)})}(e,n,t);return new Io(r,i)}{if(e.shouldAttach(n.value)){const o=e.retrieve(n.value);if(null!==o){const s=o.route;return s.value._futureSnapshot=n.value,s.children=n.children.map(a=>qA(e,a)),s}}const r=function $Z(e){return new Vi(new Ii(e.url),new Ii(e.params),new Ii(e.queryParams),new Ii(e.fragment),new Ii(e.data),e.outlet,e.component,e)}(n.value),i=n.children.map(o=>qA(e,o));return new Io(r,i)}}class S0{redirectTo;navigationBehaviorOptions;constructor(n,t){this.redirectTo=n,this.navigationBehaviorOptions=t}}const Bx="ngNavigationCancelingError";function Cp(e,n){const{redirectTo:t,navigationBehaviorOptions:r}=pc(n)?{redirectTo:n,navigationBehaviorOptions:void 0}:n,i=wx(!1,Qi.Redirect);return i.url=t,i.navigationBehaviorOptions=r,i}function wx(e,n){const t=new Error(`NavigationCancelingError: ${e||""}`);return t[Bx]=!0,t.cancellationCode=n,t}function vx(e){return!!e&&e[Bx]}class eX{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(n,t,r,i,o){this.routeReuseStrategy=n,this.futureState=t,this.currState=r,this.forwardEvent=i,this.inputBindingEnabled=o}activate(n){const t=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,r,n),b0(this.futureState.root),this.activateChildRoutes(t,r,n)}deactivateChildRoutes(n,t,r){const i=uu(t);n.children.forEach(o=>{const s=o.value.outlet;this.deactivateRoutes(o,i[s],r),delete i[s]}),Object.values(i).forEach(o=>{this.deactivateRouteAndItsChildren(o,r)})}deactivateRoutes(n,t,r){const i=n.value,o=t?t.value:null;if(i===o)if(i.component){const s=r.getContext(i.outlet);s&&this.deactivateChildRoutes(n,t,s.children)}else this.deactivateChildRoutes(n,t,r);else o&&this.deactivateRouteAndItsChildren(t,r)}deactivateRouteAndItsChildren(n,t){n.value.component&&this.routeReuseStrategy.shouldDetach(n.value.snapshot)?this.detachAndStoreRouteSubtree(n,t):this.deactivateRouteAndOutlet(n,t)}detachAndStoreRouteSubtree(n,t){const r=t.getContext(n.value.outlet),i=r&&n.value.component?r.children:t,o=uu(n);for(const s of Object.values(o))this.deactivateRouteAndItsChildren(s,i);if(r&&r.outlet){const s=r.outlet.detach(),a=r.children.onOutletDeactivated();this.routeReuseStrategy.store(n.value.snapshot,{componentRef:s,route:n,contexts:a})}}deactivateRouteAndOutlet(n,t){const r=t.getContext(n.value.outlet),i=r&&n.value.component?r.children:t,o=uu(n);for(const s of Object.values(o))this.deactivateRouteAndItsChildren(s,i);r&&(r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated()),r.attachRef=null,r.route=null)}activateChildRoutes(n,t,r){const i=uu(t);n.children.forEach(o=>{this.activateRoutes(o,i[o.value.outlet],r),this.forwardEvent(new UZ(o.value.snapshot))}),n.children.length&&this.forwardEvent(new RZ(n.value.snapshot))}activateRoutes(n,t,r){const i=n.value,o=t?t.value:null;if(b0(i),i===o)if(i.component){const s=r.getOrCreateContext(i.outlet);this.activateChildRoutes(n,t,s.children)}else this.activateChildRoutes(n,t,r);else if(i.component){const s=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const a=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),s.children.onOutletReAttached(a.contexts),s.attachRef=a.componentRef,s.route=a.route.value,s.outlet&&s.outlet.attach(a.componentRef,a.route.value),b0(a.route.value),this.activateChildRoutes(n,null,s.children)}else s.attachRef=null,s.route=i,s.outlet&&s.outlet.activateWith(i,s.injector),this.activateChildRoutes(n,null,s.children)}else this.activateChildRoutes(n,null,r)}}class _x{path;route;constructor(n){this.path=n,this.route=this.path[this.path.length-1]}}class yp{component;route;constructor(n,t){this.component=n,this.route=t}}function tX(e,n,t){const r=e._root;return zA(r,n?n._root:null,t,[r.value])}function Au(e,n){const t=Symbol(),r=n.get(e,t);return r===t?"function"!=typeof e||function i8(e){return null!==qf(e)}(e)?n.get(e):e:r}function zA(e,n,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=uu(n);return e.children.forEach(s=>{(function rX(e,n,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=e.value,s=n?n.value:null,a=t?t.getContext(e.value.outlet):null;if(s&&o.routeConfig===s.routeConfig){const c=function iX(e,n,t){if("function"==typeof t)return t(e,n);switch(t){case"pathParamsChange":return!hc(e.url,n.url);case"pathParamsOrQueryParamsChange":return!hc(e.url,n.url)||!Go(e.queryParams,n.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Q0(e,n)||!Go(e.queryParams,n.queryParams);default:return!Q0(e,n)}}(s,o,o.routeConfig.runGuardsAndResolvers);c?i.canActivateChecks.push(new _x(r)):(o.data=s.data,o._resolvedData=s._resolvedData),zA(e,n,o.component?a?a.children:null:t,r,i),c&&a&&a.outlet&&a.outlet.isActivated&&i.canDeactivateChecks.push(new yp(a.outlet.component,s))}else s&&KA(n,a,i),i.canActivateChecks.push(new _x(r)),zA(e,null,o.component?a?a.children:null:t,r,i)})(s,o[s.value.outlet],t,r.concat([s.value]),i),delete o[s.value.outlet]}),Object.entries(o).forEach(([s,a])=>KA(a,t.getContext(s),i)),i}function KA(e,n,t){const r=uu(e),i=e.value;Object.entries(r).forEach(([o,s])=>{KA(s,i.component?n?n.children.getContext(o):null:n,t)}),t.canDeactivateChecks.push(new yp(i.component&&n&&n.outlet&&n.outlet.isActivated?n.outlet.component:null,i))}function JA(e){return"function"==typeof e}function bx(e){return e instanceof np||"EmptyError"===e?.name}const Ep=Symbol("INITIAL_VALUE");function fu(){return Lo(e=>u0(e.map(n=>n.pipe(su(1),function T7(...e){const n=tp(e);return Dr((t,r)=>{(n?d0(e,t,n):d0(e,t)).subscribe(r)})}(Ep)))).pipe(cn(n=>{for(const t of n)if(!0!==t){if(t===Ep)return Ep;if(!1===t||dX(t))return t}return!0}),ra(n=>n!==Ep),su(1)))}function dX(e){return pc(e)||e instanceof S0}function Qx(e){return function xH(...e){return cb(e)}(Wr(n=>{if("boolean"!=typeof n)throw Cp(0,n)}),cn(n=>!0===n))}class k0{segmentGroup;constructor(n){this.segmentGroup=n||null}}class M0 extends Error{urlTree;constructor(n){super(),this.urlTree=n}}function gu(e){return rp(new k0(e))}class vX{urlSerializer;urlTree;constructor(n,t){this.urlSerializer=n,this.urlTree=t}lineralizeSegments(n,t){let r=[],i=t.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return xt(r);if(i.numberOfChildren>1||!i.children[Ut])return rp(new Pe(4e3,!1));i=i.children[Ut]}}applyRedirectCommands(n,t,r,i,o){if("string"!=typeof t){const a=t,{queryParams:c,fragment:l,routeConfig:u,url:d,outlet:f,params:A,data:p,title:C}=i,E=no(o,()=>a({params:A,data:p,queryParams:c,fragment:l,routeConfig:u,url:d,outlet:f,title:C}));if(E instanceof gc)throw new M0(E);t=E}const s=this.applyRedirectCreateUrlTree(t,this.urlSerializer.parse(t),n,r);if("/"===t[0])throw new M0(s);return s}applyRedirectCreateUrlTree(n,t,r,i){const o=this.createSegmentGroup(n,t.root,r,i);return new gc(o,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(n,t){const r={};return Object.entries(n).forEach(([i,o])=>{if("string"==typeof o&&":"===o[0]){const a=o.substring(1);r[i]=t[a]}else r[i]=o}),r}createSegmentGroup(n,t,r,i){const o=this.createSegments(n,t.segments,r,i);let s={};return Object.entries(t.children).forEach(([a,c])=>{s[a]=this.createSegmentGroup(n,c,r,i)}),new pn(o,s)}createSegments(n,t,r,i){return t.map(o=>":"===o.path[0]?this.findPosParam(n,o,i):this.findOrReturn(o,r))}findPosParam(n,t,r){const i=r[t.path.substring(1)];if(!i)throw new Pe(4001,!1);return i}findOrReturn(n,t){let r=0;for(const i of t){if(i.path===n.path)return t.splice(r),i;r++}return n}}const F0={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function _X(e,n,t,r,i){const o=Dx(e,n,t);return o.matched?(r=function HZ(e,n){return e.providers&&!e._injector&&(e._injector=ch(e.providers,n,`Route: ${e.path}`)),e._injector??n}(n,r),function EX(e,n,t,r){const i=n.canMatch;return i&&0!==i.length?xt(i.map(s=>{const a=Au(s,e);return oa(function uX(e){return e&&JA(e.canMatch)}(a)?a.canMatch(n,t):no(e,()=>a(n,t)))})).pipe(fu(),Qx()):xt(!0)}(r,n,t).pipe(cn(s=>!0===s?o:{...F0}))):xt(o)}function Dx(e,n,t){if("**"===n.path)return function bX(e){return{matched:!0,parameters:e.length>0?j2(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}(t);if(""===n.path)return"full"===n.pathMatch&&(e.hasChildren()||t.length>0)?{...F0}:{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};const i=(n.matcher||rZ)(t,e,n);if(!i)return{...F0};const o={};Object.entries(i.posParams??{}).forEach(([a,c])=>{o[a]=c.path});const s=i.consumed.length>0?{...o,...i.consumed[i.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:i.consumed,remainingSegments:t.slice(i.consumed.length),parameters:s,positionalParamSegments:i.posParams??{}}}function Sx(e,n,t,r){return t.length>0&&function SX(e,n,t){return t.some(r=>Bp(e,n,r)&&po(r)!==Ut)}(e,t,r)?{segmentGroup:new pn(n,DX(r,new pn(t,e.children))),slicedSegments:[]}:0===t.length&&function kX(e,n,t){return t.some(r=>Bp(e,n,r))}(e,t,r)?{segmentGroup:new pn(e.segments,QX(e,t,r,e.children)),slicedSegments:t}:{segmentGroup:new pn(e.segments,e.children),slicedSegments:t}}function QX(e,n,t,r){const i={};for(const o of t)if(Bp(e,n,o)&&!r[po(o)]){const s=new pn([],{});i[po(o)]=s}return{...r,...i}}function DX(e,n){const t={};t[Ut]=n;for(const r of e)if(""===r.path&&po(r)!==Ut){const i=new pn([],{});t[po(r)]=i}return t}function Bp(e,n,t){return(!(e.hasChildren()||n.length>0)||"full"!==t.pathMatch)&&""===t.path}class FX{}class TX{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(n,t,r,i,o,s,a){this.injector=n,this.configLoader=t,this.rootComponentType=r,this.config=i,this.urlTree=o,this.paramsInheritanceStrategy=s,this.urlSerializer=a,this.applyRedirects=new vX(this.urlSerializer,this.urlTree)}noMatchError(n){return new Pe(4002,`'${n.segmentGroup}'`)}recognize(){const n=Sx(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(n).pipe(cn(({children:t,rootSnapshot:r})=>{const i=new Io(r,t),o=new Ix("",i),s=function wZ(e,n,t=null,r=null){return sx(ox(e),n,t,r)}(r,[],this.urlTree.queryParams,this.urlTree.fragment);return s.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(s),{state:o,tree:s}}))}match(n){const t=new Ip([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Object.freeze({}),Ut,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,n,Ut,t).pipe(cn(r=>({children:r,rootSnapshot:t})),au(r=>{if(r instanceof M0)return this.urlTree=r.urlTree,this.match(r.urlTree.root);throw r instanceof k0?this.noMatchError(r):r}))}processSegmentGroup(n,t,r,i,o){return 0===r.segments.length&&r.hasChildren()?this.processChildren(n,t,r,o):this.processSegment(n,t,r,r.segments,i,!0,o).pipe(cn(s=>s instanceof Io?[s]:[]))}processChildren(n,t,r,i){const o=[];for(const s of Object.keys(r.children))"primary"===s?o.unshift(s):o.push(s);return Br(o).pipe(xA(s=>{const a=r.children[s],c=function qZ(e,n){const t=e.filter(r=>po(r)===n);return t.push(...e.filter(r=>po(r)!==n)),t}(t,s);return this.processSegmentGroup(n,c,a,s,i)}),function P7(e,n){return Dr(function R7(e,n,t,r,i){return(o,s)=>{let a=t,c=n,l=0;o.subscribe(dr(s,u=>{const d=l++;c=a?e(c,u,d):(a=!0,u),r&&s.next(c)},i&&(()=>{a&&s.next(c),s.complete()})))}}(e,n,arguments.length>=2,!0))}((s,a)=>(s.push(...a),s)),ip(null),function U7(e,n){const t=arguments.length>=2;return r=>r.pipe(e?ra((i,o)=>e(i,o,r)):xa,f0(1),t?ip(n):L2(()=>new np))}(),Ur(s=>{if(null===s)return gu(r);const a=kx(s);return function OX(e){e.sort((n,t)=>n.value.outlet===Ut?-1:t.value.outlet===Ut?1:n.value.outlet.localeCompare(t.value.outlet))}(a),xt(a)}))}processSegment(n,t,r,i,o,s,a){return Br(t).pipe(xA(c=>this.processSegmentAgainstRoute(c._injector??n,t,c,r,i,o,s,a).pipe(au(l=>{if(l instanceof k0)return xt(null);throw l}))),fc(c=>!!c),au(c=>{if(bx(c))return function MX(e,n,t){return 0===n.length&&!e.children[t]}(r,i,o)?xt(new FX):gu(r);throw c}))}processSegmentAgainstRoute(n,t,r,i,o,s,a,c){return po(r)===s||s!==Ut&&Bp(i,o,r)?void 0===r.redirectTo?this.matchSegmentAgainstRoute(n,i,r,o,s,c):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(n,i,t,r,o,s,c):gu(i):gu(i)}expandSegmentAgainstRouteUsingRedirect(n,t,r,i,o,s,a){const{matched:c,parameters:l,consumedSegments:u,positionalParamSegments:d,remainingSegments:f}=Dx(t,i,o);if(!c)return gu(t);"string"==typeof i.redirectTo&&"/"===i.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const A=new Ip(o,l,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Mx(i),po(i),i.component??i._loadedComponent??null,i,Fx(i)),p=pp(A,a,this.paramsInheritanceStrategy);A.params=Object.freeze(p.params),A.data=Object.freeze(p.data);const C=this.applyRedirects.applyRedirectCommands(u,i.redirectTo,d,A,n);return this.applyRedirects.lineralizeSegments(i,C).pipe(Ur(E=>this.processSegment(n,r,t,E.concat(f),s,!1,a)))}matchSegmentAgainstRoute(n,t,r,i,o,s){const a=_X(t,r,i,n);return"**"===r.path&&(t.children={}),a.pipe(Lo(c=>c.matched?this.getChildConfig(n=r._injector??n,r,i).pipe(Lo(({routes:l})=>{const u=r._loadedInjector??n,{parameters:d,consumedSegments:f,remainingSegments:A}=c,p=new Ip(f,d,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Mx(r),po(r),r.component??r._loadedComponent??null,r,Fx(r)),C=pp(p,s,this.paramsInheritanceStrategy);p.params=Object.freeze(C.params),p.data=Object.freeze(C.data);const{segmentGroup:E,slicedSegments:Q}=Sx(t,f,A,l);if(0===Q.length&&E.hasChildren())return this.processChildren(u,l,E,p).pipe(cn(se=>new Io(p,se)));if(0===l.length&&0===Q.length)return xt(new Io(p,[]));const F=po(r)===o;return this.processSegment(u,l,E,Q,F?Ut:o,!0,p).pipe(cn(se=>new Io(p,se instanceof Io?[se]:[])))})):gu(t)))}getChildConfig(n,t,r){return t.children?xt({routes:t.children,injector:n}):t.loadChildren?void 0!==t._loadedRoutes?xt({routes:t._loadedRoutes,injector:t._loadedInjector}):function yX(e,n,t,r){const i=n.canLoad;return void 0===i||0===i.length?xt(!0):xt(i.map(s=>{const a=Au(s,e);return oa(function sX(e){return e&&JA(e.canLoad)}(a)?a.canLoad(n,t):no(e,()=>a(n,t)))})).pipe(fu(),Qx())}(n,t,r).pipe(Ur(i=>i?this.configLoader.loadChildren(n,t).pipe(Wr(o=>{t._loadedRoutes=o.routes,t._loadedInjector=o.injector})):function wX(){return rp(wx(!1,Qi.GuardRejected))}())):xt({routes:[],injector:n})}}function RX(e){const n=e.value.routeConfig;return n&&""===n.path}function kx(e){const n=[],t=new Set;for(const r of e){if(!RX(r)){n.push(r);continue}const i=n.find(o=>r.value.routeConfig===o.value.routeConfig);void 0!==i?(i.children.push(...r.children),t.add(i)):n.push(r)}for(const r of t){const i=kx(r.children);n.push(new Io(r.value,i))}return n.filter(r=>!t.has(r))}function Mx(e){return e.data||{}}function Fx(e){return e.resolve||{}}function Nx(e){const n=e.children.map(t=>Nx(t)).flat();return[e,...n]}function N0(e){return Lo(n=>{const t=e(n);return t?Br(t).pipe(cn(()=>n)):xt(n)})}let xx=(()=>{class e{buildTitle(t){let r,i=t.root;for(;void 0!==i;)r=this.getResolvedTitleForRoute(i)??r,i=i.children.find(o=>o.outlet===Ut);return r}getResolvedTitleForRoute(t){return t.data[OA]}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:()=>de(VX),providedIn:"root"})}return e})(),VX=(()=>{class e extends xx{title;constructor(t){super(),this.title=t}updateTitle(t){const r=this.buildTitle(t);void 0!==r&&this.title.setTitle(r)}static \u0275fac=function(r){return new(r||e)(_t(Z7))};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const jA=new $e("",{providedIn:"root",factory:()=>({})}),YA=new $e("");let x0=(()=>{class e{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=de(xj);loadComponent(t){if(this.componentLoaders.get(t))return this.componentLoaders.get(t);if(t._loadedComponent)return xt(t._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(t);const r=oa(t.loadComponent()).pipe(cn(Tx),Wr(o=>{this.onLoadEndListener&&this.onLoadEndListener(t),t._loadedComponent=o}),g0(()=>{this.componentLoaders.delete(t)})),i=new H2(r,()=>new ni).pipe(A0());return this.componentLoaders.set(t,i),i}loadChildren(t,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return xt({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);const o=function qX(e,n,t,r){return oa(e.loadChildren()).pipe(cn(Tx),Ur(i=>i instanceof tk||Array.isArray(i)?xt(i):Br(n.compileModuleAsync(i))),cn(i=>{r&&r(e);let o,s,a=!1;return Array.isArray(i)?(s=i,!0):(o=i.create(t).injector,s=o.get(YA,[],{optional:!0,self:!0}).flat()),{routes:s.map(D0),injector:o}}))}(r,this.compiler,t,this.onLoadEndListener).pipe(g0(()=>{this.childrenLoaders.delete(r)})),s=new H2(o,()=>new ni).pipe(A0());return this.childrenLoaders.set(r,s),s}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Tx(e){return function zX(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let T0=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:()=>de(KX),providedIn:"root"})}return e})(),KX=(()=>{class e{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,r){return t}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Ox=new $e(""),Rx=new $e("");function JX(e,n,t){const r=e.get(Rx),i=e.get(Ui);return e.get(tn).runOutsideAngular(()=>{if(!i.startViewTransition||r.skipNextTransition)return r.skipNextTransition=!1,new Promise(l=>setTimeout(l));let o;const s=new Promise(l=>{o=l}),a=i.startViewTransition(()=>(o(),function jX(e){return new Promise(n=>{Ay({read:()=>setTimeout(n)},{injector:e})})}(e))),{onViewTransitionCreated:c}=r;return c&&no(e,()=>c({transition:a,from:n,to:t})),s})}const Px=new $e("");let O0=(()=>{class e{currentNavigation=null;currentTransition=null;lastSuccessfulNavigation=null;events=new ni;transitionAbortSubject=new ni;configLoader=de(x0);environmentInjector=de(si);destroyRef=de(ko);urlSerializer=de(PA);rootContexts=de(VA);location=de(_A);inputBindingEnabled=null!==de(mp,{optional:!0});titleStrategy=de(xx);options=de(jA,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=de(T0);createViewTransition=de(Ox,{optional:!0});navigationErrorHandler=de(Px,{optional:!0});navigationId=0;get hasRequestedNavigation(){return 0!==this.navigationId}transitions;afterPreactivation=()=>xt(void 0);rootComponentType=null;destroyed=!1;constructor(){this.configLoader.onLoadEndListener=i=>this.events.next(new TZ(i)),this.configLoader.onLoadStartListener=i=>this.events.next(new xZ(i)),this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(t){const r=++this.navigationId;this.transitions?.next({...t,extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl),targetSnapshot:null,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null,id:r})}setupNavigations(t){return this.transitions=new Ii(null),this.transitions.pipe(ra(r=>null!==r),Lo(r=>{let i=!1,o=!1;return xt(r).pipe(Lo(s=>{if(this.navigationId>r.id)return this.cancelNavigationTransition(r,"",Qi.SupersededByNewNavigation),ho;this.currentTransition=r,this.currentNavigation={id:s.id,initialUrl:s.rawUrl,extractedUrl:s.extractedUrl,targetBrowserUrl:"string"==typeof s.extras.browserUrl?this.urlSerializer.parse(s.extras.browserUrl):s.extras.browserUrl,trigger:s.source,extras:s.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const a=!t.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!a&&"reload"!==(s.extras.onSameUrlNavigation??t.onSameUrlNavigation)){const l="";return this.events.next(new lu(s.id,this.urlSerializer.serialize(s.rawUrl),l,gp.IgnoredSameUrlNavigation)),s.resolve(!1),ho}if(this.urlHandlingStrategy.shouldProcessUrl(s.rawUrl))return xt(s).pipe(Lo(l=>(this.events.next(new fp(l.id,this.urlSerializer.serialize(l.extractedUrl),l.source,l.restoredState)),l.id!==this.navigationId?ho:Promise.resolve(l))),function PX(e,n,t,r,i,o){return Ur(s=>function NX(e,n,t,r,i,o,s="emptyOnly"){return new TX(e,n,t,r,i,s,o).recognize()}(e,n,t,r,s.extractedUrl,i,o).pipe(cn(({state:a,tree:c})=>({...s,targetSnapshot:a,urlAfterRedirects:c}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,t.config,this.urlSerializer,this.paramsInheritanceStrategy),Wr(l=>{r.targetSnapshot=l.targetSnapshot,r.urlAfterRedirects=l.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:l.urlAfterRedirects};const u=new Ax(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(u)}));if(a&&this.urlHandlingStrategy.shouldProcessUrl(s.currentRawUrl)){const{id:l,extractedUrl:u,source:d,restoredState:f,extras:A}=s,p=new fp(l,this.urlSerializer.serialize(u),d,f);this.events.next(p);const C=px(this.rootComponentType).snapshot;return this.currentTransition=r={...s,targetSnapshot:C,urlAfterRedirects:u,extras:{...A,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=u,xt(r)}{const l="";return this.events.next(new lu(s.id,this.urlSerializer.serialize(s.extractedUrl),l,gp.IgnoredByUrlHandlingStrategy)),s.resolve(!1),ho}}),Wr(s=>{const a=new kZ(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects),s.targetSnapshot);this.events.next(a)}),cn(s=>(this.currentTransition=r={...s,guards:tX(s.targetSnapshot,s.currentSnapshot,this.rootContexts)},r)),function AX(e,n){return Ur(t=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:s}}=t;return 0===s.length&&0===o.length?xt({...t,guardsResult:!0}):function fX(e,n,t,r){return Br(e).pipe(Ur(i=>function CX(e,n,t,r,i){const o=n&&n.routeConfig?n.routeConfig.canDeactivate:null;return o&&0!==o.length?xt(o.map(a=>{const c=GA(n)??i,l=Au(a,c);return oa(function lX(e){return e&&JA(e.canDeactivate)}(l)?l.canDeactivate(e,n,t,r):no(c,()=>l(e,n,t,r))).pipe(fc())})).pipe(fu()):xt(!0)}(i.component,i.route,t,n,r)),fc(i=>!0!==i,!0))}(s,r,i,e).pipe(Ur(a=>a&&function oX(e){return"boolean"==typeof e}(a)?function gX(e,n,t,r){return Br(n).pipe(xA(i=>d0(function pX(e,n){return null!==e&&n&&n(new OZ(e)),xt(!0)}(i.route.parent,r),function hX(e,n){return null!==e&&n&&n(new PZ(e)),xt(!0)}(i.route,r),function mX(e,n,t){const r=n[n.length-1],o=n.slice(0,n.length-1).reverse().map(s=>function nX(e){const n=e.routeConfig?e.routeConfig.canActivateChild:null;return n&&0!==n.length?{node:e,guards:n}:null}(s)).filter(s=>null!==s).map(s=>U2(()=>xt(s.guards.map(c=>{const l=GA(s.node)??t,u=Au(c,l);return oa(function cX(e){return e&&JA(e.canActivateChild)}(u)?u.canActivateChild(r,e):no(l,()=>u(r,e))).pipe(fc())})).pipe(fu())));return xt(o).pipe(fu())}(e,i.path,t),function IX(e,n,t){const r=n.routeConfig?n.routeConfig.canActivate:null;if(!r||0===r.length)return xt(!0);const i=r.map(o=>U2(()=>{const s=GA(n)??t,a=Au(o,s);return oa(function aX(e){return e&&JA(e.canActivate)}(a)?a.canActivate(n,e):no(s,()=>a(n,e))).pipe(fc())}));return xt(i).pipe(fu())}(e,i.route,t))),fc(i=>!0!==i,!0))}(r,o,e,n):xt(a)),cn(a=>({...t,guardsResult:a})))})}(this.environmentInjector,s=>this.events.next(s)),Wr(s=>{if(r.guardsResult=s.guardsResult,s.guardsResult&&"boolean"!=typeof s.guardsResult)throw Cp(0,s.guardsResult);const a=new MZ(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects),s.targetSnapshot,!!s.guardsResult);this.events.next(a)}),ra(s=>!!s.guardsResult||(this.cancelNavigationTransition(s,"",Qi.GuardRejected),!1)),N0(s=>{if(0!==s.guards.canActivateChecks.length)return xt(s).pipe(Wr(a=>{const c=new FZ(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(c)}),Lo(a=>{let c=!1;return xt(a).pipe(function UX(e,n){return Ur(t=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=t;if(!i.length)return xt(t);const o=new Set(i.map(c=>c.route)),s=new Set;for(const c of o)if(!s.has(c))for(const l of Nx(c))s.add(l);let a=0;return Br(s).pipe(xA(c=>o.has(c)?function HX(e,n,t,r){const i=e.routeConfig,o=e._resolve;return void 0!==i?.title&&!Cx(i)&&(o[OA]=i.title),function LX(e,n,t,r){const i=p0(e);if(0===i.length)return xt({});const o={};return Br(i).pipe(Ur(s=>function GX(e,n,t,r){const i=GA(n)??r,o=Au(e,i);return oa(o.resolve?o.resolve(n,t):no(i,()=>o(n,t)))}(e[s],n,t,r).pipe(fc(),Wr(a=>{if(a instanceof S0)throw Cp(new sp,a);o[s]=a}))),f0(1),cn(()=>o),au(s=>bx(s)?ho:rp(s)))}(o,e,n,r).pipe(cn(s=>(e._resolvedData=s,e.data=pp(e,e.parent,t).resolve,null)))}(c,r,e,n):(c.data=pp(c,c.parent,e).resolve,xt(void 0))),Wr(()=>a++),f0(1),Ur(c=>a===s.size?xt(t):ho))})}(this.paramsInheritanceStrategy,this.environmentInjector),Wr({next:()=>c=!0,complete:()=>{c||this.cancelNavigationTransition(a,"",Qi.NoDataFromResolver)}}))}),Wr(a=>{const c=new NZ(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(c)}))}),N0(s=>{const a=c=>{const l=[];c.routeConfig?.loadComponent&&!c.routeConfig._loadedComponent&&l.push(this.configLoader.loadComponent(c.routeConfig).pipe(Wr(u=>{c.component=u}),cn(()=>{})));for(const u of c.children)l.push(...a(u));return l};return u0(a(s.targetSnapshot.root)).pipe(ip(null),su(1))}),N0(()=>this.afterPreactivation()),Lo(()=>{const{currentSnapshot:s,targetSnapshot:a}=r,c=this.createViewTransition?.(this.environmentInjector,s.root,a.root);return c?Br(c).pipe(cn(()=>r)):xt(r)}),cn(s=>{const a=function YZ(e,n,t){const r=qA(e,n._root,t?t._root:void 0);return new hx(r,n)}(t.routeReuseStrategy,s.targetSnapshot,s.currentRouterState);return this.currentTransition=r={...s,targetRouterState:a},this.currentNavigation.targetRouterState=a,r}),Wr(()=>{this.events.next(new B0)}),((e,n,t,r)=>cn(i=>(new eX(n,i.targetRouterState,i.currentRouterState,t,r).activate(e),i)))(this.rootContexts,t.routeReuseStrategy,s=>this.events.next(s),this.inputBindingEnabled),su(1),Wr({next:s=>{i=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new _s(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects))),this.titleStrategy?.updateTitle(s.targetRouterState.snapshot),s.resolve(!0)},complete:()=>{i=!0}}),function H7(e){return Dr((n,t)=>{Ho(e).subscribe(dr(t,()=>t.complete(),dt)),!t.closed&&n.subscribe(t)})}(this.transitionAbortSubject.pipe(Wr(s=>{throw s}))),g0(()=>{!i&&!o&&this.cancelNavigationTransition(r,"",Qi.SupersededByNewNavigation),this.currentTransition?.id===r.id&&(this.currentNavigation=null,this.currentTransition=null)}),au(s=>{if(this.destroyed)return r.resolve(!1),ho;if(o=!0,vx(s))this.events.next(new Ic(r.id,this.urlSerializer.serialize(r.extractedUrl),s.message,s.cancellationCode)),function ZZ(e){return vx(e)&&pc(e.url)}(s)?this.events.next(new hp(s.url,s.navigationBehaviorOptions)):r.resolve(!1);else{const a=new E0(r.id,this.urlSerializer.serialize(r.extractedUrl),s,r.targetSnapshot??void 0);try{const c=no(this.environmentInjector,()=>this.navigationErrorHandler?.(a));if(!(c instanceof S0))throw this.events.next(a),s;{const{message:l,cancellationCode:u}=Cp(0,c);this.events.next(new Ic(r.id,this.urlSerializer.serialize(r.extractedUrl),l,u)),this.events.next(new hp(c.redirectTo,c.navigationBehaviorOptions))}}catch(c){this.options.resolveNavigationPromiseOnError?r.resolve(!1):r.reject(c)}}return ho}))}))}cancelNavigationTransition(t,r,i){const o=new Ic(t.id,this.urlSerializer.serialize(t.extractedUrl),r,i);this.events.next(o),t.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){const t=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),r=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return t.toString()!==r?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function YX(e){return e!==Ap}let WX=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:()=>de(ZX),providedIn:"root"})}return e})();class $X{shouldDetach(n){return!1}store(n,t){}shouldAttach(n){return!1}retrieve(n){return null}shouldReuseRoute(n,t){return n.routeConfig===t.routeConfig}}let ZX=(()=>{class e extends $X{static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Ux=(()=>{class e{urlSerializer=de(PA);options=de(jA,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";location=de(_A);urlHandlingStrategy=de(T0);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new gc;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}createBrowserPath({finalUrl:t,initialUrl:r,targetBrowserUrl:i}){const o=void 0!==t?this.urlHandlingStrategy.merge(t,r):r,s=i??o;return s instanceof gc?this.urlSerializer.serialize(s):s}commitTransition({targetRouterState:t,finalUrl:r,initialUrl:i}){r&&t?(this.currentUrlTree=r,this.rawUrlTree=this.urlHandlingStrategy.merge(r,i),this.routerState=t):this.rawUrlTree=i}routerState=px(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();updateStateMemento(){this.stateMemento=this.createStateMemento()}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}resetInternalState({finalUrl:t}){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t??this.rawUrlTree)}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:()=>de(XX),providedIn:"root"})}return e})(),XX=(()=>{class e extends Ux{currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}registerNonRouterCurrentEntryChangeListener(t){return this.location.subscribe(r=>{"popstate"===r.type&&setTimeout(()=>{t(r.url,r.state,"popstate")})})}handleRouterEvent(t,r){t instanceof fp?this.updateStateMemento():t instanceof lu?this.commitTransition(r):t instanceof Ax?"eager"===this.urlUpdateStrategy&&(r.extras.skipLocationChange||this.setBrowserUrl(this.createBrowserPath(r),r)):t instanceof B0?(this.commitTransition(r),"deferred"===this.urlUpdateStrategy&&!r.extras.skipLocationChange&&this.setBrowserUrl(this.createBrowserPath(r),r)):t instanceof Ic&&(t.code===Qi.GuardRejected||t.code===Qi.NoDataFromResolver)?this.restoreHistory(r):t instanceof E0?this.restoreHistory(r,!0):t instanceof _s&&(this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId)}setBrowserUrl(t,{extras:r,id:i}){const{replaceUrl:o,state:s}=r;if(this.location.isCurrentPathEqualTo(t)||o){const a=this.browserPageId,c={...s,...this.generateNgRouterState(i,a)};this.location.replaceState(t,"",c)}else{const a={...s,...this.generateNgRouterState(i,this.browserPageId+1)};this.location.go(t,"",a)}}restoreHistory(t,r=!1){if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-this.browserPageId;0!==o?this.location.historyGo(o):this.getCurrentUrlTree()===t.finalUrl&&0===o&&(this.resetInternalState(t),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(r&&this.resetInternalState(t),this.resetUrlToCurrentUrlTree())}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.getRawUrlTree()),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,r){return"computed"===this.canceledNavigationResolution?{navigationId:t,\u0275routerPageId:r}:{navigationId:t}}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Hx(e,n){e.events.pipe(ra(t=>t instanceof _s||t instanceof Ic||t instanceof E0||t instanceof lu),cn(t=>t instanceof _s||t instanceof lu?0:t instanceof Ic&&(t.code===Qi.Redirect||t.code===Qi.SupersededByNewNavigation)?2:1),ra(t=>2!==t),su(1)).subscribe(()=>{n()})}const eee={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},tee={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let An=(()=>{class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=de(UE);stateManager=de(Ux);options=de(jA,{optional:!0})||{};pendingTasks=de(Wa);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=de(O0);urlSerializer=de(PA);location=de(_A);urlHandlingStrategy=de(T0);_events=new ni;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=de(WX);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=de(YA,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!de(mp,{optional:!0});constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this).subscribe({error:t=>{this.console.warn(t)}}),this.subscribeToNavigationEvents()}eventsSubscription=new m;subscribeToNavigationEvents(){const t=this.navigationTransitions.events.subscribe(r=>{try{const i=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(null!==i&&null!==o)if(this.stateManager.handleRouterEvent(r,o),r instanceof Ic&&r.code!==Qi.Redirect&&r.code!==Qi.SupersededByNewNavigation)this.navigated=!0;else if(r instanceof _s)this.navigated=!0;else if(r instanceof hp){const s=r.navigationBehaviorOptions,a=this.urlHandlingStrategy.merge(r.url,i.currentRawUrl),c={browserUrl:i.extras.browserUrl,info:i.extras.info,skipLocationChange:i.extras.skipLocationChange,replaceUrl:i.extras.replaceUrl||"eager"===this.urlUpdateStrategy||YX(i.source),...s};this.scheduleNavigation(a,Ap,null,c,{resolve:i.resolve,reject:i.reject,promise:i.promise})}(function ree(e){return!(e instanceof B0||e instanceof hp)})(r)&&this._events.next(r)}catch(i){this.navigationTransitions.transitionAbortSubject.next(i)}});this.eventsSubscription.add(t)}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Ap,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((t,r,i)=>{this.navigateToSyncWithBrowser(t,i,r)})}navigateToSyncWithBrowser(t,r,i){const o={replaceUrl:!0},s=i?.navigationId?i:null;if(i){const c={...i};delete c.navigationId,delete c.\u0275routerPageId,0!==Object.keys(c).length&&(o.state=c)}const a=this.parseUrl(t);this.scheduleNavigation(a,r,s,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(t){this.config=t.map(D0),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(t,r={}){const{relativeTo:i,queryParams:o,fragment:s,queryParamsHandling:a,preserveFragment:c}=r,l=c?this.currentUrlTree.fragment:s;let d,u=null;switch(a??this.options.defaultQueryParamsHandling){case"merge":u={...this.currentUrlTree.queryParams,...o};break;case"preserve":u=this.currentUrlTree.queryParams;break;default:u=o||null}null!==u&&(u=this.removeEmptyProps(u));try{d=ox(i?i.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof t[0]||"/"!==t[0][0])&&(t=[]),d=this.currentUrlTree.root}return sx(d,t,u,l??null)}navigateByUrl(t,r={skipLocationChange:!1}){const i=pc(t)?t:this.parseUrl(t),o=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(o,Ap,null,r)}navigate(t,r={skipLocationChange:!1}){return function nee(e){for(let n=0;n<e.length;n++)if(null==e[n])throw new Pe(4008,!1)}(t),this.navigateByUrl(this.createUrlTree(t,r),r)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){try{return this.urlSerializer.parse(t)}catch{return this.urlSerializer.parse("/")}}isActive(t,r){let i;if(i=!0===r?{...eee}:!1===r?{...tee}:r,pc(t))return W2(this.currentUrlTree,t,i);const o=this.parseUrl(t);return W2(this.currentUrlTree,o,i)}removeEmptyProps(t){return Object.entries(t).reduce((r,[i,o])=>(null!=o&&(r[i]=o),r),{})}scheduleNavigation(t,r,i,o,s){if(this.disposed)return Promise.resolve(!1);let a,c,l;s?(a=s.resolve,c=s.reject,l=s.promise):l=new Promise((d,f)=>{a=d,c=f});const u=this.pendingTasks.add();return Hx(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(u))}),this.navigationTransitions.handleNavigationRequest({source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:o,resolve:a,reject:c,promise:l,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),l.catch(d=>Promise.reject(d))}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),vp=(()=>{class e{router;route;tabIndexAttribute;renderer;el;locationStrategy;href=null;target;queryParams;fragment;queryParamsHandling;state;info;relativeTo;isAnchorElement;subscription;onChanges=new ni;constructor(t,r,i,o,s,a){this.router=t,this.route=r,this.tabIndexAttribute=i,this.renderer=o,this.el=s,this.locationStrategy=a;const c=s.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===c||"area"===c,this.isAnchorElement?this.subscription=t.events.subscribe(l=>{l instanceof _s&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}preserveFragment=!1;skipLocationChange=!1;replaceUrl=!1;setTabIndexIfNotOnNativeEl(t){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",t)}ngOnChanges(t){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}routerLinkInput=null;set routerLink(t){null==t?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(this.routerLinkInput=pc(t)||Array.isArray(t)?t:[t],this.setTabIndexIfNotOnNativeEl("0"))}onClick(t,r,i,o,s){const a=this.urlTree;return!!(null===a||this.isAnchorElement&&(0!==t||r||i||o||s||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(a,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){const t=this.urlTree;this.href=null!==t&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(t)):null;const r=null===this.href?null:function C1(e,n,t){return function qG(e,n){return"src"===n&&GG.has(e)||"href"===n&&VG.has(e)||"xlink:href"===n&&"script"===e?m1:ec}(n,t)(e)}(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",r)}applyAttributeValue(t,r){const i=this.renderer,o=this.el.nativeElement;null!==r?i.setAttribute(o,t,r):i.removeAttribute(o,t)}get urlTree(){return null===this.routerLinkInput?null:pc(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static \u0275fac=function(r){return new(r||e)(ze(An),ze(Vi),function vd(e){return function BL(e,n){if("class"===n)return e.classes;if("style"===n)return e.styles;const t=e.attrs;if(t){const r=t.length;let i=0;for(;i<r;){const o=t[i];if(hQ(o))break;if(0===o)i+=2;else if("number"==typeof o)for(i++;i<r&&"string"==typeof t[i];)i++;else{if(o===n)return t[i+1];i+=2}}}return null}(Lt(),e)}("tabindex"),ze(Cs),ze(vi),ze(Ac))};static \u0275dir=Mt({type:e,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(r,i){1&r&&_e("click",function(s){return i.onClick(s.button,s.ctrlKey,s.shiftKey,s.altKey,s.metaKey)}),2&r&&Ro("target",i.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",iu],skipLocationChange:[2,"skipLocationChange","skipLocationChange",iu],replaceUrl:[2,"replaceUrl","replaceUrl",iu],routerLink:"routerLink"},features:[oo]})}return e})(),Lx=(()=>{class e{router;element;renderer;cdr;link;links;classes=[];routerEventsSubscription;linkInputChangesSubscription;_isActive=!1;get isActive(){return this._isActive}routerLinkActiveOptions={exact:!1};ariaCurrentWhenActive;isActiveChange=new Pn;constructor(t,r,i,o,s){this.router=t,this.element=r,this.renderer=i,this.cdr=o,this.link=s,this.routerEventsSubscription=t.events.subscribe(a=>{a instanceof _s&&this.update()})}ngAfterContentInit(){xt(this.links.changes,xt(null)).pipe(NA()).subscribe(t=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){this.linkInputChangesSubscription?.unsubscribe();const t=[...this.links.toArray(),this.link].filter(r=>!!r).map(r=>r.onChanges);this.linkInputChangesSubscription=Br(t).pipe(NA()).subscribe(r=>{this._isActive!==this.isLinkActive(this.router)(r)&&this.update()})}set routerLinkActive(t){const r=Array.isArray(t)?t:t.split(" ");this.classes=r.filter(i=>!!i)}ngOnChanges(t){this.update()}ngOnDestroy(){this.routerEventsSubscription.unsubscribe(),this.linkInputChangesSubscription?.unsubscribe()}update(){!this.links||!this.router.navigated||queueMicrotask(()=>{const t=this.hasActiveLinks();this.classes.forEach(r=>{t?this.renderer.addClass(this.element.nativeElement,r):this.renderer.removeClass(this.element.nativeElement,r)}),t&&void 0!==this.ariaCurrentWhenActive?this.renderer.setAttribute(this.element.nativeElement,"aria-current",this.ariaCurrentWhenActive.toString()):this.renderer.removeAttribute(this.element.nativeElement,"aria-current"),this._isActive!==t&&(this._isActive=t,this.cdr.markForCheck(),this.isActiveChange.emit(t))})}isLinkActive(t){const r=function fee(e){return!!e.paths}(this.routerLinkActiveOptions)?this.routerLinkActiveOptions:this.routerLinkActiveOptions.exact||!1;return i=>{const o=i.urlTree;return!!o&&t.isActive(o,r)}}hasActiveLinks(){const t=this.isLinkActive(this.router);return this.link&&t(this.link)||this.links.some(t)}static \u0275fac=function(r){return new(r||e)(ze(An),ze(vi),ze(Cs),ze(wA),ze(vp,8))};static \u0275dir=Mt({type:e,selectors:[["","routerLinkActive",""]],contentQueries:function(r,i,o){if(1&r&&YM(o,vp,5),2&r){let s;Zs(s=Xs())&&(i.links=s)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",ariaCurrentWhenActive:"ariaCurrentWhenActive",routerLinkActive:"routerLinkActive"},outputs:{isActiveChange:"isActiveChange"},exportAs:["routerLinkActive"],features:[oo]})}return e})();class Gx{}let gee=(()=>{class e{router;injector;preloadingStrategy;loader;subscription;constructor(t,r,i,o){this.router=t,this.injector=r,this.preloadingStrategy=i,this.loader=o}setUpPreloading(){this.subscription=this.router.events.pipe(ra(t=>t instanceof _s),xA(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,r){const i=[];for(const o of r){o.providers&&!o._injector&&(o._injector=ch(o.providers,t,`Route: ${o.path}`));const s=o._injector??t,a=o._loadedInjector??s;(o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent)&&i.push(this.preloadConfig(s,o)),(o.children||o._loadedRoutes)&&i.push(this.processRoutes(a,o.children??o._loadedRoutes))}return Br(i).pipe(NA())}preloadConfig(t,r){return this.preloadingStrategy.preload(r,()=>{let i;i=r.loadChildren&&void 0===r.canLoad?this.loader.loadChildren(t,r):xt(null);const o=i.pipe(Ur(s=>null===s?xt(void 0):(r._loadedRoutes=s.routes,r._loadedInjector=s.injector,this.processRoutes(s.injector??t,s.routes))));return r.loadComponent&&!r._loadedComponent?Br([o,this.loader.loadComponent(r)]).pipe(NA()):o})}static \u0275fac=function(r){return new(r||e)(_t(An),_t(si),_t(Gx),_t(x0))};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const R0=new $e("");let Vx=(()=>{class e{urlSerializer;transitions;viewportScroller;zone;options;routerEventsSubscription;scrollEventsSubscription;lastId=0;lastSource="imperative";restoredId=0;store={};constructor(t,r,i,o,s={}){this.urlSerializer=t,this.transitions=r,this.viewportScroller=i,this.zone=o,this.options=s,s.scrollPositionRestoration||="disabled",s.anchorScrolling||="disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof fp?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof _s?(this.lastId=t.id,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.urlAfterRedirects).fragment)):t instanceof lu&&t.code===gp.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof fx&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,r){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new fx(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,r))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static \u0275fac=function(r){!function vS(){throw new Error("invalid")}()};static \u0275prov=rt({token:e,factory:e.\u0275fac})}return e})();function qx(e){return e.routerState.root}function qo(e,n){return{\u0275kind:e,\u0275providers:n}}function zx(){const e=de(hr);return n=>{const t=e.get(_i);if(n!==t.components[0])return;const r=e.get(An),i=e.get(Kx);1===e.get(P0)&&r.initialNavigation(),e.get(Jx,null,Ht.Optional)?.setUpPreloading(),e.get(R0,null,Ht.Optional)?.init(),r.resetRootComponentType(t.componentTypes[0]),i.closed||(i.next(),i.complete(),i.unsubscribe())}}const Kx=new $e("",{factory:()=>new ni}),P0=new $e("",{providedIn:"root",factory:()=>1}),Jx=new $e("");function Cee(e){return qo(0,[{provide:Jx,useExisting:gee},{provide:Gx,useExisting:e}])}function Eee(e){return li("NgRouterViewTransitions"),qo(9,[{provide:Ox,useValue:JX},{provide:Rx,useValue:{skipNextTransition:!!e?.skipInitialTransition,...e}}])}const Bee=[_A,{provide:PA,useClass:sp},An,VA,{provide:Vi,useFactory:qx,deps:[An]},x0,[]];let wee=(()=>{class e{constructor(){}static forRoot(t,r){return{ngModule:e,providers:[Bee,[],{provide:YA,multi:!0,useValue:t},[],r?.errorHandler?{provide:Px,useValue:r.errorHandler}:[],{provide:jA,useValue:r||{}},r?.useHash?{provide:Ac,useClass:y9}:{provide:Ac,useClass:kN},{provide:R0,useFactory:()=>{const e=de(VW),n=de(tn),t=de(jA),r=de(O0),i=de(PA);return t.scrollOffset&&e.setOffset(t.scrollOffset),new Vx(i,r,e,n,t)}},r?.preloadingStrategy?Cee(r.preloadingStrategy).\u0275providers:[],r?.initialNavigation?Qee(r):[],r?.bindToComponentInputs?qo(8,[yx,{provide:mp,useExisting:yx}]).\u0275providers:[],r?.enableViewTransitions?Eee().\u0275providers:[],[{provide:jx,useFactory:zx},{provide:Gl,multi:!0,useExisting:jx}]]}}static forChild(t){return{ngModule:e,providers:[{provide:YA,multi:!0,useValue:t}]}}static \u0275fac=function(r){return new(r||e)};static \u0275mod=Ul({type:e});static \u0275inj=Oa({})}return e})();function Qee(e){return["disabled"===e.initialNavigation?qo(3,[Dk(()=>{de(An).setUpLocationChangeListener()}),{provide:P0,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?qo(2,[{provide:P0,useValue:0},Dk(()=>{const n=de(hr);return n.get(rW,Promise.resolve()).then(()=>new Promise(r=>{const i=n.get(An),o=n.get(Kx);Hx(i,()=>{r(!0)}),n.get(O0).afterPreactivation=()=>(r(!0),o.closed?xt(void 0):o),i.initialNavigation()}))})]).\u0275providers:[]]}const jx=new $e("");let Yx=(()=>{class e{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,r){this._renderer=t,this._elementRef=r}setProperty(t,r){this._renderer.setProperty(this._elementRef.nativeElement,t,r)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(r){return new(r||e)(ze(Cs),ze(vi))};static \u0275dir=Mt({type:e})}return e})(),mc=(()=>{class e extends Yx{static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275dir=Mt({type:e,features:[Nt]})}return e})();const zo=new $e(""),Mee={provide:zo,useExisting:vn(()=>mo),multi:!0},Nee=new $e("");let mo=(()=>{class e extends Yx{_compositionMode;_composing=!1;constructor(t,r,i){super(t,r),this._compositionMode=i,null==this._compositionMode&&(this._compositionMode=!function Fee(){const e=ta()?ta().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}())}writeValue(t){this.setProperty("value",t??"")}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(r){return new(r||e)(ze(Cs),ze(vi),ze(Nee,8))};static \u0275dir=Mt({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(r,i){1&r&&_e("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},standalone:!1,features:[xn([Mee]),Nt]})}return e})();const Hr=new $e(""),sa=new $e("");function _p(e){return null}function oT(e){return null!=e}function sT(e){return lA(e)?Br(e):e}function aT(e){let n={};return e.forEach(t=>{n=null!=t?{...n,...t}:n}),0===Object.keys(n).length?null:n}function cT(e,n){return n.map(t=>t(e))}function lT(e){return e.map(n=>function Tee(e){return!e.validate}(n)?n:t=>n.validate(t))}function L0(e){return null!=e?function uT(e){if(!e)return null;const n=e.filter(oT);return 0==n.length?null:function(t){return aT(cT(t,n))}}(lT(e)):null}function G0(e){return null!=e?function dT(e){if(!e)return null;const n=e.filter(oT);return 0==n.length?null:function(t){return function See(...e){const n=x2(e),{args:t,keys:r}=T2(e),i=new Cr(o=>{const{length:s}=t;if(!s)return void o.complete();const a=new Array(s);let c=s,l=s;for(let u=0;u<s;u++){let d=!1;Ho(t[u]).subscribe(dr(o,f=>{d||(d=!0,l--),a[u]=f},()=>c--,void 0,()=>{(!c||!d)&&(l||o.next(r?R2(r,a):a),o.complete())}))}});return n?i.pipe(O2(n)):i}(cT(t,n).map(sT)).pipe(cn(aT))}}(lT(e)):null}function AT(e,n){return null===e?[n]:Array.isArray(e)?[...e,n]:[e,n]}function V0(e){return e?Array.isArray(e)?e:[e]:[]}function bp(e,n){return Array.isArray(e)?e.includes(n):e===n}function hT(e,n){const t=V0(n);return V0(e).forEach(i=>{bp(t,i)||t.push(i)}),t}function pT(e,n){return V0(n).filter(t=>!bp(e,t))}class IT{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(n){this._rawValidators=n||[],this._composedValidatorFn=L0(this._rawValidators)}_setAsyncValidators(n){this._rawAsyncValidators=n||[],this._composedAsyncValidatorFn=G0(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(n){this._onDestroyCallbacks.push(n)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(n=>n()),this._onDestroyCallbacks=[]}reset(n=void 0){this.control&&this.control.reset(n)}hasError(n,t){return!!this.control&&this.control.hasError(n,t)}getError(n,t){return this.control?this.control.getError(n,t):null}}class $r extends IT{name;get formDirective(){return null}get path(){return null}}class aa extends IT{_parent=null;name=null;valueAccessor=null}class mT{_cd;constructor(n){this._cd=n}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}}let Co=(()=>{class e extends mT{constructor(t){super(t)}static \u0275fac=function(r){return new(r||e)(ze(aa,2))};static \u0275dir=Mt({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(r,i){2&r&&er("ng-untouched",i.isUntouched)("ng-touched",i.isTouched)("ng-pristine",i.isPristine)("ng-dirty",i.isDirty)("ng-valid",i.isValid)("ng-invalid",i.isInvalid)("ng-pending",i.isPending)},standalone:!1,features:[Nt]})}return e})();const WA="VALID",Dp="INVALID",hu="PENDING",$A="DISABLED";class pu{}class yT extends pu{value;source;constructor(n,t){super(),this.value=n,this.source=t}}class K0 extends pu{pristine;source;constructor(n,t){super(),this.pristine=n,this.source=t}}class J0 extends pu{touched;source;constructor(n,t){super(),this.touched=n,this.source=t}}class Sp extends pu{status;source;constructor(n,t){super(),this.status=n,this.source=t}}function kp(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class W0{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(n,t){this._assignValidators(n),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(n){this._rawValidators=this._composedValidatorFn=n}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(n){this._rawAsyncValidators=this._composedAsyncValidatorFn=n}get parent(){return this._parent}get status(){return or(this.statusReactive)}set status(n){or(()=>this.statusReactive.set(n))}_status=Es(()=>this.statusReactive());statusReactive=Mo(void 0);get valid(){return this.status===WA}get invalid(){return this.status===Dp}get pending(){return this.status==hu}get disabled(){return this.status===$A}get enabled(){return this.status!==$A}errors;get pristine(){return or(this.pristineReactive)}set pristine(n){or(()=>this.pristineReactive.set(n))}_pristine=Es(()=>this.pristineReactive());pristineReactive=Mo(!0);get dirty(){return!this.pristine}get touched(){return or(this.touchedReactive)}set touched(n){or(()=>this.touchedReactive.set(n))}_touched=Es(()=>this.touchedReactive());touchedReactive=Mo(!1);get untouched(){return!this.touched}_events=new ni;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(n){this._assignValidators(n)}setAsyncValidators(n){this._assignAsyncValidators(n)}addValidators(n){this.setValidators(hT(n,this._rawValidators))}addAsyncValidators(n){this.setAsyncValidators(hT(n,this._rawAsyncValidators))}removeValidators(n){this.setValidators(pT(n,this._rawValidators))}removeAsyncValidators(n){this.setAsyncValidators(pT(n,this._rawAsyncValidators))}hasValidator(n){return bp(this._rawValidators,n)}hasAsyncValidator(n){return bp(this._rawAsyncValidators,n)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(n={}){const t=!1===this.touched;this.touched=!0;const r=n.sourceControl??this;this._parent&&!n.onlySelf&&this._parent.markAsTouched({...n,sourceControl:r}),t&&!1!==n.emitEvent&&this._events.next(new J0(!0,r))}markAllAsTouched(n={}){this.markAsTouched({onlySelf:!0,emitEvent:n.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(n))}markAsUntouched(n={}){const t=!0===this.touched;this.touched=!1,this._pendingTouched=!1;const r=n.sourceControl??this;this._forEachChild(i=>{i.markAsUntouched({onlySelf:!0,emitEvent:n.emitEvent,sourceControl:r})}),this._parent&&!n.onlySelf&&this._parent._updateTouched(n,r),t&&!1!==n.emitEvent&&this._events.next(new J0(!1,r))}markAsDirty(n={}){const t=!0===this.pristine;this.pristine=!1;const r=n.sourceControl??this;this._parent&&!n.onlySelf&&this._parent.markAsDirty({...n,sourceControl:r}),t&&!1!==n.emitEvent&&this._events.next(new K0(!1,r))}markAsPristine(n={}){const t=!1===this.pristine;this.pristine=!0,this._pendingDirty=!1;const r=n.sourceControl??this;this._forEachChild(i=>{i.markAsPristine({onlySelf:!0,emitEvent:n.emitEvent})}),this._parent&&!n.onlySelf&&this._parent._updatePristine(n,r),t&&!1!==n.emitEvent&&this._events.next(new K0(!0,r))}markAsPending(n={}){this.status=hu;const t=n.sourceControl??this;!1!==n.emitEvent&&(this._events.next(new Sp(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!n.onlySelf&&this._parent.markAsPending({...n,sourceControl:t})}disable(n={}){const t=this._parentMarkedDirty(n.onlySelf);this.status=$A,this.errors=null,this._forEachChild(i=>{i.disable({...n,onlySelf:!0})}),this._updateValue();const r=n.sourceControl??this;!1!==n.emitEvent&&(this._events.next(new yT(this.value,r)),this._events.next(new Sp(this.status,r)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...n,skipPristineCheck:t},this),this._onDisabledChange.forEach(i=>i(!0))}enable(n={}){const t=this._parentMarkedDirty(n.onlySelf);this.status=WA,this._forEachChild(r=>{r.enable({...n,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:n.emitEvent}),this._updateAncestors({...n,skipPristineCheck:t},this),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(n,t){this._parent&&!n.onlySelf&&(this._parent.updateValueAndValidity(n),n.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(n){this._parent=n}getRawValue(){return this.value}updateValueAndValidity(n={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){const r=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===WA||this.status===hu)&&this._runAsyncValidator(r,n.emitEvent)}const t=n.sourceControl??this;!1!==n.emitEvent&&(this._events.next(new yT(this.value,t)),this._events.next(new Sp(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!n.onlySelf&&this._parent.updateValueAndValidity({...n,sourceControl:t})}_updateTreeValidity(n={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(n)),this.updateValueAndValidity({onlySelf:!0,emitEvent:n.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?$A:WA}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(n,t){if(this.asyncValidator){this.status=hu,this._hasOwnPendingAsyncValidator={emitEvent:!1!==t};const r=sT(this.asyncValidator(this));this._asyncValidationSubscription=r.subscribe(i=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(i,{emitEvent:t,shouldHaveEmitted:n})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();const n=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,n}return!1}setErrors(n,t={}){this.errors=n,this._updateControlsErrors(!1!==t.emitEvent,this,t.shouldHaveEmitted)}get(n){let t=n;return null==t||(Array.isArray(t)||(t=t.split(".")),0===t.length)?null:t.reduce((r,i)=>r&&r._find(i),this)}getError(n,t){const r=t?this.get(t):this;return r&&r.errors?r.errors[n]:null}hasError(n,t){return!!this.getError(n,t)}get root(){let n=this;for(;n._parent;)n=n._parent;return n}_updateControlsErrors(n,t,r){this.status=this._calculateStatus(),n&&this.statusChanges.emit(this.status),(n||r)&&this._events.next(new Sp(this.status,t)),this._parent&&this._parent._updateControlsErrors(n,t,r)}_initObservables(){this.valueChanges=new Pn,this.statusChanges=new Pn}_calculateStatus(){return this._allControlsDisabled()?$A:this.errors?Dp:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(hu)?hu:this._anyControlsHaveStatus(Dp)?Dp:WA}_anyControlsHaveStatus(n){return this._anyControls(t=>t.status===n)}_anyControlsDirty(){return this._anyControls(n=>n.dirty)}_anyControlsTouched(){return this._anyControls(n=>n.touched)}_updatePristine(n,t){const r=!this._anyControlsDirty(),i=this.pristine!==r;this.pristine=r,this._parent&&!n.onlySelf&&this._parent._updatePristine(n,t),i&&this._events.next(new K0(this.pristine,t))}_updateTouched(n={},t){this.touched=this._anyControlsTouched(),this._events.next(new J0(this.touched,t)),this._parent&&!n.onlySelf&&this._parent._updateTouched(n,t)}_onDisabledChange=[];_registerOnCollectionChange(n){this._onCollectionChange=n}_setUpdateStrategy(n){kp(n)&&null!=n.updateOn&&(this._updateOn=n.updateOn)}_parentMarkedDirty(n){return!n&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(n){return null}_assignValidators(n){this._rawValidators=Array.isArray(n)?n.slice():n,this._composedValidatorFn=function Vee(e){return Array.isArray(e)?L0(e):e||null}(this._rawValidators)}_assignAsyncValidators(n){this._rawAsyncValidators=Array.isArray(n)?n.slice():n,this._composedAsyncValidatorFn=function qee(e){return Array.isArray(e)?G0(e):e||null}(this._rawAsyncValidators)}}const Iu=new $e("",{providedIn:"root",factory:()=>Mp}),Mp="always";function ZA(e,n,t=Mp){(function Z0(e,n){const t=function fT(e){return e._rawValidators}(e);null!==n.validator?e.setValidators(AT(t,n.validator)):"function"==typeof t&&e.setValidators([t]);const r=function gT(e){return e._rawAsyncValidators}(e);null!==n.asyncValidator?e.setAsyncValidators(AT(r,n.asyncValidator)):"function"==typeof r&&e.setAsyncValidators([r]);const i=()=>e.updateValueAndValidity();xp(n._rawValidators,i),xp(n._rawAsyncValidators,i)})(e,n),n.valueAccessor.writeValue(e.value),(e.disabled||"always"===t)&&n.valueAccessor.setDisabledState?.(e.disabled),function Jee(e,n){n.valueAccessor.registerOnChange(t=>{e._pendingValue=t,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&_T(e,n)})}(e,n),function Yee(e,n){const t=(r,i)=>{n.valueAccessor.writeValue(r),i&&n.viewToModelUpdate(r)};e.registerOnChange(t),n._registerOnDestroy(()=>{e._unregisterOnChange(t)})}(e,n),function jee(e,n){n.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&_T(e,n),"submit"!==e.updateOn&&e.markAsTouched()})}(e,n),function Kee(e,n){if(n.valueAccessor.setDisabledState){const t=r=>{n.valueAccessor.setDisabledState(r)};e.registerOnDisabledChange(t),n._registerOnDestroy(()=>{e._unregisterOnDisabledChange(t)})}}(e,n)}function xp(e,n){e.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(n)})}function _T(e,n){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),n.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function DT(e,n){const t=e.indexOf(n);t>-1&&e.splice(t,1)}function ST(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}Promise.resolve();const kT=class extends W0{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(n=null,t,r){super(function j0(e){return(kp(e)?e.validators:e)||null}(t),function Y0(e,n){return(kp(n)?n.asyncValidators:e)||null}(r,t)),this._applyFormState(n),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),kp(t)&&(t.nonNullable||t.initialValueIsDefault)&&(this.defaultValue=ST(n)?n.value:n)}setValue(n,t={}){this.value=this._pendingValue=n,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(r=>r(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(n,t={}){this.setValue(n,t)}reset(n=this.defaultValue,t={}){this._applyFormState(n),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(n){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(n){this._onChange.push(n)}_unregisterOnChange(n){DT(this._onChange,n)}registerOnDisabledChange(n){this._onDisabledChange.push(n)}_unregisterOnDisabledChange(n){DT(this._onDisabledChange,n)}_forEachChild(n){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(n){ST(n)?(this.value=this._pendingValue=n.value,n.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=n}},ote={provide:aa,useExisting:vn(()=>qi)},MT=Promise.resolve();let qi=(()=>{class e extends aa{_changeDetectorRef;callSetDisabledState;control=new kT;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new Pn;constructor(t,r,i,o,s,a){super(),this._changeDetectorRef=s,this.callSetDisabledState=a,this._parent=t,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=function tw(e,n){if(!n)return null;let t,r,i;return Array.isArray(n),n.forEach(o=>{o.constructor===mo?t=o:function Zee(e){return Object.getPrototypeOf(e.constructor)===mc}(o)?r=o:i=o}),i||r||t||null}(0,o)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){const r=t.name.previousValue;this.formDirective.removeControl({name:r,path:this._getPath(r)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),function ew(e,n){if(!e.hasOwnProperty("model"))return!1;const t=e.model;return!!t.isFirstChange()||!Object.is(n,t.currentValue)}(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){ZA(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){MT.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){const r=t.isDisabled.currentValue,i=0!==r&&iu(r);MT.then(()=>{i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?function Fp(e,n){return[...n.path,e]}(t,this._parent):[t]}static \u0275fac=function(r){return new(r||e)(ze($r,9),ze(Hr,10),ze(sa,10),ze(zo,10),ze(wA,8),ze(Iu,8))};static \u0275dir=Mt({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[xn([ote]),Nt,oo]})}return e})();const ate={provide:zo,useExisting:vn(()=>nw),multi:!0};let nw=(()=>{class e extends mc{writeValue(t){this.setProperty("value",t??"")}registerOnChange(t){this.onChange=r=>{t(""==r?null:parseFloat(r))}}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275dir=Mt({type:e,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(r,i){1&r&&_e("input",function(s){return i.onChange(s.target.value)})("blur",function(){return i.onTouched()})},standalone:!1,features:[xn([ate]),Nt]})}return e})();const pte={provide:zo,useExisting:vn(()=>tf),multi:!0};function PT(e,n){return null==e?`${n}`:(n&&"object"==typeof n&&(n="Object"),`${e}: ${n}`.slice(0,50))}let tf=(()=>{class e extends mc{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){this.value=t;const i=PT(this._getOptionId(t),t);this.setProperty("value",i)}registerOnChange(t){this.onChange=r=>{this.value=this._getOptionValue(r),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(const r of this._optionMap.keys())if(this._compareWith(this._optionMap.get(r),t))return r;return null}_getOptionValue(t){const r=function Ite(e){return e.split(":")[0]}(t);return this._optionMap.has(r)?this._optionMap.get(r):t}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275dir=Mt({type:e,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(r,i){1&r&&_e("change",function(s){return i.onChange(s.target.value)})("blur",function(){return i.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[xn([pte]),Nt]})}return e})(),rw=(()=>{class e{_element;_renderer;_select;id;constructor(t,r,i){this._element=t,this._renderer=r,this._select=i,this._select&&(this.id=this._select._registerOption())}set ngValue(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(PT(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(r){return new(r||e)(ze(vi),ze(Cs),ze(tf,9))};static \u0275dir=Mt({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return e})();const mte={provide:zo,useExisting:vn(()=>iw),multi:!0};function UT(e,n){return null==e?`${n}`:("string"==typeof n&&(n=`'${n}'`),n&&"object"==typeof n&&(n="Object"),`${e}: ${n}`.slice(0,50))}let iw=(()=>{class e extends mc{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){let r;if(this.value=t,Array.isArray(t)){const i=t.map(o=>this._getOptionId(o));r=(o,s)=>{o._setSelected(i.indexOf(s.toString())>-1)}}else r=(i,o)=>{i._setSelected(!1)};this._optionMap.forEach(r)}registerOnChange(t){this.onChange=r=>{const i=[],o=r.selectedOptions;if(void 0!==o){const s=o;for(let a=0;a<s.length;a++){const l=this._getOptionValue(s[a].value);i.push(l)}}else{const s=r.options;for(let a=0;a<s.length;a++){const c=s[a];if(c.selected){const l=this._getOptionValue(c.value);i.push(l)}}}this.value=i,t(i)}}_registerOption(t){const r=(this._idCounter++).toString();return this._optionMap.set(r,t),r}_getOptionId(t){for(const r of this._optionMap.keys())if(this._compareWith(this._optionMap.get(r)._value,t))return r;return null}_getOptionValue(t){const r=function Cte(e){return e.split(":")[0]}(t);return this._optionMap.has(r)?this._optionMap.get(r)._value:t}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275dir=Mt({type:e,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(r,i){1&r&&_e("change",function(s){return i.onChange(s.target)})("blur",function(){return i.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[xn([mte]),Nt]})}return e})(),ow=(()=>{class e{_element;_renderer;_select;id;_value;constructor(t,r,i){this._element=t,this._renderer=r,this._select=i,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){null!=this._select&&(this._value=t,this._setElementValue(UT(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(UT(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(r){return new(r||e)(ze(vi),ze(Cs),ze(iw,9))};static \u0275dir=Mt({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return e})();function LT(e){return"number"==typeof e?e:parseFloat(e)}let Cc=(()=>{class e{_validator=_p;_onChange;_enabled;ngOnChanges(t){if(this.inputName in t){const r=this.normalizeInput(t[this.inputName].currentValue);this._enabled=this.enabled(r),this._validator=this._enabled?this.createValidator(r):_p,this._onChange&&this._onChange()}}validate(t){return this._validator(t)}registerOnValidatorChange(t){this._onChange=t}enabled(t){return null!=t}static \u0275fac=function(r){return new(r||e)};static \u0275dir=Mt({type:e,features:[oo]})}return e})();const yte={provide:Hr,useExisting:vn(()=>sw),multi:!0};let sw=(()=>{class e extends Cc{max;inputName="max";normalizeInput=t=>LT(t);createValidator=t=>function Zx(e){return n=>{if(null==n.value||null==e)return null;const t=parseFloat(n.value);return!isNaN(t)&&t>e?{max:{max:e,actual:n.value}}:null}}(t);static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275dir=Mt({type:e,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(r,i){2&r&&Ro("max",i._enabled?i.max:null)},inputs:{max:"max"},standalone:!1,features:[xn([yte]),Nt]})}return e})();const Ete={provide:Hr,useExisting:vn(()=>aw),multi:!0};let aw=(()=>{class e extends Cc{min;inputName="min";normalizeInput=t=>LT(t);createValidator=t=>function $x(e){return n=>{if(null==n.value||null==e)return null;const t=parseFloat(n.value);return!isNaN(t)&&t<e?{min:{min:e,actual:n.value}}:null}}(t);static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275dir=Mt({type:e,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(r,i){2&r&&Ro("min",i._enabled?i.min:null)},inputs:{min:"min"},standalone:!1,features:[xn([Ete]),Nt]})}return e})(),Dte=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=Ul({type:e});static \u0275inj=Oa({})}return e})(),Ko=(()=>{class e{static withConfig(t){return{ngModule:e,providers:[{provide:Iu,useValue:t.callSetDisabledState??Mp}]}}static \u0275fac=function(r){return new(r||e)};static \u0275mod=Ul({type:e});static \u0275inj=Oa({imports:[Dte]})}return e})();var yc=function(e){return e[e.NO_SYNC=0]="NO_SYNC",e[e.BROWSER_SYNC=1]="BROWSER_SYNC",e[e.SIGNER_SYNC=2]="SIGNER_SYNC",e[e.CUSTOM_SYNC=3]="CUSTOM_SYNC",e}(yc||{});const Ec=yc;var yn=L(3838);class zi{static generateIV(){const n=crypto.getRandomValues(new Uint8Array(12));return yn.Buffer.from(n).toString("base64")}static hash(n){return I(function*(){const t=(new TextEncoder).encode(n),r=yield crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(s=>s.toString(16).padStart(2,"0")).join("")})()}static v4(){return crypto.randomUUID()}static deriveKey(n){return I(function*(){const t={name:"PBKDF2",hash:"SHA-256",salt:(new TextEncoder).encode("3e7cdebd-3b4c-4125-a18c-05750cad8ec3"),iterations:1e3};return crypto.subtle.deriveKey(t,yield crypto.subtle.importKey("raw",(new TextEncoder).encode(n),{name:t.name},!1,["deriveKey"]),{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])})()}static encrypt(n,t,r){return I(function*(){const i={name:"AES-GCM",length:256,iv:yn.Buffer.from(t,"base64")},o=yield crypto.subtle.encrypt(i,yield zi.deriveKey(r),(new TextEncoder).encode(n));return yn.Buffer.from(o).toString("base64")})()}static decrypt(n,t,r){return I(function*(){const i={name:"AES-GCM",length:256,iv:yn.Buffer.from(t,"base64")};return(new TextDecoder).decode(yield crypto.subtle.decrypt(i,yield zi.deriveKey(r),yn.Buffer.from(n,"base64")))})()}}function Bc(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function JT(e,n){return!!Array.isArray(n)&&(0===n.length||n.every(e?t=>"string"==typeof t:t=>Number.isSafeInteger(t)))}function uw(e){if("function"!=typeof e)throw new Error("function expected");return!0}function ca(e,n){if("string"!=typeof n)throw new Error(`${e}: string expected`);return!0}function mu(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function Lp(e){if(!Array.isArray(e))throw new Error("array expected")}function Gp(e,n){if(!JT(!0,n))throw new Error(`${e}: array of strings expected`)}function dw(e,n){if(!JT(!1,n))throw new Error(`${e}: array of numbers expected`)}function Zr(...e){const n=o=>o,t=(o,s)=>a=>o(s(a));return{encode:e.map(o=>o.encode).reduceRight(t,n),decode:e.map(o=>o.decode).reduce(t,n)}}function Ai(e){const n="string"==typeof e?e.split(""):e,t=n.length;Gp("alphabet",n);const r=new Map(n.map((i,o)=>[i,o]));return{encode:i=>(Lp(i),i.map(o=>{if(!Number.isSafeInteger(o)||o<0||o>=t)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${e}`);return n[o]})),decode:i=>(Lp(i),i.map(o=>{ca("alphabet.decode",o);const s=r.get(o);if(void 0===s)throw new Error(`Unknown letter: "${o}". Allowed: ${e}`);return s}))}}function fi(e=""){return ca("join",e),{encode:n=>(Gp("join.decode",n),n.join(e)),decode:n=>(ca("join.decode",n),n.split(e))}}const YT=(e,n)=>0===n?e:YT(n,e%n),Vp=(e,n)=>e+(n-YT(e,n)),qp=(()=>{let e=[];for(let n=0;n<40;n++)e.push(2**n);return e})();function zp(e,n,t,r){if(Lp(e),n<=0||n>32)throw new Error(`convertRadix2: wrong from=${n}`);if(t<=0||t>32)throw new Error(`convertRadix2: wrong to=${t}`);if(Vp(n,t)>32)throw new Error(`convertRadix2: carry overflow from=${n} to=${t} carryBits=${Vp(n,t)}`);let i=0,o=0;const s=qp[n],a=qp[t]-1,c=[];for(const l of e){if(mu(l),l>=s)throw new Error(`convertRadix2: invalid data word=${l} from=${n}`);if(i=i<<n|l,o+n>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${n}`);for(o+=n;o>=t;o-=t)c.push((i>>o-t&a)>>>0);const u=qp[o];if(void 0===u)throw new Error("invalid carry");i&=u-1}if(i=i<<t-o&a,!r&&o>=n)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&c.push(i>>>0),c}function Di(e,n=!1){if(mu(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Vp(8,e)>32||Vp(e,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!Bc(t))throw new Error("radix2.encode input should be Uint8Array");return zp(Array.from(t),8,e,!n)},decode:t=>(dw("radix2.decode",t),Uint8Array.from(zp(t,e,8,n)))}}function $T(e){return uw(e),function(...n){try{return e.apply(null,n)}catch{}}}"function"==typeof Uint8Array.from([]).toBase64&&Uint8Array;const gw=Zr(Ai("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),fi("")),n3=[996825010,642813549,513874426,1027748829,705979059];function rf(e){const n=e>>25;let t=(33554431&e)<<5;for(let r=0;r<n3.length;r++)1==(n>>r&1)&&(t^=n3[r]);return t}function r3(e,n,t=1){const r=e.length;let i=1;for(let o=0;o<r;o++){const s=e.charCodeAt(o);if(s<33||s>126)throw new Error(`Invalid prefix (${e})`);i=rf(i)^s>>5}i=rf(i);for(let o=0;o<r;o++)i=rf(i)^31&e.charCodeAt(o);for(let o of n)i=rf(i)^o;for(let o=0;o<6;o++)i=rf(i);return i^=t,gw.encode(zp([i%qp[30]],30,5,!1))}function i3(e){const n="bech32"===e?1:734539939,t=Di(5),r=t.decode,i=t.encode,o=$T(r);function s(d,f,A=90){ca("bech32.encode prefix",d),Bc(f)&&(f=Array.from(f)),dw("bech32.encode",f);const p=d.length;if(0===p)throw new TypeError(`Invalid prefix length ${p}`);const C=p+7+f.length;if(!1!==A&&C>A)throw new TypeError(`Length ${C} exceeds limit ${A}`);const E=d.toLowerCase(),Q=r3(E,f,n);return`${E}1${gw.encode(f)}${Q}`}function a(d,f=90){ca("bech32.decode input",d);const A=d.length;if(A<8||!1!==f&&A>f)throw new TypeError(`invalid string length: ${A} (${d}). Expected (8..${f})`);const p=d.toLowerCase();if(d!==p&&d!==d.toUpperCase())throw new Error("String must be lowercase or uppercase");const C=p.lastIndexOf("1");if(0===C||-1===C)throw new Error('Letter "1" must be present between prefix and data only');const E=p.slice(0,C),Q=p.slice(C+1);if(Q.length<6)throw new Error("Data must be at least 6 characters long");const F=gw.decode(Q).slice(0,-6),se=r3(E,F,n);if(!Q.endsWith(se))throw new Error(`Invalid checksum in ${d}: expected "${se}"`);return{prefix:E,words:F}}return{encode:s,decode:a,encodeFromBytes:function u(d,f){return s(d,i(f))},decodeToBytes:function l(d){const{prefix:f,words:A}=a(d,!1);return{prefix:f,words:A,bytes:r(A)}},decodeUnsafe:$T(a),fromWords:r,fromWordsUnsafe:o,toWords:i}}const Cu=i3("bech32"),yu=("function"==typeof Uint8Array.from([]).toHex&&Uint8Array,"object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0);function wc(e,...n){if(!function jp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}const s3="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,Rte=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function vc(e){if(wc(e),s3)return e.toHex();let n="";for(let t=0;t<e.length;t++)n+=Rte[e[t]];return n}function a3(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function _c(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(s3)return Uint8Array.fromHex(e);const n=e.length,t=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(t);for(let i=0,o=0;i<t;i++,o+=2){const s=a3(e.charCodeAt(o)),a=a3(e.charCodeAt(o+1));if(void 0===s||void 0===a)throw new Error('hex string expected, got non-hex character "'+(e[o]+e[o+1])+'" at index '+o);r[i]=16*s+a}return r}function l3(e=32){if(yu&&"function"==typeof yu.getRandomValues)return yu.getRandomValues(new Uint8Array(e));if(yu&&"function"==typeof yu.randomBytes)return Uint8Array.from(yu.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const bc=vc,Ki=_c;function Ew(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Bw(e,...n){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(n.length>0&&!n.includes(e.length))throw new Error(`Expected Uint8Array of length ${n}, not of length=${e.length}`)}function sf(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")}const ww="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,vw=e=>e instanceof Uint8Array,_w=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Jo=(e,n)=>e<<32-n|e>>>n;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function af(e){if("string"==typeof e&&(e=function dne(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!vw(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class h3{clone(){return this._cloneInto()}}function gne(e){const n=r=>e().update(af(r)).digest(),t=e();return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=()=>e(),n}function p3(e=32){if(ww&&"function"==typeof ww.getRandomValues)return ww.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}class pne extends h3{constructor(n,t,r,i){super(),this.blockLen=n,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(n),this.view=_w(this.buffer)}update(n){sf(this);const{view:t,buffer:r,blockLen:i}=this,o=(n=af(n)).length;for(let s=0;s<o;){const a=Math.min(i-this.pos,o-s);if(a!==i)r.set(n.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const c=_w(n);for(;i<=o-s;s+=i)this.process(c,s)}}return this.length+=n.length,this.roundClean(),this}digestInto(n){sf(this),function g3(e,n){Bw(e);const t=n.outputLen;if(e.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}(n,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:o}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)t[d]=0;(function hne(e,n,t,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(n,t,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(t>>i&o),a=Number(t&o),l=r?0:4;e.setUint32(n+(r?4:0),s,r),e.setUint32(n+l,a,r)})(r,i-8,BigInt(8*this.length),o),this.process(r,0);const a=_w(n),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],o)}digest(){const{buffer:n,outputLen:t}=this;this.digestInto(n);const r=n.slice(0,t);return this.destroy(),r}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:o,destroyed:s,pos:a}=this;return n.length=i,n.pos=a,n.finished=o,n.destroyed=s,i%t&&n.buffer.set(r),n}}const Ine=(e,n,t)=>e&n^~e&t,mne=(e,n,t)=>e&n^e&t^n&t,Cne=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]),la=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ua=new Uint32Array(64);class I3 extends pne{constructor(){super(64,32,8,!1),this.A=0|la[0],this.B=0|la[1],this.C=0|la[2],this.D=0|la[3],this.E=0|la[4],this.F=0|la[5],this.G=0|la[6],this.H=0|la[7]}get(){const{A:n,B:t,C:r,D:i,E:o,F:s,G:a,H:c}=this;return[n,t,r,i,o,s,a,c]}set(n,t,r,i,o,s,a,c){this.A=0|n,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|o,this.F=0|s,this.G=0|a,this.H=0|c}process(n,t){for(let d=0;d<16;d++,t+=4)ua[d]=n.getUint32(t,!1);for(let d=16;d<64;d++){const f=ua[d-15],A=ua[d-2],p=Jo(f,7)^Jo(f,18)^f>>>3,C=Jo(A,17)^Jo(A,19)^A>>>10;ua[d]=C+ua[d-7]+p+ua[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const A=u+(Jo(a,6)^Jo(a,11)^Jo(a,25))+Ine(a,c,l)+Cne[d]+ua[d]|0,C=(Jo(r,2)^Jo(r,13)^Jo(r,22))+mne(r,i,o)|0;u=l,l=c,c=a,a=s+A|0,s=o,o=i,i=r,r=A+C|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,o,s,a,c,l,u)}roundClean(){ua.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Qw=gne(()=>new I3),Wp=(BigInt(0),BigInt(1)),yne=BigInt(2),$p=e=>e instanceof Uint8Array,Ene=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function Eu(e){if(!$p(e))throw new Error("Uint8Array expected");let n="";for(let t=0;t<e.length;t++)n+=Ene[e[t]];return n}function C3(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function Bu(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const n=e.length;if(n%2)throw new Error("padded hex string expected, got unpadded hex of length "+n);const t=new Uint8Array(n/2);for(let r=0;r<t.length;r++){const i=2*r,o=e.slice(i,i+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[r]=s}return t}function gi(e){return C3(Eu(e))}function Dw(e){if(!$p(e))throw new Error("Uint8Array expected");return C3(Eu(Uint8Array.from(e).reverse()))}function da(e,n){return Bu(e.toString(16).padStart(2*n,"0"))}function Sw(e,n){return da(e,n).reverse()}function Lr(e,n,t){let r;if("string"==typeof n)try{r=Bu(n)}catch(o){throw new Error(`${e} must be valid hex string, got "${n}". Cause: ${o}`)}else{if(!$p(n))throw new Error(`${e} must be hex string or Uint8Array`);r=Uint8Array.from(n)}const i=r.length;if("number"==typeof t&&i!==t)throw new Error(`${e} expected ${t} bytes, got ${i}`);return r}function Qc(...e){const n=new Uint8Array(e.reduce((r,i)=>r+i.length,0));let t=0;return e.forEach(r=>{if(!$p(r))throw new Error("Uint8Array expected");n.set(r,t),t+=r.length}),n}const kw=e=>(yne<<BigInt(e-1))-Wp,Mw=e=>new Uint8Array(e),y3=e=>Uint8Array.from(e);function E3(e,n,t){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof n||n<2)throw new Error("qByteLen must be a number");if("function"!=typeof t)throw new Error("hmacFn must be a function");let r=Mw(e),i=Mw(e),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...d)=>t(i,r,...d),c=(d=Mw())=>{i=a(y3([0]),d),r=a(),0!==d.length&&(i=a(y3([1]),d),r=a())},l=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d<n;){r=a();const A=r.slice();f.push(A),d+=r.length}return Qc(...f)};return(d,f)=>{let A;for(s(),c(d);!(A=f(l()));)c();return s(),A}}const wne={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,n)=>n.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function cf(e,n,t={}){const r=(i,o,s)=>{const a=wne[o];if("function"!=typeof a)throw new Error(`Invalid validator "${o}", expected function`);const c=e[i];if(!(s&&void 0===c||a(c,e)))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${o}`)};for(const[i,o]of Object.entries(n))r(i,o,!1);for(const[i,o]of Object.entries(t))r(i,o,!0);return e}const Ir=BigInt(0),En=BigInt(1),Aa=BigInt(2),Qne=BigInt(3),Fw=BigInt(4),B3=BigInt(5),w3=BigInt(8);function mr(e,n){const t=e%n;return t>=Ir?t:n+t}function kne(e,n,t){if(t<=Ir||n<Ir)throw new Error("Expected power/modulo > 0");if(t===En)return Ir;let r=En;for(;n>Ir;)n&En&&(r=r*e%t),e=e*e%t,n>>=En;return r}function Ji(e,n,t){let r=e;for(;n-- >Ir;)r*=r,r%=t;return r}function Zp(e,n){if(e===Ir||n<=Ir)throw new Error(`invert: expected positive integers, got n=${e} mod=${n}`);let t=mr(e,n),r=n,i=Ir,o=En,s=En,a=Ir;for(;t!==Ir;){const l=r/t,u=r%t,d=i-s*l,f=o-a*l;r=t,t=u,i=s,o=a,s=d,a=f}if(r!==En)throw new Error("invert: does not exist");return mr(i,n)}BigInt(9),BigInt(16);const Nne=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Nw(e,n){const t=void 0!==n?n:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function v3(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const n=e.toString(2).length;return Math.ceil(n/8)}function _3(e){const n=v3(e);return n+Math.ceil(n/2)}class b3 extends h3{constructor(n,t){super(),this.finished=!1,this.destroyed=!1,function f3(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Ew(e.outputLen),Ew(e.blockLen)}(n);const r=af(t);if(this.iHash=n.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,o=new Uint8Array(i);o.set(r.length>i?n.create().update(r).digest():r);for(let s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=n.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),o.fill(0)}update(n){return sf(this),this.iHash.update(n),this}digestInto(n){sf(this),Bw(n,this.outputLen),this.finished=!0,this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const n=new Uint8Array(this.oHash.outputLen);return this.digestInto(n),n}_cloneInto(n){n||(n=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:i,destroyed:o,blockLen:s,outputLen:a}=this;return n.finished=i,n.destroyed=o,n.blockLen=s,n.outputLen=a,n.oHash=t._cloneInto(n.oHash),n.iHash=r._cloneInto(n.iHash),n}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Q3=(e,n,t)=>new b3(e,n).update(t).digest();Q3.create=(e,n)=>new b3(e,n);const Une=BigInt(0),xw=BigInt(1);function D3(e){return function xne(e){cf(e,Nne.reduce((r,i)=>(r[i]="function",r),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),cf(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Nw(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:Vne,aT:qne}=B,Dc={Err:class extends Error{constructor(n=""){super(n)}},_parseInt(e){const{Err:n}=Dc;if(e.length<2||2!==e[0])throw new n("Invalid signature integer tag");const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new n("Invalid signature integer: wrong length");if(128&r[0])throw new n("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new n("Invalid signature integer: unnecessary leading zero");return{d:Vne(r),l:e.subarray(t+2)}},toSig(e){const{Err:n}=Dc,t="string"==typeof e?qne(e):e;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let r=t.length;if(r<2||48!=t[0])throw new n("Invalid signature tag");if(t[1]!==r-2)throw new n("Invalid signature: incorrect length");const{d:i,l:o}=Dc._parseInt(t.subarray(2)),{d:s,l:a}=Dc._parseInt(o);if(a.length)throw new n("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(e){const n=l=>8&Number.parseInt(l[0],16)?"00"+l:l,t=l=>{const u=l.toString(16);return 1&u.length?`0${u}`:u},r=n(t(e.s)),i=n(t(e.r)),o=r.length/2,s=i.length/2,a=t(o),c=t(s);return`30${t(s+o+4)}02${c}${i}02${a}${r}`}},yo=BigInt(0),Jn=BigInt(1),Xp=(BigInt(2),BigInt(3));function Jne(e){const n=function Kne(e){const n=D3(e);return cf(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}(e),{Fp:t,n:r}=n,i=t.BYTES+1,o=2*t.BYTES+1;function a(Ue){return mr(Ue,r)}function c(Ue){return Zp(Ue,r)}const{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=function zne(e){const n=function Gne(e){const n=D3(e);cf(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:i}=n;if(t){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}(e),{Fp:t}=n,r=n.toBytes||((p,C,E)=>{const Q=C.toAffine();return Qc(Uint8Array.from([4]),t.toBytes(Q.x),t.toBytes(Q.y))}),i=n.fromBytes||(p=>{const C=p.subarray(1);return{x:t.fromBytes(C.subarray(0,t.BYTES)),y:t.fromBytes(C.subarray(t.BYTES,2*t.BYTES))}});function o(p){const{a:C,b:E}=n,Q=t.sqr(p),F=t.mul(Q,p);return t.add(t.add(F,t.mul(p,C)),E)}if(!t.eql(t.sqr(n.Gy),o(n.Gx)))throw new Error("bad generator point: equation left != right");function s(p){return"bigint"==typeof p&&yo<p&&p<n.n}function a(p){if(!s(p))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(p){const{allowedPrivateKeyLengths:C,nByteLength:E,wrapPrivateKey:Q,n:F}=n;if(C&&"bigint"!=typeof p){if(p instanceof Uint8Array&&(p=Eu(p)),"string"!=typeof p||!C.includes(p.length))throw new Error("Invalid key");p=p.padStart(2*E,"0")}let se;try{se="bigint"==typeof p?p:gi(Lr("private key",p,E))}catch{throw new Error(`private key must be ${E} bytes, hex or bigint, not ${typeof p}`)}return Q&&(se=mr(se,F)),a(se),se}const l=new Map;function u(p){if(!(p instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(C,E,Q){if(this.px=C,this.py=E,this.pz=Q,null==C||!t.isValid(C))throw new Error("x required");if(null==E||!t.isValid(E))throw new Error("y required");if(null==Q||!t.isValid(Q))throw new Error("z required")}static fromAffine(C){const{x:E,y:Q}=C||{};if(!C||!t.isValid(E)||!t.isValid(Q))throw new Error("invalid affine point");if(C instanceof d)throw new Error("projective point not allowed");const F=se=>t.eql(se,t.ZERO);return F(E)&&F(Q)?d.ZERO:new d(E,Q,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const E=t.invertBatch(C.map(Q=>Q.pz));return C.map((Q,F)=>Q.toAffine(E[F])).map(d.fromAffine)}static fromHex(C){const E=d.fromAffine(i(Lr("pointHex",C)));return E.assertValidity(),E}static fromPrivateKey(C){return d.BASE.multiply(c(C))}_setWindowSize(C){this._WINDOW_SIZE=C,l.delete(this)}assertValidity(){if(this.is0()){if(n.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:C,y:E}=this.toAffine();if(!t.isValid(C)||!t.isValid(E))throw new Error("bad point: x or y not FE");const Q=t.sqr(E),F=o(C);if(!t.eql(Q,F))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:C}=this.toAffine();if(t.isOdd)return!t.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){u(C);const{px:E,py:Q,pz:F}=this,{px:se,py:le,pz:Be}=C,he=t.eql(t.mul(E,Be),t.mul(se,F)),we=t.eql(t.mul(Q,Be),t.mul(le,F));return he&&we}negate(){return new d(this.px,t.neg(this.py),this.pz)}double(){const{a:C,b:E}=n,Q=t.mul(E,Xp),{px:F,py:se,pz:le}=this;let Be=t.ZERO,he=t.ZERO,we=t.ZERO,Re=t.mul(F,F),Ye=t.mul(se,se),Je=t.mul(le,le),Ze=t.mul(F,se);return Ze=t.add(Ze,Ze),we=t.mul(F,le),we=t.add(we,we),Be=t.mul(C,we),he=t.mul(Q,Je),he=t.add(Be,he),Be=t.sub(Ye,he),he=t.add(Ye,he),he=t.mul(Be,he),Be=t.mul(Ze,Be),we=t.mul(Q,we),Je=t.mul(C,Je),Ze=t.sub(Re,Je),Ze=t.mul(C,Ze),Ze=t.add(Ze,we),we=t.add(Re,Re),Re=t.add(we,Re),Re=t.add(Re,Je),Re=t.mul(Re,Ze),he=t.add(he,Re),Je=t.mul(se,le),Je=t.add(Je,Je),Re=t.mul(Je,Ze),Be=t.sub(Be,Re),we=t.mul(Je,Ye),we=t.add(we,we),we=t.add(we,we),new d(Be,he,we)}add(C){u(C);const{px:E,py:Q,pz:F}=this,{px:se,py:le,pz:Be}=C;let he=t.ZERO,we=t.ZERO,Re=t.ZERO;const Ye=n.a,Je=t.mul(n.b,Xp);let Ze=t.mul(E,se),ht=t.mul(Q,le),lt=t.mul(F,Be),Qt=t.add(E,Q),Ue=t.add(se,le);Qt=t.mul(Qt,Ue),Ue=t.add(Ze,ht),Qt=t.sub(Qt,Ue),Ue=t.add(E,F);let Le=t.add(se,Be);return Ue=t.mul(Ue,Le),Le=t.add(Ze,lt),Ue=t.sub(Ue,Le),Le=t.add(Q,F),he=t.add(le,Be),Le=t.mul(Le,he),he=t.add(ht,lt),Le=t.sub(Le,he),Re=t.mul(Ye,Ue),he=t.mul(Je,lt),Re=t.add(he,Re),he=t.sub(ht,Re),Re=t.add(ht,Re),we=t.mul(he,Re),ht=t.add(Ze,Ze),ht=t.add(ht,Ze),lt=t.mul(Ye,lt),Ue=t.mul(Je,Ue),ht=t.add(ht,lt),lt=t.sub(Ze,lt),lt=t.mul(Ye,lt),Ue=t.add(Ue,lt),Ze=t.mul(ht,Ue),we=t.add(we,Ze),Ze=t.mul(Le,Ue),he=t.mul(Qt,he),he=t.sub(he,Ze),Ze=t.mul(Qt,ht),Re=t.mul(Le,Re),Re=t.add(Re,Ze),new d(he,we,Re)}subtract(C){return this.add(C.negate())}is0(){return this.equals(d.ZERO)}wNAF(C){return A.wNAFCached(this,l,C,E=>{const Q=t.invertBatch(E.map(F=>F.pz));return E.map((F,se)=>F.toAffine(Q[se])).map(d.fromAffine)})}multiplyUnsafe(C){const E=d.ZERO;if(C===yo)return E;if(a(C),C===Jn)return this;const{endo:Q}=n;if(!Q)return A.unsafeLadder(this,C);let{k1neg:F,k1:se,k2neg:le,k2:Be}=Q.splitScalar(C),he=E,we=E,Re=this;for(;se>yo||Be>yo;)se&Jn&&(he=he.add(Re)),Be&Jn&&(we=we.add(Re)),Re=Re.double(),se>>=Jn,Be>>=Jn;return F&&(he=he.negate()),le&&(we=we.negate()),we=new d(t.mul(we.px,Q.beta),we.py,we.pz),he.add(we)}multiply(C){a(C);let Q,F,E=C;const{endo:se}=n;if(se){const{k1neg:le,k1:Be,k2neg:he,k2:we}=se.splitScalar(E);let{p:Re,f:Ye}=this.wNAF(Be),{p:Je,f:Ze}=this.wNAF(we);Re=A.constTimeNegate(le,Re),Je=A.constTimeNegate(he,Je),Je=new d(t.mul(Je.px,se.beta),Je.py,Je.pz),Q=Re.add(Je),F=Ye.add(Ze)}else{const{p:le,f:Be}=this.wNAF(E);Q=le,F=Be}return d.normalizeZ([Q,F])[0]}multiplyAndAddUnsafe(C,E,Q){const F=d.BASE,se=(Be,he)=>he!==yo&&he!==Jn&&Be.equals(F)?Be.multiply(he):Be.multiplyUnsafe(he),le=se(this,E).add(se(C,Q));return le.is0()?void 0:le}toAffine(C){const{px:E,py:Q,pz:F}=this,se=this.is0();null==C&&(C=se?t.ONE:t.inv(F));const le=t.mul(E,C),Be=t.mul(Q,C),he=t.mul(F,C);if(se)return{x:t.ZERO,y:t.ZERO};if(!t.eql(he,t.ONE))throw new Error("invZ was invalid");return{x:le,y:Be}}isTorsionFree(){const{h:C,isTorsionFree:E}=n;if(C===Jn)return!0;if(E)return E(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:E}=n;return C===Jn?this:E?E(d,this):this.multiplyUnsafe(n.h)}toRawBytes(C=!0){return this.assertValidity(),r(d,this,C)}toHex(C=!0){return Eu(this.toRawBytes(C))}}d.BASE=new d(n.Gx,n.Gy,t.ONE),d.ZERO=new d(t.ZERO,t.ONE,t.ZERO);const f=n.nBitLength,A=function Hne(e,n){const t=(i,o)=>{const s=o.negate();return i?s:o},r=i=>({windows:Math.ceil(n/i)+1,windowSize:2**(i-1)});return{constTimeNegate:t,unsafeLadder(i,o){let s=e.ZERO,a=i;for(;o>Une;)o&xw&&(s=s.add(a)),a=a.double(),o>>=xw;return s},precomputeWindow(i,o){const{windows:s,windowSize:a}=r(o),c=[];let l=i,u=l;for(let d=0;d<s;d++){u=l,c.push(u);for(let f=1;f<a;f++)u=u.add(l),c.push(u);l=u.double()}return c},wNAF(i,o,s){const{windows:a,windowSize:c}=r(i);let l=e.ZERO,u=e.BASE;const d=BigInt(2**i-1),f=2**i,A=BigInt(i);for(let p=0;p<a;p++){const C=p*c;let E=Number(s&d);s>>=A,E>c&&(E-=f,s+=xw);const Q=C,F=C+Math.abs(E)-1,le=E<0;0===E?u=u.add(t(p%2!=0,o[Q])):l=l.add(t(le,o[F]))}return{p:l,f:u}},wNAFCached(i,o,s,a){const c=i._WINDOW_SIZE||1;let l=o.get(i);return l||(l=this.precomputeWindow(i,c),1!==c&&o.set(i,a(l))),this.wNAF(c,l,s)}}}(d,n.endo?Math.ceil(f/2):f);return{CURVE:n,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}({...n,toBytes(Ue,Le,We){const ct=Le.toAffine(),qe=t.toBytes(ct.x),It=Qc;return We?It(Uint8Array.from([Le.hasEvenY()?2:3]),qe):It(Uint8Array.from([4]),qe,t.toBytes(ct.y))},fromBytes(Ue){const Le=Ue.length,We=Ue[0],ct=Ue.subarray(1);if(Le!==i||2!==We&&3!==We){if(Le===o&&4===We)return{x:t.fromBytes(ct.subarray(0,t.BYTES)),y:t.fromBytes(ct.subarray(t.BYTES,2*t.BYTES))};throw new Error(`Point of length ${Le} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}{const qe=gi(ct);if(!function s(Ue){return yo<Ue&&Ue<t.ORDER}(qe))throw new Error("Point is not on curve");const It=d(qe);let Ft=t.sqrt(It);return!(1&~We)!=((Ft&Jn)===Jn)&&(Ft=t.neg(Ft)),{x:qe,y:Ft}}}}),A=Ue=>Eu(da(Ue,n.nByteLength));function p(Ue){return Ue>r>>Jn}const E=(Ue,Le,We)=>gi(Ue.slice(Le,We));class Q{constructor(Le,We,ct){this.r=Le,this.s=We,this.recovery=ct,this.assertValidity()}static fromCompact(Le){const We=n.nByteLength;return Le=Lr("compactSignature",Le,2*We),new Q(E(Le,0,We),E(Le,We,2*We))}static fromDER(Le){const{r:We,s:ct}=Dc.toSig(Lr("DER",Le));return new Q(We,ct)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Le){return new Q(this.r,this.s,Le)}recoverPublicKey(Le){const{r:We,s:ct,recovery:qe}=this,It=we(Lr("msgHash",Le));if(null==qe||![0,1,2,3].includes(qe))throw new Error("recovery id invalid");const Ft=2===qe||3===qe?We+n.n:We;if(Ft>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ln=l.fromHex((1&qe?"03":"02")+A(Ft)),Wn=c(Ft),$n=a(-It*Wn),_r=a(ct*Wn),ur=l.BASE.multiplyAndAddUnsafe(Ln,$n,_r);if(!ur)throw new Error("point at infinify");return ur.assertValidity(),ur}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new Q(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Bu(this.toDERHex())}toDERHex(){return Dc.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Bu(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}const F={isValidPrivateKey(Ue){try{return u(Ue),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const Ue=_3(n.n);return function Pne(e,n,t=!1){const r=e.length,i=v3(n),o=_3(n);if(r<16||r<o||r>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const a=mr(t?gi(e):Dw(e),n-En)+En;return t?Sw(a,i):da(a,i)}(n.randomBytes(Ue),n.n)},precompute:(Ue=8,Le=l.BASE)=>(Le._setWindowSize(Ue),Le.multiply(BigInt(3)),Le)};function le(Ue){const Le=Ue instanceof Uint8Array,We="string"==typeof Ue,ct=(Le||We)&&Ue.length;return Le?ct===i||ct===o:We?ct===2*i||ct===2*o:Ue instanceof l}const he=n.bits2int||function(Ue){const Le=gi(Ue),We=8*Ue.length-n.nBitLength;return We>0?Le>>BigInt(We):Le},we=n.bits2int_modN||function(Ue){return a(he(Ue))},Re=kw(n.nBitLength);function Ye(Ue){if("bigint"!=typeof Ue)throw new Error("bigint expected");if(!(yo<=Ue&&Ue<Re))throw new Error(`bigint expected < 2^${n.nBitLength}`);return da(Ue,n.nByteLength)}const Ze={lowS:n.lowS,prehash:!1},ht={lowS:n.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:n,getPublicKey:function se(Ue,Le=!0){return l.fromPrivateKey(Ue).toRawBytes(Le)},getSharedSecret:function Be(Ue,Le,We=!0){if(le(Ue))throw new Error("first arg must be private key");if(!le(Le))throw new Error("second arg must be public key");return l.fromHex(Le).multiply(u(Ue)).toRawBytes(We)},sign:function lt(Ue,Le,We=Ze){const{seed:ct,k2sig:qe}=function Je(Ue,Le,We=Ze){if(["recovered","canonical"].some(Qr=>Qr in We))throw new Error("sign() legacy options not supported");const{hash:ct,randomBytes:qe}=n;let{lowS:It,prehash:Ft,extraEntropy:Tt}=We;null==It&&(It=!0),Ue=Lr("msgHash",Ue),Ft&&(Ue=Lr("prehashed msgHash",ct(Ue)));const Ln=we(Ue),Wn=u(Le),$n=[Ye(Wn),Ye(Ln)];if(null!=Tt){const Qr=!0===Tt?qe(t.BYTES):Tt;$n.push(Lr("extraEntropy",Qr))}const _r=Qc(...$n),ur=Ln;return{seed:_r,k2sig:function br(Qr){const Na=he(Qr);if(!f(Na))return;const ld=c(Na),eo=l.BASE.multiply(Na).toAffine(),Hs=a(eo.x);if(Hs===yo)return;const ud=a(ld*a(ur+Hs*Wn));if(ud===yo)return;let Fm=(eo.x===Hs?0:2)|Number(eo.y&Jn),Uf=ud;return It&&p(ud)&&(Uf=function C(Ue){return p(Ue)?a(-Ue):Ue}(ud),Fm^=1),new Q(Hs,Uf,Fm)}}}(Ue,Le,We);return E3(n.hash.outputLen,n.nByteLength,n.hmac)(ct,qe)},verify:function Qt(Ue,Le,We,ct=ht){const qe=Ue;if(Le=Lr("msgHash",Le),We=Lr("publicKey",We),"strict"in ct)throw new Error("options.strict was renamed to lowS");const{lowS:It,prehash:Ft}=ct;let Tt,Ln;try{if("string"==typeof qe||qe instanceof Uint8Array)try{Tt=Q.fromDER(qe)}catch(eo){if(!(eo instanceof Dc.Err))throw eo;Tt=Q.fromCompact(qe)}else{if("object"!=typeof qe||"bigint"!=typeof qe.r||"bigint"!=typeof qe.s)throw new Error("PARSE");{const{r:eo,s:Hs}=qe;Tt=new Q(eo,Hs)}}Ln=l.fromHex(We)}catch(eo){if("PARSE"===eo.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(It&&Tt.hasHighS())return!1;Ft&&(Le=n.hash(Le));const{r:Wn,s:$n}=Tt,_r=we(Le),ur=c($n),br=a(_r*ur),Qr=a(Wn*ur),Na=l.BASE.multiplyAndAddUnsafe(Ln,br,Qr)?.toAffine();return!!Na&&a(Na.x)===Wn},ProjectivePoint:l,Signature:Q,utils:F}}function Yne(e){return{hash:e,hmac:(n,...t)=>Q3(e,n,function Ane(...e){const n=new Uint8Array(e.reduce((r,i)=>r+i.length,0));let t=0;return e.forEach(r=>{if(!vw(r))throw new Error("Uint8Array expected");n.set(r,t),t+=r.length}),n}(...t)),randomBytes:p3}}BigInt(4);const eI=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),tI=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),k3=BigInt(1),nI=BigInt(2),M3=(e,n)=>(e+n/nI)/n;function F3(e){const n=eI,t=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%n,u=l*l*e%n,d=Ji(u,t,n)*u%n,f=Ji(d,t,n)*u%n,A=Ji(f,nI,n)*l%n,p=Ji(A,i,n)*A%n,C=Ji(p,o,n)*p%n,E=Ji(C,a,n)*C%n,Q=Ji(E,c,n)*E%n,F=Ji(Q,a,n)*C%n,se=Ji(F,t,n)*u%n,le=Ji(se,s,n)*p%n,Be=Ji(le,r,n)*l%n,he=Ji(Be,nI,n);if(!Tw.eql(Tw.sqr(he),e))throw new Error("Cannot find square root");return he}const Tw=function Rne(e,n,t=!1,r={}){if(e<=Ir)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:o}=Nw(e,n);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=function Fne(e){if(e%Fw===Qne){const n=(e+En)/Fw;return function(r,i){const o=r.pow(i,n);if(!r.eql(r.sqr(o),i))throw new Error("Cannot find square root");return o}}if(e%w3===B3){const n=(e-B3)/w3;return function(r,i){const o=r.mul(i,Aa),s=r.pow(o,n),a=r.mul(i,s),c=r.mul(r.mul(a,Aa),s),l=r.mul(a,r.sub(c,r.ONE));if(!r.eql(r.sqr(l),i))throw new Error("Cannot find square root");return l}}return function Mne(e){const n=(e-En)/Aa;let t,r,i;for(t=e-En,r=0;t%Aa===Ir;t/=Aa,r++);for(i=Aa;i<e&&kne(i,n,e)!==e-En;i++);if(1===r){const s=(e+En)/Fw;return function(c,l){const u=c.pow(l,s);if(!c.eql(c.sqr(u),l))throw new Error("Cannot find square root");return u}}const o=(t+En)/Aa;return function(a,c){if(a.pow(c,n)===a.neg(a.ONE))throw new Error("Cannot find square root");let l=r,u=a.pow(a.mul(a.ONE,i),t),d=a.pow(c,o),f=a.pow(c,t);for(;!a.eql(f,a.ONE);){if(a.eql(f,a.ZERO))return a.ZERO;let A=1;for(let C=a.sqr(f);A<l&&!a.eql(C,a.ONE);A++)C=a.sqr(C);const p=a.pow(u,En<<BigInt(l-A-1));u=a.sqr(p),d=a.mul(d,p),f=a.mul(f,u),l=A}return d}}(e)}(e),a=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:kw(i),ZERO:Ir,ONE:En,create:c=>mr(c,e),isValid:c=>{if("bigint"!=typeof c)throw new Error("Invalid field element: expected bigint, got "+typeof c);return Ir<=c&&c<e},is0:c=>c===Ir,isOdd:c=>(c&En)===En,neg:c=>mr(-c,e),eql:(c,l)=>c===l,sqr:c=>mr(c*c,e),add:(c,l)=>mr(c+l,e),sub:(c,l)=>mr(c-l,e),mul:(c,l)=>mr(c*l,e),pow:(c,l)=>function Tne(e,n,t){if(t<Ir)throw new Error("Expected power > 0");if(t===Ir)return e.ONE;if(t===En)return n;let r=e.ONE,i=n;for(;t>Ir;)t&En&&(r=e.mul(r,i)),i=e.sqr(i),t>>=En;return r}(a,c,l),div:(c,l)=>mr(c*Zp(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>Zp(c,e),sqrt:r.sqrt||(c=>s(a,c)),invertBatch:c=>function One(e,n){const t=new Array(n.length),r=n.reduce((o,s,a)=>e.is0(s)?o:(t[a]=o,e.mul(o,s)),e.ONE),i=e.inv(r);return n.reduceRight((o,s,a)=>e.is0(s)?o:(t[a]=e.mul(o,t[a]),e.mul(o,s)),i),t}(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>t?Sw(c,o):da(c,o),fromBytes:c=>{if(c.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);return t?Dw(c):gi(c)}});return Object.freeze(a)}(eI,void 0,void 0,{sqrt:F3}),wu=function Wne(e,n){const t=r=>Jne({...e,...Yne(r)});return Object.freeze({...t(n),create:t})}({a:BigInt(0),b:BigInt(7),Fp:Tw,n:tI,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const n=tI,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-k3*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=t,s=BigInt("0x100000000000000000000000000000000"),a=M3(o*e,n),c=M3(-r*e,n);let l=mr(e-a*t-c*i,n),u=mr(-a*r-c*o,n);const d=l>s,f=u>s;if(d&&(l=n-l),f&&(u=n-u),l>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},Qw),rI=BigInt(0),N3=e=>"bigint"==typeof e&&rI<e&&e<eI,x3={};function iI(e,...n){let t=x3[e];if(void 0===t){const r=Qw(Uint8Array.from(e,i=>i.charCodeAt(0)));t=Qc(r,r),x3[e]=t}return Qw(Qc(t,...n))}const Ow=e=>e.toRawBytes(!0).slice(1),Rw=e=>da(e,32),Pw=e=>mr(e,eI),lf=e=>mr(e,tI),Uw=wu.ProjectivePoint;function Hw(e){let n=wu.utils.normPrivateKeyToScalar(e),t=Uw.fromPrivateKey(n);return{scalar:t.hasEvenY()?n:lf(-n),bytes:Ow(t)}}function T3(e){if(!N3(e))throw new Error("bad x: need 0 < x < p");const n=Pw(e*e);let r=F3(Pw(n*e+BigInt(7)));r%nI!==rI&&(r=Pw(-r));const i=new Uw(e,r,k3);return i.assertValidity(),i}function O3(...e){return lf(gi(iI("BIP0340/challenge",...e)))}function R3(e,n,t){const r=Lr("signature",e,64),i=Lr("message",n),o=Lr("publicKey",t,32);try{const s=T3(gi(o)),a=gi(r.subarray(0,32));if(!N3(a))return!1;const c=gi(r.subarray(32,64));if(!(e=>"bigint"==typeof e&&rI<e&&e<tI)(c))return!1;const l=O3(Rw(a),Ow(s),i),u=((e,n,t)=>Uw.BASE.multiplyAndAddUnsafe(e,n,t))(s,c,lf(-l));return!(!u||!u.hasEvenY()||u.toAffine().x!==a)}catch{return!1}}const jo={getPublicKey:function Xne(e){return Hw(e).bytes},sign:function ere(e,n,t=p3(32)){const r=Lr("message",e),{bytes:i,scalar:o}=Hw(n),s=Lr("auxRand",t,32),a=Rw(o^gi(iI("BIP0340/aux",s))),c=iI("BIP0340/nonce",a,i,r),l=lf(gi(c));if(l===rI)throw new Error("sign failed: k is zero");const{bytes:u,scalar:d}=Hw(l),f=O3(u,i,r),A=new Uint8Array(64);if(A.set(u,0),A.set(Rw(lf(d+f*o)),32),!R3(A,r,i))throw new Error("sign: Invalid signature produced");return A},verify:R3,utils:{randomPrivateKey:wu.utils.randomPrivateKey,lift_x:T3,pointToBytes:Ow,numberToBytesBE:da,bytesToNumberBE:gi,taggedHash:iI,mod:mr}},Lw="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Gw=e=>e instanceof Uint8Array,Vw=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),oI=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Yo=(e,n)=>e<<32-n|e>>>n;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const nre=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function wr(e){if(!Gw(e))throw new Error("Uint8Array expected");let n="";for(let t=0;t<e.length;t++)n+=nre[e[t]];return n}function vu(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const n=e.length;if(n%2)throw new Error("padded hex string expected, got unpadded hex of length "+n);const t=new Uint8Array(n/2);for(let r=0;r<t.length;r++){const i=2*r,o=e.slice(i,i+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[r]=s}return t}function Qs(e){if("string"==typeof e&&(e=function ire(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Gw(e))throw new Error("expected Uint8Array, got "+typeof e);return e}function uf(...e){const n=new Uint8Array(e.reduce((r,i)=>r+i.length,0));let t=0;return e.forEach(r=>{if(!Gw(r))throw new Error("Uint8Array expected");n.set(r,t),t+=r.length}),n}class P3{clone(){return this._cloneInto()}}function U3(e,n){if(void 0!==n&&("object"!=typeof n||!(e=>"[object Object]"===Object.prototype.toString.call(e)&&e.constructor===Object)(n)))throw new Error("Options should be object or undefined");return Object.assign(e,n)}function H3(e){const n=r=>e().update(Qs(r)).digest(),t=e();return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=()=>e(),n}function sI(e=32){if(Lw&&"function"==typeof Lw.getRandomValues)return Lw.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function zw(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function L3(e,...n){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(n.length>0&&!n.includes(e.length))throw new Error(`Expected Uint8Array of length ${n}, not of length=${e.length}`)}const cr={number:zw,bool:function sre(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:L3,hash:function are(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");zw(e.outputLen),zw(e.blockLen)},exists:function cre(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")},output:function lre(e,n){L3(e);const t=n.outputLen;if(e.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}};class dre extends P3{constructor(n,t,r,i){super(),this.blockLen=n,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(n),this.view=oI(this.buffer)}update(n){cr.exists(this);const{view:t,buffer:r,blockLen:i}=this,o=(n=Qs(n)).length;for(let s=0;s<o;){const a=Math.min(i-this.pos,o-s);if(a!==i)r.set(n.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const c=oI(n);for(;i<=o-s;s+=i)this.process(c,s)}}return this.length+=n.length,this.roundClean(),this}digestInto(n){cr.exists(this),cr.output(n,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:o}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)t[d]=0;(function ure(e,n,t,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(n,t,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(t>>i&o),a=Number(t&o),l=r?0:4;e.setUint32(n+(r?4:0),s,r),e.setUint32(n+l,a,r)})(r,i-8,BigInt(8*this.length),o),this.process(r,0);const a=oI(n),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],o)}digest(){const{buffer:n,outputLen:t}=this;this.digestInto(n);const r=n.slice(0,t);return this.destroy(),r}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:o,destroyed:s,pos:a}=this;return n.length=i,n.pos=a,n.finished=o,n.destroyed=s,i%t&&n.buffer.set(r),n}}const Are=(e,n,t)=>e&n^~e&t,fre=(e,n,t)=>e&n^e&t^n&t,gre=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]),ga=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ha=new Uint32Array(64);class G3 extends dre{constructor(){super(64,32,8,!1),this.A=0|ga[0],this.B=0|ga[1],this.C=0|ga[2],this.D=0|ga[3],this.E=0|ga[4],this.F=0|ga[5],this.G=0|ga[6],this.H=0|ga[7]}get(){const{A:n,B:t,C:r,D:i,E:o,F:s,G:a,H:c}=this;return[n,t,r,i,o,s,a,c]}set(n,t,r,i,o,s,a,c){this.A=0|n,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|o,this.F=0|s,this.G=0|a,this.H=0|c}process(n,t){for(let d=0;d<16;d++,t+=4)ha[d]=n.getUint32(t,!1);for(let d=16;d<64;d++){const f=ha[d-15],A=ha[d-2],p=Yo(f,7)^Yo(f,18)^f>>>3,C=Yo(A,17)^Yo(A,19)^A>>>10;ha[d]=C+ha[d-7]+p+ha[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const A=u+(Yo(a,6)^Yo(a,11)^Yo(a,25))+Are(a,c,l)+gre[d]+ha[d]|0,C=(Yo(r,2)^Yo(r,13)^Yo(r,22))+fre(r,i,o)|0;u=l,l=c,c=a,a=s+A|0,s=o,o=i,i=r,r=A+C|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,o,s,a,c,l,u)}roundClean(){ha.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class hre extends G3{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}}const pa=H3(()=>new G3);function Sc(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function Eo(...e){const n=(i,o)=>s=>i(o(s));return{encode:Array.from(e).reverse().reduce((i,o)=>i?n(i,o.encode):o.encode,void 0),decode:e.reduce((i,o)=>i?n(i,o.decode):o.decode,void 0)}}function Wo(e){return{encode:n=>{if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("alphabet.encode input should be an array of numbers");return n.map(t=>{if(Sc(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})},decode:n=>{if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("alphabet.decode input should be array of strings");return n.map(t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r})}}}function $o(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:n=>{if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("join.encode input should be array of strings");for(let t of n)if("string"!=typeof t)throw new Error(`join.encode: non-string input=${t}`);return n.join(e)},decode:n=>{if("string"!=typeof n)throw new Error("join.decode input should be string");return n.split(e)}}}function df(e,n="="){if(Sc(e),"string"!=typeof n)throw new Error("padding chr should be string");return{encode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let r of t)if("string"!=typeof r)throw new Error(`padding.encode: non-string input=${r}`);for(;t.length*e%8;)t.push(n);return t},decode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let i of t)if("string"!=typeof i)throw new Error(`padding.decode: non-string input=${i}`);let r=t.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&t[r-1]===n;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return t.slice(0,r)}}}function V3(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:n=>n,decode:n=>e(n)}}function q3(e,n,t){if(n<2)throw new Error(`convertRadix: wrong from=${n}, base cannot be less than 2`);if(t<2)throw new Error(`convertRadix: wrong to=${t}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const i=[],o=Array.from(e);for(o.forEach(s=>{if(Sc(s),s<0||s>=n)throw new Error(`Wrong integer: ${s}`)});;){let s=0,a=!0;for(let c=r;c<o.length;c++){const l=o[c],u=n*s+l;if(!Number.isSafeInteger(u)||n*s/n!==s||u-l!=n*s)throw new Error("convertRadix: carry overflow");if(s=u%t,o[c]=Math.floor(u/t),!Number.isSafeInteger(o[c])||o[c]*t+s!==u)throw new Error("convertRadix: carry overflow");a&&(o[c]?a=!1:r=c)}if(i.push(s),a)break}for(let s=0;s<e.length-1&&0===e[s];s++)i.push(0);return i.reverse()}H3(()=>new hre);const z3=(e,n)=>n?z3(n,e%n):e,aI=(e,n)=>e+(n-z3(e,n));function Kw(e,n,t,r){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(n<=0||n>32)throw new Error(`convertRadix2: wrong from=${n}`);if(t<=0||t>32)throw new Error(`convertRadix2: wrong to=${t}`);if(aI(n,t)>32)throw new Error(`convertRadix2: carry overflow from=${n} to=${t} carryBits=${aI(n,t)}`);let i=0,o=0;const s=2**t-1,a=[];for(const c of e){if(Sc(c),c>=2**n)throw new Error(`convertRadix2: invalid data word=${c} from=${n}`);if(i=i<<n|c,o+n>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${n}`);for(o+=n;o>=t;o-=t)a.push((i>>o-t&s)>>>0);i&=2**o-1}if(i=i<<t-o&s,!r&&o>=n)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&a.push(i>>>0),a}function Ds(e,n=!1){if(Sc(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(aI(8,e)>32||aI(e,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Kw(Array.from(t),8,e,!n)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Kw(t,e,8,n))}}}function J3(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...n){try{return e.apply(null,n)}catch{}}}Eo(Ds(4),Wo("0123456789ABCDEF"),$o("")),Eo(Ds(5),Wo("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),df(5),$o(""));const Ss=(Eo(Ds(5),Wo("0123456789ABCDEFGHIJKLMNOPQRSTUV"),df(5),$o("")),Eo(Ds(5),Wo("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),$o(""),V3(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),Eo(Ds(6),Wo("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),df(6),$o(""))),Jw=(Eo(Ds(6),Wo("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),df(6),$o("")),e=>Eo(function K3(e){return Sc(e),{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return q3(Array.from(n),256,e)},decode:n=>{if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(q3(n,e,256))}}}(58),Wo(e),$o(""))),jw=(Jw("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),Jw("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),Jw("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),Eo(Wo("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),$o(""))),W3=[996825010,642813549,513874426,1027748829,705979059];function Af(e){const n=e>>25;let t=(33554431&e)<<5;for(let r=0;r<W3.length;r++)1==(n>>r&1)&&(t^=W3[r]);return t}function $3(e,n,t=1){const r=e.length;let i=1;for(let o=0;o<r;o++){const s=e.charCodeAt(o);if(s<33||s>126)throw new Error(`Invalid prefix (${e})`);i=Af(i)^s>>5}i=Af(i);for(let o=0;o<r;o++)i=Af(i)^31&e.charCodeAt(o);for(let o of n)i=Af(i)^o;for(let o=0;o<6;o++)i=Af(i);return i^=t,jw.encode(Kw([i%2**30],30,5,!1))}function Z3(e){const n="bech32"===e?1:734539939,t=Ds(5),r=t.decode,i=t.encode,o=J3(r);function a(u,d=90){if("string"!=typeof u)throw new Error("bech32.decode input should be string, not "+typeof u);if(u.length<8||!1!==d&&u.length>d)throw new TypeError(`Wrong string length: ${u.length} (${u}). Expected (8..${d})`);const f=u.toLowerCase();if(u!==f&&u!==u.toUpperCase())throw new Error("String must be lowercase or uppercase");const A=(u=f).lastIndexOf("1");if(0===A||-1===A)throw new Error('Letter "1" must be present between prefix and data only');const p=u.slice(0,A),C=u.slice(A+1);if(C.length<6)throw new Error("Data must be at least 6 characters long");const E=jw.decode(C).slice(0,-6),Q=$3(p,E,n);if(!C.endsWith(Q))throw new Error(`Invalid checksum in ${u}: expected "${Q}"`);return{prefix:p,words:E}}return{encode:function s(u,d,f=90){if("string"!=typeof u)throw new Error("bech32.encode prefix should be string, not "+typeof u);if(!Array.isArray(d)||d.length&&"number"!=typeof d[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof d);const A=u.length+7+d.length;if(!1!==f&&A>f)throw new TypeError(`Length ${A} exceeds limit ${f}`);return`${u=u.toLowerCase()}1${jw.encode(d)}${$3(u,d,n)}`},decode:a,decodeToBytes:function l(u){const{prefix:d,words:f}=a(u,!1);return{prefix:d,words:f,bytes:r(f)}},decodeUnsafe:J3(a),fromWords:r,fromWordsUnsafe:o,toWords:i}}const Ia=Z3("bech32");function _u(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Yw(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function eO(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function zt(e,...n){if(!eO(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error(`Uint8Array expected of length ${n}, not of length=${e.length}`)}function kc(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")}function uI(e,n){zt(e);const t=n.outputLen;if(e.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}Z3("bech32m"),Eo(Ds(4),Wo("0123456789abcdef"),$o(""),V3(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 qt=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),bu=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function ma(e){if("string"==typeof e)e=function Sre(e){if("string"!=typeof e)throw new Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!eO(e))throw new Error("Uint8Array expected, got "+typeof e);e=e.slice()}return e}function dI(e,n){if(e.length!==n.length)return!1;let t=0;for(let r=0;r<e.length;r++)t|=e[r]^n[r];return 0===t}const Ca=(e,n)=>(Object.assign(n,e),n);function Mc(e,n,t,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(n,t,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(t>>i&o),a=Number(t&o),l=r?0:4;e.setUint32(n+(r?4:0),s,r),e.setUint32(n+l,a,r)}const Zw=new Uint8Array(16),Zo=qt(Zw),Fre=(e,n,t,r)=>({s3:t<<31|r>>>1,s2:n<<31|t>>>1,s1:e<<31|n>>>1,s0:e>>>1^225<<24&-(1&r)}),ji=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255;class rO{constructor(n,t){this.blockLen=16,this.outputLen=16,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,zt(n=ma(n),16);const r=bu(n);let i=r.getUint32(0,!1),o=r.getUint32(4,!1),s=r.getUint32(8,!1),a=r.getUint32(12,!1);const c=[];for(let p=0;p<128;p++)c.push({s0:ji(i),s1:ji(o),s2:ji(s),s3:ji(a)}),({s0:i,s1:o,s2:s,s3:a}=Fre(i,o,s,a));const l=(e=t||1024)>65536?8:e>1024?4:2;var e;if(![1,2,4,8].includes(l))throw new Error(`ghash: wrong window size=${l}, should be 2, 4 or 8`);this.W=l;const d=128/l,f=this.windowSize=2**l,A=[];for(let p=0;p<d;p++)for(let C=0;C<f;C++){let E=0,Q=0,F=0,se=0;for(let le=0;le<l;le++){if(!(C>>>l-le-1&1))continue;const{s0:he,s1:we,s2:Re,s3:Ye}=c[l*p+le];E^=he,Q^=we,F^=Re,se^=Ye}A.push({s0:E,s1:Q,s2:F,s3:se})}this.t=A}_updateBlock(n,t,r,i){n^=this.s0,t^=this.s1,r^=this.s2,i^=this.s3;const{W:o,t:s,windowSize:a}=this;let c=0,l=0,u=0,d=0;const f=(1<<o)-1;let A=0;for(const p of[n,t,r,i])for(let C=0;C<4;C++){const E=p>>>8*C&255;for(let Q=8/o-1;Q>=0;Q--){const F=E>>>o*Q&f,{s0:se,s1:le,s2:Be,s3:he}=s[A*a+F];c^=se,l^=le,u^=Be,d^=he,A+=1}}this.s0=c,this.s1=l,this.s2=u,this.s3=d}update(n){n=ma(n),kc(this);const t=qt(n),r=Math.floor(n.length/16),i=n.length%16;for(let o=0;o<r;o++)this._updateBlock(t[4*o+0],t[4*o+1],t[4*o+2],t[4*o+3]);return i&&(Zw.set(n.subarray(16*r)),this._updateBlock(Zo[0],Zo[1],Zo[2],Zo[3]),Zo.fill(0)),this}destroy(){const{t:n}=this;for(const t of n)t.s0=0,t.s1=0,t.s2=0,t.s3=0}digestInto(n){kc(this),uI(n,this),this.finished=!0;const{s0:t,s1:r,s2:i,s3:o}=this,s=qt(n);return s[0]=t,s[1]=r,s[2]=i,s[3]=o,n}digest(){const n=new Uint8Array(16);return this.digestInto(n),this.destroy(),n}}class Tre extends rO{constructor(n,t){const r=function Nre(e){e.reverse();const n=1&e[15];let t=0;for(let r=0;r<e.length;r++){const i=e[r];e[r]=i>>>1|t,t=(1&i)<<7}return e[0]^=225&-n,e}((n=ma(n)).slice());super(r,t),r.fill(0)}update(n){n=ma(n),kc(this);const t=qt(n),r=n.length%16,i=Math.floor(n.length/16);for(let o=0;o<i;o++)this._updateBlock(ji(t[4*o+3]),ji(t[4*o+2]),ji(t[4*o+1]),ji(t[4*o+0]));return r&&(Zw.set(n.subarray(16*i)),this._updateBlock(ji(Zo[3]),ji(Zo[2]),ji(Zo[1]),ji(Zo[0])),Zo.fill(0)),this}digestInto(n){kc(this),uI(n,this),this.finished=!0;const{s0:t,s1:r,s2:i,s3:o}=this,s=qt(n);return s[0]=t,s[1]=r,s[2]=i,s[3]=o,n.reverse()}}function iO(e){const n=(r,i)=>e(i,r.length).update(ma(r)).digest(),t=e(new Uint8Array(16),0);return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=(r,i)=>e(r,i),n}function ev(e){return e<<1^283&-(e>>7)}function Qu(e,n){let t=0;for(;n>0;n>>=1)t^=e&-(1&n),e=ev(e);return t}iO((e,n)=>new rO(e,n)),iO((e,n)=>new Tre(e,n)),new Uint8Array(16);const tv=(()=>{let e=new Uint8Array(256);for(let t=0,r=1;t<256;t++,r^=ev(r))e[t]=r;const n=new Uint8Array(256);n[0]=99;for(let t=0;t<255;t++){let r=e[255-t];r|=r<<8,n[e[t]]=255&(r^r>>4^r>>5^r>>6^r>>7^99)}return n})(),Pre=tv.map((e,n)=>tv.indexOf(n)),Ure=e=>e<<24|e>>>8,nv=e=>e<<8|e>>>24;function sO(e,n){if(256!==e.length)throw new Error("Wrong sbox length");const t=new Uint32Array(256).map((l,u)=>n(e[u])),r=t.map(nv),i=r.map(nv),o=i.map(nv),s=new Uint32Array(65536),a=new Uint32Array(65536),c=new Uint16Array(65536);for(let l=0;l<256;l++)for(let u=0;u<256;u++){const d=256*l+u;s[d]=t[l]^r[u],a[d]=i[l]^o[u],c[d]=e[l]<<8|e[u]}return{sbox:e,sbox2:c,T0:t,T1:r,T2:i,T3:o,T01:s,T23:a}}const rv=sO(tv,e=>Qu(e,3)<<24|e<<16|e<<8|Qu(e,2)),aO=sO(Pre,e=>Qu(e,11)<<24|Qu(e,13)<<16|Qu(e,9)<<8|Qu(e,14)),Hre=(()=>{const e=new Uint8Array(16);for(let n=0,t=1;n<16;n++,t=ev(t))e[n]=t;return e})();function Fs(e){zt(e);const n=e.length;if(![16,24,32].includes(n))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${n}`);const{sbox2:t}=rv,r=qt(e),i=r.length,o=a=>Xo(t,a,a,a,a),s=new Uint32Array(n+28);s.set(r);for(let a=i;a<s.length;a++){let c=s[a-1];a%i==0?c=o(Ure(c))^Hre[a/i-1]:i>6&&a%i==4&&(c=o(c)),s[a]=s[a-i]^c}return s}function ya(e,n,t,r,i,o){return e[t<<8&65280|r>>>8&255]^n[i>>>8&65280|o>>>24&255]}function Xo(e,n,t,r,i){return e[255&n|65280&t]|e[r>>>16&255|i>>>16&65280]<<16}function hi(e,n,t,r,i){const{sbox2:o,T01:s,T23:a}=rv;let c=0;n^=e[c++],t^=e[c++],r^=e[c++],i^=e[c++];const l=e.length/4-2;for(let p=0;p<l;p++){const C=e[c++]^ya(s,a,n,t,r,i),E=e[c++]^ya(s,a,t,r,i,n),Q=e[c++]^ya(s,a,r,i,n,t),F=e[c++]^ya(s,a,i,n,t,r);n=C,t=E,r=Q,i=F}return{s0:e[c++]^Xo(o,n,t,r,i),s1:e[c++]^Xo(o,t,r,i,n),s2:e[c++]^Xo(o,r,i,n,t),s3:e[c++]^Xo(o,i,n,t,r)}}function fI(e,n,t,r,i){const{sbox2:o,T01:s,T23:a}=aO;let c=0;n^=e[c++],t^=e[c++],r^=e[c++],i^=e[c++];const l=e.length/4-2;for(let p=0;p<l;p++){const C=e[c++]^ya(s,a,n,i,r,t),E=e[c++]^ya(s,a,t,n,i,r),Q=e[c++]^ya(s,a,r,t,n,i),F=e[c++]^ya(s,a,i,r,t,n);n=C,t=E,r=Q,i=F}return{s0:e[c++]^Xo(o,n,i,r,t),s1:e[c++]^Xo(o,t,n,i,r),s2:e[c++]^Xo(o,r,t,n,i),s3:e[c++]^Xo(o,i,r,t,n)}}function Du(e,n){if(!n)return new Uint8Array(e);if(zt(n),n.length<e)throw new Error(`aes: wrong destination length, expected at least ${e}, got: ${n.length}`);return n}const fO=Ca({blockSize:16,nonceLength:16},function(n,t,r={}){zt(n),zt(t,16);const i=!r.disablePadding;return{encrypt:(o,s)=>{const a=Fs(n),{b:c,o:l,out:u}=function uO(e,n,t){let r=e.length;const i=r%16;if(!n&&0!==i)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");const o=qt(e);if(n){let c=16-i;c||(c=16),r+=c}const s=Du(r,t);return{b:o,o:qt(s),out:s}}(o,i,s),d=qt(t);let f=d[0],A=d[1],p=d[2],C=d[3],E=0;for(;E+4<=c.length;)f^=c[E+0],A^=c[E+1],p^=c[E+2],C^=c[E+3],({s0:f,s1:A,s2:p,s3:C}=hi(a,f,A,p,C)),l[E++]=f,l[E++]=A,l[E++]=p,l[E++]=C;if(i){const Q=function AO(e){const n=new Uint8Array(16),t=qt(n);n.set(e);const r=16-e.length;for(let i=16-r;i<16;i++)n[i]=r;return t}(o.subarray(4*E));f^=Q[0],A^=Q[1],p^=Q[2],C^=Q[3],({s0:f,s1:A,s2:p,s3:C}=hi(a,f,A,p,C)),l[E++]=f,l[E++]=A,l[E++]=p,l[E++]=C}return a.fill(0),u},decrypt:(o,s)=>{!function lO(e){if(zt(e),e.length%16!=0)throw new Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")}(o);const a=function iv(e){const n=Fs(e),t=n.slice(),r=n.length,{sbox2:i}=rv,{T0:o,T1:s,T2:a,T3:c}=aO;for(let l=0;l<r;l+=4)for(let u=0;u<4;u++)t[l+u]=n[r-l-4+u];n.fill(0);for(let l=4;l<r-4;l++){const u=t[l],d=Xo(i,u,u,u,u);t[l]=o[255&d]^s[d>>>8&255]^a[d>>>16&255]^c[d>>>24]}return t}(n),c=qt(t),l=Du(o.length,s),u=qt(o),d=qt(l);let f=c[0],A=c[1],p=c[2],C=c[3];for(let E=0;E+4<=u.length;){const Q=f,F=A,se=p,le=C;f=u[E+0],A=u[E+1],p=u[E+2],C=u[E+3];const{s0:Be,s1:he,s2:we,s3:Re}=fI(a,f,A,p,C);d[E++]=Be^Q,d[E++]=he^F,d[E++]=we^se,d[E++]=Re^le}return a.fill(0),function dO(e,n){if(!n)return e;const t=e.length;if(!t)throw new Error("aes/pcks5: empty ciphertext not allowed");const r=e[t-1];if(r<=0||r>16)throw new Error(`aes/pcks5: wrong padding byte: ${r}`);const i=e.subarray(0,-r);for(let o=0;o<r;o++)if(e[t-o-1]!==r)throw new Error("aes/pcks5: wrong padding");return i}(l,i)}}}),Mr=(e,n)=>255&e[n++]|(255&e[n++])<<8;class Vre{constructor(n){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,zt(n=ma(n),32);const t=Mr(n,0),r=Mr(n,2),i=Mr(n,4),o=Mr(n,6),s=Mr(n,8),a=Mr(n,10),c=Mr(n,12),l=Mr(n,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|r<<3),this.r[2]=7939&(r>>>10|i<<6),this.r[3]=8191&(i>>>7|o<<9),this.r[4]=255&(o>>>4|s<<12),this.r[5]=s>>>1&8190,this.r[6]=8191&(s>>>14|a<<2),this.r[7]=8065&(a>>>11|c<<5),this.r[8]=8191&(c>>>8|l<<8),this.r[9]=l>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Mr(n,16+2*u)}process(n,t,r=!1){const i=r?0:2048,{h:o,r:s}=this,a=s[0],c=s[1],l=s[2],u=s[3],d=s[4],f=s[5],A=s[6],p=s[7],C=s[8],E=s[9],Q=Mr(n,t+0),F=Mr(n,t+2),se=Mr(n,t+4),le=Mr(n,t+6),Be=Mr(n,t+8),he=Mr(n,t+10),we=Mr(n,t+12),Re=Mr(n,t+14);let Ye=o[0]+(8191&Q),Je=o[1]+(8191&(Q>>>13|F<<3)),Ze=o[2]+(8191&(F>>>10|se<<6)),ht=o[3]+(8191&(se>>>7|le<<9)),lt=o[4]+(8191&(le>>>4|Be<<12)),Qt=o[5]+(Be>>>1&8191),Ue=o[6]+(8191&(Be>>>14|he<<2)),Le=o[7]+(8191&(he>>>11|we<<5)),We=o[8]+(8191&(we>>>8|Re<<8)),ct=o[9]+(Re>>>5|i),qe=0,It=qe+Ye*a+Je*(5*E)+Ze*(5*C)+ht*(5*p)+lt*(5*A);qe=It>>>13,It&=8191,It+=Qt*(5*f)+Ue*(5*d)+Le*(5*u)+We*(5*l)+ct*(5*c),qe+=It>>>13,It&=8191;let Ft=qe+Ye*c+Je*a+Ze*(5*E)+ht*(5*C)+lt*(5*p);qe=Ft>>>13,Ft&=8191,Ft+=Qt*(5*A)+Ue*(5*f)+Le*(5*d)+We*(5*u)+ct*(5*l),qe+=Ft>>>13,Ft&=8191;let Tt=qe+Ye*l+Je*c+Ze*a+ht*(5*E)+lt*(5*C);qe=Tt>>>13,Tt&=8191,Tt+=Qt*(5*p)+Ue*(5*A)+Le*(5*f)+We*(5*d)+ct*(5*u),qe+=Tt>>>13,Tt&=8191;let Ln=qe+Ye*u+Je*l+Ze*c+ht*a+lt*(5*E);qe=Ln>>>13,Ln&=8191,Ln+=Qt*(5*C)+Ue*(5*p)+Le*(5*A)+We*(5*f)+ct*(5*d),qe+=Ln>>>13,Ln&=8191;let Wn=qe+Ye*d+Je*u+Ze*l+ht*c+lt*a;qe=Wn>>>13,Wn&=8191,Wn+=Qt*(5*E)+Ue*(5*C)+Le*(5*p)+We*(5*A)+ct*(5*f),qe+=Wn>>>13,Wn&=8191;let $n=qe+Ye*f+Je*d+Ze*u+ht*l+lt*c;qe=$n>>>13,$n&=8191,$n+=Qt*a+Ue*(5*E)+Le*(5*C)+We*(5*p)+ct*(5*A),qe+=$n>>>13,$n&=8191;let _r=qe+Ye*A+Je*f+Ze*d+ht*u+lt*l;qe=_r>>>13,_r&=8191,_r+=Qt*c+Ue*a+Le*(5*E)+We*(5*C)+ct*(5*p),qe+=_r>>>13,_r&=8191;let ur=qe+Ye*p+Je*A+Ze*f+ht*d+lt*u;qe=ur>>>13,ur&=8191,ur+=Qt*l+Ue*c+Le*a+We*(5*E)+ct*(5*C),qe+=ur>>>13,ur&=8191;let br=qe+Ye*C+Je*p+Ze*A+ht*f+lt*d;qe=br>>>13,br&=8191,br+=Qt*u+Ue*l+Le*c+We*a+ct*(5*E),qe+=br>>>13,br&=8191;let Qr=qe+Ye*E+Je*C+Ze*p+ht*A+lt*f;qe=Qr>>>13,Qr&=8191,Qr+=Qt*d+Ue*u+Le*l+We*c+ct*a,qe+=Qr>>>13,Qr&=8191,qe=(qe<<2)+qe|0,qe=qe+It|0,It=8191&qe,qe>>>=13,Ft+=qe,o[0]=It,o[1]=Ft,o[2]=Tt,o[3]=Ln,o[4]=Wn,o[5]=$n,o[6]=_r,o[7]=ur,o[8]=br,o[9]=Qr}finalize(){const{h:n,pad:t}=this,r=new Uint16Array(10);let i=n[1]>>>13;n[1]&=8191;for(let a=2;a<10;a++)n[a]+=i,i=n[a]>>>13,n[a]&=8191;n[0]+=5*i,i=n[0]>>>13,n[0]&=8191,n[1]+=i,i=n[1]>>>13,n[1]&=8191,n[2]+=i,r[0]=n[0]+5,i=r[0]>>>13,r[0]&=8191;for(let a=1;a<10;a++)r[a]=n[a]+i,i=r[a]>>>13,r[a]&=8191;r[9]-=8192;let o=(1^i)-1;for(let a=0;a<10;a++)r[a]&=o;o=~o;for(let a=0;a<10;a++)n[a]=n[a]&o|r[a];n[0]=65535&(n[0]|n[1]<<13),n[1]=65535&(n[1]>>>3|n[2]<<10),n[2]=65535&(n[2]>>>6|n[3]<<7),n[3]=65535&(n[3]>>>9|n[4]<<4),n[4]=65535&(n[4]>>>12|n[5]<<1|n[6]<<14),n[5]=65535&(n[6]>>>2|n[7]<<11),n[6]=65535&(n[7]>>>5|n[8]<<8),n[7]=65535&(n[8]>>>8|n[9]<<5);let s=n[0]+t[0];n[0]=65535&s;for(let a=1;a<8;a++)s=(n[a]+t[a]|0)+(s>>>16)|0,n[a]=65535&s}update(n){kc(this);const{buffer:t,blockLen:r}=this,i=(n=ma(n)).length;for(let o=0;o<i;){const s=Math.min(r-this.pos,i-o);if(s!==r)t.set(n.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0,!1),this.pos=0);else for(;r<=i-o;o+=r)this.process(n,o)}return this}destroy(){this.h.fill(0),this.r.fill(0),this.buffer.fill(0),this.pad.fill(0)}digestInto(n){kc(this),uI(n,this),this.finished=!0;const{buffer:t,h:r}=this;let{pos:i}=this;if(i){for(t[i++]=1;i<16;i++)t[i]=0;this.process(t,0,!0)}this.finalize();let o=0;for(let s=0;s<8;s++)n[o++]=r[s]>>>0,n[o++]=r[s]>>>8;return n}digest(){const{buffer:n,outputLen:t}=this;this.digestInto(n);const r=n.slice(0,t);return this.destroy(),r}}const zre=function qre(e){const n=(r,i)=>e(i).update(ma(r)).digest(),t=e(new Uint8Array(32));return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=r=>e(r),n}(e=>new Vre(e)),pO=e=>Uint8Array.from(e.split("").map(n=>n.charCodeAt(0))),Kre=pO("expand 16-byte k"),Jre=pO("expand 32-byte k"),jre=qt(Kre),IO=qt(Jre);function st(e,n){return e<<n|e>>>32-n}function ov(e){return e.byteOffset%4==0}IO.slice();const mO=2**32-1,CO=new Uint32Array;function ff(e,n){const{allowShortKeys:t,extendNonceFn:r,counterLength:i,counterRight:o,rounds:s}=function kre(e,n){if(null==n||"object"!=typeof n)throw new Error("options must be defined");return Object.assign(e,n)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},n);if("function"!=typeof e)throw new Error("core must be a function");return _u(i),_u(s),Yw(o),Yw(t),(a,c,l,u,d=0)=>{zt(a),zt(c),zt(l);const f=l.length;if(u||(u=new Uint8Array(f)),zt(u),_u(d),d<0||d>=mO)throw new Error("arx: counter overflow");if(u.length<f)throw new Error(`arx: output (${u.length}) is shorter than data (${f})`);const A=[];let C,E,p=a.length;if(32===p)C=a.slice(),A.push(C),E=IO;else{if(16!==p||!t)throw new Error(`arx: invalid 32-byte key, got length=${p}`);C=new Uint8Array(32),C.set(a),C.set(a,16),E=jre,A.push(C)}ov(c)||(c=c.slice(),A.push(c));const Q=qt(C);if(r){if(24!==c.length)throw new Error("arx: extended nonce must be 24 bytes");r(E,Q,qt(c.subarray(0,16)),Q),c=c.subarray(16)}const F=16-i;if(F!==c.length)throw new Error(`arx: nonce must be ${F} or 16 bytes`);if(12!==F){const le=new Uint8Array(12);le.set(c,o?0:12-c.length),A.push(c=le)}const se=qt(c);for(function Wre(e,n,t,r,i,o,s,a){const c=i.length,l=new Uint8Array(64),u=qt(l),d=ov(i)&&ov(o),f=d?qt(i):CO,A=d?qt(o):CO;for(let p=0;p<c;s++){if(e(n,t,r,u,s,a),s>=mO)throw new Error("arx: counter overflow");const C=Math.min(64,c-p);if(d&&64===C){const E=p/4;if(p%4!=0)throw new Error("arx: invalid block position");for(let F,Q=0;Q<16;Q++)F=E+Q,A[F]=f[F]^u[Q];p+=64}else{for(let Q,E=0;E<C;E++)Q=p+E,o[Q]=i[Q]^l[E];p+=C}}}(e,E,Q,se,l,u,d,s);A.length>0;)A.pop().fill(0);return u}}function gf(e,n,t,r,i,o=20){let s=e[0],a=e[1],c=e[2],l=e[3],u=n[0],d=n[1],f=n[2],A=n[3],p=n[4],C=n[5],E=n[6],Q=n[7],F=i,se=t[0],le=t[1],Be=t[2],he=s,we=a,Re=c,Ye=l,Je=u,Ze=d,ht=f,lt=A,Qt=p,Ue=C,Le=E,We=Q,ct=F,qe=se,It=le,Ft=Be;for(let Ln=0;Ln<o;Ln+=2)he=he+Je|0,ct=st(ct^he,16),Qt=Qt+ct|0,Je=st(Je^Qt,12),he=he+Je|0,ct=st(ct^he,8),Qt=Qt+ct|0,Je=st(Je^Qt,7),we=we+Ze|0,qe=st(qe^we,16),Ue=Ue+qe|0,Ze=st(Ze^Ue,12),we=we+Ze|0,qe=st(qe^we,8),Ue=Ue+qe|0,Ze=st(Ze^Ue,7),Re=Re+ht|0,It=st(It^Re,16),Le=Le+It|0,ht=st(ht^Le,12),Re=Re+ht|0,It=st(It^Re,8),Le=Le+It|0,ht=st(ht^Le,7),Ye=Ye+lt|0,Ft=st(Ft^Ye,16),We=We+Ft|0,lt=st(lt^We,12),Ye=Ye+lt|0,Ft=st(Ft^Ye,8),We=We+Ft|0,lt=st(lt^We,7),he=he+Ze|0,Ft=st(Ft^he,16),Le=Le+Ft|0,Ze=st(Ze^Le,12),he=he+Ze|0,Ft=st(Ft^he,8),Le=Le+Ft|0,Ze=st(Ze^Le,7),we=we+ht|0,ct=st(ct^we,16),We=We+ct|0,ht=st(ht^We,12),we=we+ht|0,ct=st(ct^we,8),We=We+ct|0,ht=st(ht^We,7),Re=Re+lt|0,qe=st(qe^Re,16),Qt=Qt+qe|0,lt=st(lt^Qt,12),Re=Re+lt|0,qe=st(qe^Re,8),Qt=Qt+qe|0,lt=st(lt^Qt,7),Ye=Ye+Je|0,It=st(It^Ye,16),Ue=Ue+It|0,Je=st(Je^Ue,12),Ye=Ye+Je|0,It=st(It^Ye,8),Ue=Ue+It|0,Je=st(Je^Ue,7);let Tt=0;r[Tt++]=s+he|0,r[Tt++]=a+we|0,r[Tt++]=c+Re|0,r[Tt++]=l+Ye|0,r[Tt++]=u+Je|0,r[Tt++]=d+Ze|0,r[Tt++]=f+ht|0,r[Tt++]=A+lt|0,r[Tt++]=p+Qt|0,r[Tt++]=C+Ue|0,r[Tt++]=E+Le|0,r[Tt++]=Q+We|0,r[Tt++]=F+ct|0,r[Tt++]=se+qe|0,r[Tt++]=le+It|0,r[Tt++]=Be+Ft|0}const sv=ff(gf,{counterRight:!1,counterLength:4,allowShortKeys:!1}),Zre=ff(gf,{counterRight:!1,counterLength:8,extendNonceFn:function $re(e,n,t,r){let i=e[0],o=e[1],s=e[2],a=e[3],c=n[0],l=n[1],u=n[2],d=n[3],f=n[4],A=n[5],p=n[6],C=n[7],E=t[0],Q=t[1],F=t[2],se=t[3];for(let Be=0;Be<20;Be+=2)i=i+c|0,E=st(E^i,16),f=f+E|0,c=st(c^f,12),i=i+c|0,E=st(E^i,8),f=f+E|0,c=st(c^f,7),o=o+l|0,Q=st(Q^o,16),A=A+Q|0,l=st(l^A,12),o=o+l|0,Q=st(Q^o,8),A=A+Q|0,l=st(l^A,7),s=s+u|0,F=st(F^s,16),p=p+F|0,u=st(u^p,12),s=s+u|0,F=st(F^s,8),p=p+F|0,u=st(u^p,7),a=a+d|0,se=st(se^a,16),C=C+se|0,d=st(d^C,12),a=a+d|0,se=st(se^a,8),C=C+se|0,d=st(d^C,7),i=i+l|0,se=st(se^i,16),p=p+se|0,l=st(l^p,12),i=i+l|0,se=st(se^i,8),p=p+se|0,l=st(l^p,7),o=o+u|0,E=st(E^o,16),C=C+E|0,u=st(u^C,12),o=o+u|0,E=st(E^o,8),C=C+E|0,u=st(u^C,7),s=s+d|0,Q=st(Q^s,16),f=f+Q|0,d=st(d^f,12),s=s+d|0,Q=st(Q^s,8),f=f+Q|0,d=st(d^f,7),a=a+c|0,F=st(F^a,16),A=A+F|0,c=st(c^A,12),a=a+c|0,F=st(F^a,8),A=A+F|0,c=st(c^A,7);let le=0;r[le++]=i,r[le++]=o,r[le++]=s,r[le++]=a,r[le++]=E,r[le++]=Q,r[le++]=F,r[le++]=se},allowShortKeys:!1}),Xre=new Uint8Array(16),yO=(e,n)=>{e.update(n);const t=n.length%16;t&&e.update(Xre.subarray(t))},eie=new Uint8Array(32);function EO(e,n,t,r,i){const o=e(n,t,eie),s=zre.create(o);i&&yO(s,i),yO(s,r);const a=new Uint8Array(16),c=bu(a);Mc(c,0,BigInt(i?i.length:0),!0),Mc(c,8,BigInt(r.length),!0),s.update(a);const l=s.digest();return o.fill(0),l}const BO=e=>(n,t,r)=>(zt(n,32),zt(t),{encrypt:(o,s)=>{const a=o.length,c=a+16;s?zt(s,c):s=new Uint8Array(c),e(n,t,o,s,1);const l=EO(e,n,t,s.subarray(0,-16),r);return s.set(l,a),s},decrypt:(o,s)=>{const a=o.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");s?zt(s,c):s=new Uint8Array(c);const l=o.subarray(0,-16);if(!dI(o.subarray(-16),EO(e,n,t,l,r)))throw new Error("invalid tag");return e(n,t,l,s,1),s}}),tie=(BO(sv),Ca({blockSize:64,nonceLength:24,tagLength:16},BO(Zre)));class wO extends P3{constructor(n,t){super(),this.finished=!1,this.destroyed=!1,cr.hash(n);const r=Qs(t);if(this.iHash=n.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,o=new Uint8Array(i);o.set(r.length>i?n.create().update(r).digest():r);for(let s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=n.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),o.fill(0)}update(n){return cr.exists(this),this.iHash.update(n),this}digestInto(n){cr.exists(this),cr.bytes(n,this.outputLen),this.finished=!0,this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const n=new Uint8Array(this.oHash.outputLen);return this.digestInto(n),n}_cloneInto(n){n||(n=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:i,destroyed:o,blockLen:s,outputLen:a}=this;return n.finished=i,n.destroyed=o,n.blockLen=s,n.outputLen=a,n.oHash=t._cloneInto(n.oHash),n.iHash=r._cloneInto(n.iHash),n}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const hf=(e,n,t)=>new wO(e,n).update(t).digest();hf.create=(e,n)=>new wO(e,n);const av=new Uint8Array([0]),_O=new Uint8Array;var nie=Object.defineProperty,nr=(e,n)=>{for(var t in n)nie(e,t,{get:n[t],enumerable:!0})},Fc=Symbol("verified");function QO(e){if(!(e=>e instanceof Object)(e)||"number"!=typeof e.kind||"string"!=typeof e.content||"number"!=typeof e.created_at||"string"!=typeof e.pubkey||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let n=0;n<e.tags.length;n++){let t=e.tags[n];if(!Array.isArray(t))return!1;for(let r=0;r<t.length;r++)if("object"==typeof t[r])return!1}return!0}nr({},{Queue:()=>SO,QueueNode:()=>DO,binarySearch:()=>cv,insertEventIntoAscendingList:()=>sie,insertEventIntoDescendingList:()=>oie,normalizeURL:()=>ku,utf8Decoder:()=>es,utf8Encoder:()=>Bo});var es=new TextDecoder("utf-8"),Bo=new TextEncoder;function ku(e){-1===e.indexOf("://")&&(e="wss://"+e);let n=new URL(e);return n.pathname=n.pathname.replace(/\/+/g,"/"),n.pathname.endsWith("/")&&(n.pathname=n.pathname.slice(0,-1)),("80"===n.port&&"ws:"===n.protocol||"443"===n.port&&"wss:"===n.protocol)&&(n.port=""),n.searchParams.sort(),n.hash="",n.toString()}function oie(e,n){const[t,r]=cv(e,i=>n.id===i.id?0:n.created_at===i.created_at?-1:i.created_at-n.created_at);return r||e.splice(t,0,n),e}function sie(e,n){const[t,r]=cv(e,i=>n.id===i.id?0:n.created_at===i.created_at?-1:n.created_at-i.created_at);return r||e.splice(t,0,n),e}function cv(e,n){let t=0,r=e.length-1;for(;t<=r;){const i=Math.floor((t+r)/2),o=n(e[i]);if(0===o)return[i,!0];o<0?r=i-1:t=i+1}return[t,!1]}var DO=class{value;next=null;prev=null;constructor(e){this.value=e}},SO=class{first;last;constructor(){this.first=null,this.last=null}enqueue(e){const n=new DO(e);return this.last?this.last===this.first?(this.last=n,this.last.prev=this.first,this.first.next=n):(n.prev=this.last,this.last.next=n,this.last=n):(this.first=n,this.last=n),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const n=this.first;return this.first=null,this.last=null,n.value}const e=this.first;return this.first=e.next,e.value}};function pI(e){let n=pa(Bo.encode(function cie(e){if(!QO(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}(e)));return wr(n)}var II=new class{generateSecretKey(){return jo.utils.randomPrivateKey()}getPublicKey(e){return wr(jo.getPublicKey(e))}finalizeEvent(e,n){const t=e;return t.pubkey=wr(jo.getPublicKey(n)),t.id=pI(t),t.sig=wr(jo.sign(pI(t),n)),t[Fc]=!0,t}verifyEvent(e){if("boolean"==typeof e[Fc])return e[Fc];const n=pI(e);if(n!==e.id)return e[Fc]=!1,!1;try{const t=jo.verify(e.sig,n,e.pubkey);return e[Fc]=t,t}catch{return e[Fc]=!1,!1}}},lie=II.generateSecretKey,kO=II.getPublicKey,wo=II.finalizeEvent,pf=II.verifyEvent;function MO(e){return 1e3<=e&&e<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(e)}function lv(e){return[0,3].includes(e)||1e4<=e&&e<2e4}function FO(e){return 2e4<=e&&e<3e4}function NO(e){return 3e4<=e&&e<4e4}function die(e){return MO(e)?"regular":lv(e)?"replaceable":FO(e)?"ephemeral":NO(e)?"parameterized":"unknown"}nr({},{Application:()=>uoe,BadgeAward:()=>Cie,BadgeDefinition:()=>roe,BlockedRelaysList:()=>Gie,BookmarkList:()=>Uie,Bookmarksets:()=>eoe,Calendar:()=>Ioe,CalendarEventRSVP:()=>moe,ChannelCreation:()=>xO,ChannelHideMessage:()=>RO,ChannelMessage:()=>OO,ChannelMetadata:()=>TO,ChannelMuteUser:()=>PO,ClassifiedListing:()=>foe,ClientAuth:()=>UO,CommunitiesList:()=>Hie,CommunityDefinition:()=>Eoe,CommunityPostApproval:()=>Die,Contacts:()=>hie,CreateOrUpdateProduct:()=>soe,CreateOrUpdateStall:()=>ooe,Curationsets:()=>toe,Date:()=>hoe,DraftClassifiedListing:()=>goe,DraftLong:()=>coe,Emojisets:()=>loe,EncryptedDirectMessage:()=>pie,EncryptedDirectMessages:()=>Iie,EventDeletion:()=>mie,FileMetadata:()=>Bie,FileServerPreference:()=>Kie,Followsets:()=>$ie,GenericRepost:()=>yie,Genericlists:()=>Zie,HTTPAuth:()=>Av,Handlerinformation:()=>yoe,Handlerrecommendation:()=>Coe,Highlights:()=>Tie,InterestsList:()=>qie,Interestsets:()=>ioe,JobFeedback:()=>Mie,JobRequest:()=>Sie,JobResult:()=>kie,Label:()=>Qie,LightningPubRPC:()=>jie,LiveChatMessage:()=>wie,LiveEvent:()=>doe,LongFormArticle:()=>aoe,Metadata:()=>Aie,Mutelist:()=>Oie,NWCWalletInfo:()=>Jie,NWCWalletRequest:()=>HO,NWCWalletResponse:()=>Yie,NostrConnect:()=>Wie,OpenTimestamps:()=>Eie,Pinlist:()=>Rie,ProblemTracker:()=>vie,ProfileBadges:()=>noe,PublicChatsList:()=>Lie,Reaction:()=>dv,RecommendRelay:()=>gie,RelayList:()=>Pie,Relaysets:()=>Xie,Report:()=>_ie,Reporting:()=>bie,Repost:()=>uv,SearchRelaysList:()=>Vie,ShortTextNote:()=>fie,Time:()=>poe,UserEmojiList:()=>zie,UserStatuses:()=>Aoe,Zap:()=>xie,ZapGoal:()=>Fie,ZapRequest:()=>Nie,classifyKind:()=>die,isEphemeralKind:()=>FO,isParameterizedReplaceableKind:()=>NO,isRegularKind:()=>MO,isReplaceableKind:()=>lv});var Aie=0,fie=1,gie=2,hie=3,pie=4,Iie=4,mie=5,uv=6,dv=7,Cie=8,yie=16,xO=40,TO=41,OO=42,RO=43,PO=44,Eie=1040,Bie=1063,wie=1311,vie=1971,_ie=1984,bie=1984,Qie=1985,Die=4550,Sie=5999,kie=6999,Mie=7e3,Fie=9041,Nie=9734,xie=9735,Tie=9802,Oie=1e4,Rie=10001,Pie=10002,Uie=10003,Hie=10004,Lie=10005,Gie=10006,Vie=10007,qie=10015,zie=10030,Kie=10096,Jie=13194,jie=21e3,UO=22242,HO=23194,Yie=23195,Wie=24133,Av=27235,$ie=3e4,Zie=30001,Xie=30002,eoe=30003,toe=30004,noe=30008,roe=30009,ioe=30015,ooe=30017,soe=30018,aoe=30023,coe=30024,loe=30030,uoe=30078,doe=30311,Aoe=30315,foe=30402,goe=30403,hoe=31922,poe=31923,Ioe=31924,moe=31925,Coe=31989,yoe=31990,Eoe=34550;function mI(e,n){let t=n.length+3,r=e.indexOf(`"${n}":`)+t,i=e.slice(r).indexOf('"')+r+1;return e.slice(i,i+64)}function LO(e,n){let t=n.length,r=e.indexOf(`"${n}":`)+t+3,i=e.slice(r),o=Math.min(i.indexOf(","),i.indexOf("}"));return parseInt(i.slice(0,o),10)}function GO(e){let n=e.slice(0,22).indexOf('"EVENT"');if(-1===n)return null;let t=e.slice(n+7+1).indexOf('"');if(-1===t)return null;let r=n+7+1+t,i=e.slice(r+1,80).indexOf('"');return-1===i?null:e.slice(r+1,r+1+i)}function _oe(e,n){return n===mI(e,"id")}function boe(e,n){return n===mI(e,"pubkey")}function Qoe(e,n){return n===LO(e,"kind")}function VO(e,n){return{kind:UO,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",n]],content:""}}nr({},{getHex64:()=>mI,getInt:()=>LO,getSubscriptionId:()=>GO,matchEventId:()=>_oe,matchEventKind:()=>Qoe,matchEventPubkey:()=>boe}),nr({},{makeAuthEvent:()=>VO});try{WebSocket}catch{}try{WebSocket}catch{}nr({},{BECH32_REGEX:()=>KO,Bech32MaxSize:()=>hv,decode:()=>If,encodeBytes:()=>yI,naddrEncode:()=>Loe,neventEncode:()=>Hoe,noteEncode:()=>Poe,nprofileEncode:()=>Uoe,npubEncode:()=>Roe,nrelayEncode:()=>Goe,nsecEncode:()=>Ooe});var hv=5e3,KO=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function If(e){let{prefix:n,words:t}=Ia.decode(e,hv),r=new Uint8Array(Ia.fromWords(t));switch(n){case"nprofile":{let i=CI(r);if(!i[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(32!==i[0][0].length)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:wr(i[0][0]),relays:i[1]?i[1].map(o=>es.decode(o)):[]}}}case"nevent":{let i=CI(r);if(!i[0]?.[0])throw new Error("missing TLV 0 for nevent");if(32!==i[0][0].length)throw new Error("TLV 0 should be 32 bytes");if(i[2]&&32!==i[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(i[3]&&4!==i[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:wr(i[0][0]),relays:i[1]?i[1].map(o=>es.decode(o)):[],author:i[2]?.[0]?wr(i[2][0]):void 0,kind:i[3]?.[0]?parseInt(wr(i[3][0]),16):void 0}}}case"naddr":{let i=CI(r);if(!i[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!i[2]?.[0])throw new Error("missing TLV 2 for naddr");if(32!==i[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(!i[3]?.[0])throw new Error("missing TLV 3 for naddr");if(4!==i[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:es.decode(i[0][0]),pubkey:wr(i[2][0]),kind:parseInt(wr(i[3][0]),16),relays:i[1]?i[1].map(o=>es.decode(o)):[]}}}case"nrelay":{let i=CI(r);if(!i[0]?.[0])throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:es.decode(i[0][0])}}case"nsec":return{type:n,data:r};case"npub":case"note":return{type:n,data:wr(r)};default:throw new Error(`unknown prefix ${n}`)}}function CI(e){let n={},t=e;for(;t.length>0;){let r=t[0],i=t[1],o=t.slice(2,2+i);if(t=t.slice(2+i),o.length<i)throw new Error(`not enough data to read on TLV ${r}`);n[r]=n[r]||[],n[r].push(o)}return n}function Ooe(e){return yI("nsec",e)}function Roe(e){return yI("npub",vu(e))}function Poe(e){return yI("note",vu(e))}function mf(e,n){let t=Ia.toWords(n);return Ia.encode(e,t,hv)}function yI(e,n){return mf(e,n)}function Uoe(e){return mf("nprofile",EI({0:[vu(e.pubkey)],1:(e.relays||[]).map(t=>Bo.encode(t))}))}function Hoe(e){let n;return void 0!==e.kind&&(n=function Toe(e){const n=new Uint8Array(4);return n[0]=e>>24&255,n[1]=e>>16&255,n[2]=e>>8&255,n[3]=255&e,n}(e.kind)),mf("nevent",EI({0:[vu(e.id)],1:(e.relays||[]).map(r=>Bo.encode(r)),2:e.author?[vu(e.author)]:[],3:n?[new Uint8Array(n)]:[]}))}function Loe(e){let n=new ArrayBuffer(4);return new DataView(n).setUint32(0,e.kind,!1),mf("naddr",EI({0:[Bo.encode(e.identifier)],1:(e.relays||[]).map(r=>Bo.encode(r)),2:[vu(e.pubkey)],3:[new Uint8Array(n)]}))}function Goe(e){return mf("nrelay",EI({0:[Bo.encode(e)]}))}function EI(e){let n=[];return Object.entries(e).reverse().forEach(([t,r])=>{r.forEach(i=>{let o=new Uint8Array(i.length+2);o.set([parseInt(t)],0),o.set([i.length],1),o.set(i,2),n.push(o)})}),uf(...n)}var BI={};function JO(e,n,t){return pv.apply(this,arguments)}function pv(){return(pv=I(function*(e,n,t){const r=e instanceof Uint8Array?wr(e):e,o=jO(wu.getSharedSecret(r,"02"+n));let s=Uint8Array.from(sI(16)),a=Bo.encode(t),c=fO(o,s).encrypt(a);return`${Ss.encode(new Uint8Array(c))}?iv=${Ss.encode(new Uint8Array(s.buffer))}`})).apply(this,arguments)}function qoe(e,n,t){return Iv.apply(this,arguments)}function Iv(){return(Iv=I(function*(e,n,t){const r=e instanceof Uint8Array?wr(e):e;let[i,o]=t.split("?iv="),a=jO(wu.getSharedSecret(r,"02"+n)),c=Ss.decode(o),l=Ss.decode(i),u=fO(a,c).decrypt(l);return es.decode(u)})).apply(this,arguments)}function jO(e){return e.slice(1,33)}nr(BI,{decrypt:()=>qoe,encrypt:()=>JO}),nr({},{NIP05_REGEX:()=>YO,isValid:()=>joe,queryProfile:()=>WO,searchDomain:()=>Joe,useFetchImplementation:()=>Koe});var wI,YO=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/;try{wI=fetch}catch{}function Koe(e){wI=e}function Joe(e){return mv.apply(this,arguments)}function mv(){return(mv=I(function*(e,n=""){try{const t=`https://${e}/.well-known/nostr.json?name=${n}`;return(yield(yield wI(t,{redirect:"error"})).json()).names}catch{return{}}})).apply(this,arguments)}function WO(e){return Cv.apply(this,arguments)}function Cv(){return(Cv=I(function*(e){const n=e.match(YO);if(!n)return null;const[t,r="_",i]=n;try{const o=`https://${i}/.well-known/nostr.json?name=${r}`,s=yield(yield wI(o,{redirect:"error"})).json();let a=s.names[r];return a?{pubkey:a,relays:s.relays?.[a]}:null}catch{return null}})).apply(this,arguments)}function joe(e,n){return yv.apply(this,arguments)}function yv(){return(yv=I(function*(e,n){let t=yield WO(n);return!!t&&t.pubkey===e})).apply(this,arguments)}function Woe(e){const n={reply:void 0,root:void 0,mentions:[],profiles:[]},t=[];for(const r of e.tags)"e"===r[0]&&r[1]&&t.push(r),"p"===r[0]&&r[1]&&n.profiles.push({pubkey:r[1],relays:r[2]?[r[2]]:[]});for(let r=0;r<t.length;r++){const i=t[r],[o,s,a,c]=i,l={id:s,relays:a?[a]:[]},d=r===t.length-1;"root"!==c?"reply"!==c?"mention"!==c?0===r?n.root=l:d?n.reply=l:n.mentions.push(l):n.mentions.push(l):n.reply=l:n.root=l}return n}nr({},{parse:()=>Woe}),nr({},{fetchRelayInformation:()=>Xoe,useFetchImplementation:()=>Zoe});try{fetch}catch{}function Zoe(e){}function Xoe(e){return Ev.apply(this,arguments)}function Ev(){return(Ev=I(function*(e){return yield(yield fetch(e.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()})).apply(this,arguments)}function ZO(e){let n=0;for(let t=0;t<e.length;t++){const r=parseInt(e[t],16);if(0!==r){n+=Math.clz32(r)-28;break}n+=4}return n}function tse(e,n){let t=0;const r=e,i=["nonce",t.toString(),n.toString()];for(r.tags.push(i);;){const o=Math.floor((new Date).getTime()/1e3);if(o!==r.created_at&&(t=0,r.created_at=o),i[1]=(++t).toString(),r.id=pI(r),ZO(r.id)>=n)break}return r}function rse(e,n,t,r){return wo({kind:uv,tags:[...e.tags??[],["e",n.id,t],["p",n.pubkey]],content:""===e.content?"":JSON.stringify(n),created_at:e.created_at},r)}function XO(e){if(e.kind!==uv)return;let n,t;for(let r=e.tags.length-1;r>=0&&(void 0===n||void 0===t);r--){const i=e.tags[r];i.length>=2&&("e"===i[0]&&void 0===n?n=i:"p"===i[0]&&void 0===t&&(t=i))}return void 0!==n?{id:n[1],relays:[n[2],t?.[2]].filter(r=>"string"==typeof r),author:t?.[1]}:void 0}function ise(e,{skipVerification:n}={}){const t=XO(e);if(void 0===t||""===e.content)return;let r;try{r=JSON.parse(e.content)}catch{return}return r.id===t.id&&(n||pf(r))?r:void 0}nr({},{getPow:()=>ZO,minePow:()=>tse}),nr({},{finishRepostEvent:()=>rse,getRepostedEvent:()=>ise,getRepostedEventPointer:()=>XO}),nr({},{NOSTR_URI_REGEX:()=>vI,parse:()=>ase,test:()=>sse});var vI=new RegExp(`nostr:(${KO.source})`);function sse(e){return"string"==typeof e&&new RegExp(`^${vI.source}$`).test(e)}function ase(e){const n=e.match(new RegExp(`^${vI.source}$`));if(!n)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:n[0],value:n[1],decoded:If(n[1])}}function lse(e,n,t){const r=n.tags.filter(i=>i.length>=2&&("e"===i[0]||"p"===i[0]));return wo({...e,kind:dv,tags:[...e.tags??[],...r,["e",n.id],["p",n.pubkey]],content:e.content??"+"},t)}function use(e){if(e.kind!==dv)return;let n,t;for(let r=e.tags.length-1;r>=0&&(void 0===n||void 0===t);r--){const i=e.tags[r];i.length>=2&&("e"===i[0]&&void 0===n?n=i:"p"===i[0]&&void 0===t&&(t=i))}return void 0!==n&&void 0!==t?{id:n[1],relays:[n[2],t[2]].filter(r=>void 0!==r),author:t[1]}:void 0}nr({},{finishReactionEvent:()=>lse,getReactedEventPointer:()=>use}),nr({},{matchAll:()=>Ase,regex:()=>Bv,replaceAll:()=>fse});var Bv=()=>new RegExp(`\\b${vI.source}\\b`,"g");function*Ase(e){const n=e.matchAll(Bv());for(const t of n)try{const[r,i]=t;yield{uri:r,value:i,decoded:If(i),start:t.index,end:t.index+r.length}}catch{}}function fse(e,n){return e.replaceAll(Bv(),(t,r)=>n({uri:t,value:r,decoded:If(r)}))}nr({},{channelCreateEvent:()=>hse,channelHideMessageEvent:()=>mse,channelMessageEvent:()=>Ise,channelMetadataEvent:()=>pse,channelMuteUserEvent:()=>Cse});var hse=(e,n)=>{let t;if("object"==typeof e.content)t=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;t=e.content}return wo({kind:xO,tags:[...e.tags??[]],content:t,created_at:e.created_at},n)},pse=(e,n)=>{let t;if("object"==typeof e.content)t=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;t=e.content}return wo({kind:TO,tags:[["e",e.channel_create_event_id],...e.tags??[]],content:t,created_at:e.created_at},n)},Ise=(e,n)=>{const t=[["e",e.channel_create_event_id,e.relay_url,"root"]];return e.reply_to_channel_message_event_id&&t.push(["e",e.reply_to_channel_message_event_id,e.relay_url,"reply"]),wo({kind:OO,tags:[...t,...e.tags??[]],content:e.content,created_at:e.created_at},n)},mse=(e,n)=>{let t;if("object"==typeof e.content)t=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;t=e.content}return wo({kind:RO,tags:[["e",e.channel_message_event_id],...e.tags??[]],content:t,created_at:e.created_at},n)},Cse=(e,n)=>{let t;if("object"==typeof e.content)t=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;t=e.content}return wo({kind:PO,tags:[["p",e.pubkey_to_mute],...e.tags??[]],content:t,created_at:e.created_at},n)};nr({},{EMOJI_SHORTCODE_REGEX:()=>eR,matchAll:()=>Ese,regex:()=>wv,replaceAll:()=>Bse});var vv,eR=/:(\w+):/,wv=()=>new RegExp(`\\B${eR.source}\\B`,"g");function*Ese(e){const n=e.matchAll(wv());for(const t of n)try{const[r,i]=t;yield{shortcode:r,name:i,start:t.index,end:t.index+r.length}}catch{}}function Bse(e,n){return e.replaceAll(wv(),(t,r)=>n({shortcode:t,name:r}))}nr({},{useFetchImplementation:()=>vse,validateGithub:()=>_se});try{vv=fetch}catch{}function vse(e){vv=e}function _se(e,n,t){return _v.apply(this,arguments)}function _v(){return(_v=I(function*(e,n,t){try{return(yield(yield vv(`https://gist.github.com/${n}/${t}/raw`)).text())===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}})).apply(this,arguments)}var _I={};function rR(e,n){const t=wu.getSharedSecret(e,"02"+n).subarray(1,33);return function vO(e,n,t){return cr.hash(e),void 0===t&&(t=new Uint8Array(e.outputLen)),hf(e,Qs(t),Qs(n))}(pa,t,"nip44-v2")}function iR(e,n){const t=function bO(e,n,t,r=32){if(cr.hash(e),cr.number(r),r>255*e.outputLen)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(r/e.outputLen);void 0===t&&(t=_O);const o=new Uint8Array(i*e.outputLen),s=hf.create(e,n),a=s._cloneInto(),c=new Uint8Array(s.outputLen);for(let l=0;l<i;l++)av[0]=l+1,a.update(0===l?_O:c).update(t).update(av).digestInto(c),o.set(c,e.outputLen*l),s._cloneInto(a);return s.destroy(),a.destroy(),c.fill(0),av.fill(0),o.slice(0,r)}(pa,e,n,76);return{chacha_key:t.subarray(0,32),chacha_nonce:t.subarray(32,44),hmac_key:t.subarray(44,76)}}function bv(e){if(!Number.isSafeInteger(e)||e<1)throw new Error("expected positive integer");if(e<=32)return 32;const n=1<<Math.floor(Math.log2(e-1))+1,t=n<=256?32:n/8;return t*(Math.floor((e-1)/t)+1)}function oR(e,n,t){if(32!==t.length)throw new Error("AAD associated data must be 32 bytes");const r=uf(t,n);return hf(pa,e,r)}function sR(e,n,t=sI(32)){const{chacha_key:r,chacha_nonce:i,hmac_key:o}=iR(n,t),s=function Qse(e){const n=Bo.encode(e),t=n.length,r=function bse(e){if(!Number.isSafeInteger(e)||e<1||e>65535)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const n=new Uint8Array(2);return new DataView(n.buffer).setUint16(0,e,!1),n}(t);return uf(r,n,new Uint8Array(bv(t)-t))}(e),a=sv(r,i,s),c=oR(o,a,t);return Ss.encode(uf(new Uint8Array([2]),t,a,c))}function aR(e,n){const{nonce:t,ciphertext:r,mac:i}=function Sse(e){if("string"!=typeof e)throw new Error("payload must be a valid string");const n=e.length;if(n<132||n>87472)throw new Error("invalid payload length: "+n);if("#"===e[0])throw new Error("unknown encryption version");let t;try{t=Ss.decode(e)}catch(o){throw new Error("invalid base64: "+o.message)}const r=t.length;if(r<99||r>65603)throw new Error("invalid data length: "+r);const i=t[0];if(2!==i)throw new Error("unknown encryption version "+i);return{nonce:t.subarray(1,33),ciphertext:t.subarray(33,-32),mac:t.subarray(-32)}}(e),{chacha_key:o,chacha_nonce:s,hmac_key:a}=iR(n,t);if(!dI(oR(a,r,t),i))throw new Error("invalid MAC");return function Dse(e){const n=new DataView(e.buffer).getUint16(0),t=e.subarray(2,2+n);if(n<1||n>65535||t.length!==n||e.length!==2+bv(n))throw new Error("invalid padding");return es.decode(t)}(sv(o,s,r))}nr(_I,{decrypt:()=>aR,encrypt:()=>sR,getConversationKey:()=>rR,v2:()=>kse});var Dv,kse={utils:{getConversationKey:rR,calcPaddedLen:bv},encrypt:sR,decrypt:aR};function Fse(e){const{pathname:n,searchParams:t}=new URL(e),r=n,i=t.get("relay"),o=t.get("secret");if(!r||!i||!o)throw new Error("invalid connection string");return{pubkey:r,relay:i,secret:o}}function Nse(e,n,t){return Qv.apply(this,arguments)}function Qv(){return(Qv=I(function*(e,n,t){const i=yield JO(n,e,JSON.stringify({method:"pay_invoice",params:{invoice:t}})),o={kind:HO,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",e]]};return wo(o,n)})).apply(this,arguments)}nr({},{makeNwcRequestEvent:()=>Nse,parseConnectionString:()=>Fse}),nr({},{getZapEndpoint:()=>Ose,makeZapReceipt:()=>Use,makeZapRequest:()=>Rse,useFetchImplementation:()=>Tse,validateZapRequest:()=>Pse});try{Dv=fetch}catch{}function Tse(e){Dv=e}function Ose(e){return Sv.apply(this,arguments)}function Sv(){return(Sv=I(function*(e){try{let n="",{lud06:t,lud16:r}=JSON.parse(e.content);if(t){let{words:s}=Ia.decode(t,1e3),a=Ia.fromWords(s);n=es.decode(a)}else{if(!r)return null;{let[s,a]=r.split("@");n=new URL(`/.well-known/lnurlp/${s}`,`https://${a}`).toString()}}let o=yield(yield Dv(n)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null})).apply(this,arguments)}function Rse({profile:e,event:n,amount:t,relays:r,comment:i=""}){if(!t)throw new Error("amount not given");if(!e)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",e],["amount",t.toString()],["relays",...r]]};return n&&o.tags.push(["e",n]),o}function Pse(e){let n;try{n=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!QO(n))return"Zap request is not a valid Nostr event.";if(!pf(n))return"Invalid signature on zap request.";let t=n.tags.find(([o,s])=>"p"===o&&s);if(!t)return"Zap request doesn't have a 'p' tag.";if(!t[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let r=n.tags.find(([o,s])=>"e"===o&&s);return r&&!r[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":n.tags.find(([o,s])=>"relays"===o&&s)?null:"Zap request doesn't have a 'relays' tag."}function Use({zapRequest:e,preimage:n,bolt11:t,paidAt:r}){let i=JSON.parse(e),o=i.tags.filter(([a])=>"e"===a||"p"===a||"a"===a),s={kind:9735,created_at:Math.round(r.getTime()/1e3),content:"",tags:[...o,["P",i.pubkey],["bolt11",t],["description",e]]};return n&&s.tags.push(["preimage",n]),s}function Lse(e,n,t){return kv.apply(this,arguments)}function kv(){return(kv=I(function*(e,n,t,r=!1,i){const o={kind:Av,tags:[["u",e],["method",n]],created_at:Math.round((new Date).getTime()/1e3),content:""};i&&o.tags.push(["payload",Nv(i)]);const s=yield t(o);return(r?"Nostr ":"")+Ss.encode(Bo.encode(JSON.stringify(s)))})).apply(this,arguments)}function Gse(e,n,t){return Mv.apply(this,arguments)}function Mv(){return(Mv=I(function*(e,n,t){const r=yield lR(e).catch(o=>{throw o});return yield hR(r,n,t).catch(o=>{throw o})})).apply(this,arguments)}function lR(e){return Fv.apply(this,arguments)}function Fv(){return(Fv=I(function*(e){if(!e)throw new Error("Missing token");e=e.replace("Nostr ","");const n=es.decode(Ss.decode(e));if(!n||0===n.length||!n.startsWith("{"))throw new Error("Invalid token");return JSON.parse(n)})).apply(this,arguments)}function uR(e){return!!e.created_at&&Math.round((new Date).getTime()/1e3)-e.created_at<60}function dR(e){return e.kind===Av}function AR(e,n){const t=e.tags.find(r=>"u"===r[0]);return!!t&&t.length>0&&t[1]===n}function fR(e,n){const t=e.tags.find(r=>"method"===r[0]);return!!t&&t.length>0&&t[1].toLowerCase()===n.toLowerCase()}function Nv(e){return wr(pa(Bo.encode(JSON.stringify(e))))}function gR(e,n){const t=e.tags.find(i=>"payload"===i[0]);if(!t)return!1;const r=Nv(n);return t.length>0&&t[1]===r}function hR(e,n,t,r){return xv.apply(this,arguments)}function xv(){return(xv=I(function*(e,n,t,r){if(!pf(e))throw new Error("Invalid nostr event, signature invalid");if(!dR(e))throw new Error("Invalid nostr event, kind invalid");if(!uR(e))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!AR(e,n))throw new Error("Invalid nostr event, url tag invalid");if(!fR(e,t))throw new Error("Invalid nostr event, method tag invalid");if(r&&"object"==typeof r&&Object.keys(r).length>0&&!gR(e,r))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0})).apply(this,arguments)}function mR(e,n,t,r){const{c:i,dkLen:o,DK:s,PRF:a,PRFSalt:c}=function pR(e,n,t,r){cr.hash(e);const i=U3({dkLen:32,asyncTick:10},r),{c:o,dkLen:s,asyncTick:a}=i;if(cr.number(o),cr.number(s),cr.number(a),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Qs(n),l=Qs(t),u=new Uint8Array(s),d=hf.create(e,c),f=d._cloneInto().update(l);return{c:o,dkLen:s,asyncTick:a,DK:u,PRF:d,PRFSalt:f}}(e,n,t,r);let l;const u=new Uint8Array(4),d=oI(u),f=new Uint8Array(a.outputLen);for(let A=1,p=0;p<o;A++,p+=a.outputLen){const C=s.subarray(p,p+a.outputLen);d.setInt32(0,A,!1),(l=c._cloneInto(l)).update(u).digestInto(f),C.set(f.subarray(0,C.length));for(let E=1;E<i;E++){a._cloneInto(l).update(f).digestInto(f);for(let Q=0;Q<C.length;Q++)C[Q]^=f[Q]}}return function IR(e,n,t,r,i){return e.destroy(),n.destroy(),r&&r.destroy(),i.fill(0),t}(a,c,s,l,f)}nr({},{getToken:()=>Lse,hashPayload:()=>Nv,unpackEventFromToken:()=>lR,validateEvent:()=>hR,validateEventKind:()=>dR,validateEventMethodTag:()=>fR,validateEventPayloadTag:()=>gR,validateEventTimestamp:()=>uR,validateEventUrlTag:()=>AR,validateToken:()=>Gse});const Xt=(e,n)=>e<<n|e>>>32-n;function yR(e,n,t,r,i,o){let s=e[n++]^t[r++],a=e[n++]^t[r++],c=e[n++]^t[r++],l=e[n++]^t[r++],u=e[n++]^t[r++],d=e[n++]^t[r++],f=e[n++]^t[r++],A=e[n++]^t[r++],p=e[n++]^t[r++],C=e[n++]^t[r++],E=e[n++]^t[r++],Q=e[n++]^t[r++],F=e[n++]^t[r++],se=e[n++]^t[r++],le=e[n++]^t[r++],Be=e[n++]^t[r++],he=s,we=a,Re=c,Ye=l,Je=u,Ze=d,ht=f,lt=A,Qt=p,Ue=C,Le=E,We=Q,ct=F,qe=se,It=le,Ft=Be;for(let Tt=0;Tt<8;Tt+=2)Je^=Xt(he+ct|0,7),Qt^=Xt(Je+he|0,9),ct^=Xt(Qt+Je|0,13),he^=Xt(ct+Qt|0,18),Ue^=Xt(Ze+we|0,7),qe^=Xt(Ue+Ze|0,9),we^=Xt(qe+Ue|0,13),Ze^=Xt(we+qe|0,18),It^=Xt(Le+ht|0,7),Re^=Xt(It+Le|0,9),ht^=Xt(Re+It|0,13),Le^=Xt(ht+Re|0,18),Ye^=Xt(Ft+We|0,7),lt^=Xt(Ye+Ft|0,9),We^=Xt(lt+Ye|0,13),Ft^=Xt(We+lt|0,18),we^=Xt(he+Ye|0,7),Re^=Xt(we+he|0,9),Ye^=Xt(Re+we|0,13),he^=Xt(Ye+Re|0,18),ht^=Xt(Ze+Je|0,7),lt^=Xt(ht+Ze|0,9),Je^=Xt(lt+ht|0,13),Ze^=Xt(Je+lt|0,18),We^=Xt(Le+Ue|0,7),Qt^=Xt(We+Le|0,9),Ue^=Xt(Qt+We|0,13),Le^=Xt(Ue+Qt|0,18),ct^=Xt(Ft+It|0,7),qe^=Xt(ct+Ft|0,9),It^=Xt(qe+ct|0,13),Ft^=Xt(It+qe|0,18);i[o++]=s+he|0,i[o++]=a+we|0,i[o++]=c+Re|0,i[o++]=l+Ye|0,i[o++]=u+Je|0,i[o++]=d+Ze|0,i[o++]=f+ht|0,i[o++]=A+lt|0,i[o++]=p+Qt|0,i[o++]=C+Ue|0,i[o++]=E+Le|0,i[o++]=Q+We|0,i[o++]=F+ct|0,i[o++]=se+qe|0,i[o++]=le+It|0,i[o++]=Be+Ft|0}function Mu(e,n,t,r,i){let o=r+0,s=r+16*i;for(let a=0;a<16;a++)t[s+a]=e[n+16*(2*i-1)+a];for(let a=0;a<i;a++,o+=16,n+=16)yR(t,s,e,n,t,o),a>0&&(s+=16),yR(t,o,e,n+=16,t,s)}function Zse(e,n,t=16,r=2){let i=sI(16),o=2**t,s=function Jse(e,n,t){const{N:r,r:i,p:o,dkLen:s,blockSize32:a,V:c,B32:l,B:u,tmp:d,blockMixCb:f}=function ER(e,n,t){const r=U3({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:i,r:o,p:s,dkLen:a,asyncTick:c,maxmem:l,onProgress:u}=r;if(cr.number(i),cr.number(o),cr.number(s),cr.number(a),cr.number(c),cr.number(l),void 0!==u&&"function"!=typeof u)throw new Error("progressCb should be function");const d=128*o,f=d/4;if(i<=1||i&i-1||i>=2**(d/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(s<0||s>137438953440/d)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const A=d*(i+s);if(A>l)throw new Error(`Scrypt: parameters too large, ${A} (128 * r * (N + p)) > ${l} (maxmem)`);const p=mR(pa,e,n,{c:1,dkLen:d*s}),C=Vw(p),E=Vw(new Uint8Array(d*i)),Q=Vw(new Uint8Array(d));let F=()=>{};if(u){const se=2*i*s,le=Math.max(Math.floor(se/1e4),1);let Be=0;F=()=>{Be++,u&&(!(Be%le)||Be===se)&&u(Be/se)}}return{N:i,r:o,p:s,dkLen:a,blockSize32:f,V:E,B32:C,B:p,tmp:Q,blockMixCb:F,asyncTick:c}}(e,n,t);for(let A=0;A<o;A++){const p=a*A;for(let C=0;C<a;C++)c[C]=l[p+C];for(let C=0,E=0;C<r-1;C++)Mu(c,E,c,E+=a,i),f();Mu(c,(r-1)*a,l,p,i),f();for(let C=0;C<r;C++){const E=l[p+a-16]%r;for(let Q=0;Q<a;Q++)d[Q]=l[p+Q]^c[E*a+Q];Mu(d,0,l,p,i),f()}}return function BR(e,n,t,r,i){const o=mR(pa,e,t,{c:1,dkLen:n});return t.fill(0),r.fill(0),i.fill(0),o}(e,s,u,c,d)}(n.normalize("NFKC"),i,{N:o,r:8,p:1,dkLen:32}),a=sI(24),c=Uint8Array.from([r]),u=tie(s,a,c).encrypt(e);return function $se(e,n){return function Wse(e,n){let t=Ia.toWords(n);return Ia.encode(e,t,5e3)}(e,n)}("ncryptsec",uf(Uint8Array.from([2]),Uint8Array.from([t]),i,a,c,u))}class rr{static getNostrPrivkeyObject(n){try{const t=this.#e(n);if("nsec"!==t.represents)throw new Error("The provided string is NOT an nsec.");return{hex:t.hex,nsec:n}}catch{}try{return{hex:n,nsec:rr.privkey2nsec(n)}}catch{}throw new Error("Could not convert the provided string into nsec/hex.")}static getNostrPubkeyObject(n){try{const t=this.#e(n);if("npub"!==t.represents)throw new Error("The provided string is NOT an npub.");return{hex:t.hex,npub:n}}catch{}try{return{hex:n,npub:rr.pubkey2npub(n)}}catch{}throw new Error("Could not convert the provided string into npub/hex.")}static pubkey2npub(n){const t=Ki(n),r=Cu.toWords(t);return Cu.encode("npub",r,5e3)}static privkey2nsec(n){const t=Ki(n),r=Cu.toWords(t);return Cu.encode("nsec",r,5e3)}static pubkeyFromPrivkey(n){const t=Ki(n);return kO(t)}static hex2bytes(n){return Ki(n)}static splitKey(n,t,r){return`${n.slice(0,t)}...${n.slice(-r)}`}static#e(n){const{prefix:t,words:r}=Cu.decode(n,5e3),i=new Uint8Array(Cu.fromWords(r));return{represents:t,hex:bc(i)}}static privkeyToNcryptsec(n,t){return I(function*(r,i,o=16){return Zse(Ki(r),i,o)}).apply(this,arguments)}}const Xse=function(){var e=I(function*(n){this.assureIsInitialized();const t=rr.getNostrPrivkeyObject(n.privkeyString.toLowerCase()).hex,r=(this.getBrowserSessionHandler().browserSessionData?.identities??[]).find(l=>l.privkey===t);if(r)throw new Error(`An identity with the same private key already exists: ${r.nick}`);const i=this.getBrowserSessionHandler().browserSessionData;if(!i)throw new Error("Browser session data is undefined.");const o={id:zi.v4(),nick:n.nick,privkey:t,createdAt:(new Date).toISOString()};i.identities.push(o);let s=!1;1===i.identities.length&&(s=!0,i.selectedIdentityId=o.id),this.getBrowserSessionHandler().saveFullData(i);const a=yield Rv.call(this,o),c=[...this.getBrowserSyncHandler().browserSyncData?.identities??[],a];yield this.getBrowserSyncHandler().saveAndSetPartialData_Identities({identities:c}),s&&(yield this.getBrowserSyncHandler().saveAndSetPartialData_SelectedIdentityId({selectedIdentityId:a.id}))});return function(t){return e.apply(this,arguments)}}(),eae=function(){var e=I(function*(n){if(this.assureIsInitialized(),!n)return;const t=this.getBrowserSessionHandler().browserSessionData,r=this.getBrowserSyncHandler().browserSyncData;if(!t||!r)throw new Error("Browser session or sync data is undefined.");t.identities=t.identities.filter(o=>o.id!==n),t.permissions=t.permissions.filter(o=>o.identityId!==n),t.relays=t.relays.filter(o=>o.identityId!==n),t.selectedIdentityId===n&&(t.selectedIdentityId=t.identities.length>0?t.identities[0].id:null),yield this.getBrowserSessionHandler().saveFullData(t);const i=yield this.encrypt(n);yield this.getBrowserSyncHandler().saveAndSetPartialData_Identities({identities:r.identities.filter(o=>o.id!==i)}),yield this.getBrowserSyncHandler().saveAndSetPartialData_Permissions({permissions:r.permissions.filter(o=>o.identityId!==i)}),yield this.getBrowserSyncHandler().saveAndSetPartialData_Relays({relays:r.relays.filter(o=>o.identityId!==i)}),yield this.getBrowserSyncHandler().saveAndSetPartialData_SelectedIdentityId({selectedIdentityId:null===t.selectedIdentityId?null:yield this.encrypt(t.selectedIdentityId)})});return function(t){return e.apply(this,arguments)}}(),tae=function(){var e=I(function*(n){this.assureIsInitialized();const t=this.getBrowserSessionHandler().browserSessionData;if(!t?.identities.find(i=>i.id===n))return;t.selectedIdentityId=n,yield this.getBrowserSessionHandler().saveFullData(t);const r=null===n?null:yield this.encrypt(n);yield this.getBrowserSyncHandler().saveAndSetPartialData_SelectedIdentityId({selectedIdentityId:r})});return function(t){return e.apply(this,arguments)}}(),Rv=function(){var e=I(function*(n){return{id:yield this.encrypt(n.id),nick:yield this.encrypt(n.nick),createdAt:yield this.encrypt(n.createdAt),privkey:yield this.encrypt(n.privkey)}});return function(t){return e.apply(this,arguments)}}(),nae=function(){var e=I(function*(n,t=void 0){const r=[];for(const i of n){const o=yield rae.call(this,i,t);r.push(o)}return r});return function(t){return e.apply(this,arguments)}}(),rae=function(){var e=I(function*(n,t=void 0){return typeof t>"u"?{id:yield this.decrypt(n.id,"string"),nick:yield this.decrypt(n.nick,"string"),createdAt:yield this.decrypt(n.createdAt,"string"),privkey:yield this.decrypt(n.privkey,"string")}:t.keyBase64?{id:yield this.decryptWithLockedVaultV2(n.id,"string",t.iv,t.keyBase64),nick:yield this.decryptWithLockedVaultV2(n.nick,"string",t.iv,t.keyBase64),createdAt:yield this.decryptWithLockedVaultV2(n.createdAt,"string",t.iv,t.keyBase64),privkey:yield this.decryptWithLockedVaultV2(n.privkey,"string",t.iv,t.keyBase64)}:{id:yield this.decryptWithLockedVault(n.id,"string",t.iv,t.password),nick:yield this.decryptWithLockedVault(n.nick,"string",t.iv,t.password),createdAt:yield this.decryptWithLockedVault(n.createdAt,"string",t.iv,t.password),privkey:yield this.decryptWithLockedVault(n.privkey,"string",t.iv,t.password)}});return function(t){return e.apply(this,arguments)}}(),iae=function(){var e=I(function*(n){this.assureIsInitialized();const t=this.getBrowserSessionHandler().browserSessionData,r=this.getBrowserSyncHandler().browserSyncData;if(!t||!r)throw new Error("Browser session or sync data is undefined.");t.permissions=t.permissions.filter(o=>o.id!==n),yield this.getBrowserSessionHandler().saveFullData(t);const i=yield this.encrypt(n);yield this.getBrowserSyncHandler().saveAndSetPartialData_Permissions({permissions:r.permissions.filter(o=>o.id!==i)})});return function(t){return e.apply(this,arguments)}}(),oae=function(){var e=I(function*(n,t=void 0){if(typeof t>"u"){const i={id:yield this.decrypt(n.id,"string"),identityId:yield this.decrypt(n.identityId,"string"),method:yield this.decrypt(n.method,"string"),methodPolicy:yield this.decrypt(n.methodPolicy,"string"),host:yield this.decrypt(n.host,"string")};return n.kind&&(i.kind=yield this.decrypt(n.kind,"number")),i}if(t.keyBase64){const i={id:yield this.decryptWithLockedVaultV2(n.id,"string",t.iv,t.keyBase64),identityId:yield this.decryptWithLockedVaultV2(n.identityId,"string",t.iv,t.keyBase64),method:yield this.decryptWithLockedVaultV2(n.method,"string",t.iv,t.keyBase64),methodPolicy:yield this.decryptWithLockedVaultV2(n.methodPolicy,"string",t.iv,t.keyBase64),host:yield this.decryptWithLockedVaultV2(n.host,"string",t.iv,t.keyBase64)};return n.kind&&(i.kind=yield this.decryptWithLockedVaultV2(n.kind,"number",t.iv,t.keyBase64)),i}const r={id:yield this.decryptWithLockedVault(n.id,"string",t.iv,t.password),identityId:yield this.decryptWithLockedVault(n.identityId,"string",t.iv,t.password),method:yield this.decryptWithLockedVault(n.method,"string",t.iv,t.password),methodPolicy:yield this.decryptWithLockedVault(n.methodPolicy,"string",t.iv,t.password),host:yield this.decryptWithLockedVault(n.host,"string",t.iv,t.password)};return n.kind&&(r.kind=yield this.decryptWithLockedVault(n.kind,"number",t.iv,t.password)),r});return function(t){return e.apply(this,arguments)}}(),sae=function(){var e=I(function*(n,t=void 0){const r=[];for(const i of n)try{const o=yield oae.call(this,i,t);r.push(o)}catch(o){console.warn("[vault] Skipping corrupted permission:",o)}return r});return function(t){return e.apply(this,arguments)}}();var Pv;function vr(e,n,t,r){return new(t||(t=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):function i(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,c)}l((r=r.apply(e,n||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class Un{constructor(){this.mutex=Promise.resolve()}lock(){let n=()=>{};return this.mutex=this.mutex.then(()=>new Promise(n)),new Promise(t=>{n=t})}dispatch(n){return vr(this,void 0,void 0,function*(){const t=yield this.lock();try{return yield Promise.resolve(n())}finally{t()}})}}const Uv=function uae(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global}(),Hv=null!==(Pv=Uv.Buffer)&&void 0!==Pv?Pv:null,dae=Uv.TextEncoder?new Uv.TextEncoder:null;function bR(e,n){return(15&e)+(e>>6|e>>3&8)<<4|(15&n)+(n>>6|n>>3&8)}function QR(e,n){const t=n.length>>1;for(let r=0;r<t;r++){const i=r<<1;e[r]=bR(n.charCodeAt(i),n.charCodeAt(i+1))}}function Fu(e,n,t){let r=0;for(let i=0;i<t;i++){let o=n[i]>>>4;e[r++]=o>9?o+87:o+48,o=15&n[i],e[r++]=o>9?o+87:o+48}return String.fromCharCode.apply(null,e)}const Hn=null!==Hv?e=>{if("string"==typeof e){const n=Hv.from(e,"utf8");return new Uint8Array(n.buffer,n.byteOffset,n.length)}if(Hv.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return dae.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},vo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cf=new Uint8Array(256);for(let e=0;e<64;e++)Cf[vo.charCodeAt(e)]=e;function kR(e,n=!0){const t=e.length,r=t%3,i=[],o=t-r;for(let s=0;s<o;s+=3){const a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),c=vo.charAt(a>>18&63)+vo.charAt(a>>12&63)+vo.charAt(a>>6&63)+vo.charAt(63&a);i.push(c)}if(1===r){const s=e[t-1],a=vo.charAt(s>>2),c=vo.charAt(s<<4&63);i.push(`${a}${c}`),n&&i.push("==")}else if(2===r){const s=(e[t-2]<<8)+e[t-1],a=vo.charAt(s>>10),c=vo.charAt(s>>4&63),l=vo.charAt(s<<2&63);i.push(`${a}${c}${l}`),n&&i.push("=")}return i.join("")}function FR(e){const n=function MR(e){let n=Math.floor(.75*e.length);const t=e.length;return"="===e[t-1]&&(n-=1,"="===e[t-2]&&(n-=1)),n}(e),t=e.length,r=new Uint8Array(n);let i=0;for(let o=0;o<t;o+=4){const s=Cf[e.charCodeAt(o)],a=Cf[e.charCodeAt(o+1)],c=Cf[e.charCodeAt(o+2)],l=Cf[e.charCodeAt(o+3)];r[i]=s<<2|a>>4,i+=1,r[i]=(15&a)<<4|c>>2,i+=1,r[i]=(3&c)<<6|63&l,i+=1}return r}const gae=new Un,Lv=new Map;function Bn(e,n){return vr(this,void 0,void 0,function*(){let t=null,r=null,i=!1;if(typeof WebAssembly>"u")throw new Error("WebAssembly is not supported in this environment!");const l=()=>new DataView(t.exports.memory.buffer).getUint32(t.exports.STATE_SIZE,!0),u=gae.dispatch(()=>vr(this,void 0,void 0,function*(){if(!Lv.has(e.name)){const we=FR(e.data),Re=WebAssembly.compile(we);Lv.set(e.name,Re)}const he=yield Lv.get(e.name);t=yield WebAssembly.instantiate(he,{})})),f=(he=null)=>{i=!0,t.exports.Hash_Init(he)},p=he=>{if(!i)throw new Error("update() called before init()");(he=>{let we=0;for(;we<he.length;){const Re=he.subarray(we,we+16384);we+=Re.length,r.set(Re),t.exports.Hash_Update(Re.length)}})(Hn(he))},C=new Uint8Array(2*n),E=(he,we=null)=>{if(!i)throw new Error("digest() called before init()");return i=!1,t.exports.Hash_Final(we),"binary"===he?r.slice(0,n):Fu(C,r,n)},se=he=>"string"==typeof he?he.length<4096:he.byteLength<16384;let le=se;switch(e.name){case"argon2":case"scrypt":le=()=>!0;break;case"blake2b":case"blake2s":le=(he,we)=>we<=512&&se(he);break;case"blake3":le=(he,we)=>0===we&&se(he);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":le=()=>!1}return yield(()=>vr(this,void 0,void 0,function*(){t||(yield u);const he=t.exports.Hash_GetBuffer();r=new Uint8Array(t.exports.memory.buffer,he,16384)}))(),{getMemory:()=>r,writeMemory:(he,we=0)=>{r.set(he,we)},getExports:()=>t.exports,setMemorySize:he=>{t.exports.Hash_SetMemorySize(he);const we=t.exports.Hash_GetBuffer();r=new Uint8Array(t.exports.memory.buffer,we,he)},init:f,update:p,digest:E,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const he=t.exports.Hash_GetState(),we=l(),Ye=new Uint8Array(t.exports.memory.buffer,he,we),Je=new Uint8Array(4+we);return QR(Je,e.hash),Je.set(Ye,4),Je},load:he=>{if(!(he instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const we=t.exports.Hash_GetState(),Re=l(),Ye=4+Re,Je=t.exports.memory.buffer;if(he.length!==Ye)throw new Error(`Bad state length (expected ${Ye} bytes, got ${he.length})`);if(!function fae(e,n){if(e.length!==2*n.length)return!1;for(let t=0;t<n.length;t++){const r=t<<1;if(n[t]!==bR(e.charCodeAt(r),e.charCodeAt(r+1)))return!1}return!0}(e.hash,he.subarray(0,4)))throw new Error("This state was written by an incompatible hash implementation");const Ze=he.subarray(4);new Uint8Array(Je,we,Re).set(Ze),i=!0},calculate:(he,we=null,Re=null)=>{if(!le(he,we))return f(we),p(he),E("hex",Re);const Ye=Hn(he);return r.set(Ye),t.exports.Hash_Calculate(Ye.length,we,Re),Fu(C,r,n)},hashLength:n}})}new Un;var Cae={name:"argon2",data:"AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwAgASkDAIU3A5AIQQAgAikDCCABKQMIhTcDmAhBACACKQMQIAEpAxCFNwOgCEEAIAIpAxggASkDGIU3A6gIQQAgAikDICABKQMghTcDsAhBACACKQMoIAEpAyiFNwO4CEEAIAIpAzAgASkDMIU3A8AIQQAgAikDOCABKQM4hTcDyAhBACACKQNAIAEpA0CFNwPQCEEAIAIpA0ggASkDSIU3A9gIQQAgAikDUCABKQNQhTcD4AhBACACKQNYIAEpA1iFNwPoCEEAIAIpA2AgASkDYIU3A/AIQQAgAikDaCABKQNohTcD+AhBACACKQNwIAEpA3CFNwOACUEAIAIpA3ggASkDeIU3A4gJQQAgAikDgAEgASkDgAGFNwOQCUEAIAIpA4gBIAEpA4gBhTcDmAlBACACKQOQASABKQOQAYU3A6AJQQAgAikDmAEgASkDmAGFNwOoCUEAIAIpA6ABIAEpA6ABhTcDsAlBACACKQOoASABKQOoAYU3A7gJQQAgAikDsAEgASkDsAGFNwPACUEAIAIpA7gBIAEpA7gBhTcDyAlBACACKQPAASABKQPAAYU3A9AJQQAgAikDyAEgASkDyAGFNwPYCUEAIAIpA9ABIAEpA9ABhTcD4AlBACACKQPYASABKQPYAYU3A+gJQQAgAikD4AEgASkD4AGFNwPwCUEAIAIpA+gBIAEpA+gBhTcD+AlBACACKQPwASABKQPwAYU3A4AKQQAgAikD+AEgASkD+AGFNwOICkEAIAIpA4ACIAEpA4AChTcDkApBACACKQOIAiABKQOIAoU3A5gKQQAgAikDkAIgASkDkAKFNwOgCkEAIAIpA5gCIAEpA5gChTcDqApBACACKQOgAiABKQOgAoU3A7AKQQAgAikDqAIgASkDqAKFNwO4CkEAIAIpA7ACIAEpA7AChTcDwApBACACKQO4AiABKQO4AoU3A8gKQQAgAikDwAIgASkDwAKFNwPQCkEAIAIpA8gCIAEpA8gChTcD2ApBACACKQPQAiABKQPQAoU3A+AKQQAgAikD2AIgASkD2AKFNwPoCkEAIAIpA+ACIAEpA+AChTcD8ApBACACKQPoAiABKQPoAoU3A/gKQQAgAikD8AIgASkD8AKFNwOAC0EAIAIpA/gCIAEpA/gChTcDiAtBACACKQOAAyABKQOAA4U3A5ALQQAgAikDiAMgASkDiAOFNwOYC0EAIAIpA5ADIAEpA5ADhTcDoAtBACACKQOYAyABKQOYA4U3A6gLQQAgAikDoAMgASkDoAOFNwOwC0EAIAIpA6gDIAEpA6gDhTcDuAtBACACKQOwAyABKQOwA4U3A8ALQQAgAikDuAMgASkDuAOFNwPIC0EAIAIpA8ADIAEpA8ADhTcD0AtBACACKQPIAyABKQPIA4U3A9gLQQAgAikD0AMgASkD0AOFNwPgC0EAIAIpA9gDIAEpA9gDhTcD6AtBACACKQPgAyABKQPgA4U3A/ALQQAgAikD6AMgASkD6AOFNwP4C0EAIAIpA/ADIAEpA/ADhTcDgAxBACACKQP4AyABKQP4A4U3A4gMQQAgAikDgAQgASkDgASFNwOQDEEAIAIpA4gEIAEpA4gEhTcDmAxBACACKQOQBCABKQOQBIU3A6AMQQAgAikDmAQgASkDmASFNwOoDEEAIAIpA6AEIAEpA6AEhTcDsAxBACACKQOoBCABKQOoBIU3A7gMQQAgAikDsAQgASkDsASFNwPADEEAIAIpA7gEIAEpA7gEhTcDyAxBACACKQPABCABKQPABIU3A9AMQQAgAikDyAQgASkDyASFNwPYDEEAIAIpA9AEIAEpA9AEhTcD4AxBACACKQPYBCABKQPYBIU3A+gMQQAgAikD4AQgASkD4ASFNwPwDEEAIAIpA+gEIAEpA+gEhTcD+AxBACACKQPwBCABKQPwBIU3A4ANQQAgAikD+AQgASkD+ASFNwOIDUEAIAIpA4AFIAEpA4AFhTcDkA1BACACKQOIBSABKQOIBYU3A5gNQQAgAikDkAUgASkDkAWFNwOgDUEAIAIpA5gFIAEpA5gFhTcDqA1BACACKQOgBSABKQOgBYU3A7ANQQAgAikDqAUgASkDqAWFNwO4DUEAIAIpA7AFIAEpA7AFhTcDwA1BACACKQO4BSABKQO4BYU3A8gNQQAgAikDwAUgASkDwAWFNwPQDUEAIAIpA8gFIAEpA8gFhTcD2A1BACACKQPQBSABKQPQBYU3A+ANQQAgAikD2AUgASkD2AWFNwPoDUEAIAIpA+AFIAEpA+AFhTcD8A1BACACKQPoBSABKQPoBYU3A/gNQQAgAikD8AUgASkD8AWFNwOADkEAIAIpA/gFIAEpA/gFhTcDiA5BACACKQOABiABKQOABoU3A5AOQQAgAikDiAYgASkDiAaFNwOYDkEAIAIpA5AGIAEpA5AGhTcDoA5BACACKQOYBiABKQOYBoU3A6gOQQAgAikDoAYgASkDoAaFNwOwDkEAIAIpA6gGIAEpA6gGhTcDuA5BACACKQOwBiABKQOwBoU3A8AOQQAgAikDuAYgASkDuAaFNwPIDkEAIAIpA8AGIAEpA8AGhTcD0A5BACACKQPIBiABKQPIBoU3A9gOQQAgAikD0AYgASkD0AaFNwPgDkEAIAIpA9gGIAEpA9gGhTcD6A5BACACKQPgBiABKQPgBoU3A/AOQQAgAikD6AYgASkD6AaFNwP4DkEAIAIpA/AGIAEpA/AGhTcDgA9BACACKQP4BiABKQP4BoU3A4gPQQAgAikDgAcgASkDgAeFNwOQD0EAIAIpA4gHIAEpA4gHhTcDmA9BACACKQOQByABKQOQB4U3A6APQQAgAikDmAcgASkDmAeFNwOoD0EAIAIpA6AHIAEpA6AHhTcDsA9BACACKQOoByABKQOoB4U3A7gPQQAgAikDsAcgASkDsAeFNwPAD0EAIAIpA7gHIAEpA7gHhTcDyA9BACACKQPAByABKQPAB4U3A9APQQAgAikDyAcgASkDyAeFNwPYD0EAIAIpA9AHIAEpA9AHhTcD4A9BACACKQPYByABKQPYB4U3A+gPQQAgAikD4AcgASkD4AeFNwPwD0EAIAIpA+gHIAEpA+gHhTcD+A9BACACKQPwByABKQPwB4U3A4AQQQAgAikD+AcgASkD+AeFNwOIEEGQCEGYCEGgCEGoCEGwCEG4CEHACEHICEHQCEHYCEHgCEHoCEHwCEH4CEGACUGICRACQZAJQZgJQaAJQagJQbAJQbgJQcAJQcgJQdAJQdgJQeAJQegJQfAJQfgJQYAKQYgKEAJBkApBmApBoApBqApBsApBuApBwApByApB0ApB2ApB4ApB6ApB8ApB+ApBgAtBiAsQAkGQC0GYC0GgC0GoC0GwC0G4C0HAC0HIC0HQC0HYC0HgC0HoC0HwC0H4C0GADEGIDBACQZAMQZgMQaAMQagMQbAMQbgMQcAMQcgMQdAMQdgMQeAMQegMQfAMQfgMQYANQYgNEAJBkA1BmA1BoA1BqA1BsA1BuA1BwA1ByA1B0A1B2A1B4A1B6A1B8A1B+A1BgA5BiA4QAkGQDkGYDkGgDkGoDkGwDkG4DkHADkHIDkHQDkHYDkHgDkHoDkHwDkH4DkGAD0GIDxACQZAPQZgPQaAPQagPQbAPQbgPQcAPQcgPQdAPQdgPQeAPQegPQfAPQfgPQYAQQYgQEAJBkAhBmAhBkAlBmAlBkApBmApBkAtBmAtBkAxBmAxBkA1BmA1BkA5BmA5BkA9BmA8QAkGgCEGoCEGgCUGoCUGgCkGoCkGgC0GoC0GgDEGoDEGgDUGoDUGgDkGoDkGgD0GoDxACQbAIQbgIQbAJQbgJQbAKQbgKQbALQbgLQbAMQbgMQbANQbgNQbAOQbgOQbAPQbgPEAJBwAhByAhBwAlByAlBwApByApBwAtByAtBwAxByAxBwA1ByA1BwA5ByA5BwA9ByA8QAkHQCEHYCEHQCUHYCUHQCkHYCkHQC0HYC0HQDEHYDEHQDUHYDUHQDkHYDkHQD0HYDxACQeAIQegIQeAJQegJQeAKQegKQeALQegLQeAMQegMQeANQegNQeAOQegOQeAPQegPEAJB8AhB+AhB8AlB+AlB8ApB+ApB8AtB+AtB8AxB+AxB8A1B+A1B8A5B+A5B8A9B+A8QAkGACUGICUGACkGICkGAC0GIC0GADEGIDEGADUGIDUGADkGIDkGAD0GID0GAEEGIEBACAkACQCADRQ0AA0AgACAEaiIDIAIgBGoiBSkDACABIARqIgYpAwCFIARBkAhqKQMAhSADKQMAhTcDACADQQhqIgMgBUEIaikDACAGQQhqKQMAhSAEQZgIaikDAIUgAykDAIU3AwAgBEEQaiIEQYAIRw0ADAILC0EAIQQDQCAAIARqIgMgAiAEaiIFKQMAIAEgBGoiBikDAIUgBEGQCGopAwCFNwMAIANBCGogBUEIaikDACAGQQhqKQMAhSAEQZgIaikDAIU3AwAgBEEQaiIEQYAIRw0ACwsL5QcMBX8BfgR/An4BfwF+AX8Bfgd/AX4DfwF+AkBBACgCgAgiAiABQQp0aiIDKAIIIAFHDQAgAygCDCEEIAMoAgAhBUEAIAMoAhQiBq03A7gQQQAgBK0iBzcDsBBBACAFIAEgBUECdG4iCGwiCUECdK03A6gQAkACQAJAAkAgBEUNAEF/IQogBUUNASAIQQNsIQsgCEECdCIErSEMIAWtIQ0gBkF/akECSSEOQgAhDwNAQQAgDzcDkBAgD6chEEIAIRFBACEBA0BBACARNwOgECAPIBGEUCIDIA5xIRIgBkEBRiAPUCITIAZBAkYgEUICVHFxciEUQX8gAUEBakEDcSAIbEF/aiATGyEVIAEgEHIhFiABIAhsIRcgA0EBdCEYQgAhGQNAQQBCADcDwBBBACAZNwOYECAYIQECQCASRQ0AQQBCATcDwBBBkBhBkBBBkCBBABADQZAYQZAYQZAgQQAQA0ECIQELAkAgASAITw0AIAQgGaciGmwgF2ogAWohAwNAIANBACAEIAEbQQAgEVAiGxtqQX9qIRwCQAJAIBQNAEEAKAKACCICIBxBCnQiHGohCgwBCwJAIAFB/wBxIgINAEEAQQApA8AQQgF8NwPAEEGQGEGQEEGQIEEAEANBkBhBkBhBkCBBABADCyAcQQp0IRwgAkEDdEGQGGohCkEAKAKACCECCyACIANBCnRqIAIgHGogAiAKKQMAIh1CIIinIAVwIBogFhsiHCAEbCABIAFBACAZIBytUSIcGyIKIBsbIBdqIAogC2ogExsgAUUgHHJrIhsgFWqtIB1C/////w+DIh0gHX5CIIggG61+QiCIfSAMgqdqQQp0akEBEAMgA0EBaiEDIAggAUEBaiIBRw0ACwsgGUIBfCIZIA1SDQALIBFCAXwiEachASARQgRSDQALIA9CAXwiDyAHUg0AC0EAKAKACCECCyAJQQx0QYB4aiEXIAVBf2oiCkUNAgwBC0EAQgM3A6AQQQAgBEF/aq03A5AQQYB4IRcLIAIgF2ohGyAIQQx0IQhBACEcA0AgCCAcQQFqIhxsQYB4aiEEQQAhAQNAIBsgAWoiAyADKQMAIAIgBCABamopAwCFNwMAIANBCGoiAyADKQMAIAIgBCABQQhyamopAwCFNwMAIAFBCGohAyABQRBqIQEgA0H4B0kNAAsgHCAKRw0ACwsgAiAXaiEbQXghAQNAIAIgAWoiA0EIaiAbIAFqIgRBCGopAwA3AwAgA0EQaiAEQRBqKQMANwMAIANBGGogBEEYaikDADcDACADQSBqIARBIGopAwA3AwAgAUEgaiIBQfgHSQ0ACwsL",hash:"e4cdc523"},NR={name:"blake2b",data:"AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwoJAAECAwECAgABBQQBAQICBg4CfwFBsIsFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACkhhc2hfRmluYWwAAwlIYXNoX0luaXQABQtIYXNoX1VwZGF0ZQAGDUhhc2hfR2V0U3RhdGUABw5IYXNoX0NhbGN1bGF0ZQAIClNUQVRFX1NJWkUDAQrTOAkFAEGACQvrAgIFfwF+AkAgAUEBSA0AAkACQAJAIAFBgAFBACgC4IoBIgJrIgNKDQAgASEEDAELQQBBADYC4IoBAkAgAkH/AEoNACACQeCJAWohBSAAIQRBACEGA0AgBSAELQAAOgAAIARBAWohBCAFQQFqIQUgAyAGQQFqIgZB/wFxSg0ACwtBAEEAKQPAiQEiB0KAAXw3A8CJAUEAQQApA8iJASAHQv9+Vq18NwPIiQFB4IkBEAIgACADaiEAAkAgASADayIEQYEBSA0AIAIgAWohBQNAQQBBACkDwIkBIgdCgAF8NwPAiQFBAEEAKQPIiQEgB0L/flatfDcDyIkBIAAQAiAAQYABaiEAIAVBgH9qIgVBgAJLDQALIAVBgH9qIQQMAQsgBEEATA0BC0EAIQUDQCAFQQAoAuCKAWpB4IkBaiAAIAVqLQAAOgAAIAQgBUEBaiIFQf8BcUoNAAsLQQBBACgC4IoBIARqNgLgigELC78uASR+QQBBACkD0IkBQQApA7CJASIBQQApA5CJAXwgACkDICICfCIDhULr+obav7X2wR+FQiCJIgRCq/DT9K/uvLc8fCIFIAGFQiiJIgYgA3wgACkDKCIBfCIHIASFQjCJIgggBXwiCSAGhUIBiSIKQQApA8iJAUEAKQOoiQEiBEEAKQOIiQF8IAApAxAiA3wiBYVCn9j52cKR2oKbf4VCIIkiC0K7zqqm2NDrs7t/fCIMIASFQiiJIg0gBXwgACkDGCIEfCIOfCAAKQNQIgV8Ig9BACkDwIkBQQApA6CJASIQQQApA4CJASIRfCAAKQMAIgZ8IhKFQtGFmu/6z5SH0QCFQiCJIhNCiJLznf/M+YTqAHwiFCAQhUIoiSIVIBJ8IAApAwgiEHwiFiAThUIwiSIXhUIgiSIYQQApA9iJAUEAKQO4iQEiE0EAKQOYiQF8IAApAzAiEnwiGYVC+cL4m5Gjs/DbAIVCIIkiGkLx7fT4paf9p6V/fCIbIBOFQiiJIhwgGXwgACkDOCITfCIZIBqFQjCJIhogG3wiG3wiHSAKhUIoiSIeIA98IAApA1giCnwiDyAYhUIwiSIYIB18Ih0gDiALhUIwiSIOIAx8Ih8gDYVCAYkiDCAWfCAAKQNAIgt8Ig0gGoVCIIkiFiAJfCIaIAyFQiiJIiAgDXwgACkDSCIJfCIhIBaFQjCJIhYgGyAchUIBiSIMIAd8IAApA2AiB3wiDSAOhUIgiSIOIBcgFHwiFHwiFyAMhUIoiSIbIA18IAApA2giDHwiHCAOhUIwiSIOIBd8IhcgG4VCAYkiGyAZIBQgFYVCAYkiFHwgACkDcCINfCIVIAiFQiCJIhkgH3wiHyAUhUIoiSIUIBV8IAApA3giCHwiFXwgDHwiIoVCIIkiI3wiJCAbhUIoiSIbICJ8IBJ8IiIgFyAYIBUgGYVCMIkiFSAffCIZIBSFQgGJIhQgIXwgDXwiH4VCIIkiGHwiFyAUhUIoiSIUIB98IAV8Ih8gGIVCMIkiGCAXfCIXIBSFQgGJIhR8IAF8IiEgFiAafCIWIBUgHSAehUIBiSIaIBx8IAl8IhyFQiCJIhV8Ih0gGoVCKIkiGiAcfCAIfCIcIBWFQjCJIhWFQiCJIh4gGSAOIBYgIIVCAYkiFiAPfCACfCIPhUIgiSIOfCIZIBaFQiiJIhYgD3wgC3wiDyAOhUIwiSIOIBl8Ihl8IiAgFIVCKIkiFCAhfCAEfCIhIB6FQjCJIh4gIHwiICAiICOFQjCJIiIgJHwiIyAbhUIBiSIbIBx8IAp8IhwgDoVCIIkiDiAXfCIXIBuFQiiJIhsgHHwgE3wiHCAOhUIwiSIOIBkgFoVCAYkiFiAffCAQfCIZICKFQiCJIh8gFSAdfCIVfCIdIBaFQiiJIhYgGXwgB3wiGSAfhUIwiSIfIB18Ih0gFoVCAYkiFiAVIBqFQgGJIhUgD3wgBnwiDyAYhUIgiSIYICN8IhogFYVCKIkiFSAPfCADfCIPfCAHfCIihUIgiSIjfCIkIBaFQiiJIhYgInwgBnwiIiAjhUIwiSIjICR8IiQgFoVCAYkiFiAOIBd8Ig4gDyAYhUIwiSIPICAgFIVCAYkiFCAZfCAKfCIXhUIgiSIYfCIZIBSFQiiJIhQgF3wgC3wiF3wgBXwiICAPIBp8Ig8gHyAOIBuFQgGJIg4gIXwgCHwiGoVCIIkiG3wiHyAOhUIoiSIOIBp8IAx8IhogG4VCMIkiG4VCIIkiISAdIB4gDyAVhUIBiSIPIBx8IAF8IhWFQiCJIhx8Ih0gD4VCKIkiDyAVfCADfCIVIByFQjCJIhwgHXwiHXwiHiAWhUIoiSIWICB8IA18IiAgIYVCMIkiISAefCIeIBogFyAYhUIwiSIXIBl8IhggFIVCAYkiFHwgCXwiGSAchUIgiSIaICR8IhwgFIVCKIkiFCAZfCACfCIZIBqFQjCJIhogHSAPhUIBiSIPICJ8IAR8Ih0gF4VCIIkiFyAbIB98Iht8Ih8gD4VCKIkiDyAdfCASfCIdIBeFQjCJIhcgH3wiHyAPhUIBiSIPIBsgDoVCAYkiDiAVfCATfCIVICOFQiCJIhsgGHwiGCAOhUIoiSIOIBV8IBB8IhV8IAx8IiKFQiCJIiN8IiQgD4VCKIkiDyAifCAHfCIiICOFQjCJIiMgJHwiJCAPhUIBiSIPIBogHHwiGiAVIBuFQjCJIhUgHiAWhUIBiSIWIB18IAR8IhuFQiCJIhx8Ih0gFoVCKIkiFiAbfCAQfCIbfCABfCIeIBUgGHwiFSAXIBogFIVCAYkiFCAgfCATfCIYhUIgiSIXfCIaIBSFQiiJIhQgGHwgCXwiGCAXhUIwiSIXhUIgiSIgIB8gISAVIA6FQgGJIg4gGXwgCnwiFYVCIIkiGXwiHyAOhUIoiSIOIBV8IA18IhUgGYVCMIkiGSAffCIffCIhIA+FQiiJIg8gHnwgBXwiHiAghUIwiSIgICF8IiEgGyAchUIwiSIbIB18IhwgFoVCAYkiFiAYfCADfCIYIBmFQiCJIhkgJHwiHSAWhUIoiSIWIBh8IBJ8IhggGYVCMIkiGSAfIA6FQgGJIg4gInwgAnwiHyAbhUIgiSIbIBcgGnwiF3wiGiAOhUIoiSIOIB98IAZ8Ih8gG4VCMIkiGyAafCIaIA6FQgGJIg4gFSAXIBSFQgGJIhR8IAh8IhUgI4VCIIkiFyAcfCIcIBSFQiiJIhQgFXwgC3wiFXwgBXwiIoVCIIkiI3wiJCAOhUIoiSIOICJ8IAh8IiIgGiAgIBUgF4VCMIkiFSAcfCIXIBSFQgGJIhQgGHwgCXwiGIVCIIkiHHwiGiAUhUIoiSIUIBh8IAZ8IhggHIVCMIkiHCAafCIaIBSFQgGJIhR8IAR8IiAgGSAdfCIZIBUgISAPhUIBiSIPIB98IAN8Ih2FQiCJIhV8Ih8gD4VCKIkiDyAdfCACfCIdIBWFQjCJIhWFQiCJIiEgFyAbIBkgFoVCAYkiFiAefCABfCIZhUIgiSIbfCIXIBaFQiiJIhYgGXwgE3wiGSAbhUIwiSIbIBd8Ihd8Ih4gFIVCKIkiFCAgfCAMfCIgICGFQjCJIiEgHnwiHiAiICOFQjCJIiIgJHwiIyAOhUIBiSIOIB18IBJ8Ih0gG4VCIIkiGyAafCIaIA6FQiiJIg4gHXwgC3wiHSAbhUIwiSIbIBcgFoVCAYkiFiAYfCANfCIXICKFQiCJIhggFSAffCIVfCIfIBaFQiiJIhYgF3wgEHwiFyAYhUIwiSIYIB98Ih8gFoVCAYkiFiAVIA+FQgGJIg8gGXwgCnwiFSAchUIgiSIZICN8IhwgD4VCKIkiDyAVfCAHfCIVfCASfCIihUIgiSIjfCIkIBaFQiiJIhYgInwgBXwiIiAjhUIwiSIjICR8IiQgFoVCAYkiFiAbIBp8IhogFSAZhUIwiSIVIB4gFIVCAYkiFCAXfCADfCIXhUIgiSIZfCIbIBSFQiiJIhQgF3wgB3wiF3wgAnwiHiAVIBx8IhUgGCAaIA6FQgGJIg4gIHwgC3wiGoVCIIkiGHwiHCAOhUIoiSIOIBp8IAR8IhogGIVCMIkiGIVCIIkiICAfICEgFSAPhUIBiSIPIB18IAZ8IhWFQiCJIh18Ih8gD4VCKIkiDyAVfCAKfCIVIB2FQjCJIh0gH3wiH3wiISAWhUIoiSIWIB58IAx8Ih4gIIVCMIkiICAhfCIhIBogFyAZhUIwiSIXIBt8IhkgFIVCAYkiFHwgEHwiGiAdhUIgiSIbICR8Ih0gFIVCKIkiFCAafCAJfCIaIBuFQjCJIhsgHyAPhUIBiSIPICJ8IBN8Ih8gF4VCIIkiFyAYIBx8Ihh8IhwgD4VCKIkiDyAffCABfCIfIBeFQjCJIhcgHHwiHCAPhUIBiSIPIBggDoVCAYkiDiAVfCAIfCIVICOFQiCJIhggGXwiGSAOhUIoiSIOIBV8IA18IhV8IA18IiKFQiCJIiN8IiQgD4VCKIkiDyAifCAMfCIiICOFQjCJIiMgJHwiJCAPhUIBiSIPIBsgHXwiGyAVIBiFQjCJIhUgISAWhUIBiSIWIB98IBB8IhiFQiCJIh18Ih8gFoVCKIkiFiAYfCAIfCIYfCASfCIhIBUgGXwiFSAXIBsgFIVCAYkiFCAefCAHfCIZhUIgiSIXfCIbIBSFQiiJIhQgGXwgAXwiGSAXhUIwiSIXhUIgiSIeIBwgICAVIA6FQgGJIg4gGnwgAnwiFYVCIIkiGnwiHCAOhUIoiSIOIBV8IAV8IhUgGoVCMIkiGiAcfCIcfCIgIA+FQiiJIg8gIXwgBHwiISAehUIwiSIeICB8IiAgGCAdhUIwiSIYIB98Ih0gFoVCAYkiFiAZfCAGfCIZIBqFQiCJIhogJHwiHyAWhUIoiSIWIBl8IBN8IhkgGoVCMIkiGiAcIA6FQgGJIg4gInwgCXwiHCAYhUIgiSIYIBcgG3wiF3wiGyAOhUIoiSIOIBx8IAN8IhwgGIVCMIkiGCAbfCIbIA6FQgGJIg4gFSAXIBSFQgGJIhR8IAt8IhUgI4VCIIkiFyAdfCIdIBSFQiiJIhQgFXwgCnwiFXwgBHwiIoVCIIkiI3wiJCAOhUIoiSIOICJ8IAl8IiIgGyAeIBUgF4VCMIkiFSAdfCIXIBSFQgGJIhQgGXwgDHwiGYVCIIkiHXwiGyAUhUIoiSIUIBl8IAp8IhkgHYVCMIkiHSAbfCIbIBSFQgGJIhR8IAN8Ih4gGiAffCIaIBUgICAPhUIBiSIPIBx8IAd8IhyFQiCJIhV8Ih8gD4VCKIkiDyAcfCAQfCIcIBWFQjCJIhWFQiCJIiAgFyAYIBogFoVCAYkiFiAhfCATfCIahUIgiSIYfCIXIBaFQiiJIhYgGnwgDXwiGiAYhUIwiSIYIBd8Ihd8IiEgFIVCKIkiFCAefCAFfCIeICCFQjCJIiAgIXwiISAiICOFQjCJIiIgJHwiIyAOhUIBiSIOIBx8IAt8IhwgGIVCIIkiGCAbfCIbIA6FQiiJIg4gHHwgEnwiHCAYhUIwiSIYIBcgFoVCAYkiFiAZfCABfCIXICKFQiCJIhkgFSAffCIVfCIfIBaFQiiJIhYgF3wgBnwiFyAZhUIwiSIZIB98Ih8gFoVCAYkiFiAVIA+FQgGJIg8gGnwgCHwiFSAdhUIgiSIaICN8Ih0gD4VCKIkiDyAVfCACfCIVfCANfCIihUIgiSIjfCIkIBaFQiiJIhYgInwgCXwiIiAjhUIwiSIjICR8IiQgFoVCAYkiFiAYIBt8IhggFSAahUIwiSIVICEgFIVCAYkiFCAXfCASfCIXhUIgiSIafCIbIBSFQiiJIhQgF3wgCHwiF3wgB3wiISAVIB18IhUgGSAYIA6FQgGJIg4gHnwgBnwiGIVCIIkiGXwiHSAOhUIoiSIOIBh8IAt8IhggGYVCMIkiGYVCIIkiHiAfICAgFSAPhUIBiSIPIBx8IAp8IhWFQiCJIhx8Ih8gD4VCKIkiDyAVfCAEfCIVIByFQjCJIhwgH3wiH3wiICAWhUIoiSIWICF8IAN8IiEgHoVCMIkiHiAgfCIgIBggFyAahUIwiSIXIBt8IhogFIVCAYkiFHwgBXwiGCAchUIgiSIbICR8IhwgFIVCKIkiFCAYfCABfCIYIBuFQjCJIhsgHyAPhUIBiSIPICJ8IAx8Ih8gF4VCIIkiFyAZIB18Ihl8Ih0gD4VCKIkiDyAffCATfCIfIBeFQjCJIhcgHXwiHSAPhUIBiSIPIBkgDoVCAYkiDiAVfCAQfCIVICOFQiCJIhkgGnwiGiAOhUIoiSIOIBV8IAJ8IhV8IBN8IiKFQiCJIiN8IiQgD4VCKIkiDyAifCASfCIiICOFQjCJIiMgJHwiJCAPhUIBiSIPIBsgHHwiGyAVIBmFQjCJIhUgICAWhUIBiSIWIB98IAt8IhmFQiCJIhx8Ih8gFoVCKIkiFiAZfCACfCIZfCAJfCIgIBUgGnwiFSAXIBsgFIVCAYkiFCAhfCAFfCIahUIgiSIXfCIbIBSFQiiJIhQgGnwgA3wiGiAXhUIwiSIXhUIgiSIhIB0gHiAVIA6FQgGJIg4gGHwgEHwiFYVCIIkiGHwiHSAOhUIoiSIOIBV8IAF8IhUgGIVCMIkiGCAdfCIdfCIeIA+FQiiJIg8gIHwgDXwiICAhhUIwiSIhIB58Ih4gGSAchUIwiSIZIB98IhwgFoVCAYkiFiAafCAIfCIaIBiFQiCJIhggJHwiHyAWhUIoiSIWIBp8IAp8IhogGIVCMIkiGCAdIA6FQgGJIg4gInwgBHwiHSAZhUIgiSIZIBcgG3wiF3wiGyAOhUIoiSIOIB18IAd8Ih0gGYVCMIkiGSAbfCIbIA6FQgGJIg4gFSAXIBSFQgGJIhR8IAx8IhUgI4VCIIkiFyAcfCIcIBSFQiiJIhQgFXwgBnwiFXwgEnwiIoVCIIkiI3wiJCAOhUIoiSIOICJ8IBN8IiIgGyAhIBUgF4VCMIkiFSAcfCIXIBSFQgGJIhQgGnwgBnwiGoVCIIkiHHwiGyAUhUIoiSIUIBp8IBB8IhogHIVCMIkiHCAbfCIbIBSFQgGJIhR8IA18IiEgGCAffCIYIBUgHiAPhUIBiSIPIB18IAJ8Ih2FQiCJIhV8Ih4gD4VCKIkiDyAdfCABfCIdIBWFQjCJIhWFQiCJIh8gFyAZIBggFoVCAYkiFiAgfCADfCIYhUIgiSIZfCIXIBaFQiiJIhYgGHwgBHwiGCAZhUIwiSIZIBd8Ihd8IiAgFIVCKIkiFCAhfCAIfCIhIB+FQjCJIh8gIHwiICAiICOFQjCJIiIgJHwiIyAOhUIBiSIOIB18IAd8Ih0gGYVCIIkiGSAbfCIbIA6FQiiJIg4gHXwgDHwiHSAZhUIwiSIZIBcgFoVCAYkiFiAafCALfCIXICKFQiCJIhogFSAefCIVfCIeIBaFQiiJIhYgF3wgCXwiFyAahUIwiSIaIB58Ih4gFoVCAYkiFiAVIA+FQgGJIg8gGHwgBXwiFSAchUIgiSIYICN8IhwgD4VCKIkiDyAVfCAKfCIVfCACfCIChUIgiSIifCIjIBaFQiiJIhYgAnwgC3wiAiAihUIwiSILICN8IiIgFoVCAYkiFiAZIBt8IhkgFSAYhUIwiSIVICAgFIVCAYkiFCAXfCANfCINhUIgiSIXfCIYIBSFQiiJIhQgDXwgBXwiBXwgEHwiECAVIBx8Ig0gGiAZIA6FQgGJIg4gIXwgDHwiDIVCIIkiFXwiGSAOhUIoiSIOIAx8IBJ8IhIgFYVCMIkiDIVCIIkiFSAeIB8gDSAPhUIBiSINIB18IAl8IgmFQiCJIg98IhogDYVCKIkiDSAJfCAIfCIJIA+FQjCJIgggGnwiD3wiGiAWhUIoiSIWIBB8IAd8IhAgEYUgDCAZfCIHIA6FQgGJIgwgCXwgCnwiCiALhUIgiSILIAUgF4VCMIkiBSAYfCIJfCIOIAyFQiiJIgwgCnwgE3wiEyALhUIwiSIKIA58IguFNwOAiQFBACADIAYgDyANhUIBiSINIAJ8fCICIAWFQiCJIgUgB3wiBiANhUIoiSIHIAJ8fCICQQApA4iJAYUgBCABIBIgCSAUhUIBiSIDfHwiASAIhUIgiSISICJ8IgkgA4VCKIkiAyABfHwiASAShUIwiSIEIAl8IhKFNwOIiQFBACATQQApA5CJAYUgECAVhUIwiSIQIBp8IhOFNwOQiQFBACABQQApA5iJAYUgAiAFhUIwiSICIAZ8IgGFNwOYiQFBACASIAOFQgGJQQApA6CJAYUgAoU3A6CJAUEAIBMgFoVCAYlBACkDqIkBhSAKhTcDqIkBQQAgASAHhUIBiUEAKQOwiQGFIASFNwOwiQFBACALIAyFQgGJQQApA7iJAYUgEIU3A7iJAQvdAgUBfwF+AX8BfgJ/IwBBwABrIgAkAAJAQQApA9CJAUIAUg0AQQBBACkDwIkBIgFBACgC4IoBIgKsfCIDNwPAiQFBAEEAKQPIiQEgAyABVK18NwPIiQECQEEALQDoigFFDQBBAEJ/NwPYiQELQQBCfzcD0IkBAkAgAkH/AEoNAEEAIQQDQCACIARqQeCJAWpBADoAACAEQQFqIgRBgAFBACgC4IoBIgJrSA0ACwtB4IkBEAIgAEEAKQOAiQE3AwAgAEEAKQOIiQE3AwggAEEAKQOQiQE3AxAgAEEAKQOYiQE3AxggAEEAKQOgiQE3AyAgAEEAKQOoiQE3AyggAEEAKQOwiQE3AzAgAEEAKQO4iQE3AzhBACgC5IoBIgVBAUgNAEEAIQRBACECA0AgBEGACWogACAEai0AADoAACAEQQFqIQQgBSACQQFqIgJB/wFxSg0ACwsgAEHAAGokAAv9AwMBfwF+AX8jAEGAAWsiAiQAQQBBgQI7AfKKAUEAIAE6APGKAUEAIAA6APCKAUGQfiEAA0AgAEGAiwFqQgA3AAAgAEH4igFqQgA3AAAgAEHwigFqQgA3AAAgAEEYaiIADQALQQAhAEEAQQApA/CKASIDQoiS853/zPmE6gCFNwOAiQFBAEEAKQP4igFCu86qptjQ67O7f4U3A4iJAUEAQQApA4CLAUKr8NP0r+68tzyFNwOQiQFBAEEAKQOIiwFC8e30+KWn/aelf4U3A5iJAUEAQQApA5CLAULRhZrv+s+Uh9EAhTcDoIkBQQBBACkDmIsBQp/Y+dnCkdqCm3+FNwOoiQFBAEEAKQOgiwFC6/qG2r+19sEfhTcDsIkBQQBBACkDqIsBQvnC+JuRo7Pw2wCFNwO4iQFBACADp0H/AXE2AuSKAQJAIAFBAUgNACACQgA3A3ggAkIANwNwIAJCADcDaCACQgA3A2AgAkIANwNYIAJCADcDUCACQgA3A0ggAkIANwNAIAJCADcDOCACQgA3AzAgAkIANwMoIAJCADcDICACQgA3AxggAkIANwMQIAJCADcDCCACQgA3AwBBACEEA0AgAiAAaiAAQYAJai0AADoAACAAQQFqIQAgBEEBaiIEQf8BcSABSA0ACyACQYABEAELIAJBgAFqJAALEgAgAEEDdkH/P3EgAEEQdhAECwkAQYAJIAAQAQsGAEGAiQELGwAgAUEDdkH/P3EgAUEQdhAEQYAJIAAQARADCwsLAQBBgAgLBPAAAAA=",hash:"c6f286e6"};function DI(e){return!Number.isInteger(e)||e<8||e>512||e%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 512"):null}function Gv(e=512,n=null){if(DI(e))return Promise.reject(DI(e));let t=null,r=e;if(null!==n){if(t=Hn(n),t.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));r=function xR(e,n){return e|n<<16}(e,t.length)}const i=e/8;return Bn(NR,i).then(o=>{r>512&&o.writeMemory(t),o.init(r);const s={init:r>512?()=>(o.writeMemory(t),o.init(r),s):()=>(o.init(r),s),update:a=>(o.update(a),s),digest:a=>o.digest(a),save:()=>o.save(),load:a=>(o.load(a),s),blockSize:128,digestSize:i};return s})}new Un;const TR=new DataView(new ArrayBuffer(4));function Ns(e){return TR.setInt32(0,e,!0),new Uint8Array(TR.buffer)}function Vv(e,n,t){return vr(this,void 0,void 0,function*(){if(t<=64){const c=yield Gv(8*t);return c.update(Ns(t)),c.update(n),c.digest("binary")}const r=Math.ceil(t/32)-2,i=new Uint8Array(t);e.init(),e.update(Ns(t)),e.update(n);let o=e.digest("binary");i.set(o.subarray(0,32),0);for(let c=1;c<r;c++)e.init(),e.update(o),o=e.digest("binary"),i.set(o.subarray(0,32),32*c);const s=t-32*r;let a;return 64===s?(a=e,a.init()):a=yield Gv(8*s),a.update(o),o=a.digest("binary"),i.set(o.subarray(0,s),32*r),i})}new Un,new Un,new Un,new Un,new Uint8Array(8),new Un,new Un,new Un,new Un,new Un,new Un,new Un,new Un,new Un,new Un,new Un,new Uint8Array(8),new Un,new Uint8Array(8),new Un,new Uint8Array(8),new Un,new Un,new Un;const Ale={parallelism:4,iterations:8,memorySize:262144,hashLength:32,outputType:"binary"};function Pu(e,n){return jv.apply(this,arguments)}function jv(){return(jv=I(function*(e,n){return yield function bae(e){return vr(this,void 0,void 0,function*(){return(e=>{var n;if(!e||"object"!=typeof e)throw new Error("Invalid options parameter. It requires an object.");if(!e.password)throw new Error("Password must be specified");if(e.password=Hn(e.password),e.password.length<1)throw new Error("Password must be specified");if(!e.salt)throw new Error("Salt must be specified");if(e.salt=Hn(e.salt),e.salt.length<8)throw new Error("Salt should be at least 8 bytes long");if(e.secret=Hn(null!==(n=e.secret)&&void 0!==n?n:""),!Number.isInteger(e.iterations)||e.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(e.parallelism)||e.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(e.hashLength)||e.hashLength<4)throw new Error("Hash length should be at least 4 bytes.");if(!Number.isInteger(e.memorySize))throw new Error("Memory size should be specified.");if(e.memorySize<8*e.parallelism)throw new Error("Memory size should be at least 8 * parallelism.");if(void 0===e.outputType&&(e.outputType="hex"),!["hex","binary","encoded"].includes(e.outputType))throw new Error(`Insupported output type ${e.outputType}. Valid values: ['hex', 'binary', 'encoded']`)})(e),function SI(e){return vr(this,void 0,void 0,function*(){var n;const{parallelism:t,iterations:r,hashLength:i}=e,o=Hn(e.password),s=Hn(e.salt),c=function _ae(e){switch(e){case"d":return 0;case"i":return 1;default:return 2}}(e.hashType),{memorySize:l}=e,u=Hn(null!==(n=e.secret)&&void 0!==n?n:""),[d,f]=yield Promise.all([Bn(Cae,1024),Gv(512)]);d.setMemorySize(1024*l+1024);const A=new Uint8Array(24),p=new DataView(A.buffer);p.setInt32(0,t,!0),p.setInt32(4,i,!0),p.setInt32(8,l,!0),p.setInt32(12,r,!0),p.setInt32(16,19,!0),p.setInt32(20,c,!0),d.writeMemory(A,1024*l),f.init(),f.update(A),f.update(Ns(o.length)),f.update(o),f.update(Ns(s.length)),f.update(s),f.update(Ns(u.length)),f.update(u),f.update(Ns(0));const E=4*Math.floor(l/(4*t)),Q=new Uint8Array(72),F=f.digest("binary");Q.set(F);for(let Be=0;Be<t;Be++){Q.set(Ns(0),64),Q.set(Ns(Be),68);let he=Be*E,we=yield Vv(f,Q,1024);d.writeMemory(we,1024*he),he+=1,Q.set(Ns(1),64),we=yield Vv(f,Q,1024),d.writeMemory(we,1024*he)}const se=new Uint8Array(1024);QR(se,d.calculate(new Uint8Array([]),l));const le=yield Vv(f,se,i);return"hex"===e.outputType?Fu(new Uint8Array(2*i),le,i):"encoded"===e.outputType?function vae(e,n,t){const r=[`m=${n.memorySize}`,`t=${n.iterations}`,`p=${n.parallelism}`].join(",");return`$argon2${n.hashType}$v=19$${r}$${kR(e,!1)}$${kR(t,!1)}`}(s,e,le):le})}(Object.assign(Object.assign({},e),{hashType:"id"}))})}({password:e,salt:n,...Ale})})).apply(this,arguments)}function Yv(){const e=crypto.getRandomValues(new Uint8Array(32));return yn.Buffer.from(e).toString("base64")}function Wv(){const e=crypto.getRandomValues(new Uint8Array(12));return yn.Buffer.from(e).toString("base64")}const gle=function(){var e=I(function*(n){if(this.assureIsInitialized(),!function fle(e){try{const n=new URL(e);return"https:"===n.protocol||"http:"===n.protocol}catch{return!1}}(n.mintUrl))throw new Error("Invalid mint URL format");const t=n.mintUrl.replace(/\/$/,""),r=(this.getBrowserSessionHandler().browserSessionData?.cashuMints??[]).find(c=>c.mintUrl===t);if(r)throw new Error(`A connection to this mint already exists: ${r.name}`);const i=this.getBrowserSessionHandler().browserSessionData;if(!i)throw new Error("Browser session data is undefined.");const o={id:zi.v4(),name:n.name,mintUrl:t,unit:n.unit??"sat",createdAt:(new Date).toISOString(),proofs:[],cachedBalance:0,cachedBalanceAt:(new Date).toISOString()};i.cashuMints||(i.cashuMints=[]),i.cashuMints.push(o),this.getBrowserSessionHandler().saveFullData(i);const s=yield Xv.call(this,o),a=[...this.getBrowserSyncHandler().browserSyncData?.cashuMints??[],s];return yield this.getBrowserSyncHandler().saveAndSetPartialData_CashuMints({cashuMints:a}),o});return function(t){return e.apply(this,arguments)}}(),hle=function(){var e=I(function*(n){if(this.assureIsInitialized(),!n)return;const t=this.getBrowserSessionHandler().browserSessionData,r=this.getBrowserSyncHandler().browserSyncData;if(!t||!r)throw new Error("Browser session or sync data is undefined.");t.cashuMints=(t.cashuMints??[]).filter(o=>o.id!==n),yield this.getBrowserSessionHandler().saveFullData(t);const i=yield this.encrypt(n);yield this.getBrowserSyncHandler().saveAndSetPartialData_CashuMints({cashuMints:(r.cashuMints??[]).filter(o=>o.id!==i)})});return function(t){return e.apply(this,arguments)}}(),ple=function(){var e=I(function*(n,t){this.assureIsInitialized();const r=this.getBrowserSessionHandler().browserSessionData,i=this.getBrowserSyncHandler().browserSyncData;if(!r||!i)throw new Error("Browser session or sync data is undefined.");const o=(r.cashuMints??[]).find(u=>u.id===n),s=yield this.encrypt(n),a=(i.cashuMints??[]).find(u=>u.id===s);if(!o||!a)throw new Error("Cashu mint not found for proofs update.");const c=(new Date).toISOString(),l=t.reduce((u,d)=>u+d.amount,0);o.proofs=t,o.cachedBalance=l,o.cachedBalanceAt=c,yield this.getBrowserSessionHandler().saveFullData(r),a.proofs=yield this.encrypt(JSON.stringify(t)),a.cachedBalance=yield this.encrypt(l.toString()),a.cachedBalanceAt=yield this.encrypt(c),yield this.getBrowserSyncHandler().saveAndSetPartialData_CashuMints({cashuMints:i.cashuMints??[]})});return function(t,r){return e.apply(this,arguments)}}(),Xv=function(){var e=I(function*(n){const t={id:yield this.encrypt(n.id),name:yield this.encrypt(n.name),mintUrl:yield this.encrypt(n.mintUrl),unit:yield this.encrypt(n.unit),createdAt:yield this.encrypt(n.createdAt),proofs:yield this.encrypt(JSON.stringify(n.proofs))};return void 0!==n.cachedBalance&&(t.cachedBalance=yield this.encrypt(n.cachedBalance.toString())),n.cachedBalanceAt&&(t.cachedBalanceAt=yield this.encrypt(n.cachedBalanceAt)),t});return function(t){return e.apply(this,arguments)}}(),Ile=function(){var e=I(function*(n,t=void 0){if(typeof t>"u"){const o=yield this.decrypt(n.proofs,"string"),s={id:yield this.decrypt(n.id,"string"),name:yield this.decrypt(n.name,"string"),mintUrl:yield this.decrypt(n.mintUrl,"string"),unit:yield this.decrypt(n.unit,"string"),createdAt:yield this.decrypt(n.createdAt,"string"),proofs:JSON.parse(o)};return n.cachedBalance&&(s.cachedBalance=yield this.decrypt(n.cachedBalance,"number")),n.cachedBalanceAt&&(s.cachedBalanceAt=yield this.decrypt(n.cachedBalanceAt,"string")),s}if(t.keyBase64){const o=yield this.decryptWithLockedVaultV2(n.proofs,"string",t.iv,t.keyBase64),s={id:yield this.decryptWithLockedVaultV2(n.id,"string",t.iv,t.keyBase64),name:yield this.decryptWithLockedVaultV2(n.name,"string",t.iv,t.keyBase64),mintUrl:yield this.decryptWithLockedVaultV2(n.mintUrl,"string",t.iv,t.keyBase64),unit:yield this.decryptWithLockedVaultV2(n.unit,"string",t.iv,t.keyBase64),createdAt:yield this.decryptWithLockedVaultV2(n.createdAt,"string",t.iv,t.keyBase64),proofs:JSON.parse(o)};return n.cachedBalance&&(s.cachedBalance=yield this.decryptWithLockedVaultV2(n.cachedBalance,"number",t.iv,t.keyBase64)),n.cachedBalanceAt&&(s.cachedBalanceAt=yield this.decryptWithLockedVaultV2(n.cachedBalanceAt,"string",t.iv,t.keyBase64)),s}const r=yield this.decryptWithLockedVault(n.proofs,"string",t.iv,t.password),i={id:yield this.decryptWithLockedVault(n.id,"string",t.iv,t.password),name:yield this.decryptWithLockedVault(n.name,"string",t.iv,t.password),mintUrl:yield this.decryptWithLockedVault(n.mintUrl,"string",t.iv,t.password),unit:yield this.decryptWithLockedVault(n.unit,"string",t.iv,t.password),createdAt:yield this.decryptWithLockedVault(n.createdAt,"string",t.iv,t.password),proofs:JSON.parse(r)};return n.cachedBalance&&(i.cachedBalance=yield this.decryptWithLockedVault(n.cachedBalance,"number",t.iv,t.password)),n.cachedBalanceAt&&(i.cachedBalanceAt=yield this.decryptWithLockedVault(n.cachedBalanceAt,"string",t.iv,t.password)),i});return function(t){return e.apply(this,arguments)}}(),mle=function(){var e=I(function*(n,t=void 0){const r=[];for(const i of n){const o=yield Ile.call(this,i,t);r.push(o)}return r});return function(t){return e.apply(this,arguments)}}();function tP(e){try{const n=e.match(/^nostr\+walletconnect:\/\/([a-f0-9]{64})\?(.+)$/i);if(!n)return null;const t=n[1].toLowerCase(),r=new URLSearchParams(n[2]),i=r.get("relay"),o=r.get("secret"),s=r.get("lud16")||void 0;return i&&o&&/^[a-f0-9]{64}$/i.test(o)?{walletPubkey:t,relayUrl:decodeURIComponent(i),secret:o.toLowerCase(),lud16:s}:null}catch{return null}}const Cle=function(){var e=I(function*(n){this.assureIsInitialized();const t=tP(n.connectionUrl);if(!t)throw new Error("Invalid NWC URL format");const r=(this.getBrowserSessionHandler().browserSessionData?.nwcConnections??[]).find(c=>c.walletPubkey===t.walletPubkey);if(r)throw new Error(`A connection to this wallet already exists: ${r.name}`);const i=this.getBrowserSessionHandler().browserSessionData;if(!i)throw new Error("Browser session data is undefined.");const o={id:zi.v4(),name:n.name,connectionUrl:n.connectionUrl,walletPubkey:t.walletPubkey,relayUrl:t.relayUrl,secret:t.secret,lud16:t.lud16,createdAt:(new Date).toISOString()};i.nwcConnections||(i.nwcConnections=[]),i.nwcConnections.push(o),this.getBrowserSessionHandler().saveFullData(i);const s=yield e_.call(this,o),a=[...this.getBrowserSyncHandler().browserSyncData?.nwcConnections??[],s];yield this.getBrowserSyncHandler().saveAndSetPartialData_NwcConnections({nwcConnections:a})});return function(t){return e.apply(this,arguments)}}(),yle=function(){var e=I(function*(n){if(this.assureIsInitialized(),!n)return;const t=this.getBrowserSessionHandler().browserSessionData,r=this.getBrowserSyncHandler().browserSyncData;if(!t||!r)throw new Error("Browser session or sync data is undefined.");t.nwcConnections=(t.nwcConnections??[]).filter(o=>o.id!==n),yield this.getBrowserSessionHandler().saveFullData(t);const i=yield this.encrypt(n);yield this.getBrowserSyncHandler().saveAndSetPartialData_NwcConnections({nwcConnections:(r.nwcConnections??[]).filter(o=>o.id!==i)})});return function(t){return e.apply(this,arguments)}}(),Ele=function(){var e=I(function*(n,t){this.assureIsInitialized();const r=this.getBrowserSessionHandler().browserSessionData,i=this.getBrowserSyncHandler().browserSyncData;if(!r||!i)throw new Error("Browser session or sync data is undefined.");const o=(r.nwcConnections??[]).find(l=>l.id===n),s=yield this.encrypt(n),a=(i.nwcConnections??[]).find(l=>l.id===s);if(!o||!a)throw new Error("NWC connection not found for balance update.");const c=(new Date).toISOString();o.cachedBalance=t,o.cachedBalanceAt=c,yield this.getBrowserSessionHandler().saveFullData(r),a.cachedBalance=yield this.encrypt(t.toString()),a.cachedBalanceAt=yield this.encrypt(c),yield this.getBrowserSyncHandler().saveAndSetPartialData_NwcConnections({nwcConnections:i.nwcConnections??[]})});return function(t,r){return e.apply(this,arguments)}}(),e_=function(){var e=I(function*(n){const t={id:yield this.encrypt(n.id),name:yield this.encrypt(n.name),connectionUrl:yield this.encrypt(n.connectionUrl),walletPubkey:yield this.encrypt(n.walletPubkey),relayUrl:yield this.encrypt(n.relayUrl),secret:yield this.encrypt(n.secret),createdAt:yield this.encrypt(n.createdAt)};return n.lud16&&(t.lud16=yield this.encrypt(n.lud16)),void 0!==n.cachedBalance&&(t.cachedBalance=yield this.encrypt(n.cachedBalance.toString())),n.cachedBalanceAt&&(t.cachedBalanceAt=yield this.encrypt(n.cachedBalanceAt)),t});return function(t){return e.apply(this,arguments)}}(),Ble=function(){var e=I(function*(n,t=void 0){if(typeof t>"u"){const i={id:yield this.decrypt(n.id,"string"),name:yield this.decrypt(n.name,"string"),connectionUrl:yield this.decrypt(n.connectionUrl,"string"),walletPubkey:yield this.decrypt(n.walletPubkey,"string"),relayUrl:yield this.decrypt(n.relayUrl,"string"),secret:yield this.decrypt(n.secret,"string"),createdAt:yield this.decrypt(n.createdAt,"string")};return n.lud16&&(i.lud16=yield this.decrypt(n.lud16,"string")),n.cachedBalance&&(i.cachedBalance=yield this.decrypt(n.cachedBalance,"number")),n.cachedBalanceAt&&(i.cachedBalanceAt=yield this.decrypt(n.cachedBalanceAt,"string")),i}if(t.keyBase64){const i={id:yield this.decryptWithLockedVaultV2(n.id,"string",t.iv,t.keyBase64),name:yield this.decryptWithLockedVaultV2(n.name,"string",t.iv,t.keyBase64),connectionUrl:yield this.decryptWithLockedVaultV2(n.connectionUrl,"string",t.iv,t.keyBase64),walletPubkey:yield this.decryptWithLockedVaultV2(n.walletPubkey,"string",t.iv,t.keyBase64),relayUrl:yield this.decryptWithLockedVaultV2(n.relayUrl,"string",t.iv,t.keyBase64),secret:yield this.decryptWithLockedVaultV2(n.secret,"string",t.iv,t.keyBase64),createdAt:yield this.decryptWithLockedVaultV2(n.createdAt,"string",t.iv,t.keyBase64)};return n.lud16&&(i.lud16=yield this.decryptWithLockedVaultV2(n.lud16,"string",t.iv,t.keyBase64)),n.cachedBalance&&(i.cachedBalance=yield this.decryptWithLockedVaultV2(n.cachedBalance,"number",t.iv,t.keyBase64)),n.cachedBalanceAt&&(i.cachedBalanceAt=yield this.decryptWithLockedVaultV2(n.cachedBalanceAt,"string",t.iv,t.keyBase64)),i}const r={id:yield this.decryptWithLockedVault(n.id,"string",t.iv,t.password),name:yield this.decryptWithLockedVault(n.name,"string",t.iv,t.password),connectionUrl:yield this.decryptWithLockedVault(n.connectionUrl,"string",t.iv,t.password),walletPubkey:yield this.decryptWithLockedVault(n.walletPubkey,"string",t.iv,t.password),relayUrl:yield this.decryptWithLockedVault(n.relayUrl,"string",t.iv,t.password),secret:yield this.decryptWithLockedVault(n.secret,"string",t.iv,t.password),createdAt:yield this.decryptWithLockedVault(n.createdAt,"string",t.iv,t.password)};return n.lud16&&(r.lud16=yield this.decryptWithLockedVault(n.lud16,"string",t.iv,t.password)),n.cachedBalance&&(r.cachedBalance=yield this.decryptWithLockedVault(n.cachedBalance,"number",t.iv,t.password)),n.cachedBalanceAt&&(r.cachedBalanceAt=yield this.decryptWithLockedVault(n.cachedBalanceAt,"string",t.iv,t.password)),r});return function(t){return e.apply(this,arguments)}}(),wle=function(){var e=I(function*(n,t=void 0){const r=[];for(const i of n){const o=yield Ble.call(this,i,t);r.push(o)}return r});return function(t){return e.apply(this,arguments)}}(),vle=function(){var e=I(function*(n){if(this.assureIsInitialized(),this.getBrowserSessionHandler().browserSessionData?.relays.find(a=>a.url.toLowerCase()===n.url.toLowerCase()&&a.identityId===n.identityId))throw new Error("A relay with the same URL already exists.");const r=this.getBrowserSessionHandler().browserSessionData;if(!r)throw new Error("Browser session data is undefined.");const i={id:zi.v4(),identityId:n.identityId,url:n.url,write:n.write,read:n.read};r.relays.push(i),this.getBrowserSessionHandler().saveFullData(r);const o=yield t_.call(this,i),s=[...this.getBrowserSyncHandler().browserSyncData?.relays??[],o];yield this.getBrowserSyncHandler().saveAndSetPartialData_Relays({relays:s})});return function(t){return e.apply(this,arguments)}}(),_le=function(){var e=I(function*(n){if(this.assureIsInitialized(),!n)return;const t=this.getBrowserSessionHandler().browserSessionData,r=this.getBrowserSyncHandler().browserSyncData;if(!t||!r)throw new Error("Browser session or sync data is undefined.");t.relays=t.relays.filter(o=>o.id!==n),yield this.getBrowserSessionHandler().saveFullData(t);const i=yield this.encrypt(n);yield this.getBrowserSyncHandler().saveAndSetPartialData_Relays({relays:r.relays.filter(o=>o.id!==i)})});return function(t){return e.apply(this,arguments)}}(),ble=function(){var e=I(function*(n){this.assureIsInitialized();const t=this.getBrowserSessionHandler().browserSessionData,r=this.getBrowserSyncHandler().browserSyncData;if(!t||!r)throw new Error("Browser session or sync data is undefined.");const i=t.relays.find(a=>a.id===n.id),o=yield this.encrypt(n.id),s=r.relays.find(a=>a.id===o);if(!i||!s)throw new Error("Relay not found in browser session or sync data for update.");i.read=n.read,i.write=n.write,i.url=n.url,yield this.getBrowserSessionHandler().saveFullData(t),s.read=yield this.encrypt(n.read.toString()),s.write=yield this.encrypt(n.write.toString()),s.url=yield this.encrypt(n.url),yield this.getBrowserSyncHandler().saveAndSetPartialData_Relays({relays:r.relays})});return function(t){return e.apply(this,arguments)}}(),Qle=function(){var e=I(function*(n,t=void 0){return typeof t>"u"?{id:yield this.decrypt(n.id,"string"),identityId:yield this.decrypt(n.identityId,"string"),url:yield this.decrypt(n.url,"string"),read:yield this.decrypt(n.read,"boolean"),write:yield this.decrypt(n.write,"boolean")}:t.keyBase64?{id:yield this.decryptWithLockedVaultV2(n.id,"string",t.iv,t.keyBase64),identityId:yield this.decryptWithLockedVaultV2(n.identityId,"string",t.iv,t.keyBase64),url:yield this.decryptWithLockedVaultV2(n.url,"string",t.iv,t.keyBase64),read:yield this.decryptWithLockedVaultV2(n.read,"boolean",t.iv,t.keyBase64),write:yield this.decryptWithLockedVaultV2(n.write,"boolean",t.iv,t.keyBase64)}:{id:yield this.decryptWithLockedVault(n.id,"string",t.iv,t.password),identityId:yield this.decryptWithLockedVault(n.identityId,"string",t.iv,t.password),url:yield this.decryptWithLockedVault(n.url,"string",t.iv,t.password),read:yield this.decryptWithLockedVault(n.read,"boolean",t.iv,t.password),write:yield this.decryptWithLockedVault(n.write,"boolean",t.iv,t.password)}});return function(t){return e.apply(this,arguments)}}(),Dle=function(){var e=I(function*(n,t=void 0){const r=[];for(const i of n){const o=yield Qle.call(this,i,t);r.push(o)}return r});return function(t){return e.apply(this,arguments)}}(),t_=function(){var e=I(function*(n){return{id:yield this.encrypt(n.id),identityId:yield this.encrypt(n.identityId),url:yield this.encrypt(n.url),read:yield this.encrypt(n.read.toString()),write:yield this.encrypt(n.write.toString())}});return function(t){return e.apply(this,arguments)}}(),Sle=function(){var e=I(function*(n){this.assureIsInitialized();const t=yield zi.hash(n),r=Yv(),i=Wv(),o=yn.Buffer.from(r,"base64"),s=yield Pu(n,o),c={iv:i,salt:r,vaultKey:yn.Buffer.from(s).toString("base64"),identities:[],permissions:[],relays:[],nwcConnections:[],cashuMints:[],selectedIdentityId:null};yield this.getBrowserSessionHandler().saveFullData(c),this.getBrowserSessionHandler().setFullData(c);const l={version:this.latestVersion,salt:r,iv:i,vaultHash:t,identities:[],permissions:[],relays:[],nwcConnections:[],cashuMints:[],selectedIdentityId:null};yield this.getBrowserSyncHandler().saveAndSetFullData(l)});return function(t){return e.apply(this,arguments)}}(),kle=function(){var e=I(function*(n){this.assureIsInitialized();let t=this.getBrowserSessionHandler().browserSessionData;if(t)throw new Error("Browser session data is available. Should only happen when the vault is unlocked");const r=this.getBrowserSyncHandler().browserSyncData;if(!r)throw new Error("Browser sync data is not available. Should have been loaded before.");if((yield zi.hash(n))!==r.vaultHash)throw new Error("Invalid password.");const o=!!r.salt;let s,a,c;if(o){const C=yn.Buffer.from(r.salt,"base64"),E=yield Pu(n,C);a=yn.Buffer.from(E).toString("base64"),s={iv:r.iv,keyBase64:a}}else c=n,s={iv:r.iv,password:n};const l=yield nae.call(this,r.identities,s),u=yield sae.call(this,r.permissions,s),d=yield Dle.call(this,r.relays,s),f=yield wle.call(this,r.nwcConnections??[],s),A=yield mle.call(this,r.cashuMints??[],s);let p=null;null!==r.selectedIdentityId&&(p=o?yield this.decryptWithLockedVaultV2(r.selectedIdentityId,"string",r.iv,a):yield this.decryptWithLockedVault(r.selectedIdentityId,"string",r.iv,n)),t={vaultPassword:o?void 0:c,vaultKey:o?a:void 0,iv:r.iv,salt:r.salt,permissions:u,identities:l,selectedIdentityId:p,relays:d,nwcConnections:f,cashuMints:A},yield this.getBrowserSessionHandler().saveFullData(t),this.getBrowserSessionHandler().setFullData(t),o||(yield Mle.call(this,n))});return function(t){return e.apply(this,arguments)}}();function Mle(e){return n_.apply(this,arguments)}function n_(){return(n_=I(function*(e){const n=this.getBrowserSyncHandler().browserSyncData,t=this.getBrowserSessionHandler().browserSessionData;if(!n||!t)throw new Error("Cannot migrate: data not available");const r=Yv(),i=Wv(),o=yn.Buffer.from(r,"base64"),s=yield Pu(e,o),a=yn.Buffer.from(s).toString("base64");t.salt=r,t.iv=i,t.vaultKey=a,t.vaultPassword=void 0;const c=[];for(const C of t.identities){const E=yield Rv.call(this,C);c.push(E)}const l=[];for(const C of t.relays){const E=yield t_.call(this,C);l.push(E)}const u=[];for(const C of t.permissions){const E={id:yield this.encrypt(C.id),identityId:yield this.encrypt(C.identityId),host:yield this.encrypt(C.host),method:yield this.encrypt(C.method),methodPolicy:yield this.encrypt(C.methodPolicy),kind:void 0!==C.kind?yield this.encrypt(C.kind.toString()):void 0};u.push(E)}const d=[];for(const C of t.nwcConnections??[]){const E=yield e_.call(this,C);d.push(E)}const f=[];for(const C of t.cashuMints??[]){const E=yield Xv.call(this,C);f.push(E)}const A=t.selectedIdentityId?yield this.encrypt(t.selectedIdentityId):null,p={version:this.latestVersion,salt:r,iv:i,vaultHash:n.vaultHash,identities:c,permissions:u,relays:l,nwcConnections:d,cashuMints:f,selectedIdentityId:A};yield this.getBrowserSyncHandler().saveAndSetFullData(p),yield this.getBrowserSessionHandler().saveFullData(t),console.log("Vault migrated from v1 (PBKDF2) to v2 (Argon2id)")})).apply(this,arguments)}const Fle=function(){var e=I(function*(n){this.assureIsInitialized();const t=this.getBrowserSyncHandler().browserSyncData,r=this.getBrowserSessionHandler().browserSessionData;if(!t||!r)throw new Error("Vault must be unlocked to change password");const i=yield zi.hash(n),o=Yv(),s=Wv(),a=yn.Buffer.from(o,"base64"),c=yield Pu(n,a),l=yn.Buffer.from(c).toString("base64");r.salt=o,r.iv=s,r.vaultKey=l,r.vaultPassword=void 0;const u=[];for(const Q of r.identities)u.push(yield Rv.call(this,Q));const d=[];for(const Q of r.relays)d.push(yield t_.call(this,Q));const f=[];for(const Q of r.permissions)f.push({id:yield this.encrypt(Q.id),identityId:yield this.encrypt(Q.identityId),host:yield this.encrypt(Q.host),method:yield this.encrypt(Q.method),methodPolicy:yield this.encrypt(Q.methodPolicy),kind:void 0!==Q.kind?yield this.encrypt(Q.kind.toString()):void 0});const A=[];for(const Q of r.nwcConnections??[])A.push(yield e_.call(this,Q));const p=[];for(const Q of r.cashuMints??[])p.push(yield Xv.call(this,Q));const C=r.selectedIdentityId?yield this.encrypt(r.selectedIdentityId):null,E={version:this.latestVersion,salt:o,iv:s,vaultHash:i,identities:u,permissions:f,relays:d,nwcConnections:A,cashuMints:p,selectedIdentityId:C};yield this.getBrowserSyncHandler().saveAndSetFullData(E),yield this.getBrowserSessionHandler().saveFullData(r)});return function(t){return e.apply(this,arguments)}}(),Nle=function(){var e=I(function*(n){if(this.assureIsInitialized(),typeof this.getSignerMetaHandler().signerMetaData?.syncFlow>"u")throw new Error("Sync flow is not set.");yield this.getBrowserSyncHandler().clearData(),yield this.getBrowserSessionHandler().clearData(),n||(this.isInitialized=!1)});return function(t){return e.apply(this,arguments)}}();let lr=(()=>{class e{latestVersion=2;isInitialized=!1;#e;#t;#n;#r;initialize(t){this.isInitialized||(this.#e=t.browserSessionHandler,this.#t=t.browserSyncYesHandler,this.#n=t.browserSyncNoHandler,this.#r=t.signerMetaHandler,this.isInitialized=!0)}enableBrowserSyncFlow(t){var r=this;return I(function*(){r.assureIsInitialized(),r.#r.setSyncFlow(t)})()}loadExtensionSettings(){var t=this;return I(function*(){t.assureIsInitialized();const r=yield t.#r.loadFullData();if(0!==Object.keys(r).length)return t.#r.setFullData(r),r})()}loadSignerMetaData(){var t=this;return I(function*(){return t.loadExtensionSettings()})()}loadVaultSession(){var t=this;return I(function*(){t.assureIsInitialized();const r=yield t.#e.loadFullData();if(r.iv&&r.identities)return t.#e.setFullData(r),r})()}loadBrowserSessionData(){var t=this;return I(function*(){return t.loadVaultSession()})()}loadAndMigrateEncryptedVault(){var t=this;return I(function*(){t.assureIsInitialized();const r=yield t.getBrowserSyncHandler().loadUnmigratedData(),{encryptedVault:i,migrationWasPerformed:o}=t.#a(r);if(i)return o?t.getBrowserSyncHandler().saveAndSetFullData(i):t.getBrowserSyncHandler().setFullData(i),i})()}loadAndMigrateBrowserSyncData(){var t=this;return I(function*(){return t.loadAndMigrateEncryptedVault()})()}deleteVault(){var t=this;return I(function*(r=!1){yield Nle.call(t,r)}).apply(this,arguments)}resetExtension(){var t=this;return I(function*(){t.assureIsInitialized(),yield t.getBrowserSyncHandler().clearData(),yield t.getBrowserSessionHandler().clearData(),yield t.getSignerMetaHandler().clearData([]),t.isInitialized=!1})()}lockVault(){var t=this;return I(function*(){t.assureIsInitialized(),yield t.getBrowserSessionHandler().clearData(),t.getBrowserSessionHandler().clearInMemoryData()})()}unlockVault(t){var r=this;return I(function*(){yield kle.call(r,t)})()}createNewVault(t){var r=this;return I(function*(){yield Sle.call(r,t)})()}changePassword(t){var r=this;return I(function*(){yield Fle.call(r,t)})()}addIdentity(t){var r=this;return I(function*(){yield Xse.call(r,t)})()}deleteIdentity(t){var r=this;return I(function*(){yield eae.call(r,t)})()}switchIdentity(t){var r=this;return I(function*(){yield tae.call(r,t)})()}deletePermission(t){var r=this;return I(function*(){yield iae.call(r,t)})()}addRelay(t){var r=this;return I(function*(){yield vle.call(r,t)})()}deleteRelay(t){var r=this;return I(function*(){yield _le.call(r,t)})()}updateRelay(t){var r=this;return I(function*(){yield ble.call(r,t)})()}addNwcConnection(t){var r=this;return I(function*(){yield Cle.call(r,t)})()}deleteNwcConnection(t){var r=this;return I(function*(){yield yle.call(r,t)})()}updateNwcConnectionBalance(t,r){var i=this;return I(function*(){yield Ele.call(i,t,r)})()}addCashuMint(t){var r=this;return I(function*(){return yield gle.call(r,t)})()}deleteCashuMint(t){var r=this;return I(function*(){yield hle.call(r,t)})()}updateCashuMintProofs(t,r){var i=this;return I(function*(){yield ple.call(i,t,r)})()}exportVault(){return this.assureIsInitialized(),JSON.stringify(this.getBrowserSyncHandler().encryptedVault,void 0,4)}importVault(t){var r=this;return I(function*(){if(r.assureIsInitialized(),!r.#o(t))throw new Error("The imported data is not valid.");yield r.getBrowserSyncHandler().saveAndSetFullData(t)})()}getBrowserSyncHandler(){return this.assureIsInitialized(),this.#r.extensionSettings?.syncFlow===yc.NO_SYNC?this.#n:this.#t}getBrowserSessionHandler(){return this.assureIsInitialized(),this.#e}getSignerMetaHandler(){return this.assureIsInitialized(),this.#r}getSyncFlow(){return this.isInitialized&&this.#r?.extensionSettings?this.#r.extensionSettings.syncFlow??yc.NO_SYNC:yc.NO_SYNC}assureIsInitialized(){if(!this.isInitialized)throw new Error('StorageService is not initialized. Please call "initialize(...)" before doing anything else.')}encrypt(t){var r=this;return I(function*(){const i=r.getBrowserSessionHandler().vaultSession;if(!i)throw new Error("Vault session is undefined.");if(i.vaultKey)return r.encryptV2(t,i.iv,i.vaultKey);if(!i.vaultPassword)throw new Error("No vault password or key available.");return zi.encrypt(t,i.iv,i.vaultPassword)})()}encryptV2(t,r,i){return I(function*(){const o=yn.Buffer.from(i,"base64"),s=yn.Buffer.from(r,"base64"),a=yield crypto.subtle.importKey("raw",o,{name:"AES-GCM"},!1,["encrypt"]),c=yield crypto.subtle.encrypt({name:"AES-GCM",iv:s},a,(new TextEncoder).encode(t));return yn.Buffer.from(c).toString("base64")})()}decrypt(t,r){var i=this;return I(function*(){const o=i.getBrowserSessionHandler().vaultSession;if(!o)throw new Error("Vault session is undefined.");if(o.vaultKey){const s=yield i.decryptV2(t,o.iv,o.vaultKey);return i.parseDecryptedValue(s,r)}if(!o.vaultPassword)throw new Error("No vault password or key available.");return i.decryptWithLockedVault(t,r,o.iv,o.vaultPassword)})()}decryptV2(t,r,i){return I(function*(){const o=yn.Buffer.from(i,"base64"),s=yn.Buffer.from(r,"base64"),a=yn.Buffer.from(t,"base64"),c=yield crypto.subtle.importKey("raw",o,{name:"AES-GCM"},!1,["decrypt"]),l=yield crypto.subtle.decrypt({name:"AES-GCM",iv:s},c,a);return(new TextDecoder).decode(l)})()}parseDecryptedValue(t,r){switch(r){case"number":return parseInt(t);case"boolean":return"true"===t;default:return t}}decryptWithLockedVault(t,r,i,o){var s=this;return I(function*(){const a=yield zi.decrypt(t,i,o);return s.parseDecryptedValue(a,r)})()}decryptWithLockedVaultV2(t,r,i,o){var s=this;return I(function*(){const a=yield s.decryptV2(t,i,o);return s.parseDecryptedValue(a,r)})()}#a(t){return 0===Object.keys(t).length?{encryptedVault:void 0,migrationWasPerformed:!1}:{encryptedVault:t,migrationWasPerformed:!1}}#o(t){return!(typeof t.iv>"u"||"number"!=typeof t.version||typeof t.vaultHash>"u"||typeof t.selectedIdentityId>"u"||typeof t.identities>"u"||!Array.isArray(t.identities)||typeof t.permissions>"u"||!Array.isArray(t.permissions)||typeof t.relays>"u"||!Array.isArray(t.relays))}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Oc="extensionLogs";let Si=(()=>{class e{#e;#t=[];#n=500;get logs(){return this.#t}initialize(t){var r=this;return I(function*(){r.#e=t,yield r.#r()})()}#r(){var t=this;return I(function*(){try{if(typeof chrome<"u"&&chrome.storage?.session){const r=yield chrome.storage.session.get(Oc);r[Oc]&&(t.#t=r[Oc].map(i=>({...i,timestamp:new Date(i.timestamp)})))}}catch(r){console.error("Failed to load logs from storage:",r)}})()}#a(){var t=this;return I(function*(){try{if(typeof chrome<"u"&&chrome.storage?.session){const r=t.#t.map(i=>({...i,timestamp:i.timestamp.toISOString()}));yield chrome.storage.session.set({[Oc]:r})}}catch(r){console.error("Failed to save logs to storage:",r)}})()}refreshLogs(){var t=this;return I(function*(){yield t.#r()})()}log(t,r){this.#i(),this.#o("log","system","\u{1f4dd}",t,r),this.#s("log",t)}warn(t,r){this.#i(),this.#o("warn","system","\u26a0\ufe0f",t,r),this.#s("warn",t)}error(t,r){this.#i(),this.#o("error","system","\u274c",t,r),this.#s("error",t)}debug(t,r){this.#i(),this.#o("debug","system","\u{1f50d}",t,r),this.#s("debug",t)}logNip07Action(t,r,i,o,s){this.#i();const c=i?"\u2705":"\u{1f6ab}";let l=`${t} from ${r} - ${o?"auto-approved":i?"approved":"denied"}`;void 0!==s?.kind&&(l+=` (kind: ${s.kind})`),this.#o("log","nip07",c,l,{method:t,host:r,approved:i,autoApproved:o,...s}),this.#s("log",l)}logNip07GetPublicKey(t,r,i){this.logNip07Action("getPublicKey",t,r,i)}logNip07SignEvent(t,r,i,o){this.logNip07Action("signEvent",t,i,o,{kind:r})}logNip07Encrypt(t,r,i,o,s){this.logNip07Action(t,r,i,o,{peerPubkey:s})}logNip07Decrypt(t,r,i,o,s){this.logNip07Action(t,r,i,o,{peerPubkey:s})}logNip07GetRelays(t,r,i){this.logNip07Action("getRelays",t,r,i)}logPermissionStored(t,r,i,o){this.#i();let a=`Permission stored: ${r} for ${t} - ${i}`;void 0!==o&&(a+=` (kind: ${o})`),this.#o("log","permission","allow"===i?"\u{1f513}":"\u{1f512}",a,{host:t,method:r,policy:i,kind:o}),this.#s("log",a)}logPermissionDeleted(t,r,i){this.#i();let o=`Permission deleted: ${r} for ${t}`;void 0!==i&&(o+=` (kind: ${i})`),this.#o("log","permission","\u{1f5d1}\ufe0f",o,{host:t,method:r,kind:i}),this.#s("log",o)}logVaultUnlock(){this.#i(),this.#o("log","vault","\u{1f513}","Vault unlocked",void 0),this.#s("log","Vault unlocked")}logVaultLock(){this.#i(),this.#o("log","vault","\u{1f512}","Vault locked",void 0),this.#s("log","Vault locked")}logVaultCreated(){this.#i(),this.#o("log","vault","\u{1f195}","Vault created",void 0),this.#s("log","Vault created")}logVaultExport(t){this.#i(),this.#o("log","vault","\u{1f4e4}",`Vault exported: ${t}`,{fileName:t}),this.#s("log",`Vault exported: ${t}`)}logVaultImport(t){this.#i(),this.#o("log","vault","\u{1f4e5}",`Vault imported: ${t}`,{fileName:t}),this.#s("log",`Vault imported: ${t}`)}logVaultReset(){this.#i(),this.#o("warn","vault","\u{1f5d1}\ufe0f","Extension reset",void 0),this.#s("warn","Extension reset")}logProfileFetchError(t,r){this.#i();const i=t.substring(0,8)+"...";this.#o("error","profile","\u{1f464}",`Failed to fetch profile for ${i}: ${r}`,{pubkey:t,error:r}),this.#s("error",`Failed to fetch profile for ${i}: ${r}`)}logProfileParseError(t){this.#i();const r=t.substring(0,8)+"...";this.#o("error","profile","\u{1f464}",`Failed to parse profile content for ${r}`,{pubkey:t}),this.#s("error",`Failed to parse profile content for ${r}`)}logNip05ValidationError(t,r){this.#i(),this.#o("error","profile","\u{1f517}",`NIP-05 validation failed for ${t}: ${r}`,{nip05:t,error:r}),this.#s("error",`NIP-05 validation failed for ${t}: ${r}`)}logNip05ValidationSuccess(t,r){this.#i();const i=r.substring(0,8)+"...";this.#o("log","profile","\u2713",`NIP-05 verified: ${t} \u2192 ${i}`,{nip05:t,pubkey:r}),this.#s("log",`NIP-05 verified: ${t} \u2192 ${i}`)}logProfileEdit(t,r){this.#i(),this.#o("log","profile","\u270f\ufe0f",`Profile edited: ${t} - ${r}`,{identityNick:t,field:r}),this.#s("log",`Profile edited: ${t} - ${r}`)}logIdentityCreated(t){this.#i(),this.#o("log","profile","\u{1f195}",`Identity created: ${t}`,{nick:t}),this.#s("log",`Identity created: ${t}`)}logIdentityDeleted(t){this.#i(),this.#o("warn","profile","\u{1f5d1}\ufe0f",`Identity deleted: ${t}`,{nick:t}),this.#s("warn",`Identity deleted: ${t}`)}logIdentitySelected(t){this.#i(),this.#o("log","profile","\u{1f446}",`Identity selected: ${t}`,{nick:t}),this.#s("log",`Identity selected: ${t}`)}logBookmarkAdded(t,r){this.#i(),this.#o("log","bookmark","\u{1f516}",`Bookmark added: ${r}`,{url:t,title:r}),this.#s("log",`Bookmark added: ${r}`)}logBookmarkRemoved(t,r){this.#i(),this.#o("log","bookmark","\u{1f5d1}\ufe0f",`Bookmark removed: ${r}`,{url:t,title:r}),this.#s("log",`Bookmark removed: ${r}`)}logRelayFetchError(t,r){this.#i(),this.#o("error","system","\u{1f4e1}",`Failed to fetch relays for ${t}: ${r}`,{identityNick:t,error:r}),this.#s("error",`Failed to fetch relays for ${t}: ${r}`)}logStorageError(t,r){this.#i(),this.#o("error","system","\u{1f4be}",`Storage error (${t}): ${r}`,{operation:t,error:r}),this.#s("error",`Storage error (${t}): ${r}`)}logCryptoError(t,r){this.#i(),this.#o("error","system","\u{1f510}",`Crypto error (${t}): ${r}`,{operation:t,error:r}),this.#s("error",`Crypto error (${t}): ${r}`)}clear(){var t=this;return I(function*(){t.#t=[],yield t.#a()})()}#o(t,r,i,o,s){const a={timestamp:new Date,level:t,category:r,icon:i,message:"string"==typeof o?o:JSON.stringify(o),data:s};this.#t.unshift(a),this.#t.length>this.#n&&this.#t.pop(),this.#a()}#s(t,r){}#i(){if(!this.#e)throw new Error("LoggerService not initialized. Please call initialize(..) first.")}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Uu=(()=>{class e{#e=de(Si);#t=de(lr);#n=de(An);startOver(t){var r=this;return I(function*(){r.#t.initialize(t),t.browserSyncNoHandler.setIgnoreProperties(t.signerMetaHandler.metaProperties);const i=yield r.#t.loadSignerMetaData();if(typeof i?.syncFlow>"u")return yield r.#t.enableBrowserSyncFlow(yc.NO_SYNC),void r.#n.navigateByUrl("/vault-create/home");r.#t.enableBrowserSyncFlow(i.syncFlow),(yield r.#t.loadBrowserSessionData())?yield r.#a():yield r.#r()})()}#r(){var t=this;return I(function*(){t.#e.log("No browser session data available."),(yield t.#t.loadAndMigrateBrowserSyncData())?t.#n.navigateByUrl("/vault-login"):t.#n.navigateByUrl("/vault-create/home")})()}#a(){var t=this;return I(function*(){t.#e.log("Browser session data is available."),yield t.#t.loadAndMigrateBrowserSyncData();const r=t.#t.getBrowserSessionHandler().browserSessionData?.selectedIdentityId;t.#n.navigateByUrl("/home/"+(r?"identity":"identities"))})()}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const rP={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let nm;const xle=new Uint8Array(16);function Tle(){if(!nm&&(nm=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!nm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return nm(xle)}const Fr=[];for(let e=0;e<256;++e)Fr.push((e+256).toString(16).slice(1));const Ple=function Rle(e,n,t){if(rP.randomUUID&&!n&&!e)return rP.randomUUID();const r=(e=e||{}).random||(e.rng||Tle)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){t=t||0;for(let i=0;i<16;++i)n[t+i]=r[i];return n}return function iP(e,n=0){return Fr[e[n+0]]+Fr[e[n+1]]+Fr[e[n+2]]+Fr[e[n+3]]+"-"+Fr[e[n+4]]+Fr[e[n+5]]+"-"+Fr[e[n+6]]+Fr[e[n+7]]+"-"+Fr[e[n+8]]+Fr[e[n+9]]+"-"+Fr[e[n+10]]+Fr[e[n+11]]+Fr[e[n+12]]+Fr[e[n+13]]+Fr[e[n+14]]+Fr[e[n+15]]}(r)};class Ule{get extensionSettings(){return this.#e}get signerMetaData(){return this.#e}#e;metaProperties=["syncFlow","vaultSnapshots","maxBackups","recklessMode","whitelistedHosts","bookmarks","devMode"];DEFAULT_MAX_BACKUPS=5;setFullData(n){this.#e=n}setSyncFlow(n){var t=this;return I(function*(){t.#e?t.#e.syncFlow=n:t.#e={syncFlow:n},yield t.saveFullData(t.#e)})()}setBrowserSyncFlow(n){var t=this;return I(function*(){return t.setSyncFlow(n)})()}setRecklessMode(n){var t=this;return I(function*(){t.#e?t.#e.recklessMode=n:t.#e={recklessMode:n},yield t.saveFullData(t.#e)})()}setDevMode(n){var t=this;return I(function*(){t.#e?t.#e.devMode=n:t.#e={devMode:n},yield t.saveFullData(t.#e)})()}addWhitelistedHost(n){var t=this;return I(function*(){if(t.#e){const r=t.#e.whitelistedHosts??[];r.includes(n)||(r.push(n),t.#e.whitelistedHosts=r)}else t.#e={whitelistedHosts:[n]};yield t.saveFullData(t.#e)})()}removeWhitelistedHost(n){var t=this;return I(function*(){t.#e?.whitelistedHosts&&(t.#e.whitelistedHosts=t.#e.whitelistedHosts.filter(r=>r!==n),yield t.saveFullData(t.#e))})()}setBookmarks(n){var t=this;return I(function*(){t.#e?t.#e.bookmarks=n:t.#e={bookmarks:n},yield t.saveFullData(t.#e)})()}getBookmarks(){return this.#e?.bookmarks??[]}getMaxBackups(){return this.#e?.maxBackups??this.DEFAULT_MAX_BACKUPS}setMaxBackups(n){var t=this;return I(function*(){const r=Math.max(1,Math.min(20,n));t.#e?t.#e.maxBackups=r:t.#e={maxBackups:r},yield t.saveFullData(t.#e)})()}getBackups(){return[...this.#e?.vaultSnapshots??[]].sort((t,r)=>new Date(r.createdAt).getTime()-new Date(t.createdAt).getTime())}getBackupById(n){return this.#e?.vaultSnapshots?.find(t=>t.id===n)}createBackup(n){var t=this;return I(function*(r,i="manual"){const o=new Date,s=o.toISOString().replace(/[:.]/g,"-").slice(0,19),a=r.identities?.length??0,c={id:Ple(),fileName:`Vault Backup - ${s}`,createdAt:o.toISOString(),data:JSON.parse(JSON.stringify(r)),identityCount:a,reason:i};if(t.#e){const l=t.#e.vaultSnapshots??[];l.push(c);const u=t.getMaxBackups(),d=l.filter(p=>"auto"===p.reason),f=l.filter(p=>"auto"!==p.reason);d.sort((p,C)=>new Date(C.createdAt).getTime()-new Date(p.createdAt).getTime());const A=d.slice(0,u);t.#e.vaultSnapshots=[...f,...A]}else t.#e={vaultSnapshots:[c]};return yield t.saveFullData(t.#e),c}).apply(this,arguments)}deleteBackup(n){var t=this;return I(function*(){if(!t.#e?.vaultSnapshots)return!1;const r=t.#e.vaultSnapshots.length;return t.#e.vaultSnapshots=t.#e.vaultSnapshots.filter(i=>i.id!==n),t.#e.vaultSnapshots.length<r&&(yield t.saveFullData(t.#e),!0)})()}getBackupData(n){return this.getBackupById(n)?.data}}var Hle=L(8244),nn=L.n(Hle);class oP extends Ule{loadFullData(){var n=this;return I(function*(){const t=yield nn().storage.local.get(null);if(0===Object.keys(t).length)return t;const r={};return n.metaProperties.forEach(i=>{r[i]=t[i]}),r})()}saveFullData(n){return I(function*(){yield nn().storage.local.set(n)})()}clearData(n){var t=this;return I(function*(){const r=[];for(const i of t.metaProperties)n.includes(i)||r.push(i);yield nn().storage.local.remove(t.metaProperties)})()}}class Lle{get vaultSession(){return this.#e}get browserSessionData(){return this.#e}#e;setFullData(n){this.#e=JSON.parse(JSON.stringify(n))}clearInMemoryData(){this.#e=void 0}}class Gle extends Lle{loadFullData(){return I(function*(){return nn().storage.session.get(null)})()}saveFullData(n){return I(function*(){yield nn().storage.session.set(n)})()}clearData(){return I(function*(){yield nn().storage.session.clear()})()}}class sP{get encryptedVault(){return this.#e}get browserSyncData(){return this.#e}get ignoreProperties(){return this.#t}#e;#t=[];setIgnoreProperties(n){this.#t=n}setFullData(n){this.#e=JSON.parse(JSON.stringify(n))}setPartialData_Permissions(n){this.#e&&(this.#e.permissions=Array.from(n.permissions))}setPartialData_Identities(n){this.#e&&(this.#e.identities=Array.from(n.identities))}setPartialData_SelectedIdentityId(n){this.#e&&(this.#e.selectedIdentityId=n.selectedIdentityId)}setPartialData_Relays(n){this.#e&&(this.#e.relays=Array.from(n.relays))}setPartialData_NwcConnections(n){this.#e&&(this.#e.nwcConnections=Array.from(n.nwcConnections))}setPartialData_CashuMints(n){this.#e&&(this.#e.cashuMints=Array.from(n.cashuMints))}}class Vle extends sP{loadUnmigratedData(){var n=this;return I(function*(){const t=yield nn().storage.local.get(null);return n.ignoreProperties.forEach(r=>{delete t[r]}),t})()}saveAndSetFullData(n){var t=this;return I(function*(){yield nn().storage.local.set(n),t.setFullData(n)})()}saveAndSetPartialData_Permissions(n){var t=this;return I(function*(){yield nn().storage.local.set(n),t.setPartialData_Permissions(n)})()}saveAndSetPartialData_Identities(n){var t=this;return I(function*(){yield nn().storage.local.set(n),t.setPartialData_Identities(n)})()}saveAndSetPartialData_SelectedIdentityId(n){var t=this;return I(function*(){yield nn().storage.local.set(n),t.setPartialData_SelectedIdentityId(n)})()}saveAndSetPartialData_Relays(n){var t=this;return I(function*(){yield nn().storage.local.set(n),t.setPartialData_Relays(n)})()}saveAndSetPartialData_NwcConnections(n){var t=this;return I(function*(){yield nn().storage.local.set(n),t.setPartialData_NwcConnections(n)})()}saveAndSetPartialData_CashuMints(n){var t=this;return I(function*(){yield nn().storage.local.set(n),t.setPartialData_CashuMints(n)})()}clearData(){var n=this;return I(function*(){const t=Object.keys(yield n.loadUnmigratedData());yield nn().storage.local.remove(t)})()}}class qle extends sP{loadUnmigratedData(){return I(function*(){return yield nn().storage.sync.get(null)})()}saveAndSetFullData(n){var t=this;return I(function*(){yield nn().storage.sync.set(n),t.setFullData(n)})()}saveAndSetPartialData_Permissions(n){var t=this;return I(function*(){yield nn().storage.sync.set(n),t.setPartialData_Permissions(n)})()}saveAndSetPartialData_Identities(n){var t=this;return I(function*(){yield nn().storage.sync.set(n),t.setPartialData_Identities(n)})()}saveAndSetPartialData_SelectedIdentityId(n){var t=this;return I(function*(){yield nn().storage.sync.set(n),t.setPartialData_SelectedIdentityId(n)})()}saveAndSetPartialData_Relays(n){var t=this;return I(function*(){yield nn().storage.sync.set(n),t.setPartialData_Relays(n)})()}saveAndSetPartialData_NwcConnections(n){var t=this;return I(function*(){yield nn().storage.sync.set(n),t.setPartialData_NwcConnections(n)})()}saveAndSetPartialData_CashuMints(n){var t=this;return I(function*(){yield nn().storage.sync.set(n),t.setPartialData_CashuMints(n)})()}clearData(){return I(function*(){yield nn().storage.sync.clear()})()}}const Hu=()=>({browserSessionHandler:new Gle,browserSyncYesHandler:new qle,browserSyncNoHandler:new Vle,signerMetaHandler:new oP});function zle(e,n){if(1&e&&(y(0,"option",13),R(1),v()),2&e){const t=n.$implicit;gt("ngValue",t),J(),Zt(" ",t.fileName," ")}}function Kle(e,n){if(1&e){const t=pt();y(0,"select",12),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.selectedSnapshot,i)||(o.selectedSnapshot=i),De(i)}),Rr(1,zle,2,2,"option",13,eu),v(),y(3,"button",14),_e("click",function(){return Qe(t),De(Ee().onClickImport())}),R(4," Import selected vault "),v()}if(2&e){const t=Ee();sn("ngModel",t.selectedSnapshot),J(),Pr(t.snapshots),J(2),gt("disabled",!t.selectedSnapshot)}}function Jle(e,n){1&e&&(y(0,"span",10),R(1,"No vault snapshots available"),v())}let jle=(()=>{class e{router=de(An);#e=de(lr);#t=de(Uu);snapshots=[];selectedSnapshot;ngOnInit(){this.#n()}#n(){var t=this;return I(function*(){const r=yield nn().storage.local.get("vaultSnapshots");t.snapshots=(r.vaultSnapshots??[]).sortBy(i=>i.fileName,"desc"),t.selectedSnapshot=t.snapshots[0]})()}onClickImport(){var t=this;return I(function*(){if(t.selectedSnapshot)try{yield t.#e.deleteVault(!0),yield t.#e.importVault(t.selectedSnapshot.data),t.#e.isInitialized=!1,t.#t.startOver(Hu())}catch(r){console.log(r)}})()}openOptionsPage(){nn().runtime.openOptionsPage()}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-vault-create-home"]],decls:18,vars:1,consts:[[1,"vertically-centered"],[1,"sam-flex-column","center"],[1,"sam-flex-column","gap",2,"align-items","center"],[1,"title"],[1,"logo-frame"],["src","logo.svg","height","120","width","120","alt",""],["type","button",1,"sam-mt-2","btn","btn-primary",3,"click"],[1,"sam-flex-row","gap-h"],[1,"bi","bi-plus-circle",2,"height","22px"],[1,"sam-text-muted"],[1,"sam-text-muted","sam-text-sm"],["type","button",1,"btn","btn-secondary",3,"click"],[1,"form-select","sam-text-sm",3,"ngModelChange","ngModel"],[3,"ngValue"],[1,"btn","btn-primary",3,"click","disabled"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),R(4,"Smesh Signer"),v(),y(5,"div",4),ot(6,"img",5),v(),y(7,"button",6),_e("click",function(){return i.router.navigateByUrl("/vault-create/new")}),y(8,"div",7),ot(9,"i",8),y(10,"span"),R(11,"Create a new vault"),v()()(),y(12,"span",9),R(13,"or"),v(),At(14,Kle,5,2)(15,Jle,2,0,"span",10),y(16,"button",11),_e("click",function(){return i.openOptionsPage()}),R(17," Import vault snapshot "),v()()()()),2&r&&(J(14),tt(i.snapshots.length>0?14:15))},dependencies:[Ko,rw,ow,tf,Co,qi],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n[_nghost-%COMP%] .vertically-centered[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n[_nghost-%COMP%] .title[_ngcontent-%COMP%] {\n font-size: 20px;\n font-weight: 500;\n margin-bottom: var(--size);\n}\n[_nghost-%COMP%] .sync-note[_ngcontent-%COMP%] {\n font-size: 12px;\n text-align: center;\n}\n[_nghost-%COMP%] .link-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n color: var(--muted-foreground);\n font-size: 0.8rem;\n cursor: pointer;\n padding: 4px 8px;\n margin-top: 4px;\n}\n[_nghost-%COMP%] .link-btn[_ngcontent-%COMP%]:hover {\n color: var(--foreground);\n text-decoration: underline;\n}\n[_nghost-%COMP%] .file-input[_ngcontent-%COMP%] {\n position: absolute;\n visibility: hidden;\n}"]})}return e})();class Nr{#e=de(An);storage=de(lr);devMode=!1;constructor(){this.devMode=this.storage.getSignerMetaHandler().signerMetaData?.devMode??!1}navigateBack(){window.history.back()}navigate(n){this.#e.navigate([n])}onTestPrompt(){const n={kind:1,content:"This is a test note for permission prompt preview.",tags:[],created_at:Math.floor(Date.now()/1e3)},t=yn.Buffer.from(JSON.stringify(n,null,2)).toString("base64"),i=this.storage.getBrowserSessionHandler().browserSessionData?.identities.find(l=>l.id===this.storage.getBrowserSessionHandler().browserSessionData?.selectedIdentityId)?.nick??"Test Identity",a=Math.round((screen.width-375)/2),c=Math.round((screen.height-600)/2);chrome.windows.create({type:"popup",url:`prompt.html?method=signEvent&host=example.com&id=test-${Date.now()}&nick=${encodeURIComponent(i)}&event=${t}`,width:375,height:600,left:a,top:c})}}function Yle(e,n){if(1&e&&(y(0,"div",0)(1,"div",1),ot(2,"div",2),y(3,"h3"),R(4),v(),y(5,"p",3),R(6,"This may take a few seconds"),v()()()),2&e){const t=Ee();J(4),ft(t.message)}}let aP=(()=>{class e{visible=!1;message="Deriving encryption key";show(t){t&&(this.message=t),this.visible=!0}hide(){this.visible=!1}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-deriving-modal"]],decls:1,vars:1,consts:[[1,"deriving-overlay"],[1,"deriving-modal"],[1,"deriving-spinner"],[1,"deriving-note"]],template:function(r,i){1&r&&At(0,Yle,7,1,"div",0),2&r&&tt(i.visible?0:-1)},styles:[".deriving-overlay[_ngcontent-%COMP%] {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n backdrop-filter: blur(4px);\n}\n\n.deriving-modal[_ngcontent-%COMP%] {\n background: #1a1a1a;\n border-radius: 12px;\n padding: 2rem;\n text-align: center;\n min-width: 280px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);\n border: 1px solid #3d3d3d;\n}\n.deriving-modal[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 1rem 0 0.5rem;\n color: #fafafa;\n font-size: 1.1rem;\n font-weight: 600;\n}\n\n.deriving-note[_ngcontent-%COMP%] {\n margin: 0.5rem 0 0;\n color: #a1a1a1;\n font-size: 0.85rem;\n}\n\n.deriving-spinner[_ngcontent-%COMP%] {\n width: 48px;\n height: 48px;\n border: 4px solid #3d3d3d;\n border-top-color: #f59e0b;\n border-radius: 50%;\n animation: _ngcontent-%COMP%_spin 1s linear infinite;\n margin: 0 auto;\n}\n\n@keyframes _ngcontent-%COMP%_spin {\n to {\n transform: rotate(360deg);\n }\n}"]})}return e})();const Wle=["derivingModal"];let $le=(()=>{class e extends Nr{derivingModal;password="";#e=de(An);#t=de(lr);#n=de(Si);toggleType(t){t.type="password"===t.type?"text":"password"}createVault(){var t=this;return I(function*(){if(t.password){t.derivingModal.show("Creating secure vault");try{yield t.#t.createNewVault(t.password),t.derivingModal.hide(),t.#n.logVaultCreated(),t.#e.navigateByUrl("/home/identities")}catch(r){t.derivingModal.hide(),console.error("Failed to create vault:",r)}}})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-new"]],viewQuery:function(r,i){if(1&r&&uc(Wle,5),2&r){let o;Zs(o=Xs())&&(i.derivingModal=o.first)}},features:[Nt],decls:20,vars:6,consts:[["derivingModal",""],["passwordInputElement",""],[1,"sam-text-header"],[1,"content"],[1,"sam-flex-column","gap",2,"align-items","center"],[1,"logo-frame"],["src","logo.svg","height","120","width","120","alt",""],[1,"sam-mt-2"],[1,"sam-text-muted"],[1,"sam-mt","input-group"],["type","password","placeholder","vault password",1,"form-control","form-control-lg",2,"font-size","1rem",3,"ngModelChange","ngModel"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"bi","bi-eye"],["type","button",1,"sam-mt","btn","btn-primary",3,"click","disabled"]],template:function(r,i){if(1&r){const o=pt();ot(0,"app-deriving-modal",null,0),y(2,"div",2)(3,"span"),R(4,"Smesh Signer"),v()(),y(5,"div",3)(6,"div",4)(7,"div",5),ot(8,"img",6),v(),y(9,"span",7),R(10," Please define a password for your vault. "),v(),y(11,"small",8),R(12," Sensitive data is encypted before it is stored. "),v(),y(13,"div",9)(14,"input",10,1),an("ngModelChange",function(a){return Qe(o),dn(i.password,a)||(i.password=a),De(a)}),v(),y(16,"button",11),_e("click",function(){Qe(o);const a=Dn(15);return De(i.toggleType(a))}),ot(17,"i",12),v()(),y(18,"button",13),_e("click",function(){return Qe(o),De(i.createVault())}),R(19," Create vault "),v()()()}if(2&r){const o=Dn(15);J(14),sn("ngModel",i.password),J(3),er("bi-eye","password"===o.type)("bi-eye-slash","text"===o.type),J(),gt("disabled",!i.password||i.password.length<4)}},dependencies:[Ko,mo,Co,qi,aP],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n color-scheme: dark;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] {\n padding-top: var(--size);\n padding-bottom: var(--size);\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: auto;\n align-items: center;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .back[_ngcontent-%COMP%] {\n grid-column-start: 1;\n grid-column-end: 2;\n grid-row-start: 1;\n grid-row-end: 2;\n justify-self: start;\n padding-left: var(--size);\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] {\n grid-column-start: 1;\n grid-column-end: 2;\n grid-row-start: 1;\n grid-row-end: 2;\n font-size: 20px;\n font-weight: 500;\n justify-self: center;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n padding: 0 var(--size) var(--size) var(--size);\n}"]})}return e})(),Zle=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-home"]],decls:18,vars:0,consts:[[1,"tab-content"],[1,"tabs"],["routerLink","/home/identity","routerLinkActive","active","title","You",1,"tab"],[1,"emoji"],["routerLink","/home/identities","routerLinkActive","active","title","Identities",1,"tab"],["routerLink","/home/wallet","routerLinkActive","active","title","Wallet",1,"tab"],["routerLink","/home/bookmarks","routerLinkActive","active","title","Bookmarks",1,"tab"],["routerLink","/home/settings","routerLinkActive","active","title","Settings",1,"tab"]],template:function(r,i){1&r&&(y(0,"div",0),ot(1,"router-outlet"),v(),y(2,"div",1)(3,"a",2)(4,"span",3),R(5,"\u{1f464}"),v()(),y(6,"a",4)(7,"span",3),R(8,"\u{1f465}"),v()(),y(9,"a",5)(10,"span",3),R(11,"\u{1f4b0}"),v()(),y(12,"a",6)(13,"span",3),R(14,"\u{1f516}"),v()(),y(15,"a",7)(16,"span",3),R(17,"\u2699\ufe0f"),v()()())},dependencies:[du,wee,vp,Lx],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n[_nghost-%COMP%] .tab-content[_ngcontent-%COMP%] {\n height: calc(100% - 48px);\n}\n[_nghost-%COMP%] .tabs[_ngcontent-%COMP%] {\n height: 48px;\n min-height: 48px;\n background: var(--background-light);\n display: flex;\n flex-direction: row;\n}\n[_nghost-%COMP%] .tabs[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [_nghost-%COMP%] .tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\n all: unset;\n}\n[_nghost-%COMP%] .tabs[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%] {\n flex-grow: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--muted-foreground);\n border-top: 2px solid transparent;\n transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;\n cursor: pointer;\n}\n[_nghost-%COMP%] .tabs[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 20px;\n}\n[_nghost-%COMP%] .tabs[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%]:hover {\n background: var(--background-light-hover);\n color: var(--foreground);\n}\n[_nghost-%COMP%] .tabs[_ngcontent-%COMP%] .tab.active[_ngcontent-%COMP%] {\n color: var(--foreground);\n border-top: 2px solid var(--primary);\n}"]})}return e})();var Rc=Symbol("verified");new TextDecoder("utf-8");var tue=new TextEncoder;function wf(e){-1===e.indexOf("://")&&(e="wss://"+e);let n=new URL(e);return n.pathname=n.pathname.replace(/\/+/g,"/"),n.pathname.endsWith("/")&&(n.pathname=n.pathname.slice(0,-1)),("80"===n.port&&"ws:"===n.protocol||"443"===n.port&&"wss:"===n.protocol)&&(n.port=""),n.searchParams.sort(),n.hash="",n.toString()}var nue=class{value;next=null;prev=null;constructor(e){this.value=e}},rue=class{first;last;constructor(){this.first=null,this.last=null}enqueue(e){const n=new nue(e);return this.last?this.last===this.first?(this.last=n,this.last.prev=this.first,this.first.next=n):(n.prev=this.last,this.last.next=n,this.last=n):(this.first=n,this.last=n),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const n=this.first;return this.first=null,this.last=null,n.value}const e=this.first;return this.first=e.next,e.value}};function a_(e){let n=pa(tue.encode(function oue(e){if(!function eue(e){if(!(e=>e instanceof Object)(e)||"number"!=typeof e.kind||"string"!=typeof e.content||"number"!=typeof e.created_at||"string"!=typeof e.pubkey||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let n=0;n<e.tags.length;n++){let t=e.tags[n];if(!Array.isArray(t))return!1;for(let r=0;r<t.length;r++)if("object"==typeof t[r])return!1}return!0}(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}(e)));return wr(n)}var sue=(new class{generateSecretKey(){return jo.utils.randomPrivateKey()}getPublicKey(e){return wr(jo.getPublicKey(e))}finalizeEvent(e,n){const t=e;return t.pubkey=wr(jo.getPublicKey(n)),t.id=a_(t),t.sig=wr(jo.sign(a_(t),n)),t[Rc]=!0,t}verifyEvent(e){if("boolean"==typeof e[Rc])return e[Rc];const n=a_(e);if(n!==e.id)return e[Rc]=!1,!1;try{const t=jo.verify(e.sig,n,e.pubkey);return e[Rc]=t,t}catch{return e[Rc]=!1,!1}}}).verifyEvent;function cue(e,n){if(e.ids&&-1===e.ids.indexOf(n.id)||e.kinds&&-1===e.kinds.indexOf(n.kind)||e.authors&&-1===e.authors.indexOf(n.pubkey))return!1;for(let t in e)if("#"===t[0]){let i=e[`#${t.slice(1)}`];if(i&&!n.tags.find(([o,s])=>o===t.slice(1)&&-1!==i.indexOf(s)))return!1}return!(e.since&&n.created_at<e.since||e.until&&n.created_at>e.until)}function fue(){return c_.apply(this,arguments)}function c_(){return(c_=I(function*(){return new Promise(e=>{const n=new MessageChannel,t=()=>{n.port1.removeEventListener("message",t),e()};n.port1.addEventListener("message",t),n.port2.postMessage(0),n.port1.start()})})).apply(this,arguments)}var l_,gue=e=>(e[Rc]=!0,!0),cP=class{url;_connected=!1;onclose=null;onnotice=e=>console.debug(`NOTICE from ${this.url}: ${e}`);_onauth=null;baseEoseTimeout=4400;connectionTimeout=4400;openSubs=new Map;connectionTimeoutHandle;connectionPromise;openCountRequests=new Map;openEventPublishes=new Map;ws;incomingMessageQueue=new rue;queueRunning=!1;challenge;serial=0;verifyEvent;_WebSocket;constructor(e,n){this.url=wf(e),this.verifyEvent=n.verifyEvent,this._WebSocket=n.websocketImplementation||WebSocket}static connect(e,n){return I(function*(){const t=new cP(e,n);return yield t.connect(),t})()}closeAllSubscriptions(e){for(let[n,t]of this.openSubs)t.close(e);this.openSubs.clear();for(let[n,t]of this.openEventPublishes)t.reject(new Error(e));this.openEventPublishes.clear();for(let[n,t]of this.openCountRequests)t.reject(new Error(e));this.openCountRequests.clear()}get connected(){return this._connected}connect(){var e=this;return I(function*(){return e.connectionPromise||(e.challenge=void 0,e.connectionPromise=new Promise((n,t)=>{e.connectionTimeoutHandle=setTimeout(()=>{t("connection timed out"),e.connectionPromise=void 0,e.onclose?.(),e.closeAllSubscriptions("relay connection timed out")},e.connectionTimeout);try{e.ws=new e._WebSocket(e.url)}catch(r){return void t(r)}e.ws.onopen=()=>{clearTimeout(e.connectionTimeoutHandle),e._connected=!0,n()},e.ws.onerror=r=>{t(r.message),e._connected&&(e._connected=!1,e.connectionPromise=void 0,e.onclose?.(),e.closeAllSubscriptions("relay connection errored"))},e.ws.onclose=I(function*(){e._connected&&(e._connected=!1,e.connectionPromise=void 0,e.onclose?.(),e.closeAllSubscriptions("relay connection closed"))}),e.ws.onmessage=e._onmessage.bind(e)})),e.connectionPromise})()}runQueue(){var e=this;return I(function*(){for(e.queueRunning=!0;!1!==e.handleNext();)yield fue();e.queueRunning=!1})()}handleNext(){const e=this.incomingMessageQueue.dequeue();if(!e)return!1;const n=function due(e){let n=e.slice(0,22).indexOf('"EVENT"');if(-1===n)return null;let t=e.slice(n+7+1).indexOf('"');if(-1===t)return null;let r=n+7+1+t,i=e.slice(r+1,80).indexOf('"');return-1===i?null:e.slice(r+1,r+1+i)}(e);if(n){const t=this.openSubs.get(n);if(!t)return;const r=function uue(e,n){let t=n.length+3,r=e.indexOf(`"${n}":`)+t,i=e.slice(r).indexOf('"')+r+1;return e.slice(i,i+64)}(e,"id"),i=t.alreadyHaveEvent?.(r);if(t.receivedEvent?.(this,r),i)return}try{let t=JSON.parse(e);switch(t[0]){case"EVENT":{const r=this.openSubs.get(t[1]),i=t[2];return void(this.verifyEvent(i)&&function lue(e,n){for(let t=0;t<e.length;t++)if(cue(e[t],n))return!0;return!1}(r.filters,i)&&r.onevent(i))}case"COUNT":{const r=t[1],i=t[2],o=this.openCountRequests.get(r);return void(o&&(o.resolve(i.count),this.openCountRequests.delete(r)))}case"EOSE":{const r=this.openSubs.get(t[1]);if(!r)return;return void r.receivedEose()}case"OK":{const r=t[1],i=t[2],o=t[3],s=this.openEventPublishes.get(r);return i?s.resolve(o):s.reject(new Error(o)),void this.openEventPublishes.delete(r)}case"CLOSED":{const i=this.openSubs.get(t[1]);if(!i)return;return i.closed=!0,void i.close(t[2])}case"NOTICE":return void this.onnotice(t[1]);case"AUTH":return this.challenge=t[1],void this._onauth?.(t[1])}}catch{return}}send(e){var n=this;return I(function*(){if(!n.connectionPromise)throw new Error("sending on closed connection");n.connectionPromise.then(()=>{n.ws?.send(e)})})()}auth(e){var n=this;return I(function*(){if(!n.challenge)throw new Error("can't perform auth, no challenge was received");const t=yield e(function Aue(e,n){return{kind:22242,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",n]],content:""}}(n.url,n.challenge)),r=new Promise((i,o)=>{n.openEventPublishes.set(t.id,{resolve:i,reject:o})});return n.send('["AUTH",'+JSON.stringify(t)+"]"),r})()}publish(e){var n=this;return I(function*(){const t=new Promise((r,i)=>{n.openEventPublishes.set(e.id,{resolve:r,reject:i})});return n.send('["EVENT",'+JSON.stringify(e)+"]"),t})()}count(e,n){var t=this;return I(function*(){t.serial++;const r=n?.id||"count:"+t.serial,i=new Promise((o,s)=>{t.openCountRequests.set(r,{resolve:o,reject:s})});return t.send('["COUNT","'+r+'",'+JSON.stringify(e).substring(1)),i})()}subscribe(e,n){const t=this.prepareSubscription(e,n);return t.fire(),t}prepareSubscription(e,n){this.serial++;const t=n.id||"sub:"+this.serial,r=new hue(this,t,e,n);return this.openSubs.set(t,r),r}close(){this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,this.ws?.close()}_onmessage(e){this.incomingMessageQueue.enqueue(e.data),this.queueRunning||this.runQueue()}},hue=class{relay;id;closed=!1;eosed=!1;filters;alreadyHaveEvent;receivedEvent;onevent;oneose;onclose;eoseTimeout;eoseTimeoutHandle;constructor(e,n,t,r){this.relay=e,this.filters=t,this.id=n,this.alreadyHaveEvent=r.alreadyHaveEvent,this.receivedEvent=r.receivedEvent,this.eoseTimeout=r.eoseTimeout||e.baseEoseTimeout,this.oneose=r.oneose,this.onclose=r.onclose,this.onevent=r.onevent||(i=>{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,i)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,this.oneose?.())}close(e="closed by caller"){!this.closed&&this.relay.connected&&(this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]"),this.closed=!0),this.relay.openSubs.delete(this.id),this.onclose?.(e)}},pue=class{relays=new Map;seenOn=new Map;trackRelays=!1;verifyEvent;trustedRelayURLs=new Set;_WebSocket;constructor(e){this.verifyEvent=e.verifyEvent,this._WebSocket=e.websocketImplementation}ensureRelay(e,n){var t=this;return I(function*(){e=wf(e);let r=t.relays.get(e);return r||(r=new cP(e,{verifyEvent:t.trustedRelayURLs.has(e)?gue:t.verifyEvent,websocketImplementation:t._WebSocket}),n?.connectionTimeout&&(r.connectionTimeout=n.connectionTimeout),t.relays.set(e,r)),yield r.connect(),r})()}close(e){e.map(wf).forEach(n=>{this.relays.get(n)?.close()})}subscribeMany(e,n,t){return this.subscribeManyMap(Object.fromEntries(e.map(r=>[r,n])),t)}subscribeManyMap(e,n){var t=this;this.trackRelays&&(n.receivedEvent=(f,A)=>{let p=this.seenOn.get(A);p||(p=new Set,this.seenOn.set(A,p)),p.add(f)});const r=new Set,i=[],o=Object.keys(e).length,s=[];let a=f=>{s[f]=!0,s.filter(A=>A).length===o&&(n.oneose?.(),a=()=>{})};const c=[];let l=(f,A)=>{a(f),c[f]=A,c.filter(p=>p).length===o&&(n.onclose?.(c),l=()=>{})};const u=f=>{if(n.alreadyHaveEvent?.(f))return!0;const A=r.has(f);return r.add(f),A},d=Promise.all(Object.entries(e).map(function(){var f=I(function*(A,p,C){if(C.indexOf(A)!==p)return void l(p,"duplicate url");let F,[E,Q]=A;E=wf(E);try{F=yield t.ensureRelay(E,{connectionTimeout:n.maxWait?Math.max(.8*n.maxWait,n.maxWait-1e3):void 0})}catch(le){return void l(p,le?.message||String(le))}let se=F.subscribe(Q,{...n,oneose:()=>a(p),onclose:le=>l(p,le),alreadyHaveEvent:u,eoseTimeout:n.maxWait});i.push(se)});return function(A,p,C){return f.apply(this,arguments)}}()));return{close:()=>I(function*(){yield d,i.forEach(f=>{f.close()})})()}}subscribeManyEose(e,n,t){const r=this.subscribeMany(e,n,{...t,oneose(){r.close()}});return r}querySync(e,n,t){var r=this;return I(function*(){return new Promise(function(){var i=I(function*(o){const s=[];r.subscribeManyEose(e,[n],{...t,onevent(a){s.push(a)},onclose(a){o(s)}})});return function(o){return i.apply(this,arguments)}}())})()}get(e,n,t){var r=this;return I(function*(){n.limit=1;const i=yield r.querySync(e,n,t);return i.sort((o,s)=>s.created_at-o.created_at),i[0]||null})()}publish(e,n){var t=this;return e.map(wf).map(function(){var r=I(function*(i,o,s){return s.indexOf(i)!==o?Promise.reject("duplicate url"):(yield t.ensureRelay(i)).publish(n)});return function(i,o,s){return r.apply(this,arguments)}}())}};try{l_=WebSocket}catch{}var u_=class extends pue{constructor(){super({verifyEvent:sue,websocketImplementation:l_})}};const Lu=["wss://relay.nostr.band/","wss://nostr.wine/","wss://nos.lol/","wss://relay.primal.net/","wss://purplepag.es/"],im="profileMetadataCache";let om=(()=>{class e{#e=de(Si);#t={};#n=null;#r=new Map;#a=!1;#o=null;initialize(){var t=this;return I(function*(){if(!t.#a){if(t.#o)return t.#o;t.#o=t.#s(),yield t.#o,t.#a=!0}})()}#s(){var t=this;return I(function*(){try{if(typeof chrome<"u"&&chrome.storage?.session){const r=yield chrome.storage.session.get(im);r[im]&&(t.#t=r[im],t.#l())}}catch(r){const i=r instanceof Error?r.message:"Unknown error";t.#e.logStorageError("load profile cache",i)}})()}#i(){var t=this;return I(function*(){try{typeof chrome<"u"&&chrome.storage?.session&&(yield chrome.storage.session.set({[im]:t.#t}))}catch(r){const i=r instanceof Error?r.message:"Unknown error";t.#e.logStorageError("save profile cache",i)}})()}#l(){const t=Date.now();for(const r of Object.keys(this.#t))t-this.#t[r].fetchedAt>864e5&&delete this.#t[r]}#c(){return this.#n||(this.#n=new u_),this.#n}getCachedProfile(t){const r=this.#t[t];return r?Date.now()-r.fetchedAt>864e5?(delete this.#t[t],null):r:null}fetchProfile(t){var r=this;return I(function*(){yield r.initialize();const i=r.getCachedProfile(t);if(i)return i;const o=r.#r.get(t);if(o)return o;const s=r.#u(t);r.#r.set(t,s);try{return yield s}finally{r.#r.delete(t)}})()}fetchProfiles(t){var r=this;return I(function*(){yield r.initialize();const i=new Map,o=[];for(const a of t){const c=r.getCachedProfile(a);c?i.set(a,c):o.push(a)}if(0===o.length)return i;const s=r.#c();try{const a=yield r.#d(s,Lu,[{kinds:[0],authors:o}],1e4),c=new Map;for(const l of a){const u=c.get(l.pubkey);(!u||l.created_at>u.created_at)&&c.set(l.pubkey,{created_at:l.created_at,content:l.content})}for(const[l,u]of c)try{const d=JSON.parse(u.content),f={pubkey:l,name:d.name,display_name:d.display_name,displayName:d.displayName,picture:d.picture,banner:d.banner,about:d.about,website:d.website,nip05:d.nip05,lud06:d.lud06,lud16:d.lud16,fetchedAt:Date.now()};r.#t[l]=f,i.set(l,f)}catch{r.#e.logProfileParseError(l),i.set(l,null)}for(const l of o)i.has(l)||i.set(l,null);yield r.#i()}catch(a){const c=a instanceof Error?a.message:"Unknown error";r.#e.logProfileFetchError("multiple",c);for(const l of o)i.has(l)||i.set(l,null)}return i})()}#u(t){var r=this;return I(function*(){const i=r.#c();try{const o=yield r.#d(i,Lu,[{kinds:[0],authors:[t]}],1e4);if(0===o.length)return null;const s=o.reduce((a,c)=>c.created_at>a.created_at?c:a);try{const a=JSON.parse(s.content),c={pubkey:t,name:a.name,display_name:a.display_name,displayName:a.displayName,picture:a.picture,banner:a.banner,about:a.about,website:a.website,nip05:a.nip05,lud06:a.lud06,lud16:a.lud16,fetchedAt:Date.now()};return r.#t[t]=c,yield r.#i(),c}catch{return r.#e.logProfileParseError(t),null}}catch(o){const s=o instanceof Error?o.message:"Unknown error";return r.#e.logProfileFetchError(t,s),null}})()}#d(t,r,i,o){return I(function*(){return new Promise(s=>{const a=[];let c=!1;const l=setTimeout(()=>{c||(c=!0,s(a))},o),u=t.subscribeMany(r,i,{onevent(d){a.push(d)},oneose(){c||(c=!0,clearTimeout(l),u.close(),s(a))}})})})()}clearCache(){var t=this;return I(function*(){t.#t={},yield t.#i()})()}clearCacheForPubkey(t){var r=this;return I(function*(){delete r.#t[t],yield r.#i()})()}getDisplayName(t){if(t)return t.display_name||t.displayName||t.name}getUsername(t){if(t)return t.name||t.display_name||t.displayName}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Iue(e,n){if(1&e&&(y(0,"span",1),R(1),v()),2&e){const t=Ee();J(),ft(t.icon)}}function mue(e,n){1&e&&ot(0,"i"),2&e&&mh("bi bi-"+Ee().icon)}let xs=(()=>{class e{icon;get isEmoji(){return this.icon.length>0&&this.icon.charCodeAt(0)>255}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["lib-icon-button"]],inputs:{icon:"icon"},decls:3,vars:1,consts:[[1,"icon-button"],[1,"emoji"],[3,"class"]],template:function(r,i){1&r&&(y(0,"div",0),At(1,Iue,2,1,"span",1)(2,mue,1,2,"i",2),v()),2&r&&(J(),tt(i.isEmoji?1:2))},styles:["[_nghost-%COMP%] .icon-button[_ngcontent-%COMP%] {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 100%;\n cursor: pointer;\n color: var(--foreground);\n transition: background-color 0.2s ease, color 0.2s ease;\n}\n[_nghost-%COMP%] .icon-button[_ngcontent-%COMP%]:hover {\n background: var(--muted);\n color: var(--primary);\n}"]})}return e})();var ei="top",ki="bottom",Mi="right",ti="left",sm="auto",Gu=[ei,ki,Mi,ti],Pc="start",Vu="end",dP="clippingParents",d_="viewport",qu="popper",AP="reference",A_=Gu.reduce(function(e,n){return e.concat([n+"-"+Pc,n+"-"+Vu])},[]),f_=[].concat(Gu,[sm]).reduce(function(e,n){return e.concat([n,n+"-"+Pc,n+"-"+Vu])},[]),fP="beforeRead",gP="read",hP="afterRead",pP="beforeMain",IP="main",mP="afterMain",CP="beforeWrite",yP="write",EP="afterWrite",BP=[fP,gP,hP,pP,IP,mP,CP,yP,EP];function ts(e){return e?(e.nodeName||"").toLowerCase():null}function Fi(e){if(null==e)return window;if("[object Window]"!==e.toString()){var n=e.ownerDocument;return n&&n.defaultView||window}return e}function Uc(e){return e instanceof Fi(e).Element||e instanceof Element}function Yi(e){return e instanceof Fi(e).HTMLElement||e instanceof HTMLElement}function g_(e){return!(typeof ShadowRoot>"u")&&(e instanceof Fi(e).ShadowRoot||e instanceof ShadowRoot)}const h_={name:"applyStyles",enabled:!0,phase:"write",fn:function Cue(e){var n=e.state;Object.keys(n.elements).forEach(function(t){var r=n.styles[t]||{},i=n.attributes[t]||{},o=n.elements[t];!Yi(o)||!ts(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];!1===a?o.removeAttribute(s):o.setAttribute(s,!0===a?"":a)}))})},effect:function yue(e){var n=e.state,t={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,t.popper),n.styles=t,n.elements.arrow&&Object.assign(n.elements.arrow.style,t.arrow),function(){Object.keys(n.elements).forEach(function(r){var i=n.elements[r],o=n.attributes[r]||{},a=Object.keys(n.styles.hasOwnProperty(r)?n.styles[r]:t[r]).reduce(function(c,l){return c[l]="",c},{});!Yi(i)||!ts(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}},requires:["computeStyles"]};function ns(e){return e.split("-")[0]}var Hc=Math.max,am=Math.min,zu=Math.round;function p_(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function wP(){return!/^((?!chrome|android).)*safari/i.test(p_())}function Ku(e,n,t){void 0===n&&(n=!1),void 0===t&&(t=!1);var r=e.getBoundingClientRect(),i=1,o=1;n&&Yi(e)&&(i=e.offsetWidth>0&&zu(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&zu(r.height)/e.offsetHeight||1);var a=(Uc(e)?Fi(e):window).visualViewport,c=!wP()&&t,l=(r.left+(c&&a?a.offsetLeft:0))/i,u=(r.top+(c&&a?a.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l,x:l,y:u}}function I_(e){var n=Ku(e),t=e.offsetWidth,r=e.offsetHeight;return Math.abs(n.width-t)<=1&&(t=n.width),Math.abs(n.height-r)<=1&&(r=n.height),{x:e.offsetLeft,y:e.offsetTop,width:t,height:r}}function vP(e,n){var t=n.getRootNode&&n.getRootNode();if(e.contains(n))return!0;if(t&&g_(t)){var r=n;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ts(e){return Fi(e).getComputedStyle(e)}function Eue(e){return["table","td","th"].indexOf(ts(e))>=0}function va(e){return((Uc(e)?e.ownerDocument:e.document)||window.document).documentElement}function cm(e){return"html"===ts(e)?e:e.assignedSlot||e.parentNode||(g_(e)?e.host:null)||va(e)}function _P(e){return Yi(e)&&"fixed"!==Ts(e).position?e.offsetParent:null}function vf(e){for(var n=Fi(e),t=_P(e);t&&Eue(t)&&"static"===Ts(t).position;)t=_P(t);return t&&("html"===ts(t)||"body"===ts(t)&&"static"===Ts(t).position)?n:t||function Bue(e){var n=/firefox/i.test(p_());if(/Trident/i.test(p_())&&Yi(e)&&"fixed"===Ts(e).position)return null;var i=cm(e);for(g_(i)&&(i=i.host);Yi(i)&&["html","body"].indexOf(ts(i))<0;){var o=Ts(i);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||n&&"filter"===o.willChange||n&&o.filter&&"none"!==o.filter)return i;i=i.parentNode}return null}(e)||n}function m_(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function _f(e,n,t){return Hc(e,am(n,t))}function QP(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function DP(e,n){return n.reduce(function(t,r){return t[r]=e,t},{})}const SP={name:"arrow",enabled:!0,phase:"main",fn:function _ue(e){var n,t=e.state,r=e.name,i=e.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,a=ns(t.placement),c=m_(a),u=[ti,Mi].indexOf(a)>=0?"height":"width";if(o&&s){var d=function(n,t){return QP("number"!=typeof(n="function"==typeof n?n(Object.assign({},t.rects,{placement:t.placement})):n)?n:DP(n,Gu))}(i.padding,t),f=I_(o),A="y"===c?ei:ti,p="y"===c?ki:Mi,C=t.rects.reference[u]+t.rects.reference[c]-s[c]-t.rects.popper[u],E=s[c]-t.rects.reference[c],Q=vf(o),F=Q?"y"===c?Q.clientHeight||0:Q.clientWidth||0:0,he=F/2-f[u]/2+(C/2-E/2),we=_f(d[A],he,F-f[u]-d[p]);t.modifiersData[r]=((n={})[c]=we,n.centerOffset=we-he,n)}},effect:function bue(e){var n=e.state,r=e.options.element,i=void 0===r?"[data-popper-arrow]":r;null!=i&&("string"==typeof i&&!(i=n.elements.popper.querySelector(i))||vP(n.elements.popper,i)&&(n.elements.arrow=i))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ju(e){return e.split("-")[1]}var Que={top:"auto",right:"auto",bottom:"auto",left:"auto"};function kP(e){var n,t=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,A=void 0===f?0:f,p=s.y,C=void 0===p?0:p,E="function"==typeof u?u({x:A,y:C}):{x:A,y:C};A=E.x,C=E.y;var Q=s.hasOwnProperty("x"),F=s.hasOwnProperty("y"),se=ti,le=ei,Be=window;if(l){var he=vf(t),we="clientHeight",Re="clientWidth";he===Fi(t)&&"static"!==Ts(he=va(t)).position&&"absolute"===a&&(we="scrollHeight",Re="scrollWidth"),(i===ei||(i===ti||i===Mi)&&o===Vu)&&(le=ki,C-=(d&&he===Be&&Be.visualViewport?Be.visualViewport.height:he[we])-r.height,C*=c?1:-1),i!==ti&&(i!==ei&&i!==ki||o!==Vu)||(se=Mi,A-=(d&&he===Be&&Be.visualViewport?Be.visualViewport.width:he[Re])-r.width,A*=c?1:-1)}var lt,Ze=Object.assign({position:a},l&&Que),ht=!0===u?function Due(e,n){var r=e.y,i=n.devicePixelRatio||1;return{x:zu(e.x*i)/i||0,y:zu(r*i)/i||0}}({x:A,y:C},Fi(t)):{x:A,y:C};return A=ht.x,C=ht.y,Object.assign({},Ze,c?((lt={})[le]=F?"0":"",lt[se]=Q?"0":"",lt.transform=(Be.devicePixelRatio||1)<=1?"translate("+A+"px, "+C+"px)":"translate3d("+A+"px, "+C+"px, 0)",lt):((n={})[le]=F?C+"px":"",n[se]=Q?A+"px":"",n.transform="",n))}const C_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function Sue(e){var n=e.state,t=e.options,r=t.gpuAcceleration,i=void 0===r||r,o=t.adaptive,s=void 0===o||o,a=t.roundOffsets,c=void 0===a||a,l={placement:ns(n.placement),variation:Ju(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:i,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,kP(Object.assign({},l,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:s,roundOffsets:c})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,kP(Object.assign({},l,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}};var lm={passive:!0};const y_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function kue(e){var n=e.state,t=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,c=Fi(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&l.forEach(function(u){u.addEventListener("scroll",t.update,lm)}),a&&c.addEventListener("resize",t.update,lm),function(){o&&l.forEach(function(u){u.removeEventListener("scroll",t.update,lm)}),a&&c.removeEventListener("resize",t.update,lm)}},data:{}};var Mue={left:"right",right:"left",bottom:"top",top:"bottom"};function um(e){return e.replace(/left|right|bottom|top/g,function(n){return Mue[n]})}var Fue={start:"end",end:"start"};function MP(e){return e.replace(/start|end/g,function(n){return Fue[n]})}function E_(e){var n=Fi(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function B_(e){return Ku(va(e)).left+E_(e).scrollLeft}function w_(e){var n=Ts(e);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function FP(e){return["html","body","#document"].indexOf(ts(e))>=0?e.ownerDocument.body:Yi(e)&&w_(e)?e:FP(cm(e))}function bf(e,n){var t;void 0===n&&(n=[]);var r=FP(e),i=r===(null==(t=e.ownerDocument)?void 0:t.body),o=Fi(r),s=i?[o].concat(o.visualViewport||[],w_(r)?r:[]):r,a=n.concat(s);return i?a:a.concat(bf(cm(s)))}function v_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function NP(e,n,t){return n===d_?v_(function Nue(e,n){var t=Fi(e),r=va(e),i=t.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;var l=wP();(l||!l&&"fixed"===n)&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a+B_(e),y:c}}(e,t)):Uc(n)?function Tue(e,n){var t=Ku(e,!1,"fixed"===n);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(n,t):v_(function xue(e){var n,t=va(e),r=E_(e),i=null==(n=e.ownerDocument)?void 0:n.body,o=Hc(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Hc(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+B_(e),c=-r.scrollTop;return"rtl"===Ts(i||t).direction&&(a+=Hc(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}(va(e)))}function xP(e){var c,n=e.reference,t=e.element,r=e.placement,i=r?ns(r):null,o=r?Ju(r):null,s=n.x+n.width/2-t.width/2,a=n.y+n.height/2-t.height/2;switch(i){case ei:c={x:s,y:n.y-t.height};break;case ki:c={x:s,y:n.y+n.height};break;case Mi:c={x:n.x+n.width,y:a};break;case ti:c={x:n.x-t.width,y:a};break;default:c={x:n.x,y:n.y}}var l=i?m_(i):null;if(null!=l){var u="y"===l?"height":"width";switch(o){case Pc:c[l]=c[l]-(n[u]/2-t[u]/2);break;case Vu:c[l]=c[l]+(n[u]/2-t[u]/2)}}return c}function ju(e,n){void 0===n&&(n={});var r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,s=void 0===o?e.strategy:o,a=n.boundary,c=void 0===a?dP:a,l=n.rootBoundary,u=void 0===l?d_:l,d=n.elementContext,f=void 0===d?qu:d,A=n.altBoundary,p=void 0!==A&&A,C=n.padding,E=void 0===C?0:C,Q=QP("number"!=typeof E?E:DP(E,Gu)),se=e.rects.popper,le=e.elements[p?f===qu?AP:qu:f],Be=function Rue(e,n,t,r){var i="clippingParents"===n?function Oue(e){var n=bf(cm(e)),r=["absolute","fixed"].indexOf(Ts(e).position)>=0&&Yi(e)?vf(e):e;return Uc(r)?n.filter(function(i){return Uc(i)&&vP(i,r)&&"body"!==ts(i)}):[]}(e):[].concat(n),o=[].concat(i,[t]),a=o.reduce(function(c,l){var u=NP(e,l,r);return c.top=Hc(u.top,c.top),c.right=am(u.right,c.right),c.bottom=am(u.bottom,c.bottom),c.left=Hc(u.left,c.left),c},NP(e,o[0],r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(Uc(le)?le:le.contextElement||va(e.elements.popper),c,u,s),he=Ku(e.elements.reference),we=xP({reference:he,element:se,strategy:"absolute",placement:i}),Re=v_(Object.assign({},se,we)),Ye=f===qu?Re:he,Je={top:Be.top-Ye.top+Q.top,bottom:Ye.bottom-Be.bottom+Q.bottom,left:Be.left-Ye.left+Q.left,right:Ye.right-Be.right+Q.right},Ze=e.modifiersData.offset;if(f===qu&&Ze){var ht=Ze[i];Object.keys(Je).forEach(function(lt){var Qt=[Mi,ki].indexOf(lt)>=0?1:-1,Ue=[ei,ki].indexOf(lt)>=0?"y":"x";Je[lt]+=ht[Ue]*Qt})}return Je}const TP={name:"flip",enabled:!0,phase:"main",fn:function Hue(e){var n=e.state,t=e.options,r=e.name;if(!n.modifiersData[r]._skip){for(var i=t.mainAxis,o=void 0===i||i,s=t.altAxis,a=void 0===s||s,c=t.fallbackPlacements,l=t.padding,u=t.boundary,d=t.rootBoundary,f=t.altBoundary,A=t.flipVariations,p=void 0===A||A,C=t.allowedAutoPlacements,E=n.options.placement,Q=ns(E),se=c||(Q!==E&&p?function Uue(e){if(ns(e)===sm)return[];var n=um(e);return[MP(e),n,MP(n)]}(E):[um(E)]),le=[E].concat(se).reduce(function(Wn,$n){return Wn.concat(ns($n)===sm?function Pue(e,n){void 0===n&&(n={});var i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?f_:c,u=Ju(n.placement),d=u?a?A_:A_.filter(function(p){return Ju(p)===u}):Gu,f=d.filter(function(p){return l.indexOf(p)>=0});0===f.length&&(f=d);var A=f.reduce(function(p,C){return p[C]=ju(e,{placement:C,boundary:i,rootBoundary:o,padding:s})[ns(C)],p},{});return Object.keys(A).sort(function(p,C){return A[p]-A[C]})}(n,{placement:$n,boundary:u,rootBoundary:d,padding:l,flipVariations:p,allowedAutoPlacements:C}):$n)},[]),Be=n.rects.reference,he=n.rects.popper,we=new Map,Re=!0,Ye=le[0],Je=0;Je<le.length;Je++){var Ze=le[Je],ht=ns(Ze),lt=Ju(Ze)===Pc,Qt=[ei,ki].indexOf(ht)>=0,Ue=Qt?"width":"height",Le=ju(n,{placement:Ze,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),We=Qt?lt?Mi:ti:lt?ki:ei;Be[Ue]>he[Ue]&&(We=um(We));var ct=um(We),qe=[];if(o&&qe.push(Le[ht]<=0),a&&qe.push(Le[We]<=0,Le[ct]<=0),qe.every(function(Wn){return Wn})){Ye=Ze,Re=!1;break}we.set(Ze,qe)}if(Re)for(var Ft=function($n){var _r=le.find(function(ur){var br=we.get(ur);if(br)return br.slice(0,$n).every(function(Qr){return Qr})});if(_r)return Ye=_r,"break"},Tt=p?3:1;Tt>0&&"break"!==Ft(Tt);Tt--);n.placement!==Ye&&(n.modifiersData[r]._skip=!0,n.placement=Ye,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function OP(e,n,t){return void 0===t&&(t={x:0,y:0}),{top:e.top-n.height-t.y,right:e.right-n.width+t.x,bottom:e.bottom-n.height+t.y,left:e.left-n.width-t.x}}function RP(e){return[ei,Mi,ki,ti].some(function(n){return e[n]>=0})}const PP={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function Lue(e){var n=e.state,t=e.name,r=n.rects.reference,i=n.rects.popper,o=n.modifiersData.preventOverflow,s=ju(n,{elementContext:"reference"}),a=ju(n,{altBoundary:!0}),c=OP(s,r),l=OP(a,i,o),u=RP(c),d=RP(l);n.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}},UP={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function Vue(e){var n=e.state,r=e.name,i=e.options.offset,o=void 0===i?[0,0]:i,s=f_.reduce(function(u,d){return u[d]=function Gue(e,n,t){var r=ns(e),i=[ti,ei].indexOf(r)>=0?-1:1,o="function"==typeof t?t(Object.assign({},n,{placement:e})):t,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[ti,Mi].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(d,n.rects,o),u},{}),a=s[n.placement],l=a.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=a.x,n.modifiersData.popperOffsets.y+=l),n.modifiersData[r]=s}},__={name:"popperOffsets",enabled:!0,phase:"read",fn:function que(e){var n=e.state;n.modifiersData[e.name]=xP({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},HP={name:"preventOverflow",enabled:!0,phase:"main",fn:function Kue(e){var n=e.state,t=e.options,r=e.name,i=t.mainAxis,o=void 0===i||i,s=t.altAxis,a=void 0!==s&&s,f=t.tether,A=void 0===f||f,p=t.tetherOffset,C=void 0===p?0:p,E=ju(n,{boundary:t.boundary,rootBoundary:t.rootBoundary,padding:t.padding,altBoundary:t.altBoundary}),Q=ns(n.placement),F=Ju(n.placement),se=!F,le=m_(Q),Be=function zue(e){return"x"===e?"y":"x"}(le),he=n.modifiersData.popperOffsets,we=n.rects.reference,Re=n.rects.popper,Ye="function"==typeof C?C(Object.assign({},n.rects,{placement:n.placement})):C,Je="number"==typeof Ye?{mainAxis:Ye,altAxis:Ye}:Object.assign({mainAxis:0,altAxis:0},Ye),Ze=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,ht={x:0,y:0};if(he){if(o){var lt,Qt="y"===le?ei:ti,Ue="y"===le?ki:Mi,Le="y"===le?"height":"width",We=he[le],ct=We+E[Qt],qe=We-E[Ue],It=A?-Re[Le]/2:0,Ft=F===Pc?we[Le]:Re[Le],Tt=F===Pc?-Re[Le]:-we[Le],Ln=n.elements.arrow,Wn=A&&Ln?I_(Ln):{width:0,height:0},$n=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},_r=$n[Qt],ur=$n[Ue],br=_f(0,we[Le],Wn[Le]),Qr=se?we[Le]/2-It-br-_r-Je.mainAxis:Ft-br-_r-Je.mainAxis,Na=se?-we[Le]/2+It+br+ur+Je.mainAxis:Tt+br+ur+Je.mainAxis,ld=n.elements.arrow&&vf(n.elements.arrow),eo=ld?"y"===le?ld.clientTop||0:ld.clientLeft||0:0,Hs=null!=(lt=Ze?.[le])?lt:0,Fm=We+Na-Hs,Uf=_f(A?am(ct,We+Qr-Hs-eo):ct,We,A?Hc(qe,Fm):qe);he[le]=Uf,ht[le]=Uf-We}if(a){var wH,Yc=he[Be],Nm="y"===Be?"height":"width",vH=Yc+E["x"===le?ei:ti],_H=Yc-E["x"===le?ki:Mi],ab=-1!==[ei,ti].indexOf(Q),bH=null!=(wH=Ze?.[Be])?wH:0,QH=ab?vH:Yc-we[Nm]-Re[Nm]-bH+Je.altAxis,DH=ab?Yc+we[Nm]+Re[Nm]-bH-Je.altAxis:_H,SH=A&&ab?function wue(e,n,t){var r=_f(e,n,t);return r>t?t:r}(QH,Yc,DH):_f(A?QH:vH,Yc,A?DH:_H);he[Be]=SH,ht[Be]=SH-Yc}n.modifiersData[r]=ht}},requiresIfExists:["offset"]};function Wue(e,n,t){void 0===t&&(t=!1);var r=Yi(n),i=Yi(n)&&function Yue(e){var n=e.getBoundingClientRect(),t=zu(n.width)/e.offsetWidth||1,r=zu(n.height)/e.offsetHeight||1;return 1!==t||1!==r}(n),o=va(n),s=Ku(e,i,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&(("body"!==ts(n)||w_(o))&&(a=function jue(e){return e!==Fi(e)&&Yi(e)?function Jue(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(e):E_(e)}(n)),Yi(n)?((c=Ku(n,!0)).x+=n.clientLeft,c.y+=n.clientTop):o&&(c.x=B_(o))),{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function $ue(e){var n=new Map,t=new Set,r=[];function i(o){t.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach(function(a){if(!t.has(a)){var c=n.get(a);c&&i(c)}}),r.push(o)}return e.forEach(function(o){n.set(o.name,o)}),e.forEach(function(o){t.has(o.name)||i(o)}),r}function Xue(e){var n;return function(){return n||(n=new Promise(function(t){Promise.resolve().then(function(){n=void 0,t(e())})})),n}}var LP={placement:"bottom",modifiers:[],strategy:"absolute"};function GP(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return!n.some(function(r){return!(r&&"function"==typeof r.getBoundingClientRect)})}function dm(e){void 0===e&&(e={});var t=e.defaultModifiers,r=void 0===t?[]:t,i=e.defaultOptions,o=void 0===i?LP:i;return function(a,c,l){void 0===l&&(l=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},LP,o),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},d=[],f=!1,A={state:u,setOptions:function(Q){var F="function"==typeof Q?Q(u.options):Q;C(),u.options=Object.assign({},o,u.options,F),u.scrollParents={reference:Uc(a)?bf(a):a.contextElement?bf(a.contextElement):[],popper:bf(c)};var se=function Zue(e){var n=$ue(e);return BP.reduce(function(t,r){return t.concat(n.filter(function(i){return i.phase===r}))},[])}(function ede(e){var n=e.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(n).map(function(t){return n[t]})}([].concat(r,u.options.modifiers)));return u.orderedModifiers=se.filter(function(le){return le.enabled}),function p(){u.orderedModifiers.forEach(function(E){var F=E.options,le=E.effect;if("function"==typeof le){var Be=le({state:u,name:E.name,instance:A,options:void 0===F?{}:F});d.push(Be||function(){})}})}(),A.update()},forceUpdate:function(){if(!f){var Q=u.elements,F=Q.reference,se=Q.popper;if(GP(F,se)){u.rects={reference:Wue(F,vf(se),"fixed"===u.options.strategy),popper:I_(se)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(Je){return u.modifiersData[Je.name]=Object.assign({},Je.data)});for(var le=0;le<u.orderedModifiers.length;le++)if(!0!==u.reset){var Be=u.orderedModifiers[le],he=Be.fn,we=Be.options;"function"==typeof he&&(u=he({state:u,options:void 0===we?{}:we,name:Be.name,instance:A})||u)}else u.reset=!1,le=-1}}},update:Xue(function(){return new Promise(function(E){A.forceUpdate(),E(u)})}),destroy:function(){C(),f=!0}};if(!GP(a,c))return A;function C(){d.forEach(function(E){return E()}),d=[]}return A.setOptions(l).then(function(E){!f&&l.onFirstUpdate&&l.onFirstUpdate(E)}),A}}var tde=dm(),b_=dm({defaultModifiers:[y_,__,C_,h_,UP,TP,HP,SP,PP]}),ide=dm({defaultModifiers:[y_,__,C_,h_]});const _a=new Map,Q_={set(e,n,t){_a.has(e)||_a.set(e,new Map);const r=_a.get(e);r.has(n)||0===r.size?r.set(n,t):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(r.keys())[0]}.`)},get:(e,n)=>_a.has(e)&&_a.get(e).get(n)||null,remove(e,n){if(!_a.has(e))return;const t=_a.get(e);t.delete(n),0===t.size&&_a.delete(e)}},D_="transitionend",VP=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(n,t)=>`#${CSS.escape(t)}`)),e),qP=e=>{e.dispatchEvent(new Event(D_))},Os=e=>!(!e||"object"!=typeof e)&&(typeof e.jquery<"u"&&(e=e[0]),typeof e.nodeType<"u"),ba=e=>Os(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(VP(e)):null,Yu=e=>{if(!Os(e)||0===e.getClientRects().length)return!1;const n="visible"===getComputedStyle(e).getPropertyValue("visibility"),t=e.closest("details:not([open])");if(!t)return n;if(t!==e){const r=e.closest("summary");if(r&&r.parentNode!==t||null===r)return!1}return n},Qa=e=>!(e&&e.nodeType===Node.ELEMENT_NODE&&!e.classList.contains("disabled"))||(typeof e.disabled<"u"?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),zP=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const n=e.getRootNode();return n instanceof ShadowRoot?n:null}return e instanceof ShadowRoot?e:e.parentNode?zP(e.parentNode):null},Am=()=>{},KP=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,S_=[],Wi=()=>"rtl"===document.documentElement.dir,$i=e=>{(e=>{"loading"===document.readyState?(S_.length||document.addEventListener("DOMContentLoaded",()=>{for(const n of S_)n()}),S_.push(e)):e()})(()=>{const n=KP();if(n){const t=e.NAME,r=n.fn[t];n.fn[t]=e.jQueryInterface,n.fn[t].Constructor=e,n.fn[t].noConflict=()=>(n.fn[t]=r,e.jQueryInterface)}})},pi=(e,n=[],t=e)=>"function"==typeof e?e.call(...n):t,JP=(e,n,t=!0)=>{if(!t)return void pi(e);const i=(e=>{if(!e)return 0;let{transitionDuration:n,transitionDelay:t}=window.getComputedStyle(e);const r=Number.parseFloat(n),i=Number.parseFloat(t);return r||i?(n=n.split(",")[0],t=t.split(",")[0],1e3*(Number.parseFloat(n)+Number.parseFloat(t))):0})(n)+5;let o=!1;const s=({target:a})=>{a===n&&(o=!0,n.removeEventListener(D_,s),pi(e))};n.addEventListener(D_,s),setTimeout(()=>{o||qP(n)},i)},k_=(e,n,t,r)=>{const i=e.length;let o=e.indexOf(n);return-1===o?!t&&r?e[i-1]:e[0]:(o+=t?1:-1,r&&(o=(o+i)%i),e[Math.max(0,Math.min(o,i-1))])},dde=/[^.]*(?=\..*)\.|.*/,Ade=/\..*/,fde=/::\d+$/,M_={};let jP=1;const YP={mouseenter:"mouseover",mouseleave:"mouseout"},gde=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function WP(e,n){return n&&`${n}::${jP++}`||e.uidEvent||jP++}function $P(e){const n=WP(e);return e.uidEvent=n,M_[n]=M_[n]||{},M_[n]}function ZP(e,n,t=null){return Object.values(e).find(r=>r.callable===n&&r.delegationSelector===t)}function XP(e,n,t){const r="string"==typeof n,i=r?t:n||t;let o=tU(e);return gde.has(o)||(o=e),[r,i,o]}function eU(e,n,t,r,i){if("string"!=typeof n||!e)return;let[o,s,a]=XP(n,t,r);var p;n in YP&&(p=s,s=function(C){if(!C.relatedTarget||C.relatedTarget!==C.delegateTarget&&!C.delegateTarget.contains(C.relatedTarget))return p.call(this,C)});const c=$P(e),l=c[a]||(c[a]={}),u=ZP(l,s,o?t:null);if(u)return void(u.oneOff=u.oneOff&&i);const d=WP(s,n.replace(dde,"")),f=o?function pde(e,n,t){return function r(i){const o=e.querySelectorAll(n);for(let{target:s}=i;s&&s!==this;s=s.parentNode)for(const a of o)if(a===s)return N_(i,{delegateTarget:s}),r.oneOff&&Ve.off(e,i.type,n,t),t.apply(s,[i])}}(e,t,s):function hde(e,n){return function t(r){return N_(r,{delegateTarget:e}),t.oneOff&&Ve.off(e,r.type,n),n.apply(e,[r])}}(e,s);f.delegationSelector=o?t:null,f.callable=s,f.oneOff=i,f.uidEvent=d,l[d]=f,e.addEventListener(a,f,o)}function F_(e,n,t,r,i){const o=ZP(n[t],r,i);o&&(e.removeEventListener(t,o,!!i),delete n[t][o.uidEvent])}function Ide(e,n,t,r){const i=n[t]||{};for(const[o,s]of Object.entries(i))o.includes(r)&&F_(e,n,t,s.callable,s.delegationSelector)}function tU(e){return e=e.replace(Ade,""),YP[e]||e}const Ve={on(e,n,t,r){eU(e,n,t,r,!1)},one(e,n,t,r){eU(e,n,t,r,!0)},off(e,n,t,r){if("string"!=typeof n||!e)return;const[i,o,s]=XP(n,t,r),a=s!==n,c=$P(e),l=c[s]||{},u=n.startsWith(".");if(typeof o<"u"){if(!Object.keys(l).length)return;F_(e,c,s,o,i?t:null)}else{if(u)for(const d of Object.keys(c))Ide(e,c,d,n.slice(1));for(const[d,f]of Object.entries(l)){const A=d.replace(fde,"");(!a||n.includes(A))&&F_(e,c,s,f.callable,f.delegationSelector)}}},trigger(e,n,t){if("string"!=typeof n||!e)return null;const r=KP();let s=null,a=!0,c=!0,l=!1;n!==tU(n)&&r&&(s=r.Event(n,t),r(e).trigger(s),a=!s.isPropagationStopped(),c=!s.isImmediatePropagationStopped(),l=s.isDefaultPrevented());const u=N_(new Event(n,{bubbles:a,cancelable:!0}),t);return l&&u.preventDefault(),c&&e.dispatchEvent(u),u.defaultPrevented&&s&&s.preventDefault(),u}};function N_(e,n={}){for(const[t,r]of Object.entries(n))try{e[t]=r}catch{Object.defineProperty(e,t,{configurable:!0,get:()=>r})}return e}function nU(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function x_(e){return e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}const Rs={setDataAttribute(e,n,t){e.setAttribute(`data-bs-${x_(n)}`,t)},removeDataAttribute(e,n){e.removeAttribute(`data-bs-${x_(n)}`)},getDataAttributes(e){if(!e)return{};const n={},t=Object.keys(e.dataset).filter(r=>r.startsWith("bs")&&!r.startsWith("bsConfig"));for(const r of t){let i=r.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),n[i]=nU(e.dataset[r])}return n},getDataAttribute:(e,n)=>nU(e.getAttribute(`data-bs-${x_(n)}`))};class Df{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(n){return n=this._mergeConfigObj(n),n=this._configAfterMerge(n),this._typeCheckConfig(n),n}_configAfterMerge(n){return n}_mergeConfigObj(n,t){const r=Os(t)?Rs.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof r?r:{},...Os(t)?Rs.getDataAttributes(t):{},..."object"==typeof n?n:{}}}_typeCheckConfig(n,t=this.constructor.DefaultType){for(const[r,i]of Object.entries(t)){const o=n[r],s=Os(o)?"element":null==(e=o)?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(i).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${s}" but expected type "${i}".`)}var e}}class _o extends Df{constructor(n,t){super(),(n=ba(n))&&(this._element=n,this._config=this._getConfig(t),Q_.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Q_.remove(this._element,this.constructor.DATA_KEY),Ve.off(this._element,this.constructor.EVENT_KEY);for(const n of Object.getOwnPropertyNames(this))this[n]=null}_queueCallback(n,t,r=!0){JP(n,t,r)}_getConfig(n){return n=this._mergeConfigObj(n,this._element),n=this._configAfterMerge(n),this._typeCheckConfig(n),n}static getInstance(n){return Q_.get(ba(n),this.DATA_KEY)}static getOrCreateInstance(n,t={}){return this.getInstance(n)||new this(n,"object"==typeof t?t:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(n){return`${n}${this.EVENT_KEY}`}}const T_=e=>{let n=e.getAttribute("data-bs-target");if(!n||"#"===n){let t=e.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),n=t&&"#"!==t?t.trim():null}return n?n.split(",").map(t=>VP(t)).join(","):null},Ct={find:(e,n=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(n,e)),findOne:(e,n=document.documentElement)=>Element.prototype.querySelector.call(n,e),children:(e,n)=>[].concat(...e.children).filter(t=>t.matches(n)),parents(e,n){const t=[];let r=e.parentNode.closest(n);for(;r;)t.push(r),r=r.parentNode.closest(n);return t},prev(e,n){let t=e.previousElementSibling;for(;t;){if(t.matches(n))return[t];t=t.previousElementSibling}return[]},next(e,n){let t=e.nextElementSibling;for(;t;){if(t.matches(n))return[t];t=t.nextElementSibling}return[]},focusableChildren(e){const n=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(n,e).filter(t=>!Qa(t)&&Yu(t))},getSelectorFromElement(e){const n=T_(e);return n&&Ct.findOne(n)?n:null},getElementFromSelector(e){const n=T_(e);return n?Ct.findOne(n):null},getMultipleElementsFromSelector(e){const n=T_(e);return n?Ct.find(n):[]}},fm=(e,n="hide")=>{const r=e.NAME;Ve.on(document,`click.dismiss${e.EVENT_KEY}`,`[data-bs-dismiss="${r}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),Qa(this))return;const o=Ct.getElementFromSelector(this)||this.closest(`.${r}`);e.getOrCreateInstance(o)[n]()})},rU=".bs.alert",yde=`close${rU}`,Ede=`closed${rU}`;class gm extends _o{static get NAME(){return"alert"}close(){if(Ve.trigger(this._element,yde).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),Ve.trigger(this._element,Ede),this.dispose()}static jQueryInterface(n){return this.each(function(){const t=gm.getOrCreateInstance(this);if("string"==typeof n){if(void 0===t[n]||n.startsWith("_")||"constructor"===n)throw new TypeError(`No method named "${n}"`);t[n](this)}})}}fm(gm,"close"),$i(gm);const iU='[data-bs-toggle="button"]';class hm extends _o{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(n){return this.each(function(){const t=hm.getOrCreateInstance(this);"toggle"===n&&t[n]()})}}Ve.on(document,"click.bs.button.data-api",iU,e=>{e.preventDefault();const n=e.target.closest(iU);hm.getOrCreateInstance(n).toggle()}),$i(hm);const Wu=".bs.swipe",kde=`touchstart${Wu}`,Mde=`touchmove${Wu}`,Fde=`touchend${Wu}`,Nde=`pointerdown${Wu}`,xde=`pointerup${Wu}`,Ude={endCallback:null,leftCallback:null,rightCallback:null},Hde={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class pm extends Df{constructor(n,t){super(),this._element=n,n&&pm.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return Ude}static get DefaultType(){return Hde}static get NAME(){return"swipe"}dispose(){Ve.off(this._element,Wu)}_start(n){this._supportPointerEvents?this._eventIsPointerPenTouch(n)&&(this._deltaX=n.clientX):this._deltaX=n.touches[0].clientX}_end(n){this._eventIsPointerPenTouch(n)&&(this._deltaX=n.clientX-this._deltaX),this._handleSwipe(),pi(this._config.endCallback)}_move(n){this._deltaX=n.touches&&n.touches.length>1?0:n.touches[0].clientX-this._deltaX}_handleSwipe(){const n=Math.abs(this._deltaX);if(n<=40)return;const t=n/this._deltaX;this._deltaX=0,t&&pi(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Ve.on(this._element,Nde,n=>this._start(n)),Ve.on(this._element,xde,n=>this._end(n)),this._element.classList.add("pointer-event")):(Ve.on(this._element,kde,n=>this._start(n)),Ve.on(this._element,Mde,n=>this._move(n)),Ve.on(this._element,Fde,n=>this._end(n)))}_eventIsPointerPenTouch(n){return this._supportPointerEvents&&("pen"===n.pointerType||"touch"===n.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Da=".bs.carousel",oU=".data-api",Gde="ArrowLeft",Vde="ArrowRight",Sf="next",$u="prev",Zu="left",Im="right",zde=`slide${Da}`,O_=`slid${Da}`,Kde=`keydown${Da}`,Jde=`mouseenter${Da}`,jde=`mouseleave${Da}`,Yde=`dragstart${Da}`,Wde=`load${Da}${oU}`,$de=`click${Da}${oU}`,sU="carousel",mm="active",aU=".active",cU=".carousel-item",rAe=aU+cU,cAe={[Gde]:Im,[Vde]:Zu},lAe={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},uAe={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class kf extends _o{constructor(n,t){super(n,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Ct.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===sU&&this.cycle()}static get Default(){return lAe}static get DefaultType(){return uAe}static get NAME(){return"carousel"}next(){this._slide(Sf)}nextWhenVisible(){!document.hidden&&Yu(this._element)&&this.next()}prev(){this._slide($u)}pause(){this._isSliding&&qP(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding)return void Ve.one(this._element,O_,()=>this.cycle());this.cycle()}}to(n){const t=this._getItems();if(n>t.length-1||n<0)return;if(this._isSliding)return void Ve.one(this._element,O_,()=>this.to(n));const r=this._getItemIndex(this._getActive());r!==n&&this._slide(n>r?Sf:$u,t[n])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(n){return n.defaultInterval=n.interval,n}_addEventListeners(){this._config.keyboard&&Ve.on(this._element,Kde,n=>this._keydown(n)),"hover"===this._config.pause&&(Ve.on(this._element,Jde,()=>this.pause()),Ve.on(this._element,jde,()=>this._maybeEnableCycle())),this._config.touch&&pm.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const r of Ct.find(".carousel-item img",this._element))Ve.on(r,Yde,i=>i.preventDefault());this._swipeHelper=new pm(this._element,{leftCallback:()=>this._slide(this._directionToOrder(Zu)),rightCallback:()=>this._slide(this._directionToOrder(Im)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}})}_keydown(n){if(/input|textarea/i.test(n.target.tagName))return;const t=cAe[n.key];t&&(n.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(n){return this._getItems().indexOf(n)}_setActiveIndicatorElement(n){if(!this._indicatorsElement)return;const t=Ct.findOne(aU,this._indicatorsElement);t.classList.remove(mm),t.removeAttribute("aria-current");const r=Ct.findOne(`[data-bs-slide-to="${n}"]`,this._indicatorsElement);r&&(r.classList.add(mm),r.setAttribute("aria-current","true"))}_updateInterval(){const n=this._activeElement||this._getActive();if(!n)return;const t=Number.parseInt(n.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(n,t=null){if(this._isSliding)return;const r=this._getActive(),i=n===Sf,o=t||k_(this._getItems(),r,i,this._config.wrap);if(o===r)return;const s=this._getItemIndex(o),a=A=>Ve.trigger(this._element,A,{relatedTarget:o,direction:this._orderToDirection(n),from:this._getItemIndex(r),to:s});if(a(zde).defaultPrevented||!r||!o)return;const l=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=o;const u=i?"carousel-item-start":"carousel-item-end",d=i?"carousel-item-next":"carousel-item-prev";o.classList.add(d),r.classList.add(u),o.classList.add(u),this._queueCallback(()=>{o.classList.remove(u,d),o.classList.add(mm),r.classList.remove(mm,d,u),this._isSliding=!1,a(O_)},r,this._isAnimated()),l&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return Ct.findOne(rAe,this._element)}_getItems(){return Ct.find(cU,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(n){return Wi()?n===Zu?$u:Sf:n===Zu?Sf:$u}_orderToDirection(n){return Wi()?n===$u?Zu:Im:n===$u?Im:Zu}static jQueryInterface(n){return this.each(function(){const t=kf.getOrCreateInstance(this,n);if("number"!=typeof n){if("string"==typeof n){if(void 0===t[n]||n.startsWith("_")||"constructor"===n)throw new TypeError(`No method named "${n}"`);t[n]()}}else t.to(n)})}}Ve.on(document,$de,"[data-bs-slide], [data-bs-slide-to]",function(e){const n=Ct.getElementFromSelector(this);if(!n||!n.classList.contains(sU))return;e.preventDefault();const t=kf.getOrCreateInstance(n),r=this.getAttribute("data-bs-slide-to");return r?(t.to(r),void t._maybeEnableCycle()):"next"===Rs.getDataAttribute(this,"slide")?(t.next(),void t._maybeEnableCycle()):(t.prev(),void t._maybeEnableCycle())}),Ve.on(window,Wde,()=>{const e=Ct.find('[data-bs-ride="carousel"]');for(const n of e)kf.getOrCreateInstance(n)}),$i(kf);const Mf=".bs.collapse",fAe=`show${Mf}`,gAe=`shown${Mf}`,hAe=`hide${Mf}`,pAe=`hidden${Mf}`,IAe=`click${Mf}.data-api`,R_="show",Xu="collapse",Cm="collapsing",CAe=`:scope .${Xu} .${Xu}`,P_='[data-bs-toggle="collapse"]',vAe={parent:null,toggle:!0},_Ae={parent:"(null|element)",toggle:"boolean"};class Ff extends _o{constructor(n,t){super(n,t),this._isTransitioning=!1,this._triggerArray=[];const r=Ct.find(P_);for(const i of r){const o=Ct.getSelectorFromElement(i),s=Ct.find(o).filter(a=>a===this._element);null!==o&&s.length&&this._triggerArray.push(i)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return vAe}static get DefaultType(){return _Ae}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let n=[];if(this._config.parent&&(n=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(a=>a!==this._element).map(a=>Ff.getOrCreateInstance(a,{toggle:!1}))),n.length&&n[0]._isTransitioning||Ve.trigger(this._element,fAe).defaultPrevented)return;for(const a of n)a.hide();const r=this._getDimension();this._element.classList.remove(Xu),this._element.classList.add(Cm),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const s=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Cm),this._element.classList.add(Xu,R_),this._element.style[r]="",Ve.trigger(this._element,gAe)},this._element,!0),this._element.style[r]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown()||Ve.trigger(this._element,hAe).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,this._element.classList.add(Cm),this._element.classList.remove(Xu,R_);for(const i of this._triggerArray){const o=Ct.getElementFromSelector(i);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([i],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Cm),this._element.classList.add(Xu),Ve.trigger(this._element,pAe)},this._element,!0)}_isShown(n=this._element){return n.classList.contains(R_)}_configAfterMerge(n){return n.toggle=!!n.toggle,n.parent=ba(n.parent),n}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const n=this._getFirstLevelChildren(P_);for(const t of n){const r=Ct.getElementFromSelector(t);r&&this._addAriaAndCollapsedClass([t],this._isShown(r))}}_getFirstLevelChildren(n){const t=Ct.find(CAe,this._config.parent);return Ct.find(n,this._config.parent).filter(r=>!t.includes(r))}_addAriaAndCollapsedClass(n,t){if(n.length)for(const r of n)r.classList.toggle("collapsed",!t),r.setAttribute("aria-expanded",t)}static jQueryInterface(n){const t={};return"string"==typeof n&&/show|hide/.test(n)&&(t.toggle=!1),this.each(function(){const r=Ff.getOrCreateInstance(this,t);if("string"==typeof n){if(typeof r[n]>"u")throw new TypeError(`No method named "${n}"`);r[n]()}})}}Ve.on(document,IAe,P_,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const n of Ct.getMultipleElementsFromSelector(this))Ff.getOrCreateInstance(n,{toggle:!1}).toggle()}),$i(Ff);const lU="dropdown",Lc=".bs.dropdown",U_=".data-api",QAe="ArrowUp",dU="ArrowDown",SAe=`hide${Lc}`,kAe=`hidden${Lc}`,MAe=`show${Lc}`,FAe=`shown${Lc}`,AU=`click${Lc}${U_}`,fU=`keydown${Lc}${U_}`,NAe=`keyup${Lc}${U_}`,ed="show",Gc='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',UAe=`${Gc}.${ed}`,ym=".dropdown-menu",VAe=Wi()?"top-end":"top-start",qAe=Wi()?"top-start":"top-end",zAe=Wi()?"bottom-end":"bottom-start",KAe=Wi()?"bottom-start":"bottom-end",JAe=Wi()?"left-start":"right-start",jAe=Wi()?"right-start":"left-start",$Ae={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},ZAe={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class rs extends _o{constructor(n,t){super(n,t),this._popper=null,this._parent=this._element.parentNode,this._menu=Ct.next(this._element,ym)[0]||Ct.prev(this._element,ym)[0]||Ct.findOne(ym,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return $Ae}static get DefaultType(){return ZAe}static get NAME(){return lU}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Qa(this._element)||this._isShown())return;const n={relatedTarget:this._element};if(!Ve.trigger(this._element,MAe,n).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const r of[].concat(...document.body.children))Ve.on(r,"mouseover",Am);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ed),this._element.classList.add(ed),Ve.trigger(this._element,FAe,n)}}hide(){!Qa(this._element)&&this._isShown()&&this._completeHide({relatedTarget:this._element})}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(n){if(!Ve.trigger(this._element,SAe,n).defaultPrevented){if("ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))Ve.off(r,"mouseover",Am);this._popper&&this._popper.destroy(),this._menu.classList.remove(ed),this._element.classList.remove(ed),this._element.setAttribute("aria-expanded","false"),Rs.removeDataAttribute(this._menu,"popper"),Ve.trigger(this._element,kAe,n)}}_getConfig(n){if("object"==typeof(n=super._getConfig(n)).reference&&!Os(n.reference)&&"function"!=typeof n.reference.getBoundingClientRect)throw new TypeError(`${lU.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return n}_createPopper(){let n=this._element;"parent"===this._config.reference?n=this._parent:Os(this._config.reference)?n=ba(this._config.reference):"object"==typeof this._config.reference&&(n=this._config.reference);const t=this._getPopperConfig();this._popper=b_(n,this._menu,t)}_isShown(){return this._menu.classList.contains(ed)}_getPlacement(){const n=this._parent;if(n.classList.contains("dropend"))return JAe;if(n.classList.contains("dropstart"))return jAe;if(n.classList.contains("dropup-center"))return"top";if(n.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return n.classList.contains("dropup")?t?qAe:VAe:t?KAe:zAe}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:n}=this._config;return"string"==typeof n?n.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof n?t=>n(t,this._element):n}_getPopperConfig(){const n={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(Rs.setDataAttribute(this._menu,"popper","static"),n.modifiers=[{name:"applyStyles",enabled:!1}]),{...n,...pi(this._config.popperConfig,[void 0,n])}}_selectMenuItem({key:n,target:t}){const r=Ct.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(i=>Yu(i));r.length&&k_(r,t,n===dU,!r.includes(t)).focus()}static jQueryInterface(n){return this.each(function(){const t=rs.getOrCreateInstance(this,n);if("string"==typeof n){if(typeof t[n]>"u")throw new TypeError(`No method named "${n}"`);t[n]()}})}static clearMenus(n){if(2===n.button||"keyup"===n.type&&"Tab"!==n.key)return;const t=Ct.find(UAe);for(const r of t){const i=rs.getInstance(r);if(!i||!1===i._config.autoClose)continue;const o=n.composedPath(),s=o.includes(i._menu);if(o.includes(i._element)||"inside"===i._config.autoClose&&!s||"outside"===i._config.autoClose&&s||i._menu.contains(n.target)&&("keyup"===n.type&&"Tab"===n.key||/input|select|option|textarea|form/i.test(n.target.tagName)))continue;const a={relatedTarget:i._element};"click"===n.type&&(a.clickEvent=n),i._completeHide(a)}}static dataApiKeydownHandler(n){const t=/input|textarea/i.test(n.target.tagName),r="Escape"===n.key,i=[QAe,dU].includes(n.key);if(!i&&!r||t&&!r)return;n.preventDefault();const o=this.matches(Gc)?this:Ct.prev(this,Gc)[0]||Ct.next(this,Gc)[0]||Ct.findOne(Gc,n.delegateTarget.parentNode),s=rs.getOrCreateInstance(o);if(i)return n.stopPropagation(),s.show(),void s._selectMenuItem(n);s._isShown()&&(n.stopPropagation(),s.hide(),o.focus())}}Ve.on(document,fU,Gc,rs.dataApiKeydownHandler),Ve.on(document,fU,ym,rs.dataApiKeydownHandler),Ve.on(document,AU,rs.clearMenus),Ve.on(document,NAe,rs.clearMenus),Ve.on(document,AU,Gc,function(e){e.preventDefault(),rs.getOrCreateInstance(this).toggle()}),$i(rs);const gU="backdrop",pU=`mousedown.bs.${gU}`,efe={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},tfe={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class IU extends Df{constructor(n){super(),this._config=this._getConfig(n),this._isAppended=!1,this._element=null}static get Default(){return efe}static get DefaultType(){return tfe}static get NAME(){return gU}show(n){if(!this._config.isVisible)return void pi(n);this._append();this._getElement().classList.add("show"),this._emulateAnimation(()=>{pi(n)})}hide(n){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation(()=>{this.dispose(),pi(n)})):pi(n)}dispose(){this._isAppended&&(Ve.off(this._element,pU),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const n=document.createElement("div");n.className=this._config.className,this._config.isAnimated&&n.classList.add("fade"),this._element=n}return this._element}_configAfterMerge(n){return n.rootElement=ba(n.rootElement),n}_append(){if(this._isAppended)return;const n=this._getElement();this._config.rootElement.append(n),Ve.on(n,pU,()=>{pi(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(n){JP(n,this._getElement(),this._config.isAnimated)}}const Em=".bs.focustrap",rfe=`focusin${Em}`,ife=`keydown.tab${Em}`,mU="backward",afe={autofocus:!0,trapElement:null},cfe={autofocus:"boolean",trapElement:"element"};class CU extends Df{constructor(n){super(),this._config=this._getConfig(n),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return afe}static get DefaultType(){return cfe}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Ve.off(document,Em),Ve.on(document,rfe,n=>this._handleFocusin(n)),Ve.on(document,ife,n=>this._handleKeydown(n)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Ve.off(document,Em))}_handleFocusin(n){const{trapElement:t}=this._config;if(n.target===document||n.target===t||t.contains(n.target))return;const r=Ct.focusableChildren(t);0===r.length?t.focus():this._lastTabNavDirection===mU?r[r.length-1].focus():r[0].focus()}_handleKeydown(n){"Tab"===n.key&&(this._lastTabNavDirection=n.shiftKey?mU:"forward")}}const yU=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",EU=".sticky-top",Bm="padding-right",BU="margin-right";class H_{constructor(){this._element=document.body}getWidth(){const n=document.documentElement.clientWidth;return Math.abs(window.innerWidth-n)}hide(){const n=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Bm,t=>t+n),this._setElementAttributes(yU,Bm,t=>t+n),this._setElementAttributes(EU,BU,t=>t-n)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Bm),this._resetElementAttributes(yU,Bm),this._resetElementAttributes(EU,BU)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(n,t,r){const i=this.getWidth();this._applyManipulationCallback(n,s=>{if(s!==this._element&&window.innerWidth>s.clientWidth+i)return;this._saveInitialAttribute(s,t);const a=window.getComputedStyle(s).getPropertyValue(t);s.style.setProperty(t,`${r(Number.parseFloat(a))}px`)})}_saveInitialAttribute(n,t){const r=n.style.getPropertyValue(t);r&&Rs.setDataAttribute(n,t,r)}_resetElementAttributes(n,t){this._applyManipulationCallback(n,i=>{const o=Rs.getDataAttribute(i,t);null!==o?(Rs.removeDataAttribute(i,t),i.style.setProperty(t,o)):i.style.removeProperty(t)})}_applyManipulationCallback(n,t){if(Os(n))t(n);else for(const r of Ct.find(n,this._element))t(r)}}const Zi=".bs.modal",Afe=`hide${Zi}`,ffe=`hidePrevented${Zi}`,wU=`hidden${Zi}`,vU=`show${Zi}`,gfe=`shown${Zi}`,hfe=`resize${Zi}`,pfe=`click.dismiss${Zi}`,Ife=`mousedown.dismiss${Zi}`,mfe=`keydown.dismiss${Zi}`,Cfe=`click${Zi}.data-api`,_U="modal-open",L_="modal-static",_fe={backdrop:!0,focus:!0,keyboard:!0},bfe={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Vc extends _o{constructor(n,t){super(n,t),this._dialog=Ct.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new H_,this._addEventListeners()}static get Default(){return _fe}static get DefaultType(){return bfe}static get NAME(){return"modal"}toggle(n){return this._isShown?this.hide():this.show(n)}show(n){this._isShown||this._isTransitioning||Ve.trigger(this._element,vU,{relatedTarget:n}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(_U),this._adjustDialog(),this._backdrop.show(()=>this._showElement(n)))}hide(){!this._isShown||this._isTransitioning||Ve.trigger(this._element,Afe).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove("show"),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){Ve.off(window,Zi),Ve.off(this._dialog,Zi),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new IU({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new CU({trapElement:this._element})}_showElement(n){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=Ct.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),this._element.classList.add("show"),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Ve.trigger(this._element,gfe,{relatedTarget:n})},this._dialog,this._isAnimated())}_addEventListeners(){Ve.on(this._element,mfe,n=>{if("Escape"===n.key){if(this._config.keyboard)return void this.hide();this._triggerBackdropTransition()}}),Ve.on(window,hfe,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Ve.on(this._element,Ife,n=>{Ve.one(this._element,pfe,t=>{if(this._element===n.target&&this._element===t.target){if("static"===this._config.backdrop)return void this._triggerBackdropTransition();this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(_U),this._resetAdjustments(),this._scrollBar.reset(),Ve.trigger(this._element,wU)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(Ve.trigger(this._element,ffe).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,r=this._element.style.overflowY;"hidden"===r||this._element.classList.contains(L_)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(L_),this._queueCallback(()=>{this._element.classList.remove(L_),this._queueCallback(()=>{this._element.style.overflowY=r},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const n=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),r=t>0;if(r&&!n){const i=Wi()?"paddingLeft":"paddingRight";this._element.style[i]=`${t}px`}if(!r&&n){const i=Wi()?"paddingRight":"paddingLeft";this._element.style[i]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(n,t){return this.each(function(){const r=Vc.getOrCreateInstance(this,n);if("string"==typeof n){if(typeof r[n]>"u")throw new TypeError(`No method named "${n}"`);r[n](t)}})}}Ve.on(document,Cfe,'[data-bs-toggle="modal"]',function(e){const n=Ct.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ve.one(n,vU,i=>{i.defaultPrevented||Ve.one(n,wU,()=>{Yu(this)&&this.focus()})});const t=Ct.findOne(".modal.show");t&&Vc.getInstance(t).hide(),Vc.getOrCreateInstance(n).toggle(this)}),fm(Vc),$i(Vc);const Ps=".bs.offcanvas",QU=".data-api",Dfe=`load${Ps}${QU}`,SU="showing",MU=".offcanvas.show",Mfe=`show${Ps}`,Ffe=`shown${Ps}`,Nfe=`hide${Ps}`,FU=`hidePrevented${Ps}`,NU=`hidden${Ps}`,xfe=`resize${Ps}`,Tfe=`click${Ps}${QU}`,Ofe=`keydown.dismiss${Ps}`,Pfe={backdrop:!0,keyboard:!0,scroll:!1},Ufe={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Sa extends _o{constructor(n,t){super(n,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Pfe}static get DefaultType(){return Ufe}static get NAME(){return"offcanvas"}toggle(n){return this._isShown?this.hide():this.show(n)}show(n){this._isShown||Ve.trigger(this._element,Mfe,{relatedTarget:n}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new H_).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(SU),this._queueCallback(()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add("show"),this._element.classList.remove(SU),Ve.trigger(this._element,Ffe,{relatedTarget:n})},this._element,!0))}hide(){this._isShown&&!Ve.trigger(this._element,Nfe).defaultPrevented&&(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add("hiding"),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove("show","hiding"),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new H_).reset(),Ve.trigger(this._element,NU)},this._element,!0))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=!!this._config.backdrop;return new IU({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():Ve.trigger(this._element,FU)}:null})}_initializeFocusTrap(){return new CU({trapElement:this._element})}_addEventListeners(){Ve.on(this._element,Ofe,n=>{if("Escape"===n.key){if(this._config.keyboard)return void this.hide();Ve.trigger(this._element,FU)}})}static jQueryInterface(n){return this.each(function(){const t=Sa.getOrCreateInstance(this,n);if("string"==typeof n){if(void 0===t[n]||n.startsWith("_")||"constructor"===n)throw new TypeError(`No method named "${n}"`);t[n](this)}})}}Ve.on(document,Tfe,'[data-bs-toggle="offcanvas"]',function(e){const n=Ct.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),Qa(this))return;Ve.one(n,NU,()=>{Yu(this)&&this.focus()});const t=Ct.findOne(MU);t&&t!==n&&Sa.getInstance(t).hide(),Sa.getOrCreateInstance(n).toggle(this)}),Ve.on(window,Dfe,()=>{for(const e of Ct.find(MU))Sa.getOrCreateInstance(e).show()}),Ve.on(window,xfe,()=>{for(const e of Ct.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&Sa.getOrCreateInstance(e).hide()}),fm(Sa),$i(Sa);const xU={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Hfe=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Lfe=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Gfe=(e,n)=>{const t=e.nodeName.toLowerCase();return n.includes(t)?!Hfe.has(t)||!!Lfe.test(e.nodeValue):n.filter(r=>r instanceof RegExp).some(r=>r.test(t))},zfe={allowList:xU,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Kfe={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Jfe={entry:"(string|element|function|null)",selector:"(string|element)"};class jfe extends Df{constructor(n){super(),this._config=this._getConfig(n)}static get Default(){return zfe}static get DefaultType(){return Kfe}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(n=>this._resolvePossibleFunction(n)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(n){return this._checkContent(n),this._config.content={...this._config.content,...n},this}toHtml(){const n=document.createElement("div");n.innerHTML=this._maybeSanitize(this._config.template);for(const[i,o]of Object.entries(this._config.content))this._setContent(n,o,i);const t=n.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&t.classList.add(...r.split(" ")),t}_typeCheckConfig(n){super._typeCheckConfig(n),this._checkContent(n.content)}_checkContent(n){for(const[t,r]of Object.entries(n))super._typeCheckConfig({selector:t,entry:r},Jfe)}_setContent(n,t,r){const i=Ct.findOne(r,n);if(i){if(!(t=this._resolvePossibleFunction(t)))return void i.remove();if(Os(t))return void this._putElementInTemplate(ba(t),i);if(this._config.html)return void(i.innerHTML=this._maybeSanitize(t));i.textContent=t}}_maybeSanitize(n){return this._config.sanitize?function Vfe(e,n,t){if(!e.length)return e;if(t&&"function"==typeof t)return t(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),o=[].concat(...i.body.querySelectorAll("*"));for(const s of o){const a=s.nodeName.toLowerCase();if(!Object.keys(n).includes(a)){s.remove();continue}const c=[].concat(...s.attributes),l=[].concat(n["*"]||[],n[a]||[]);for(const u of c)Gfe(u,l)||s.removeAttribute(u.nodeName)}return i.body.innerHTML}(n,this._config.allowList,this._config.sanitizeFn):n}_resolvePossibleFunction(n){return pi(n,[void 0,this])}_putElementInTemplate(n,t){if(this._config.html)return t.innerHTML="",void t.append(n);t.textContent=n.textContent}}const Wfe=new Set(["sanitize","allowList","sanitizeFn"]),G_="fade",wm="show",Zfe=".tooltip-inner",OU="hide.bs.modal",Nf="hover",V_="focus",q_="click",uge={AUTO:"auto",TOP:"top",RIGHT:Wi()?"left":"right",BOTTOM:"bottom",LEFT:Wi()?"right":"left"},dge={allowList:xU,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Age={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class td extends _o{constructor(n,t){super(n,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return dge}static get DefaultType(){return Age}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._isShown())return void this._leave();this._enter()}}dispose(){clearTimeout(this._timeout),Ve.off(this._element.closest(".modal"),OU,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const n=Ve.trigger(this._element,this.constructor.eventName("show")),r=(zP(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(n.defaultPrevented||!r)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(i),Ve.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(wm),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))Ve.on(a,"mouseover",Am);this._queueCallback(()=>{Ve.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!Ve.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(wm),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))Ve.off(i,"mouseover",Am);this._activeTrigger[q_]=!1,this._activeTrigger[V_]=!1,this._activeTrigger[Nf]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Ve.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(n){const t=this._getTemplateFactory(n).toHtml();if(!t)return null;t.classList.remove(G_,wm),t.classList.add(`bs-${this.constructor.NAME}-auto`);const r=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",r),this._isAnimated()&&t.classList.add(G_),t}setContent(n){this._newContent=n,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(n){return this._templateFactory?this._templateFactory.changeContent(n):this._templateFactory=new jfe({...this._config,content:n,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Zfe]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(n){return this.constructor.getOrCreateInstance(n.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(G_)}_isShown(){return this.tip&&this.tip.classList.contains(wm)}_createPopper(n){const t=pi(this._config.placement,[this,n,this._element]),r=uge[t.toUpperCase()];return b_(this._element,n,this._getPopperConfig(r))}_getOffset(){const{offset:n}=this._config;return"string"==typeof n?n.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof n?t=>n(t,this._element):n}_resolvePossibleFunction(n){return pi(n,[this._element,this._element])}_getPopperConfig(n){const t={placement:n,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:r=>{this._getTipElement().setAttribute("data-popper-placement",r.state.placement)}}]};return{...t,...pi(this._config.popperConfig,[void 0,t])}}_setListeners(){const n=this._config.trigger.split(" ");for(const t of n)if("click"===t)Ve.on(this._element,this.constructor.eventName("click"),this._config.selector,r=>{const i=this._initializeOnDelegatedTarget(r);i._activeTrigger[q_]=!(i._isShown()&&i._activeTrigger[q_]),i.toggle()});else if("manual"!==t){const r=this.constructor.eventName(t===Nf?"mouseenter":"focusin"),i=this.constructor.eventName(t===Nf?"mouseleave":"focusout");Ve.on(this._element,r,this._config.selector,o=>{const s=this._initializeOnDelegatedTarget(o);s._activeTrigger["focusin"===o.type?V_:Nf]=!0,s._enter()}),Ve.on(this._element,i,this._config.selector,o=>{const s=this._initializeOnDelegatedTarget(o);s._activeTrigger["focusout"===o.type?V_:Nf]=s._element.contains(o.relatedTarget),s._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Ve.on(this._element.closest(".modal"),OU,this._hideModalHandler)}_fixTitle(){const n=this._element.getAttribute("title");n&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",n),this._element.setAttribute("data-bs-original-title",n),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(n,t){clearTimeout(this._timeout),this._timeout=setTimeout(n,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(n){const t=Rs.getDataAttributes(this._element);for(const r of Object.keys(t))Wfe.has(r)&&delete t[r];return n={...t,..."object"==typeof n&&n?n:{}},n=this._mergeConfigObj(n),n=this._configAfterMerge(n),this._typeCheckConfig(n),n}_configAfterMerge(n){return n.container=!1===n.container?document.body:ba(n.container),"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),"number"==typeof n.title&&(n.title=n.title.toString()),"number"==typeof n.content&&(n.content=n.content.toString()),n}_getDelegateConfig(){const n={};for(const[t,r]of Object.entries(this._config))this.constructor.Default[t]!==r&&(n[t]=r);return n.selector=!1,n.trigger="manual",n}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(n){return this.each(function(){const t=td.getOrCreateInstance(this,n);if("string"==typeof n){if(typeof t[n]>"u")throw new TypeError(`No method named "${n}"`);t[n]()}})}}$i(td);const gge=".popover-header",hge=".popover-body",pge={...td.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Ige={...td.DefaultType,content:"(null|string|element|function)"};class z_ extends td{static get Default(){return pge}static get DefaultType(){return Ige}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[gge]:this._getTitle(),[hge]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(n){return this.each(function(){const t=z_.getOrCreateInstance(this,n);if("string"==typeof n){if(typeof t[n]>"u")throw new TypeError(`No method named "${n}"`);t[n]()}})}}$i(z_);const K_=".bs.scrollspy",yge=`activate${K_}`,RU=`click${K_}`,Ege=`load${K_}.data-api`,nd="active",J_="[href]",PU=".nav-link",_ge=`${PU}, .nav-item > ${PU}, .list-group-item`,Dge={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Sge={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class vm extends _o{constructor(n,t){super(n,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Dge}static get DefaultType(){return Sge}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const n of this._observableSections.values())this._observer.observe(n)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(n){return n.target=ba(n.target)||document.body,n.rootMargin=n.offset?`${n.offset}px 0px -30%`:n.rootMargin,"string"==typeof n.threshold&&(n.threshold=n.threshold.split(",").map(t=>Number.parseFloat(t))),n}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Ve.off(this._config.target,RU),Ve.on(this._config.target,RU,J_,n=>{const t=this._observableSections.get(n.target.hash);if(t){n.preventDefault();const r=this._rootElement||window,i=t.offsetTop-this._element.offsetTop;if(r.scrollTo)return void r.scrollTo({top:i,behavior:"smooth"});r.scrollTop=i}}))}_getNewObserver(){return new IntersectionObserver(t=>this._observerCallback(t),{root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin})}_observerCallback(n){const t=s=>this._targetLinks.get(`#${s.target.id}`),r=s=>{this._previousScrollData.visibleEntryTop=s.target.offsetTop,this._process(t(s))},i=(this._rootElement||document.documentElement).scrollTop,o=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const s of n){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(s));continue}const a=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&a){if(r(s),!i)return}else!o&&!a&&r(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const n=Ct.find(J_,this._config.target);for(const t of n){if(!t.hash||Qa(t))continue;const r=Ct.findOne(decodeURI(t.hash),this._element);Yu(r)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,r))}}_process(n){this._activeTarget!==n&&(this._clearActiveClass(this._config.target),this._activeTarget=n,n.classList.add(nd),this._activateParents(n),Ve.trigger(this._element,yge,{relatedTarget:n}))}_activateParents(n){if(n.classList.contains("dropdown-item"))Ct.findOne(".dropdown-toggle",n.closest(".dropdown")).classList.add(nd);else for(const t of Ct.parents(n,".nav, .list-group"))for(const r of Ct.prev(t,_ge))r.classList.add(nd)}_clearActiveClass(n){n.classList.remove(nd);const t=Ct.find(`${J_}.${nd}`,n);for(const r of t)r.classList.remove(nd)}static jQueryInterface(n){return this.each(function(){const t=vm.getOrCreateInstance(this,n);if("string"==typeof n){if(void 0===t[n]||n.startsWith("_")||"constructor"===n)throw new TypeError(`No method named "${n}"`);t[n]()}})}}Ve.on(window,Ege,()=>{for(const e of Ct.find('[data-bs-spy="scroll"]'))vm.getOrCreateInstance(e)}),$i(vm);const qc=".bs.tab",Mge=`hide${qc}`,Fge=`hidden${qc}`,Nge=`show${qc}`,xge=`shown${qc}`,Tge=`click${qc}`,Oge=`keydown${qc}`,Rge=`load${qc}`,Pge="ArrowLeft",UU="ArrowRight",Uge="ArrowUp",HU="ArrowDown",j_="Home",LU="End",zc="active",Y_="show",VU=".dropdown-toggle",W_=`:not(${VU})`,qU='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',$_=`.nav-link${W_}, .list-group-item${W_}, [role="tab"]${W_}, ${qU}`,zge=`.${zc}[data-bs-toggle="tab"], .${zc}[data-bs-toggle="pill"], .${zc}[data-bs-toggle="list"]`;class rd extends _o{constructor(n){super(n),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Ve.on(this._element,Oge,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const n=this._element;if(this._elemIsActive(n))return;const t=this._getActiveElem(),r=t?Ve.trigger(t,Mge,{relatedTarget:n}):null;Ve.trigger(n,Nge,{relatedTarget:t}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(t,n),this._activate(n,t))}_activate(n,t){n&&(n.classList.add(zc),this._activate(Ct.getElementFromSelector(n)),this._queueCallback(()=>{"tab"===n.getAttribute("role")?(n.removeAttribute("tabindex"),n.setAttribute("aria-selected",!0),this._toggleDropDown(n,!0),Ve.trigger(n,xge,{relatedTarget:t})):n.classList.add(Y_)},n,n.classList.contains("fade")))}_deactivate(n,t){n&&(n.classList.remove(zc),n.blur(),this._deactivate(Ct.getElementFromSelector(n)),this._queueCallback(()=>{"tab"===n.getAttribute("role")?(n.setAttribute("aria-selected",!1),n.setAttribute("tabindex","-1"),this._toggleDropDown(n,!1),Ve.trigger(n,Fge,{relatedTarget:t})):n.classList.remove(Y_)},n,n.classList.contains("fade")))}_keydown(n){if(![Pge,UU,Uge,HU,j_,LU].includes(n.key))return;n.stopPropagation(),n.preventDefault();const t=this._getChildren().filter(i=>!Qa(i));let r;if([j_,LU].includes(n.key))r=t[n.key===j_?0:t.length-1];else{const i=[UU,HU].includes(n.key);r=k_(t,n.target,i,!0)}r&&(r.focus({preventScroll:!0}),rd.getOrCreateInstance(r).show())}_getChildren(){return Ct.find($_,this._parent)}_getActiveElem(){return this._getChildren().find(n=>this._elemIsActive(n))||null}_setInitialAttributes(n,t){this._setAttributeIfNotExists(n,"role","tablist");for(const r of t)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(n){n=this._getInnerElement(n);const t=this._elemIsActive(n),r=this._getOuterElement(n);n.setAttribute("aria-selected",t),r!==n&&this._setAttributeIfNotExists(r,"role","presentation"),t||n.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(n,"role","tab"),this._setInitialAttributesOnTargetPanel(n)}_setInitialAttributesOnTargetPanel(n){const t=Ct.getElementFromSelector(n);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),n.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${n.id}`))}_toggleDropDown(n,t){const r=this._getOuterElement(n);if(!r.classList.contains("dropdown"))return;const i=(o,s)=>{const a=Ct.findOne(o,r);a&&a.classList.toggle(s,t)};i(VU,zc),i(".dropdown-menu",Y_),r.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(n,t,r){n.hasAttribute(t)||n.setAttribute(t,r)}_elemIsActive(n){return n.classList.contains(zc)}_getInnerElement(n){return n.matches($_)?n:Ct.findOne($_,n)}_getOuterElement(n){return n.closest(".nav-item, .list-group-item")||n}static jQueryInterface(n){return this.each(function(){const t=rd.getOrCreateInstance(this);if("string"==typeof n){if(void 0===t[n]||n.startsWith("_")||"constructor"===n)throw new TypeError(`No method named "${n}"`);t[n]()}})}}Ve.on(document,Tge,qU,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),!Qa(this)&&rd.getOrCreateInstance(this).show()}),Ve.on(window,Rge,()=>{for(const e of Ct.find(zge))rd.getOrCreateInstance(e)}),$i(rd);const ka=".bs.toast",Jge=`mouseover${ka}`,jge=`mouseout${ka}`,Yge=`focusin${ka}`,Wge=`focusout${ka}`,$ge=`hide${ka}`,Zge=`hidden${ka}`,Xge=`show${ka}`,ehe=`shown${ka}`,_m="show",bm="showing",nhe={animation:"boolean",autohide:"boolean",delay:"number"},rhe={animation:!0,autohide:!0,delay:5e3};class xf extends _o{constructor(n,t){super(n,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return rhe}static get DefaultType(){return nhe}static get NAME(){return"toast"}show(){Ve.trigger(this._element,Xge).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove("hide"),this._element.classList.add(_m,bm),this._queueCallback(()=>{this._element.classList.remove(bm),Ve.trigger(this._element,ehe),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&!Ve.trigger(this._element,$ge).defaultPrevented&&(this._element.classList.add(bm),this._queueCallback(()=>{this._element.classList.add("hide"),this._element.classList.remove(bm,_m),Ve.trigger(this._element,Zge)},this._element,this._config.animation))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(_m),super.dispose()}isShown(){return this._element.classList.contains(_m)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(n,t){switch(n.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const r=n.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){Ve.on(this._element,Jge,n=>this._onInteraction(n,!0)),Ve.on(this._element,jge,n=>this._onInteraction(n,!1)),Ve.on(this._element,Yge,n=>this._onInteraction(n,!0)),Ve.on(this._element,Wge,n=>this._onInteraction(n,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(n){return this.each(function(){const t=xf.getOrCreateInstance(this,n);if("string"==typeof n){if(typeof t[n]>"u")throw new TypeError(`No method named "${n}"`);t[n](this)}})}}fm(xf),$i(xf);let id=(()=>{class e{message;bottom=76;idString=crypto.randomUUID();toast;ngAfterViewInit(){const t=document.getElementById(this.idString);t&&(this.toast=new xf(t,{delay:2e3}))}show(t){t&&(this.message=t),this.toast?.show()}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["lib-toast"]],hostVars:2,hostBindings:function(r,i){2&r&&dA("bottom",i.bottom,"px")},inputs:{message:"message",bottom:"bottom"},decls:3,vars:2,consts:[["role","alert",1,"toast","hide",2,"width","100%",3,"id"],[1,"toast-body"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"div",1),R(2),v()()),2&r&&(gt("id",i.idString),J(2),ft(i.message))},styles:["[_nghost-%COMP%] {\n position: absolute;\n align-self: center;\n}"]})}return e})();const ihe=()=>[],ohe=(e,n)=>n.id;function she(e,n){if(1&e){const t=pt();y(0,"button",15),_e("click",function(){return Qe(t),De(Ee().onTestPrompt())}),y(1,"span",4),R(2,"\u2728"),v()()}}function ahe(e,n){1&e&&(y(0,"div",13)(1,"span",16),R(2," Create your first identity by clicking on the button in the upper right corner. "),v()())}function che(e,n){if(1&e){const t=pt();bh(0),y(1,"div",17),_e("click",function(){const i=Qe(t).$implicit;return De(Ee().onClickSelectIdentity(i.id))}),y(2,"img",18),_e("error",function(i){return Qe(t),De(i.target.src="person-fill.svg")}),v(),y(3,"span",19),R(4),v(),y(5,"lib-icon-button",20),_e("click",function(i){const o=Qe(t).$implicit;return De(Ee().onClickEditIdentity(o.id,i))}),v()()}if(2&e){const t=n.$implicit,r=Ee(),i=function pF(e){const t=Ka(tQ(),26+e);if(t===gF)throw new Pe(314,!1);return t}(19),o=t.id===(null==i?null:i.selectedIdentityId);J(),er("selected",o),J(),gt("src",r.getAvatarUrl(t),ec),J(2),ft(r.getDisplayName(t))}}let lhe=(()=>{class e extends Nr{storage=de(lr);#e=de(An);#t=de(om);#n=de(Si);#r=new Map;get isRecklessMode(){return this.storage.getSignerMetaHandler().signerMetaData?.recklessMode??!1}ngOnInit(){var t=this;return I(function*(){yield t.#t.initialize(),t.#a()})()}#a(){const t=this.storage.getBrowserSessionHandler().browserSessionData?.identities??[];for(const r of t){const i=rr.pubkeyFromPrivkey(r.privkey),o=this.#t.getCachedProfile(i);this.#r.set(r.id,o)}}getAvatarUrl(t){return this.#r.get(t.id)?.picture||"person-fill.svg"}getDisplayName(t){const r=this.#r.get(t.id)??null;return this.#t.getDisplayName(r)||t.nick}onClickNewIdentity(){this.#e.navigateByUrl("/new-identity")}onClickEditIdentity(t,r){r.stopPropagation(),this.#e.navigateByUrl(`/edit-identity/${t}/home`)}onClickSelectIdentity(t){var r=this;return I(function*(){yield r.storage.switchIdentity(t)})()}onToggleRecklessMode(){var t=this;return I(function*(){const r=!t.isRecklessMode;yield t.storage.getSignerMetaHandler().setRecklessMode(r)})()}onClickWhitelistedApps(){this.#e.navigateByUrl("/whitelisted-apps")}onClickLock(){var t=this;return I(function*(){t.#n.logVaultLock(),yield t.storage.lockVault(),t.#e.navigateByUrl("/vault-login")})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-identities"]],features:[Nt],decls:26,vars:5,consts:[["toast",""],[1,"custom-header",2,"position","sticky","top","0"],[1,"header-buttons"],["title","Lock",1,"header-btn",3,"click"],[1,"emoji"],["title","Test Permission Prompt",1,"header-btn"],[1,"text"],["title","New Identity",1,"add-btn",3,"click"],[1,"reckless-mode-row"],[1,"reckless-label",3,"click"],["type","checkbox",3,"click","change","checked"],["data-bs-toggle","tooltip","data-bs-placement","bottom","title","Auto-approve all actions. If whitelist has entries, only those apps are auto-approved.",1,"reckless-text"],["title","Manage whitelisted apps",1,"gear-btn",3,"click"],[1,"empty-state"],[1,"identity",3,"selected"],["title","Test Permission Prompt",1,"header-btn",3,"click"],[1,"sam-text-muted"],[1,"identity",3,"click"],["alt","",1,"avatar",3,"error","src"],[1,"name"],["icon","\u2699\ufe0f","title","Identity settings",3,"click"]],template:function(r,i){if(1&r){const o=pt();y(0,"div",1)(1,"div",2)(2,"button",3),_e("click",function(){return Qe(o),De(i.onClickLock())}),y(3,"span",4),R(4,"\u{1f512}"),v()(),At(5,she,3,0,"button",5),v(),y(6,"span",6),R(7,"Identities"),v(),y(8,"button",7),_e("click",function(){return Qe(o),De(i.onClickNewIdentity())}),y(9,"span",4),R(10,"\u2795"),v()()(),y(11,"div",8)(12,"label",9),_e("click",function(){return Qe(o),De(i.onToggleRecklessMode())}),y(13,"input",10),_e("click",function(a){return Qe(o),De(a.stopPropagation())})("change",function(){return Qe(o),De(i.onToggleRecklessMode())}),v(),y(14,"span",11),R(15,"Reckless mode"),v()(),y(16,"button",12),_e("click",function(){return Qe(o),De(i.onClickWhitelistedApps())}),y(17,"span",4),R(18,"\u2699\ufe0f"),v()()(),bh(19)(20),At(21,ahe,3,0,"div",13),Rr(22,che,6,4,"div",14,ohe),ot(24,"lib-toast",null,0)}if(2&r){let o;J(5),tt(i.devMode?5:-1),J(8),gt("checked",i.isRecklessMode),J(6);const s=function hF(e){return li("NgLet"),gC(bt(),be(),kr(),e),e}(i.storage.getBrowserSessionHandler().browserSessionData),a=null!==(o=null==s?null:s.identities)&&void 0!==o?o:function CF(e,n,t){const r=zr()+e,i=be();return i[r]===Rt?Oo(i,r,t?n.call(t):n()):function sA(e,n){return e[n]}(i,r)}(4,ihe);J(2),tt(0===a.length?21:-1),J(),Pr(a)}},dependencies:[xs,id],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n}\n[_nghost-%COMP%] > *[_ngcontent-%COMP%]:not(.custom-header) {\n margin-left: var(--size);\n margin-right: var(--size);\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] {\n height: 48px;\n min-height: 48px;\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: auto;\n align-items: center;\n background: var(--background);\n position: relative;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .header-buttons[_ngcontent-%COMP%] {\n position: absolute;\n left: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .header-btn[_ngcontent-%COMP%], \n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: background-color 0.2s;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .header-btn[_ngcontent-%COMP%]:hover, \n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%]:hover {\n background-color: var(--background-light);\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .header-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%], \n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 20px;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] {\n position: absolute;\n right: 0;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] {\n font-family: var(--font-heading);\n font-size: 24px;\n font-weight: 700;\n letter-spacing: 0.1rem;\n justify-self: center;\n}\n[_nghost-%COMP%] .reckless-mode-row[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 8px 12px;\n margin-bottom: 12px;\n background: var(--background-light);\n border-radius: 8px;\n}\n[_nghost-%COMP%] .reckless-mode-row[_ngcontent-%COMP%] .reckless-label[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n -webkit-user-select: none;\n user-select: none;\n}\n[_nghost-%COMP%] .reckless-mode-row[_ngcontent-%COMP%] .reckless-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%] {\n width: 16px;\n height: 16px;\n accent-color: var(--primary);\n cursor: pointer;\n}\n[_nghost-%COMP%] .reckless-mode-row[_ngcontent-%COMP%] .reckless-label[_ngcontent-%COMP%] .reckless-text[_ngcontent-%COMP%] {\n font-size: 14px;\n color: var(--foreground);\n}\n[_nghost-%COMP%] .reckless-mode-row[_ngcontent-%COMP%] .gear-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n color: var(--muted-foreground);\n padding: 4px 8px;\n cursor: pointer;\n border-radius: 4px;\n transition: color 0.15s ease, background-color 0.15s ease;\n}\n[_nghost-%COMP%] .reckless-mode-row[_ngcontent-%COMP%] .gear-btn[_ngcontent-%COMP%]:hover {\n color: var(--foreground);\n background: var(--background-light-hover);\n}\n[_nghost-%COMP%] .reckless-mode-row[_ngcontent-%COMP%] .gear-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 16px;\n}\n[_nghost-%COMP%] .empty-state[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n[_nghost-%COMP%] .identity[_ngcontent-%COMP%] {\n height: 56px;\n min-height: 56px;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 12px;\n padding-left: 12px;\n padding-right: 8px;\n background: var(--background-light);\n border-radius: 8px;\n margin-bottom: 8px;\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n[_nghost-%COMP%] .identity[_ngcontent-%COMP%]:hover {\n background: var(--background-light-hover);\n}\n[_nghost-%COMP%] .identity.selected[_ngcontent-%COMP%] {\n background: rgba(245, 158, 11, 0.15);\n border: 1px solid var(--primary);\n}\n[_nghost-%COMP%] .identity[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%] {\n width: 36px;\n height: 36px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n background: var(--muted);\n}\n[_nghost-%COMP%] .identity[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] {\n flex-grow: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: 500;\n}"]})}return e})();function Z_(){return(Z_=I(function*(e,n,t=1e4){const r=function uhe(e){if(!e||"string"!=typeof e)return null;const n=e.toLowerCase().trim().split("@");if(2!==n.length)return null;const[t,r]=n;return t&&r&&r.includes(".")&&!r.includes("/")?{name:t,domain:r}:null}(e);if(!r)return{valid:!1,error:"Invalid NIP-05 format"};const{name:i,domain:o}=r,s=`https://${o}/.well-known/nostr.json?name=${encodeURIComponent(i)}`;try{const a=new AbortController,c=setTimeout(()=>a.abort(),t),l=yield fetch(s,{signal:a.signal,headers:{Accept:"application/json"}});if(clearTimeout(c),!l.ok)return{valid:!1,error:`HTTP ${l.status}: ${l.statusText}`};const u=yield l.json();if(!u.names||"object"!=typeof u.names)return{valid:!1,error:"Invalid nostr.json structure: missing names"};const d=u.names[i]||u.names[i.toLowerCase()];if(!d)return{valid:!1,error:`Name "${i}" not found in nostr.json`};const f=n.toLowerCase(),A=d.toLowerCase(),p=f===A;let C;if(u.relays&&"object"==typeof u.relays){const E=u.relays[d]||u.relays[A];Array.isArray(E)&&(C=E)}return{valid:p,pubkey:d,relays:C,error:p?void 0:"Pubkey mismatch"}}catch(a){return a instanceof Error?"AbortError"===a.name?{valid:!1,error:"Request timeout"}:{valid:!1,error:a.message}:{valid:!1,error:"Unknown error"}}})).apply(this,arguments)}let Ahe=(()=>{class e{value;first=9;last=5;color="#dee2e6bf";npub;npubString;ngOnInit(){const t=rr.getNostrPubkeyObject(this.value);this.npub=t.npub,this.npubString=rr.splitKey(t.npub,this.first,this.last)}copyToClipboard(){this.npub&&navigator.clipboard.writeText(this.npub)}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["lib-pubkey"]],inputs:{value:"value",first:"first",last:"last",color:"color"},decls:3,vars:3,consts:[["icon","copy",3,"click"]],template:function(r,i){1&r&&(y(0,"span"),R(1),v(),y(2,"lib-icon-button",0),_e("click",function(){return i.copyToClipboard()}),v()),2&r&&(dA("color",i.color),J(),ft(i.npubString))},dependencies:[xs],styles:["[_nghost-%COMP%] {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: calc(var(--size) / 2);\n}"]})}return e})(),fhe=(()=>{class e{transform(t){return typeof t>"u"?"":t.startsWith("_@")?t.split("_@")[1]:t}static \u0275fac=function(r){return new(r||e)};static \u0275pipe=Or({name:"visualNip05",type:e,pure:!0})}return e})();function ghe(e,n){if(1&e){const t=pt();y(0,"button",20),_e("click",function(){return Qe(t),De(Ee().onTestPrompt())}),y(1,"span",4),R(2,"\u2728"),v()()}}function hhe(e,n){if(1&e&&(y(0,"span",15),R(1),v()),2&e){const t=Ee();J(),Zt(" ",t.username," ")}}function phe(e,n){1&e&&ot(0,"i",21)}function Ihe(e,n){1&e&&ot(0,"i",23)}function mhe(e,n){1&e&&ot(0,"i",24)}function Che(e,n){1&e&&At(0,Ihe,1,0,"i",23)(1,mhe,1,0,"i",24),2&e&&tt(Ee(2).nip05isValidated?0:1)}function yhe(e,n){if(1&e&&(y(0,"div",16),At(1,phe,1,0,"i",21)(2,Che,2,1),y(3,"span",22),R(4),mA(5,"visualNip05"),v()()),2&e){const t=Ee();J(),tt(t.validating?1:2),J(3),ft(hB(5,2,null==t.profile?null:t.profile.nip05))}}function Ehe(e,n){if(1&e&&(y(0,"div",19)(1,"div",25),R(2,"About"),v(),y(3,"div",26),R(4),v()()),2&e){const t=Ee();J(4),ft(t.aboutText)}}let Bhe=(()=>{class e extends Nr{selectedIdentity;selectedIdentityNpub;profile=null;nip05isValidated;validating=!1;loading=!0;#e=de(An);#t=de(om);#n=de(Si);ngOnInit(){this.#r()}get displayName(){return this.#t.getDisplayName(this.profile)}get username(){return this.#t.getUsername(this.profile)}get avatarUrl(){return this.profile?.picture}get bannerUrl(){return this.profile?.banner}get aboutText(){return this.profile?.about}copyToClipboard(t){t&&navigator.clipboard.writeText(t)}onClickShowDetails(){this.selectedIdentity&&this.#e.navigateByUrl(`/edit-identity/${this.selectedIdentity.id}/home`)}onClickEditProfile(){this.selectedIdentity&&this.#e.navigateByUrl("/profile-edit")}onClickLock(){var t=this;return I(function*(){t.#n.logVaultLock(),yield t.storage.lockVault(),t.#e.navigateByUrl("/vault-login")})()}#r(){var t=this;return I(function*(){try{const r=t.storage.getBrowserSessionHandler().browserSessionData?.selectedIdentityId??null,i=t.storage.getBrowserSessionHandler().browserSessionData?.identities.find(c=>c.id===r);if(!i)return void(t.loading=!1);t.selectedIdentity=i;const o=rr.pubkeyFromPrivkey(i.privkey);t.selectedIdentityNpub=rr.pubkey2npub(o),yield t.#t.initialize();const s=t.#t.getCachedProfile(o);if(s)return t.profile=s,t.loading=!1,void(s.nip05&&t.#a(o,s.nip05));t.loading=!0;const a=yield t.#t.fetchProfile(o);a&&(t.profile=a,a.nip05&&t.#a(o,a.nip05)),t.loading=!1}catch(r){console.error(r),t.loading=!1}})()}#a(t,r){var i=this;return I(function*(){try{i.validating=!0;const o=yield function dhe(e,n){return Z_.apply(this,arguments)}(r,t);i.nip05isValidated=o.valid,o.valid?i.#n.logNip05ValidationSuccess(r,t):i.#n.logNip05ValidationError(r,o.error??"Unknown error"),i.validating=!1}catch(o){const s=o instanceof Error?o.message:"Unknown error";i.#n.logNip05ValidationError(r,s),i.nip05isValidated=!1,i.validating=!1}})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-identity"]],features:[Nt],decls:27,vars:13,consts:[["toast",""],[1,"sam-text-header"],[1,"header-buttons"],["title","Lock",1,"header-btn",3,"click"],[1,"emoji"],["title","Test Permission Prompt",1,"header-btn"],["title","Edit profile",1,"edit-btn",3,"click"],[1,"identity-container"],[1,"banner-background"],[1,"banner-overlay"],[1,"profile-content"],[1,"avatar-frame"],["alt","",1,"avatar-image",3,"src"],[1,"name-badge-container",3,"click"],[1,"display-name"],[1,"username"],[1,"nip05-row"],[1,"npub-wrapper"],[3,"click","value","first","last"],[1,"about-section"],["title","Test Permission Prompt",1,"header-btn",3,"click"],[1,"bi","bi-circle","color-activity"],[1,"nip05-badge"],[1,"bi","bi-patch-check","sam-color-primary"],[1,"bi","bi-exclamation-octagon-fill","sam-color-danger"],[1,"about-header"],[1,"about-content"]],template:function(r,i){if(1&r){const o=pt();y(0,"div",1)(1,"div",2)(2,"button",3),_e("click",function(){return Qe(o),De(i.onClickLock())}),y(3,"span",4),R(4,"\u{1f512}"),v()(),At(5,ghe,3,0,"button",5),v(),y(6,"span"),R(7,"You"),v(),y(8,"button",6),_e("click",function(){return Qe(o),De(i.onClickEditProfile())}),y(9,"span",4),R(10,"\u{1f4dd}"),v()()(),y(11,"div",7)(12,"div",8),ot(13,"div",9),y(14,"div",10)(15,"div",11),ot(16,"img",12),v(),y(17,"div",13),_e("click",function(){return Qe(o),De(i.onClickShowDetails())}),y(18,"span",14),R(19),v(),At(20,hhe,2,1,"span",15),v(),At(21,yhe,6,4,"div",16),y(22,"div",17)(23,"lib-pubkey",18),_e("click",function(){Qe(o);const a=Dn(26);return i.copyToClipboard(i.selectedIdentityNpub),De(a.show("Copied to clipboard"))}),v()()()()(),At(24,Ehe,5,1,"div",19),ot(25,"lib-toast",null,0)}if(2&r){let o;J(5),tt(i.devMode?5:-1),J(7),dA("background-image",i.bannerUrl?"url("+i.bannerUrl+")":"none"),J(3),er("has-image",i.avatarUrl),J(),gt("src",i.avatarUrl||"person-fill.svg",ec),J(3),Zt(" ",i.displayName||(null==i.selectedIdentity?null:i.selectedIdentity.nick)||"Unknown"," "),J(),tt(i.username?20:-1),J(),tt(null!=i.profile&&i.profile.nip05?21:-1),J(2),gt("value",null!==(o=i.selectedIdentityNpub)&&void 0!==o?o:"na")("first",14)("last",8),J(),tt(i.aboutText?24:-1)}},dependencies:[Ahe,fhe,id],styles:['[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .edit-btn[_ngcontent-%COMP%] {\n position: absolute;\n right: 0;\n background: transparent;\n border: none;\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: background-color 0.2s;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .edit-btn[_ngcontent-%COMP%]:hover {\n background-color: var(--background-light);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .edit-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 20px;\n}\n[_nghost-%COMP%] .identity-container[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n[_nghost-%COMP%] .banner-background[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n position: relative;\n background-size: cover;\n background-position: center;\n background-color: var(--background-light);\n}\n[_nghost-%COMP%] .banner-background[_ngcontent-%COMP%]::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: inherit;\n background-size: cover;\n background-position: center center;\n}\n[_nghost-%COMP%] .banner-overlay[_ngcontent-%COMP%] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.3) 100%);\n z-index: 1;\n}\n[_nghost-%COMP%] .profile-content[_ngcontent-%COMP%] {\n position: relative;\n z-index: 2;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n padding: 20px;\n}\n[_nghost-%COMP%] .avatar-frame[_ngcontent-%COMP%] {\n height: 120px;\n width: 120px;\n border: 3px solid rgba(255, 255, 255, 0.9);\n border-radius: 100%;\n background: var(--background);\n padding: 12px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);\n}\n[_nghost-%COMP%] .avatar-frame.has-image[_ngcontent-%COMP%] {\n padding: 0;\n}\n[_nghost-%COMP%] .avatar-frame[_ngcontent-%COMP%] .avatar-image[_ngcontent-%COMP%] {\n border-radius: 100%;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n[_nghost-%COMP%] .npub-wrapper[_ngcontent-%COMP%], [_nghost-%COMP%] .nip05-row[_ngcontent-%COMP%], [_nghost-%COMP%] .name-badge-container[_ngcontent-%COMP%] {\n background-color: rgba(0, 0, 0, 0.75);\n padding: 6px 14px;\n border-radius: 6px;\n max-width: 300px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n backdrop-filter: blur(4px);\n}\n[_nghost-%COMP%] .name-badge-container[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n cursor: pointer;\n white-space: normal;\n text-align: center;\n}\n[_nghost-%COMP%] .name-badge-container[_ngcontent-%COMP%]:hover {\n background-color: rgba(0, 0, 0, 0.85);\n}\n[_nghost-%COMP%] .name-badge-container[_ngcontent-%COMP%] .display-name[_ngcontent-%COMP%] {\n font-family: var(--font-heading);\n font-size: 22px;\n font-weight: 700;\n letter-spacing: 0.05rem;\n color: #ffffff;\n}\n[_nghost-%COMP%] .name-badge-container[_ngcontent-%COMP%] .username[_ngcontent-%COMP%] {\n font-size: 13px;\n font-weight: 400;\n color: rgba(255, 255, 255, 0.85);\n}\n[_nghost-%COMP%] .nip05-row[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n}\n[_nghost-%COMP%] .nip05-row[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 16px;\n}\n[_nghost-%COMP%] .nip05-badge[_ngcontent-%COMP%] {\n font-size: 13px;\n color: var(--primary);\n}\n[_nghost-%COMP%] .npub-wrapper[_ngcontent-%COMP%] {\n padding: 8px 14px;\n}\n[_nghost-%COMP%] .npub-wrapper[_ngcontent-%COMP%] lib-pubkey[_ngcontent-%COMP%] {\n cursor: pointer;\n}\n[_nghost-%COMP%] .color-activity[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n animation: _ngcontent-%COMP%_pulse 1.5s infinite;\n}\n@keyframes _ngcontent-%COMP%_pulse {\n 0%, 100% {\n opacity: 0.4;\n }\n 50% {\n opacity: 1;\n }\n}\n[_nghost-%COMP%] .about-section[_ngcontent-%COMP%] {\n margin: var(--size);\n margin-top: 0;\n flex-shrink: 0;\n max-height: 150px;\n display: flex;\n flex-direction: column;\n}\n[_nghost-%COMP%] .about-section[_ngcontent-%COMP%] .about-header[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n font-weight: 600;\n color: var(--muted-foreground);\n margin-bottom: var(--size-h);\n}\n[_nghost-%COMP%] .about-section[_ngcontent-%COMP%] .about-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n font-size: 0.9rem;\n line-height: 1.5;\n color: var(--foreground);\n background: var(--background-light);\n border-radius: var(--radius-sm);\n padding: var(--size);\n white-space: pre-wrap;\n word-break: break-word;\n}']})}return e})();const whe=JSON.parse('{"Ie":{"i":{"r":"1.2.0"}}}');function vhe(e,n){if(1&e){const t=pt();y(0,"button",6),_e("click",function(){return Qe(t),De(Ee().onTestPrompt())}),y(1,"span",3),R(2,"\u2728"),v()()}}let _he=(()=>{class e extends Nr{#e=de(Si);#t=de(An);version=whe.Ie.i.r;onClickLock(){var t=this;return I(function*(){t.#e.logVaultLock(),yield t.storage.lockVault(),t.#t.navigateByUrl("/vault-login")})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-info"]],features:[Nt],decls:16,vars:2,consts:[[1,"sam-text-header"],[1,"header-buttons"],["title","Lock",1,"header-btn",3,"click"],[1,"emoji"],["title","Test Permission Prompt",1,"header-btn"],["href","https://orly.dev","target","_blank"],["title","Test Permission Prompt",1,"header-btn",3,"click"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"div",1)(2,"button",2),_e("click",function(){return i.onClickLock()}),y(3,"span",3),R(4,"\u{1f512}"),v()(),At(5,vhe,3,0,"button",4),v(),y(6,"span"),R(7," Smesh Signer "),v()(),y(8,"span"),R(9),v(),y(10,"span"),R(11,"\xa0"),v(),y(12,"span"),R(13," Source code"),v(),y(14,"a",5),R(15," orly.dev\n"),v()),2&r&&(J(5),tt(i.devMode?5:-1),J(4),Zt("Version ",i.version,""))},styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow-y: auto;\n}\n[_nghost-%COMP%] > *[_ngcontent-%COMP%]:not(.sam-text-header) {\n margin-left: var(--size);\n margin-right: var(--size);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] {\n width: 100%;\n}"]})}return e})();class bhe{static dateToISOLikeButLocal(n){const t=60*n.getTimezoneOffset()*1e3,r=n.getTime()-t;return new Date(r).toISOString().slice(0,19).replace("T"," ").replaceAll(":",".")}}let Tf=(()=>{class e{yes=new Pn;no=new Pn;message;onYes;modal;idString=crypto.randomUUID();ngAfterViewInit(){const t=document.getElementById(this.idString);t&&(this.modal=new Vc(t))}onClickYes(){this.modal?.hide(),typeof this.onYes<"u"&&this.onYes()}show(t,r){this.message=t,this.onYes=r,this.modal?.show()}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["lib-confirm"]],outputs:{yes:"yes",no:"no"},decls:15,vars:2,consts:[["data-bs-backdrop","static","tabindex","-1",1,"modal","fade",3,"id"],[1,"modal-dialog","modal-sm","modal-dialog-centered","modal-dialog-scrollable"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"btn-close",3,"click"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h5",4),R(5,"Please confirm"),v(),y(6,"button",5),_e("click",function(){return null==i.modal||i.modal.hide(),i.no.emit()}),v()(),y(7,"div",6)(8,"span"),R(9),v()(),y(10,"div",7)(11,"button",8),_e("click",function(){return null==i.modal?null:i.modal.hide()}),R(12," No "),v(),y(13,"button",9),_e("click",function(){return i.onClickYes()}),R(14," Yes "),v()()()()()),2&r&&(gt("id",i.idString),J(9),ft(i.message))},styles:["[_nghost-%COMP%] .modal[_ngcontent-%COMP%] {\n --bs-modal-margin: 32px;\n}"]})}return e})(),KU=(()=>{class e{text;static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["lib-nav-item"]],inputs:{text:"text"},decls:5,vars:1,consts:[[1,"sam-no-select","text"],[1,"sam-flex-grow"],[1,"buttons","sam-flex-row","gap-h"],["icon","arrow-right",2,"pointer-events","none"]],template:function(r,i){1&r&&(y(0,"span",0),R(1),v(),ot(2,"div",1),y(3,"div",2),ot(4,"lib-icon-button",3),v()),2&r&&(J(),Zt(" ",i.text,"\n"))},dependencies:[xs],styles:["[_nghost-%COMP%] {\n cursor: pointer;\n height: 48px;\n min-height: 48px;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-left: var(--size);\n padding-right: var(--size-h);\n background: var(--background-light);\n border-radius: var(--radius-lg);\n margin-bottom: var(--size-h);\n border: 1px solid var(--border);\n transition: background-color 0.2s ease, border-color 0.2s ease;\n}\n[_nghost-%COMP%]:hover {\n background: var(--background-light-hover);\n border-color: var(--primary);\n}\n[_nghost-%COMP%] .text[_ngcontent-%COMP%] {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--foreground);\n}"]})}return e})();function Qhe(e,n){if(1&e){const t=pt();y(0,"button",21),_e("click",function(){return Qe(t),De(Ee().onTestPrompt())}),y(1,"span",5),R(2,"\u2728"),v()()}}let Dhe=(()=>{class e extends Nr{#e=de(An);syncFlow;devMode=!1;newPassword="";changingPassword=!1;passwordChanged=!1;#t=de(lr);#n=de(Uu);#r=de(Si);ngOnInit(){const t=JSON.stringify(this.#t.getBrowserSyncHandler().browserSyncData);switch(console.log(t.length/1024+" KB"),this.#t.getSignerMetaHandler().signerMetaData?.syncFlow){case Ec.NO_SYNC:this.syncFlow="Off";break;case Ec.BROWSER_SYNC:this.syncFlow="Mozilla Firefox"}this.devMode=this.#t.getSignerMetaHandler().signerMetaData?.devMode??!1}onToggleDevMode(t){var r=this;return I(function*(){const i=t.target.checked;r.devMode=i,yield r.#t.getSignerMetaHandler().setDevMode(i)})()}onTestPrompt(){var t=this;return I(function*(){const r={kind:1,content:"This is a test note for permission prompt preview.",tags:[],created_at:Math.floor(Date.now()/1e3)},i=yn.Buffer.from(JSON.stringify(r,null,2)).toString("base64"),s=t.#t.getBrowserSessionHandler().browserSessionData?.identities.find(d=>d.id===t.#t.getBrowserSessionHandler().browserSessionData?.selectedIdentityId)?.nick??"Test Identity",l=Math.round((screen.width-375)/2),u=Math.round((screen.height-600)/2);nn().windows.create({type:"popup",url:`prompt.html?method=signEvent&host=example.com&id=test-${Date.now()}&nick=${encodeURIComponent(s)}&event=${i}`,width:375,height:600,left:l,top:u})})()}onResetExtension(){var t=this;return I(function*(){try{t.#r.logVaultReset(),yield t.#t.resetExtension(),t.#n.startOver(Hu())}catch(r){console.log(r)}})()}onChangePassword(){var t=this;return I(function*(){if(t.newPassword&&!t.changingPassword){t.changingPassword=!0,t.passwordChanged=!1;try{yield t.#t.changePassword(t.newPassword),t.passwordChanged=!0,t.newPassword=""}catch(r){console.error("Change password failed:",r)}finally{t.changingPassword=!1}}})()}onClickExportVault(){var t=this;return I(function*(){const r=t.#t.exportVault(),o=`Smesh Signer Firefox - Vault Export - ${bhe.dateToISOLikeButLocal(new Date)}.json`;t.#a(r,o),t.#r.logVaultExport(o)})()}#a(t,r){const i="data:text/json;charset=utf-8,"+encodeURIComponent(t),o=document.createElement("a");o.setAttribute("href",i),o.setAttribute("download",r),document.body.appendChild(o),o.click(),o.remove()}onClickLock(){var t=this;return I(function*(){t.#r.logVaultLock(),yield t.#t.lockVault(),t.#e.navigateByUrl("/vault-login")})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-settings"]],features:[Nt],decls:32,vars:9,consts:[["newPasswordInput",""],["confirm",""],[1,"sam-text-header"],[1,"header-buttons"],["title","Lock",1,"header-btn",3,"click"],[1,"emoji"],["title","Test Permission Prompt",1,"header-btn"],[1,"password-row"],[1,"input-group"],["type","password","placeholder","new password",1,"form-control",3,"ngModelChange","ngModel"],[1,"btn",3,"click","disabled"],[1,"vault-buttons"],[1,"btn","btn-primary",3,"click"],["text","\u{1f4be} Backups",3,"click"],["text","\u{1fab5} Logs",3,"click"],["text","\u{1f4a1} Info",3,"click"],[1,"dev-mode-row"],[1,"toggle-label"],["type","checkbox",3,"change","checked"],[1,"sam-flex-grow"],[1,"btn","btn-danger",3,"click"],["title","Test Permission Prompt",1,"header-btn",3,"click"]],template:function(r,i){if(1&r){const o=pt();y(0,"div",2)(1,"div",3)(2,"button",4),_e("click",function(){return Qe(o),De(i.onClickLock())}),y(3,"span",5),R(4,"\u{1f512}"),v()(),At(5,Qhe,3,0,"button",6),v(),y(6,"span"),R(7," Settings "),v()(),y(8,"div",7)(9,"div",8)(10,"input",9,0),an("ngModelChange",function(a){return Qe(o),dn(i.newPassword,a)||(i.newPassword=a),De(a)}),v(),y(12,"button",10),_e("click",function(){return Qe(o),De(i.onChangePassword())}),R(13),v()()(),y(14,"div",11)(15,"button",12),_e("click",function(){return Qe(o),De(i.onClickExportVault())}),R(16," Export Vault "),v(),y(17,"button",12),_e("click",function(){return Qe(o),De(i.navigate("/vault-import"))}),R(18," Import Vault "),v()(),y(19,"lib-nav-item",13),_e("click",function(){return Qe(o),De(i.navigate("/home/backups"))}),v(),y(20,"lib-nav-item",14),_e("click",function(){return Qe(o),De(i.navigate("/home/logs"))}),v(),y(21,"lib-nav-item",15),_e("click",function(){return Qe(o),De(i.navigate("/home/info"))}),v(),y(22,"div",16)(23,"label",17)(24,"input",18),_e("change",function(a){return Qe(o),De(i.onToggleDevMode(a))}),v(),y(25,"span"),R(26,"Dev Mode"),v()()(),ot(27,"div",19),y(28,"button",20),_e("click",function(){return Qe(o),De(Dn(31).show("Do you really want to reset your extension? Every data will be lost.",i.onResetExtension.bind(i)))}),R(29," Reset Extension\n"),v(),ot(30,"lib-confirm",null,1)}2&r&&(J(5),tt(i.devMode?5:-1),J(5),sn("ngModel",i.newPassword),J(2),er("btn-primary",!i.passwordChanged)("btn-success",i.passwordChanged),gt("disabled",!i.newPassword||i.changingPassword),J(),Zt(" ",i.changingPassword?"...":i.passwordChanged?"Changed":"Change"," "),J(11),gt("checked",i.devMode))},dependencies:[Tf,KU,Ko,mo,Co,qi],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n row-gap: var(--size);\n overflow-y: auto;\n}\n[_nghost-%COMP%] > *[_ngcontent-%COMP%]:not(.sam-text-header) {\n margin-left: var(--size);\n margin-right: var(--size);\n}\n[_nghost-%COMP%] .file-input[_ngcontent-%COMP%] {\n position: absolute;\n visibility: hidden;\n}\n\n.password-row[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] {\n display: flex;\n}\n.password-row[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n}\n.password-row[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .btn-success[_ngcontent-%COMP%] {\n background: var(--success, #22c55e);\n border-color: var(--success, #22c55e);\n color: #fff;\n}\n\n.vault-buttons[_ngcontent-%COMP%] {\n display: flex;\n gap: var(--size);\n}\n.vault-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.dev-mode-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--size);\n}\n.dev-mode-row[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--size-h);\n cursor: pointer;\n font-size: 0.9rem;\n}\n.dev-mode-row[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%] {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n\n.sync-info[_ngcontent-%COMP%] .sync-label[_ngcontent-%COMP%] {\n display: block;\n font-weight: 500;\n}\n.sync-info[_ngcontent-%COMP%] .sync-note[_ngcontent-%COMP%] {\n margin: var(--size-h) 0 0 0;\n font-size: 0.85rem;\n color: var(--muted-foreground);\n line-height: 1.4;\n}"]})}return e})();const She=(e,n)=>n.timestamp;function khe(e,n){if(1&e){const t=pt();y(0,"button",11),_e("click",function(){return Qe(t),De(Ee().onTestPrompt())}),y(1,"span",3),R(2,"\u2728"),v()()}}function Mhe(e,n){1&e&&(y(0,"div",9),R(1,"No activity logged yet"),v())}function Fhe(e,n){if(1&e&&(y(0,"div",12)(1,"span",13),R(2),v(),y(3,"span",14),R(4),mA(5,"date"),v(),y(6,"span",15),R(7),v()()),2&e){const t=n.$implicit;mh(Ee().getLevelClass(t.level)),J(2),ft(t.icon),J(2),ft(pB(5,5,t.timestamp,"HH:mm:ss")),J(3),ft(t.message)}}let Nhe=(()=>{class e extends Nr{#e=de(Si);#t=de(An);get logs(){return this.#e.logs}ngOnInit(){this.#e.refreshLogs()}onRefresh(){var t=this;return I(function*(){yield t.#e.refreshLogs()})()}onClear(){var t=this;return I(function*(){yield t.#e.clear()})()}getLevelClass(t){switch(t){case"error":return"log-error";case"warn":return"log-warn";case"debug":return"log-debug";default:return"log-info"}}onClickLock(){var t=this;return I(function*(){t.#e.logVaultLock(),yield t.storage.lockVault(),t.#t.navigateByUrl("/vault-login")})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-logs"]],features:[Nt],decls:17,vars:2,consts:[[1,"sam-text-header"],[1,"header-buttons"],["title","Lock",1,"header-btn",3,"click"],[1,"emoji"],["title","Test Permission Prompt",1,"header-btn"],[1,"logs-actions"],["title","Refresh logs",1,"btn","btn-sm","btn-secondary",3,"click"],["title","Clear logs",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"logs-container"],[1,"logs-empty"],[1,"log-entry",3,"class"],["title","Test Permission Prompt",1,"header-btn",3,"click"],[1,"log-entry"],[1,"log-icon","emoji"],[1,"log-time"],[1,"log-message"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"div",1)(2,"button",2),_e("click",function(){return i.onClickLock()}),y(3,"span",3),R(4,"\u{1f512}"),v()(),At(5,khe,3,0,"button",4),v(),y(6,"span"),R(7,"Logs"),v(),y(8,"div",5)(9,"button",6),_e("click",function(){return i.onRefresh()}),R(10,"Refresh"),v(),y(11,"button",7),_e("click",function(){return i.onClear()}),R(12,"Clear"),v()()(),y(13,"div",8),At(14,Mhe,2,0,"div",9),Rr(15,Fhe,8,8,"div",10,She),v()),2&r&&(J(5),tt(i.devMode?5:-1),J(9),tt(0===i.logs.length?14:-1),J(),Pr(i.logs))},dependencies:[t0],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n padding-top: var(--size);\n padding-bottom: var(--size);\n overflow: hidden;\n}\n[_nghost-%COMP%] > *[_ngcontent-%COMP%]:not(.sam-text-header) {\n margin-left: var(--size);\n margin-right: var(--size);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] {\n margin-bottom: var(--size);\n flex-shrink: 0;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .logs-actions[_ngcontent-%COMP%] {\n position: absolute;\n right: 0;\n display: flex;\n gap: 8px;\n}\n\n.logs-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n background: var(--background-light);\n border-radius: 8px;\n padding: var(--size-h);\n}\n\n.logs-empty[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n text-align: center;\n padding: var(--size);\n}\n\n.log-entry[_ngcontent-%COMP%] {\n font-family: var(--font-sans);\n font-size: 11px;\n padding: 6px 8px;\n border-radius: 4px;\n margin-bottom: 2px;\n display: flex;\n gap: 8px;\n align-items: center;\n}\n.log-entry.log-error[_ngcontent-%COMP%] {\n background: rgba(220, 53, 69, 0.15);\n color: #ff6b6b;\n}\n.log-entry.log-warn[_ngcontent-%COMP%] {\n background: rgba(255, 193, 7, 0.15);\n color: #ffc107;\n}\n.log-entry.log-debug[_ngcontent-%COMP%] {\n background: rgba(108, 117, 125, 0.15);\n color: #adb5bd;\n}\n.log-entry.log-info[_ngcontent-%COMP%] {\n background: rgba(13, 110, 253, 0.1);\n color: var(--foreground);\n}\n\n.log-icon[_ngcontent-%COMP%] {\n font-size: 14px;\n flex-shrink: 0;\n width: 18px;\n text-align: center;\n}\n\n.log-time[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n flex-shrink: 0;\n font-size: 10px;\n}\n\n.log-message[_ngcontent-%COMP%] {\n flex: 1;\n word-break: break-word;\n}"]})}return e})();const xhe=(e,n)=>n.id;function The(e,n){if(1&e){const t=pt();y(0,"button",9),_e("click",function(){return Qe(t),De(Ee().onTestPrompt())}),y(1,"span",3),R(2,"\u2728"),v()()}}function Ohe(e,n){1&e&&(y(0,"div",7),R(1,"Loading..."),v())}function Rhe(e,n){1&e&&(y(0,"div",8)(1,"span",10),R(2,' No bookmarks yet. Click "Bookmark This Page" to add the current page. '),v()())}function Phe(e,n){if(1&e){const t=pt();y(0,"div",12),_e("click",function(){const i=Qe(t).$implicit;return De(Ee(2).openBookmark(i))}),y(1,"div",13)(2,"span",14),R(3),v(),y(4,"span",15),R(5),v()(),y(6,"button",16),_e("click",function(i){const o=Qe(t).$implicit;return Ee(2).onRemoveBookmark(o),De(i.stopPropagation())}),y(7,"span",3),R(8,"\u2715"),v()()()}if(2&e){const t=n.$implicit,r=Ee(2);J(3),ft(t.title),J(2),ft(r.getDomain(t.url))}}function Uhe(e,n){1&e&&Rr(0,Phe,9,2,"div",11,xhe),2&e&&Pr(Ee().bookmarks)}let Hhe=(()=>{class e extends Nr{#e=de(Si);#t=new oP;#n=de(An);bookmarks=[];isLoading=!0;ngOnInit(){var t=this;return I(function*(){yield t.loadBookmarks()})()}loadBookmarks(){var t=this;return I(function*(){t.isLoading=!0;try{const r=yield t.#t.loadFullData();t.#t.setFullData(r),t.bookmarks=t.#t.getBookmarks()}catch(r){console.error("Failed to load bookmarks:",r)}finally{t.isLoading=!1}})()}onBookmarkThisPage(){var t=this;return I(function*(){try{const[r]=yield nn().tabs.query({active:!0,currentWindow:!0});if(!r?.url||!r?.title)return void console.error("Could not get current tab info");if(t.bookmarks.some(o=>o.url===r.url))return void console.log("Page already bookmarked");const i={id:crypto.randomUUID(),url:r.url,title:r.title,createdAt:Date.now()};t.bookmarks=[i,...t.bookmarks],yield t.saveBookmarks(),t.#e.logBookmarkAdded(i.url,i.title)}catch(r){console.error("Failed to bookmark page:",r)}})()}onRemoveBookmark(t){var r=this;return I(function*(){r.bookmarks=r.bookmarks.filter(i=>i.id!==t.id),yield r.saveBookmarks(),r.#e.logBookmarkRemoved(t.url,t.title)})()}saveBookmarks(){var t=this;return I(function*(){try{yield t.#t.setBookmarks(t.bookmarks)}catch(r){console.error("Failed to save bookmarks:",r)}})()}openBookmark(t){nn().tabs.create({url:t.url})}getDomain(t){try{return new URL(t).hostname}catch{return t}}onClickLock(){var t=this;return I(function*(){t.#e.logVaultLock(),yield t.storage.lockVault(),t.#n.navigateByUrl("/vault-login")})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-bookmarks"]],features:[Nt],decls:15,vars:2,consts:[[1,"sam-text-header"],[1,"header-buttons"],["title","Lock",1,"header-btn",3,"click"],[1,"emoji"],["title","Test Permission Prompt",1,"header-btn"],["title","Bookmark This Page",1,"add-btn",3,"click"],[1,"bookmarks-container"],[1,"loading-state"],[1,"empty-state"],["title","Test Permission Prompt",1,"header-btn",3,"click"],[1,"sam-text-muted"],[1,"bookmark-item"],[1,"bookmark-item",3,"click"],[1,"bookmark-info"],[1,"bookmark-title"],[1,"bookmark-url"],["title","Remove bookmark",1,"remove-btn",3,"click"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"div",1)(2,"button",2),_e("click",function(){return i.onClickLock()}),y(3,"span",3),R(4,"\u{1f512}"),v()(),At(5,The,3,0,"button",4),v(),y(6,"span"),R(7,"Bookmarks"),v(),y(8,"button",5),_e("click",function(){return i.onBookmarkThisPage()}),y(9,"span",3),R(10,"\u2795"),v()()(),y(11,"div",6),At(12,Ohe,2,0,"div",7)(13,Rhe,3,0,"div",8)(14,Uhe,2,0),v()),2&r&&(J(5),tt(i.devMode?5:-1),J(7),tt(i.isLoading?12:0===i.bookmarks.length?13:14))},styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n padding-top: var(--size);\n padding-bottom: var(--size);\n overflow: hidden;\n}\n[_nghost-%COMP%] > *[_ngcontent-%COMP%]:not(.sam-text-header) {\n margin-left: var(--size);\n margin-right: var(--size);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] {\n margin-bottom: var(--size);\n flex-shrink: 0;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] {\n position: absolute;\n right: 0;\n background: transparent;\n border: none;\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: background-color 0.2s;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%]:hover {\n background-color: var(--background-light);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 20px;\n}\n\n.bookmarks-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n}\n\n.empty-state[_ngcontent-%COMP%], \n.loading-state[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n color: var(--muted-foreground);\n}\n\n.bookmark-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--size-h);\n padding: var(--size-h) var(--size);\n margin-bottom: var(--size-hh);\n background: var(--background-light);\n border-radius: var(--radius-md);\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n.bookmark-item[_ngcontent-%COMP%]:hover {\n background: var(--background-light-hover);\n}\n\n.bookmark-info[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.bookmark-title[_ngcontent-%COMP%] {\n font-size: 0.9rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.bookmark-url[_ngcontent-%COMP%] {\n font-size: 0.75rem;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.remove-btn[_ngcontent-%COMP%] {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n cursor: pointer;\n color: var(--muted-foreground);\n transition: background-color 0.15s ease, color 0.15s ease;\n}\n.remove-btn[_ngcontent-%COMP%]:hover {\n background: var(--destructive);\n color: var(--destructive-foreground);\n}"]})}return e})();class JU{connectionData;ws=null;connected=!1;pendingRequests=new Map;subscriptionId=null;conversationKey;clientPubkey;encryptionMode="nip44";logCallback=null;constructor(n,t){this.connectionData=n,this.logCallback=t??null,this.conversationKey=_I.v2.utils.getConversationKey(rr.hex2bytes(n.secret),n.walletPubkey),this.clientPubkey=kO(rr.hex2bytes(n.secret))}log(n,t){this.logCallback&&this.logCallback(n,t)}connect(){var n=this;return I(function*(){if(!n.connected)return new Promise((t,r)=>{try{n.log("info",`Connecting to ${n.connectionData.relayUrl}...`),n.ws=new WebSocket(n.connectionData.relayUrl);const i=setTimeout(()=>{n.log("error","Connection timeout"),r(new Error("Connection timeout")),n.disconnect()},1e4);n.ws.onopen=()=>{clearTimeout(i),n.connected=!0,n.log("info","Connected to relay"),n.subscribe(),t()},n.ws.onerror=()=>{clearTimeout(i),n.log("error","WebSocket error"),r(new Error("WebSocket error"))},n.ws.onclose=()=>{n.connected=!1,n.subscriptionId=null;for(const[,o]of n.pendingRequests)clearTimeout(o.timeout),o.reject(new Error("Connection closed"));n.pendingRequests.clear()},n.ws.onmessage=o=>{n.handleMessage(o.data)}}catch(i){r(i)}})})()}disconnect(){this.ws&&(this.subscriptionId&&this.ws.send(JSON.stringify(["CLOSE",this.subscriptionId])),this.ws.close(),this.ws=null),this.connected=!1,this.subscriptionId=null}isConnected(){return this.connected&&this.ws?.readyState===WebSocket.OPEN}getInfo(){var n=this;return I(function*(){const t=yield n.sendRequest({method:"get_info"});if(t.error)throw new Error(t.error.message);return t.result})()}getBalance(){var n=this;return I(function*(){const t=yield n.sendRequest({method:"get_balance"});if(t.error)throw new Error(t.error.message);return t.result})()}payInvoice(n){var t=this;return I(function*(){const r=yield t.sendRequest({method:"pay_invoice",params:n});if(r.error)throw new Error(r.error.message);return r.result})()}makeInvoice(n){var t=this;return I(function*(){const r=yield t.sendRequest({method:"make_invoice",params:n});if(r.error)throw new Error(r.error.message);return r.result})()}listTransactions(n){var t=this;return I(function*(){const r=yield t.sendRequest({method:"list_transactions",params:n});if(r.error)throw new Error(r.error.message);return r.result})()}encryptContent(n){var t=this;return I(function*(){return"nip04"===t.encryptionMode?BI.encrypt(t.connectionData.secret,t.connectionData.walletPubkey,n):_I.v2.encrypt(n,t.conversationKey)})()}sendRequest(n){var t=this;return I(function*(r,i=3e4,o=!1){t.isConnected()||(yield t.connect());const s=JSON.stringify(r);t.log("info",`Sending ${r.method} request (using ${t.encryptionMode.toUpperCase()})`);const a=yield t.encryptContent(s),c={kind:23194,created_at:Math.floor(Date.now()/1e3),tags:[["p",t.connectionData.walletPubkey]],content:a},l=wo(c,rr.hex2bytes(t.connectionData.secret));return new Promise((u,d)=>{const f=setTimeout(()=>{t.pendingRequests.delete(l.id),t.log("error",`Request timeout for ${r.method}`),d(new Error("Request timeout"))},i);t.pendingRequests.set(l.id,{resolve:u,reject:d,timeout:f,request:r,isRetry:o}),t.ws.send(JSON.stringify(["EVENT",l]))})}).apply(this,arguments)}retryWithNip04(n){var t=this;return I(function*(){return t.log("warn","Retrying with NIP-04 encryption..."),t.encryptionMode="nip04",t.sendRequest(n,3e4,!0)})()}subscribe(){if(!this.ws||!this.connected)return;this.subscriptionId=Math.random().toString(36).substring(2,15);const n={kinds:[23195],"#p":[this.clientPubkey],since:Math.floor(Date.now()/1e3)-10};this.ws.send(JSON.stringify(["REQ",this.subscriptionId,n]))}handleMessage(n){try{const t=JSON.parse(n);if(!Array.isArray(t))return;const[r,...i]=t;switch(r){case"EVENT":this.handleEvent(i[1]);break;case"OK":case"EOSE":break;case"NOTICE":this.log("warn",`Relay notice: ${i[0]}`)}}catch(t){this.log("error",`Error parsing message: ${t.message}`)}}isEncryptionError(n){const t=n.toLowerCase();return t.includes("decrypt")||t.includes("initialization vector")||t.includes("iv")||t.includes("encrypt")||t.includes("cipher")||t.includes("parse")}handleEvent(n){var t=this;return I(function*(){if(!n||23195!==n.kind||n.pubkey!==t.connectionData.walletPubkey)return;const r=n.tags?.find(s=>"e"===s[0]);if(!r)return;const i=r[1],o=t.pendingRequests.get(i);if(o){clearTimeout(o.timeout),t.pendingRequests.delete(i);try{let s;if(n.content.startsWith("{")||n.content.startsWith('"'))try{const c=JSON.parse(n.content);if(c.error){t.log("error",`Wallet error: ${c.error.message||JSON.stringify(c.error)}`);const l=c.error.message||JSON.stringify(c.error);if(!o.isRetry&&"nip44"===t.encryptionMode&&t.isEncryptionError(l)){t.log("warn","Wallet returned encryption error, switching to NIP-04");try{const u=yield t.retryWithNip04(o.request);return void o.resolve(u)}catch(u){return void o.reject(u)}}return void o.resolve(c)}}catch{}if(n.content.includes("?iv="))t.log("info","Decrypting response (NIP-04 format)"),s=yield BI.decrypt(t.connectionData.secret,t.connectionData.walletPubkey,n.content);else{t.log("info","Decrypting response (NIP-44 format)");try{s=_I.v2.decrypt(n.content,t.conversationKey)}catch(c){t.log("warn",`NIP-44 decryption failed: ${c.message}, trying NIP-04...`);try{s=yield BI.decrypt(t.connectionData.secret,t.connectionData.walletPubkey,n.content)}catch{throw c}}}const a=JSON.parse(s);if(a.error){const c=a.error.message||"";if(!o.isRetry&&"nip44"===t.encryptionMode&&t.isEncryptionError(c)){t.log("warn",`Wallet returned encryption error: ${c}, retrying with NIP-04`);try{const l=yield t.retryWithNip04(o.request);return void o.resolve(l)}catch(l){return void o.reject(l)}}t.log("error",`Wallet error: ${c}`)}else t.log("info","Request successful");o.resolve(a)}catch(s){const a=s.message;if(t.log("error",`Failed to decrypt response: ${a}`),!o.isRetry&&"nip44"===t.encryptionMode&&t.isEncryptionError(a)){t.log("warn","Decryption failed, retrying with NIP-04 encryption");try{const c=yield t.retryWithNip04(o.request);return void o.resolve(c)}catch(c){return void o.reject(c)}}o.reject(new Error(`Failed to decrypt response: ${a}`))}}})()}}let Lhe=(()=>{class e{storageService;clients=new Map;_logs$=new Ii([]);maxLogs=100;logs$=this._logs$.asObservable();constructor(t){this.storageService=t}get logs(){return this._logs$.value}clearLogs(){this._logs$.next([])}addLog(t,r){const o=[{timestamp:new Date,level:t,message:r},...this._logs$.value].slice(0,this.maxLogs);this._logs$.next(o)}createLogCallback(){return(t,r)=>{this.addLog(t,r)}}parseNwcUrl(t){return tP(t)}getConnections(){return this.storageService.getBrowserSessionHandler().browserSessionData?.nwcConnections??[]}getConnection(t){return this.getConnections().find(r=>r.id===t)}addConnection(t,r){var i=this;return I(function*(){yield i.storageService.addNwcConnection({name:t,connectionUrl:r})})()}deleteConnection(t){var r=this;return I(function*(){r.disconnectClient(t),yield r.storageService.deleteNwcConnection(t)})()}getClient(t){var r=this;return I(function*(){const i=r.clients.get(t);if(i&&i.client.isConnected())return i.client;const o=r.getConnection(t);if(!o)throw new Error("Connection not found");const a=new JU({walletPubkey:o.walletPubkey,relayUrl:o.relayUrl,secret:o.secret},r.createLogCallback());return yield a.connect(),r.clients.set(t,{client:a,connectionId:t}),a})()}disconnectClient(t){const r=this.clients.get(t);r&&(r.client.disconnect(),this.clients.delete(t))}disconnectAll(){for(const t of this.clients.values())t.client.disconnect();this.clients.clear()}getInfo(t){var r=this;return I(function*(){return(yield r.getClient(t)).getInfo()})()}getBalance(t){var r=this;return I(function*(){const o=yield(yield r.getClient(t)).getBalance();return yield r.storageService.updateNwcConnectionBalance(t,o.balance),o.balance})()}getAllBalances(){var t=this;return I(function*(){const r=new Map,i=t.getConnections(),o=yield Promise.allSettled(i.map(function(){var s=I(function*(a){try{const c=yield t.getBalance(a.id);return{id:a.id,balance:c}}catch(c){if(void 0!==a.cachedBalance)return{id:a.id,balance:a.cachedBalance};throw c}});return function(a){return s.apply(this,arguments)}}()));for(const s of o)"fulfilled"===s.status&&r.set(s.value.id,s.value.balance);return r})()}getTotalBalance(){var t=this;return I(function*(){const r=yield t.getAllBalances();let i=0;for(const o of r.values())i+=o;return i})()}getCachedTotalBalance(){const t=this.getConnections();let r=0;for(const i of t)void 0!==i.cachedBalance&&(r+=i.cachedBalance);return r}payInvoice(t,r,i){var o=this;return I(function*(){const a=yield(yield o.getClient(t)).payInvoice({invoice:r,amount:i});try{yield o.getBalance(t)}catch{}return a})()}makeInvoice(t,r,i){var o=this;return I(function*(){return(yield o.getClient(t)).makeInvoice({amount:r,description:i})})()}listTransactions(t,r){var i=this;return I(function*(){return(yield(yield i.getClient(t)).listTransactions(r)).transactions})()}resolveLightningAddress(t,r){var i=this;return I(function*(){const o=t.match(/^([^@]+)@([^@]+)$/);if(!o)throw new Error("Invalid lightning address format");const[,s,a]=o,c=`https://${a}/.well-known/lnurlp/${s}`;i.addLog("info",`Fetching LNURL-pay from ${a}...`);const l=yield fetch(c);if(!l.ok)throw new Error(`Failed to fetch LNURL-pay: ${l.status}`);const u=yield l.json();if("ERROR"===u.status)throw new Error(u.reason||"LNURL-pay error");if(!u.callback)throw new Error("Invalid LNURL-pay response: missing callback");const d=u.minSendable||1e3,f=u.maxSendable||1e11;if(r<d)throw new Error(`Amount too small. Minimum: ${Math.ceil(d/1e3)} sats`);if(r>f)throw new Error(`Amount too large. Maximum: ${Math.floor(f/1e3)} sats`);const A=new URL(u.callback);A.searchParams.set("amount",r.toString()),i.addLog("info","Requesting invoice...");const p=yield fetch(A.toString());if(!p.ok)throw new Error(`Failed to get invoice: ${p.status}`);const C=yield p.json();if("ERROR"===C.status)throw new Error(C.reason||"Failed to get invoice");if(!C.pr)throw new Error("Invalid invoice response: missing payment request");return i.addLog("info","Invoice received"),C.pr})()}isLightningAddress(t){return/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)}isBolt11Invoice(t){return/^ln(bc|tb|tbs)[0-9a-z]+$/i.test(t.toLowerCase())}testConnection(t){var r=this;return I(function*(){r.addLog("info","Testing NWC connection...");const i=r.parseNwcUrl(t);if(!i)throw r.addLog("error","Invalid NWC URL"),new Error("Invalid NWC URL");const o=new JU(i,r.createLogCallback());try{yield o.connect();const s=yield o.getInfo();return r.addLog("info",`Connection test successful: ${s.alias||"wallet"}`),s}catch(s){throw r.addLog("error",`Connection test failed: ${s.message}`),s}finally{o.disconnect()}})()}static \u0275fac=function(r){return new(r||e)(_t(lr))};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function YU(e){return yn.Buffer.from(e,"base64")}function Khe(e){return"number"==typeof e||"string"==typeof e}function WU(e){var n=[];return X_(e,n),new Uint8Array(n)}function X_(e,n){if(null===e)n.push(246);else if(void 0===e)n.push(247);else if("boolean"==typeof e)n.push(e?245:244);else if("number"==typeof e)$U(e,n);else if("string"==typeof e)ZU(e,n);else if(Array.isArray(e))!function jhe(e,n){var t=e.length;if(t<24)n.push(128|t);else if(t<256)n.push(152,t);else{if(!(t<65536))throw new Error("Unsupported array length");n.push(153,t>>8,255&t)}for(var r=0,i=e;r<i.length;r++)X_(i[r],n)}(e,n);else if(e instanceof Uint8Array)!function Jhe(e,n){var t=e.length;if(t<24)n.push(64+t);else if(t<256)n.push(88,t);else if(t<65536)n.push(89,t>>8&255,255&t);else{if(!(t<4294967296))throw new Error("Byte string too long to encode");n.push(90,t>>24&255,t>>16&255,t>>8&255,255&t)}for(var r=0;r<e.length;r++)n.push(e[r])}(e,n);else{if("object"!=typeof e)throw new Error("Unsupported type");!function Yhe(e,n){var t=Object.keys(e);$U(t.length,n),n[n.length-1]|=160;for(var r=0,i=t;r<i.length;r++){var o=i[r];ZU(o,n),X_(e[o],n)}}(e,n)}}function $U(e,n){if(e<24)n.push(e);else if(e<256)n.push(24,e);else if(e<65536)n.push(25,e>>8,255&e);else{if(!(e<4294967296))throw new Error("Unsupported integer size");n.push(26,e>>24,e>>16&255,e>>8&255,255&e)}}function ZU(e,n){var t=(new TextEncoder).encode(e),r=t.length;if(r<24)n.push(96+r);else if(r<256)n.push(120,r);else if(r<65536)n.push(121,r>>8&255,255&r);else{if(!(r<4294967296))throw new Error("String too long to encode");n.push(122,r>>24&255,r>>16&255,r>>8&255,255&r)}for(var i=0;i<t.length;i++)n.push(t[i])}function XU(e){return Qm(new DataView(e.buffer,e.byteOffset,e.byteLength),0).value}function Qm(e,n){if(n>=e.byteLength)throw new Error("Unexpected end of data");var t=e.getUint8(n++),r=t>>5,i=31&t;switch(r){case 0:return function Whe(e,n,t){var r=od(e,n,t);return{value:r.value,offset:r.offset}}(e,n,i);case 1:return function $he(e,n,t){var r=od(e,n,t);return{value:-1-r.value,offset:r.offset}}(e,n,i);case 2:return function Zhe(e,n,t){var r=od(e,n,t),i=r.value,o=r.offset;if(o+i>e.byteLength)throw new Error("Byte string length exceeds data length");return{value:new Uint8Array(e.buffer,e.byteOffset+o,i),offset:o+i}}(e,n,i);case 3:return function Xhe(e,n,t){var r=od(e,n,t),i=r.value,o=r.offset;if(o+i>e.byteLength)throw new Error("String length exceeds data length");var s=new Uint8Array(e.buffer,e.byteOffset+o,i);return{value:(new TextDecoder).decode(s),offset:o+i}}(e,n,i);case 4:return function epe(e,n,t){for(var r=od(e,n,t),i=r.value,s=[],a=r.offset,c=0;c<i;c++){var l=Qm(e,a);s.push(l.value),a=l.offset}return{value:s,offset:a}}(e,n,i);case 5:return function tpe(e,n,t){for(var r=od(e,n,t),i=r.value,s={},a=r.offset,c=0;c<i;c++){var l=Qm(e,a);if(!Khe(l.value))throw new Error("Invalid key type");var u=Qm(e,l.offset);s[l.value]=u.value,a=u.offset}return{value:s,offset:a}}(e,n,i);case 7:return function rpe(e,n,t){if(t<24)switch(t){case 20:return{value:!1,offset:n};case 21:return{value:!0,offset:n};case 22:return{value:null,offset:n};case 23:return{value:void 0,offset:n};default:throw new Error("Unknown simple value: ".concat(t))}if(24===t)return{value:e.getUint8(n++),offset:n};if(25===t){var r=function npe(e){var n=(31744&e)>>10,t=1023&e,r=32768&e?-1:1;return 0===n?r*Math.pow(2,-14)*(t/1024):31===n?t?NaN:r*(1/0):r*Math.pow(2,n-15)*(1+t/1024)}(e.getUint16(n,!1));return{value:r,offset:n+=2}}if(26===t)return{value:r=e.getFloat32(n,!1),offset:n+=4};if(27===t)return{value:r=e.getFloat64(n,!1),offset:n+=8};throw new Error("Unknown simple or float value: ".concat(t))}(e,n,i);default:throw new Error("Unsupported major type: ".concat(r))}}function od(e,n,t){if(t<24)return{value:t,offset:n};if(24===t)return{value:e.getUint8(n++),offset:n};if(25===t)return{value:e.getUint16(n,!1),offset:n+=2};if(26===t)return{value:e.getUint32(n,!1),offset:n+=4};if(27===t){var i=e.getUint32(n,!1),o=e.getUint32(n+4,!1);return n+=8,{value:i*Math.pow(2,32)+o,offset:n}}throw new Error("Unsupported length: ".concat(t))}!function(){function e(n,t,r,i,o,s,a){void 0===a&&(a=!1),this.transport=n,this.id=t,this.amount=r,this.unit=i,this.mints=o,this.description=s,this.singleUse=a}e.prototype.toEncodedRequest=function(){var n={t:this.transport.map(function(i){return{t:i.type,a:i.target,g:i.tags}})};this.id&&(n.i=this.id),this.amount&&(n.a=this.amount),this.unit&&(n.u=this.unit),this.mints&&(n.m=this.mints),this.description&&(n.d=this.description),this.singleUse&&(n.s=this.singleUse);var t=WU(n);return"creqA"+yn.Buffer.from(t).toString("base64")},e.prototype.getTransport=function(n){return this.transport.find(function(t){return t.type===n})},e.fromEncodedRequest=function(n){if(!n.startsWith("creq"))throw new Error("unsupported pr: invalid prefix");if("A"!==n[4])throw new Error("unsupported pr version");var o=XU(YU(n.slice(5)));return new e(o.t.map(function(a){return{type:a.t,target:a.a,tags:a.g}}),o.i,o.a,o.u,o.m,o.d,o.s)}}();var Ma=L(8852),eH=L(8942),Rf=function(){return Rf=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},Rf.apply(this,arguments)};function sd(e,n,t,r){if(t){if(t.reduce(function(o,s){return o+s},0)>e)throw new Error("Split is greater than total amount: ".concat(t.reduce(function(o,s){return o+s},0)," > ").concat(e));t.forEach(function(o){if(!rH(o,n))throw new Error("Provided amount preferences do not match the amounts of the mint keyset.")}),e-=t.reduce(function(o,s){return o+s},0)}else t=[];return nH(n).forEach(function(o){for(var s=Math.floor(e/o),a=0;a<s;++a)t?.push(o);e%=o}),t.sort(function(o,s){return"desc"===r?s-o:o-s})}function tH(e,n,t,r){var i=[],o=e.map(function(u){return u.amount});nH(t,"asc").forEach(function(u){for(var d=o.filter(function(p){return p===u}).length,f=Math.max(r-d,0),A=0;A<f&&!(i.reduce(function(p,C){return p+C},0)+u>n);++A)i.push(u)});var a=n-i.reduce(function(u,d){return u+d},0);return a&&sd(a,t).forEach(function(u){i.push(u)}),i.sort(function(u,d){return u-d})}function nH(e,n){return void 0===n&&(n="desc"),"desc"==n?Object.keys(e).map(function(t){return parseInt(t)}).sort(function(t,r){return r-t}):Object.keys(e).map(function(t){return parseInt(t)}).sort(function(t,r){return t-r})}function rH(e,n){return e in n}function upe(e){return iH(bc(e))}function iH(e){return BigInt("0x".concat(e))}function dpe(e){return e.toString(16).padStart(64,"0")}function oH(e){return/^[a-f0-9]*$/i.test(e)}function aH(e){if(e.proofs.forEach(function(d){if(d.dleq&&null==d.dleq.r)throw new Error("Missing blinding factor in included DLEQ proof")}),function sH(e){return Array.isArray(e)?e.some(function(n){return!oH(n.id)}):oH(e.id)}(e.proofs))throw new Error("can not encode to v4 token if proofs contain non-hex keyset id");for(var t={},r=e.mint,i=0;i<e.proofs.length;i++){var o=e.proofs[i];t[o.id]?t[o.id].push(o):t[o.id]=[o]}var s={m:r,u:e.unit||"sat",t:Object.keys(t).map(function(d){return{i:Ki(d),p:t[d].map(function(f){var A;return Rf({a:f.amount,s:f.secret,c:Ki(f.C)},f.dleq&&{d:{e:Ki(f.dleq.e),s:Ki(f.dleq.s),r:Ki(null!==(A=f.dleq.r)&&void 0!==A?A:"00")}})})}})};e.memo&&(s.d=e.memo);var u=function Ghe(e){return yn.Buffer.from(e).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}(WU(s));return"cashuB"+u}function cH(e){return["web+cashu://","cashu://","cashu:","cashu"].forEach(function(t){e.startsWith(t)&&(e=e.slice(t.length))}),function fpe(e){var n=e.slice(0,1),t=e.slice(1);if("A"===n){var r=function Vhe(e){var n=yn.Buffer.from(function qhe(e){return e.replace(/-/g,"+").replace(/_/g,"/").split("=")[0]}(e),"base64").toString();return JSON.parse(n)}(t);if(r.token.length>1)throw new Error("Multi entry token are not supported");var i=r.token[0],o={mint:i.mint,proofs:i.proofs,unit:r.unit||"sat"};return r.memo&&(o.memo=r.memo),o}if("B"===n){var a=XU(YU(t)),c=[];a.t.forEach(function(u){return u.p.forEach(function(d){c.push(Rf({secret:d.s,C:bc(d.c),amount:d.a,id:bc(u.i)},d.d&&{dleq:{r:bc(d.d.r),s:bc(d.d.s),e:bc(d.d.e)}}))})});var l={mint:a.m,proofs:c,unit:a.u||"sat"};return a.d&&(l.memo=a.d),l}throw new Error("Token version is not supported")}(e)}function Us(e){return"object"==typeof e}function Ni(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.map(function(t){return t.replace(/(^\/+|\/+$)/g,"")}).join("/")}function Kc(e){return e.reduce(function(n,t){return n+t.amount},0)}var eb,ppe=function(){function e(n){this._value=n,this._next=null}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(n){this._value=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"next",{get:function(){return this._next},set:function(n){this._next=n},enumerable:!1,configurable:!0}),e}(),Ipe=function(){function e(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(e.prototype,"first",{get:function(){return this._first},set:function(n){this._first=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this._last},set:function(n){this._last=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(n){this._size=n},enumerable:!1,configurable:!0}),e.prototype.enqueue=function(n){var t=new ppe(n);return 0!==this._size&&this._last?(this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,!0},e.prototype.dequeue=function(){if(0===this._size||!this._first)return null;var n=this._first;return this._first=n.next,n.next=null,this._size--,n.value},e}();function Dm(e){return e.map(function(n){var t=Rf({},n);return delete t.dleq,delete t.dleqValid,t})}typeof WebSocket<"u"&&(eb=WebSocket);var Sm=function(){return Sm=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},Sm.apply(this,arguments)},Bpe=function(){function e(){this.connectionMap=new Map}return e.getInstance=function(){return e.instace||(e.instace=new e),e.instace},e.prototype.getConnection=function(n){if(this.connectionMap.has(n))return this.connectionMap.get(n);var t=new wpe(n);return this.connectionMap.set(n,t),t},e}(),wpe=function(){function e(n){this.subListeners={},this.rpcListeners={},this.rpcId=0,this._WS=function Cpe(){return eb}(),this.url=new URL(n),this.messageQueue=new Ipe}return e.prototype.connect=function(){var n=this;return this.connectionPromise||(this.connectionPromise=new Promise(function(t,r){try{n.ws=new n._WS(n.url)}catch(i){return void r(i)}n.ws.onopen=function(){t()},n.ws.onerror=function(){r(new Error("Failed to open WebSocket"))},n.ws.onmessage=function(i){n.messageQueue.enqueue(i.data),n.handlingInterval||(n.handlingInterval=setInterval(n.handleNextMesage.bind(n),0))},n.ws.onclose=function(){n.connectionPromise=void 0}})),this.connectionPromise},e.prototype.sendRequest=function(n,t){var r,i;if(1!==(null===(r=this.ws)||void 0===r?void 0:r.readyState))throw new Error("Socket not open...");var o=this.rpcId;this.rpcId++;var s=JSON.stringify({jsonrpc:"2.0",method:n,params:t,id:o});null===(i=this.ws)||void 0===i||i.send(s)},e.prototype.closeSubscription=function(n){var t;null===(t=this.ws)||void 0===t||t.send(JSON.stringify(["CLOSE",n]))},e.prototype.addSubListener=function(n,t){(this.subListeners[n]=this.subListeners[n]||[]).push(t)},e.prototype.addRpcListener=function(n,t,r){this.rpcListeners[r]={callback:n,errorCallback:t}},e.prototype.removeRpcListener=function(n){delete this.rpcListeners[n]},e.prototype.removeListener=function(n,t){1!==this.subListeners[n].length?this.subListeners[n]=this.subListeners[n].filter(function(r){return r!==t}):delete this.subListeners[n]},e.prototype.ensureConnection=function(){var n;return function(e,n,t,r){return new(t||(t=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):function i(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,c)}l((r=r.apply(e,n||[])).next())})}(this,void 0,void 0,function(){return function(e,n){var r,i,o,s,t={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return function c(l){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(t=0)),t;)try{if(r=1,i&&(o=2&l[0]?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(!(o=(o=t.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){t=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(6===l[0]&&t.label<o[1]){t.label=o[1],o=l;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(l);break}o[2]&&t.ops.pop(),t.trys.pop();continue}l=n.call(e,t)}catch(u){l=[6,u],i=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,u])}}}(this,function(t){switch(t.label){case 0:return 1===(null===(n=this.ws)||void 0===n?void 0:n.readyState)?[3,2]:[4,this.connect()];case 1:t.sent(),t.label=2;case 2:return[2]}})})},e.prototype.handleNextMesage=function(){var n;if(0===this.messageQueue.size)return clearInterval(this.handlingInterval),void(this.handlingInterval=void 0);var r,t=this.messageQueue.dequeue();try{if("result"in(r=JSON.parse(t))&&null!=r.id)this.rpcListeners[r.id]&&(this.rpcListeners[r.id].callback(),this.removeRpcListener(r.id));else if("error"in r&&null!=r.id)this.rpcListeners[r.id]&&(this.rpcListeners[r.id].errorCallback(r.error),this.removeRpcListener(r.id));else if("method"in r&&!("id"in r)){var i=r.params.subId;if(!i)return;if((null===(n=this.subListeners[i])||void 0===n?void 0:n.length)>0){var o=r;this.subListeners[i].forEach(function(s){return s(o.params.payload)})}}}catch(s){return void console.error(s)}},e.prototype.createSubscription=function(n,t,r){var o,i=this;if(1!==(null===(o=this.ws)||void 0===o?void 0:o.readyState))return r(new Error("Socket is not open"));var s=(Math.random()+1).toString(36).substring(7);return this.addRpcListener(function(){i.addSubListener(s,t)},function(a){r(new Error(a.message))},this.rpcId),this.sendRequest("subscribe",Sm(Sm({},n),{subId:s})),this.rpcId++,s},e.prototype.cancelSubscription=function(n,t){this.removeListener(n,t),this.rpcId++,this.sendRequest("unsubscribe",{subId:n})},Object.defineProperty(e.prototype,"activeSubscriptions",{get:function(){return Object.keys(this.subListeners)},enumerable:!1,configurable:!0}),e.prototype.close=function(){var n;this.ws&&(null===(n=this.ws)||void 0===n||n.close())},e}(),lH=function(e){return e.UNSPENT="UNSPENT",e.PENDING="PENDING",e.SPENT="SPENT",e}(lH||{}),ad=function(e){return e.UNPAID="UNPAID",e.PENDING="PENDING",e.PAID="PAID",e}(ad||{}),km=function(e){return e.UNPAID="UNPAID",e.PAID="PAID",e.ISSUED="ISSUED",e}(km||{}),_pe=function(){var e=function(n,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])})(n,t)};return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}(),uH=function(e){function n(t,r){var i=e.call(this,t)||this;return i.status=r,i}return _pe(n,e),n}(Error),Jc=function(){return Jc=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},Jc.apply(this,arguments)},dH=function(e,n,t,r){return new(t||(t=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):function i(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,c)}l((r=r.apply(e,n||[])).next())})},AH=function(e,n){var r,i,o,s,t={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return function c(l){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(t=0)),t;)try{if(r=1,i&&(o=2&l[0]?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(!(o=(o=t.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){t=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(6===l[0]&&t.label<o[1]){t.label=o[1],o=l;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(l);break}o[2]&&t.ops.pop(),t.trys.pop();continue}l=n.call(e,t)}catch(u){l=[6,u],i=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,u])}}},fH={};function Qpe(e){var n=e.endpoint,t=e.requestBody,r=e.headers,i=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]])}return t}(e,["endpoint","requestBody","headers"]);return dH(this,void 0,void 0,function(){var o,s,a,c,u,d;return AH(this,function(f){switch(f.label){case 0:return o=t?JSON.stringify(t):void 0,s=Jc(Jc({Accept:"application/json, text/plain, */*"},o?{"Content-Type":"application/json"}:void 0),r),[4,fetch(n,Jc({body:o,headers:s},i))];case 1:return(a=f.sent()).ok?[3,3]:[4,a.json().catch(function(){return{error:"bad response"}})];case 2:throw c=f.sent(),u=c.detail,new uH(c.error||u||"bad response",a.status);case 3:return f.trys.push([3,5,,6]),[4,a.json()];case 4:return[2,f.sent()];case 5:throw d=f.sent(),console.error("Failed to parse HTTP response",d),new uH("bad response",a.status);case 6:return[2]}})})}function Xi(e){return dH(this,void 0,void 0,function(){return AH(this,function(t){switch(t.label){case 0:return[4,Qpe(Jc(Jc({},e),fH))];case 1:return[2,t.sent()]}})})}function tb(e){return e.state||(console.warn("Field 'state' not found in MeltQuoteResponse. Update NUT-05 of mint: https://github.com/cashubtc/nuts/pull/136)"),"boolean"==typeof e.paid&&(e.state=e.paid?ad.PAID:ad.UNPAID)),e}function gH(e){return e.state||(console.warn("Field 'state' not found in MintQuoteResponse. Update NUT-04 of mint: https://github.com/cashubtc/nuts/pull/141)"),"boolean"==typeof e.paid&&(e.state=e.paid?km.PAID:km.UNPAID)),e}var Sn=function(e,n,t,r){return new(t||(t=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):function i(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,c)}l((r=r.apply(e,n||[])).next())})},kn=function(e,n){var r,i,o,s,t={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return function c(l){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(t=0)),t;)try{if(r=1,i&&(o=2&l[0]?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(!(o=(o=t.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){t=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(6===l[0]&&t.label<o[1]){t.label=o[1],o=l;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(l);break}o[2]&&t.ops.pop(),t.trys.pop();continue}l=n.call(e,t)}catch(u){l=[6,u],i=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,u])}}},hH=function(){function e(n,t){this._mintUrl=n,this._customRequest=t,this._mintUrl=function hpe(e){return e.replace(/\/$/,"")}(n),this._customRequest=t}return Object.defineProperty(e.prototype,"mintUrl",{get:function(){return this._mintUrl},enumerable:!1,configurable:!0}),e.getInfo=function(n,t){return Sn(this,void 0,void 0,function(){var i,o;return kn(this,function(s){switch(s.label){case 0:return[4,(t||Xi)({endpoint:Ni(n,"/v1/info")})];case 1:return i=s.sent(),o=function Dpe(e){return Array.isArray(e?.contact)&&e?.contact.length>0&&(e.contact=e.contact.map(function(n){return Array.isArray(n)&&2===n.length&&"string"==typeof n[0]&&"string"==typeof n[1]?(console.warn("Mint returned deprecated 'contact' field: Update NUT-06: https://github.com/cashubtc/nuts/pull/117"),{method:n[0],info:n[1]}):n})),e}(i),[2,o]}})})},e.prototype.getInfo=function(){return Sn(this,void 0,void 0,function(){return kn(this,function(n){return[2,e.getInfo(this._mintUrl,this._customRequest)]})})},e.swap=function(n,t,r){var i;return Sn(this,void 0,void 0,function(){var s;return kn(this,function(a){switch(a.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/swap"),method:"POST",requestBody:t})];case 1:if(!Us(s=a.sent())||!Array.isArray(s?.signatures))throw new Error(null!==(i=s.detail)&&void 0!==i?i:"bad response");return[2,s]}})})},e.prototype.swap=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.swap(this._mintUrl,n,this._customRequest)]})})},e.createMintQuote=function(n,t,r){return Sn(this,void 0,void 0,function(){return kn(this,function(a){switch(a.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/mint/quote/bolt11"),method:"POST",requestBody:t})];case 1:return[2,gH(a.sent())]}})})},e.prototype.createMintQuote=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.createMintQuote(this._mintUrl,n,this._customRequest)]})})},e.checkMintQuote=function(n,t,r){return Sn(this,void 0,void 0,function(){return kn(this,function(a){switch(a.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/mint/quote/bolt11",t),method:"GET"})];case 1:return[2,gH(a.sent())]}})})},e.prototype.checkMintQuote=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.checkMintQuote(this._mintUrl,n,this._customRequest)]})})},e.mint=function(n,t,r){return Sn(this,void 0,void 0,function(){var o;return kn(this,function(s){switch(s.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/mint/bolt11"),method:"POST",requestBody:t})];case 1:if(!Us(o=s.sent())||!Array.isArray(o?.signatures))throw new Error("bad response");return[2,o]}})})},e.prototype.mint=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.mint(this._mintUrl,n,this._customRequest)]})})},e.createMeltQuote=function(n,t,r){return Sn(this,void 0,void 0,function(){var o,s;return kn(this,function(a){switch(a.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/melt/quote/bolt11"),method:"POST",requestBody:t})];case 1:if(o=a.sent(),!Us(s=tb(o))||"number"!=typeof s?.amount||"number"!=typeof s?.fee_reserve||"string"!=typeof s?.quote)throw new Error("bad response");return[2,s]}})})},e.prototype.createMeltQuote=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.createMeltQuote(this._mintUrl,n,this._customRequest)]})})},e.checkMeltQuote=function(n,t,r){return Sn(this,void 0,void 0,function(){var o,s;return kn(this,function(a){switch(a.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/melt/quote/bolt11",t),method:"GET"})];case 1:if(o=a.sent(),!Us(s=tb(o))||"number"!=typeof s?.amount||"number"!=typeof s?.fee_reserve||"string"!=typeof s?.quote||"string"!=typeof s?.state||!Object.values(ad).includes(s.state))throw new Error("bad response");return[2,s]}})})},e.prototype.checkMeltQuote=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.checkMeltQuote(this._mintUrl,n,this._customRequest)]})})},e.melt=function(n,t,r){return Sn(this,void 0,void 0,function(){var o,s;return kn(this,function(a){switch(a.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/melt/bolt11"),method:"POST",requestBody:t})];case 1:if(o=a.sent(),!Us(s=tb(o))||"string"!=typeof s?.state||!Object.values(ad).includes(s.state))throw new Error("bad response");return[2,s]}})})},e.prototype.melt=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.melt(this._mintUrl,n,this._customRequest)]})})},e.check=function(n,t,r){return Sn(this,void 0,void 0,function(){var o;return kn(this,function(s){switch(s.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/checkstate"),method:"POST",requestBody:t})];case 1:if(!Us(o=s.sent())||!Array.isArray(o?.states))throw new Error("bad response");return[2,o]}})})},e.getKeys=function(n,t,r){return Sn(this,void 0,void 0,function(){var o;return kn(this,function(s){switch(s.label){case 0:return t&&(t=t.replace(/\//g,"_").replace(/\+/g,"-")),[4,(r||Xi)({endpoint:t?Ni(n,"/v1/keys",t):Ni(n,"/v1/keys")})];case 1:if(!Us(o=s.sent())||!Array.isArray(o.keysets))throw new Error("bad response");return[2,o]}})})},e.prototype.getKeys=function(n,t){return Sn(this,void 0,void 0,function(){return kn(this,function(i){switch(i.label){case 0:return[4,e.getKeys(t||this._mintUrl,n,this._customRequest)];case 1:return[2,i.sent()]}})})},e.getKeySets=function(n,t){return Sn(this,void 0,void 0,function(){return kn(this,function(i){return[2,(t||Xi)({endpoint:Ni(n,"/v1/keysets")})]})})},e.prototype.getKeySets=function(){return Sn(this,void 0,void 0,function(){return kn(this,function(n){return[2,e.getKeySets(this._mintUrl,this._customRequest)]})})},e.prototype.check=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.check(this._mintUrl,n,this._customRequest)]})})},e.restore=function(n,t,r){return Sn(this,void 0,void 0,function(){var o;return kn(this,function(s){switch(s.label){case 0:return[4,(r||Xi)({endpoint:Ni(n,"/v1/restore"),method:"POST",requestBody:t})];case 1:if(!Us(o=s.sent())||!Array.isArray(o?.outputs)||!Array.isArray(o?.promises))throw new Error("bad response");return[2,o]}})})},e.prototype.restore=function(n){return Sn(this,void 0,void 0,function(){return kn(this,function(t){return[2,e.restore(this._mintUrl,n,this._customRequest)]})})},e.prototype.connectWebSocket=function(){return Sn(this,void 0,void 0,function(){var n,t,r;return kn(this,function(i){switch(i.label){case 0:return this.ws?[4,this.ws.ensureConnection()]:[3,2];case 1:return i.sent(),[3,6];case 2:n=new URL(this._mintUrl),t="v1/ws",n.pathname&&(n.pathname.endsWith("/")?n.pathname+=t:n.pathname+="/"+t),this.ws=Bpe.getInstance().getConnection("".concat("https:"===n.protocol?"wss":"ws","://").concat(n.host).concat(n.pathname)),i.label=3;case 3:return i.trys.push([3,5,,6]),[4,this.ws.connect()];case 4:return i.sent(),[3,6];case 5:throw r=i.sent(),console.log(r),new Error("Failed to connect to WebSocket...");case 6:return[2]}})})},e.prototype.disconnectWebSocket=function(){this.ws&&this.ws.close()},Object.defineProperty(e.prototype,"webSocketConnection",{get:function(){return this.ws},enumerable:!1,configurable:!0}),e}(),Spe=function(){function e(n,t,r){this.amount=n,this.B_=t,this.id=r}return e.prototype.getSerializedBlindedMessage=function(){return{amount:this.amount,B_:this.B_.toHex(!0),id:this.id}},e}(),Pf=L(3402),pH=L(1698),nb=L(6043),jc=function(){return jc=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},jc.apply(this,arguments)},ir=function(e,n,t,r){return new(t||(t=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):function i(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,c)}l((r=r.apply(e,n||[])).next())})},Yn=function(e,n){var r,i,o,s,t={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return function c(l){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(t=0)),t;)try{if(r=1,i&&(o=2&l[0]?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(!(o=(o=t.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){t=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(6===l[0]&&t.label<o[1]){t.label=o[1],o=l;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(l);break}o[2]&&t.ops.pop(),t.trys.pop();continue}l=n.call(e,t)}catch(u){l=[6,u],i=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,u])}}},Fa=function(e,n,t){if(t||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)(o||!(r in n))&&(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))},Fpe=function(){function e(n,t){var r=this;this._keys=new Map,this._keysets=[],this._seed=void 0,this._unit="sat",this._mintInfo=void 0,this._denominationTarget=3,this.mint=n;var i=[];if(t?.keys&&!Array.isArray(t.keys)?i=[t.keys]:t?.keys&&Array.isArray(t?.keys)&&(i=t?.keys),i&&i.forEach(function(o){return r._keys.set(o.id,o)}),t?.unit&&(this._unit=t?.unit),t?.keysets&&(this._keysets=t.keysets),t?.mintInfo&&(this._mintInfo=t.mintInfo),t?.denominationTarget&&(this._denominationTarget=t.denominationTarget),t?.bip39seed){if(t.bip39seed instanceof Uint8Array)return void(this._seed=t.bip39seed);throw new Error("bip39seed must be a valid UInt8Array")}}return Object.defineProperty(e.prototype,"unit",{get:function(){return this._unit},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"keys",{get:function(){return this._keys},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"keysetId",{get:function(){if(!this._keysetId)throw new Error("No keysetId set");return this._keysetId},set:function(n){this._keysetId=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"keysets",{get:function(){return this._keysets},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mintInfo",{get:function(){if(!this._mintInfo)throw new Error("Mint info not loaded");return this._mintInfo},enumerable:!1,configurable:!0}),e.prototype.getMintInfo=function(){return ir(this,void 0,void 0,function(){var n;return Yn(this,function(t){switch(t.label){case 0:return n=this,[4,this.mint.getInfo()];case 1:return n._mintInfo=t.sent(),[2,this._mintInfo]}})})},e.prototype.loadMint=function(){return ir(this,void 0,void 0,function(){return Yn(this,function(n){switch(n.label){case 0:return[4,this.getMintInfo()];case 1:return n.sent(),[4,this.getKeySets()];case 2:return n.sent(),[4,this.getKeys()];case 3:return n.sent(),[2]}})})},e.prototype.getActiveKeyset=function(n){var t=n.filter(function(i){return i.active}),r=(t=t.filter(function(i){return i.id.startsWith("00")})).sort(function(i,o){var s,a;return(null!==(s=i.input_fee_ppk)&&void 0!==s?s:0)-(null!==(a=o.input_fee_ppk)&&void 0!==a?a:0)})[0];if(!r)throw new Error("No active keyset found");return r},e.prototype.getKeySets=function(){return ir(this,void 0,void 0,function(){var n,t,r=this;return Yn(this,function(i){switch(i.label){case 0:return[4,this.mint.getKeySets()];case 1:return n=i.sent(),t=n.keysets.filter(function(o){return o.unit===r._unit}),this._keysets=t,[2,this._keysets]}})})},e.prototype.getAllKeys=function(){return ir(this,void 0,void 0,function(){var n;return Yn(this,function(t){switch(t.label){case 0:return[4,this.mint.getKeys()];case 1:return n=t.sent(),this._keys=new Map(n.keysets.map(function(r){return[r.id,r]})),this.keysetId=this.getActiveKeyset(this._keysets).id,[2,n.keysets]}})})},e.prototype.getKeys=function(n,t){return ir(this,void 0,void 0,function(){var r,i;return Yn(this,function(o){switch(o.label){case 0:return this._keysets.length>0&&!t?[3,2]:[4,this.getKeySets()];case 1:o.sent(),o.label=2;case 2:return n||(r=this.getActiveKeyset(this._keysets),n=r.id),this._keysets.find(function(s){return s.id===n})?[3,4]:[4,this.getKeySets()];case 3:if(o.sent(),!this._keysets.find(function(s){return s.id===n}))throw new Error("could not initialize keys. No keyset with id '".concat(n,"' found"));o.label=4;case 4:return this._keys.get(n)?[3,6]:[4,this.mint.getKeys(n)];case 5:i=o.sent(),this._keys.set(n,i.keysets[0]),o.label=6;case 6:return this.keysetId=n,[2,this._keys.get(n)]}})})},e.prototype.receive=function(n,t){return ir(this,void 0,void 0,function(){var r,i,o,a,c;return Yn(this,function(u){switch(u.label){case 0:return"string"==typeof n&&(n=cH(n)),[4,this.getKeys(t?.keysetId)];case 1:if(r=u.sent(),t?.requireDleq&&n.proofs.some(function(d){return!function mpe(e,n){var t;if(null==e.dleq)return!1;var r={e:Ki(e.dleq.e),s:Ki(e.dleq.s),r:iH(null!==(t=e.dleq.r)&&void 0!==t?t:"00")};if(!rH(e.amount,n.keys))throw new Error("undefined key for amount ".concat(e.amount));var i=n.keys[e.amount];return!!(0,eH.BV)((new TextEncoder).encode(e.secret),r,(0,Ma.pointFromHex)(e.C),(0,Ma.pointFromHex)(i))}(d,r)}))throw new Error("Token contains proofs with invalid DLEQ");return i=Kc(n.proofs)-this.getFeesForProofs(n.proofs),o=this.createSwapPayload(i,n.proofs,r,t?.outputAmounts,t?.counter,t?.pubkey,t?.privkey),a=o.blindingData,[4,this.mint.swap(o.payload)];case 2:return c=u.sent().signatures,[2,this.constructProofs(c,a.blindingFactors,a.secrets,r)]}})})},e.prototype.send=function(n,t,r){var i;return ir(this,void 0,void 0,function(){var o,s,a,c,l,u,d,f,A,p;return Yn(this,function(C){switch(C.label){case 0:if(r?.includeDleq&&(t=t.filter(function(E){return null!=E.dleq})),Kc(t)<n)throw new Error("Not enough funds available to send");return o=this.selectProofsToSend(t,n,r?.includeFees),s=o.keep,a=o.send,c=r?.includeFees?this.getFeesForProofs(a):0,!r?.offline&&(Kc(a)!=n+c||r?.outputAmounts||r?.pubkey||r?.privkey||r?.keysetId)?(l=this.selectProofsToSend(t,n,!0),u=l.keep,d=l.send,null===(i=r?.proofsWeHave)||void 0===i||i.push.apply(i,u),[4,this.swap(n,d,r)]):[3,2];case 1:return f=C.sent(),p=f.send,A=u.concat(A=f.keep),r?.includeDleq||(p=Dm(p)),[2,{keep:A,send:p}];case 2:if(Kc(a)<n+c)throw new Error("Not enough funds available to send");return r?.includeDleq?[2,{keep:s,send:a}]:[2,{keep:s,send:Dm(a)}]}})})},e.prototype.selectProofsToSend=function(n,t,r){var i=n.sort(function(E,Q){return E.amount-Q.amount}),o=i.filter(function(E){return E.amount<=t}).sort(function(E,Q){return Q.amount-E.amount}),a=i.filter(function(E){return E.amount>t}).sort(function(E,Q){return E.amount-Q.amount})[0];if(!o.length&&a)return{keep:n.filter(function(E){return E.secret!==a.secret}),send:[a]};if(!o.length&&!a)return{keep:n,send:[]};var c=t,l=[o[0]],u=[],d=r?this.getFeesForProofs(l):0;if((c-=l[0].amount-d/1e3)>0){var f=this.selectProofsToSend(o.slice(1),c,r),A=f.keep;l.push.apply(l,f.send),u.push.apply(u,A)}var C=r?this.getFeesForProofs(l):0;return Kc(l)<t+C&&a&&(l=[a]),{keep:n.filter(function(E){return!l.includes(E)}),send:l}},e.prototype.getFeesForProofs=function(n){var t=this;if(!this._keysets.length)throw new Error("Could not calculate fees. No keysets found");return new Set(n.map(function(o){return o.id})).forEach(function(o){if(!t._keysets.find(function(s){return s.id===o}))throw new Error("Could not calculate fees. No keyset found with id: ".concat(o))}),Math.floor(Math.max((n.reduce(function(o,s){var a;return o+((null===(a=t._keysets.find(function(c){return c.id===s.id}))||void 0===a?void 0:a.input_fee_ppk)||0)},0)+999)/1e3,0))},e.prototype.getFeesForKeyset=function(n,t){var r;return Math.floor(Math.max((n*((null===(r=this._keysets.find(function(o){return o.id===t}))||void 0===r?void 0:r.input_fee_ppk)||0)+999)/1e3,0))},e.prototype.swap=function(n,t,r){var i,o,s;return ir(this,void 0,void 0,function(){var a,c,l,u,d,f,A,p,C,E,F,se,le,Be,he,we;return Yn(this,function(Re){switch(Re.label){case 0:return r||(r={}),[4,this.getKeys(r.keysetId)];case 1:if(a=Re.sent(),c=t,l=n,u=Kc(t),d=u-l-this.getFeesForProofs(c),f=(null===(i=r?.outputAmounts)||void 0===i?void 0:i.sendAmounts)||sd(l,a.keys),r?.includeFees){for(A=this.getFeesForKeyset(f.length,a.id),p=sd(A,a.keys);this.getFeesForKeyset(f.concat(p).length,a.id)>A;)A++,p=sd(A,a.keys);f=f.concat(p),l+=A,d-=A}if(!r||null!==(o=r.outputAmounts)&&void 0!==o&&o.keepAmounts||!r.proofsWeHave){if(r.outputAmounts){if((null===(s=r.outputAmounts.keepAmounts)||void 0===s?void 0:s.reduce(function(Ye,Je){return Ye+Je},0))!=d)throw new Error("Keep amounts do not match amount to keep");C=r.outputAmounts.keepAmounts}}else C=tH(r.proofsWeHave,d,a.keys,this._denominationTarget);if(l+this.getFeesForProofs(c)>u)throw console.error("Not enough funds available (".concat(u,") for swap amountToSend: ").concat(l," + fee: ").concat(this.getFeesForProofs(c)," | length: ").concat(c.length)),new Error("Not enough funds available for swap");if(l+this.getFeesForProofs(c)+d!=u)throw new Error("Amounts do not match for swap");return r.outputAmounts={keepAmounts:C,sendAmounts:f},E=this.createSwapPayload(l,c,a,r?.outputAmounts,r?.counter,r?.pubkey,r?.privkey),F=E.blindingData,[4,this.mint.swap(E.payload)];case 2:return se=Re.sent().signatures,le=this.constructProofs(se,F.blindingFactors,F.secrets,a),Be=[],he=[],we=0,le.forEach(function(Ye){if(we<d)return we+=Ye.amount,void Be.push(Ye);he.push(Ye)}),[2,{keep:Be,send:he}]}})})},e.prototype.restore=function(n,t,r){return ir(this,void 0,void 0,function(){var i,o,s,a,c,l,u,d,f,A,p;return Yn(this,function(C){switch(C.label){case 0:return[4,this.getKeys(r?.keysetId)];case 1:if(i=C.sent(),!this._seed)throw new Error("CashuWallet must be initialized with a seed to use restore");return o=Array(t).fill(0),s=this.createBlindedMessages(o,i.id,n),c=s.blindingFactors,l=s.secrets,[4,this.mint.restore({outputs:a=s.blindedMessages})];case 2:return u=C.sent(),d=u.outputs,f=u.promises,A=c.filter(function(E,Q){return d.map(function(F){return F.B_}).includes(a[Q].B_)}),p=l.filter(function(E,Q){return d.map(function(F){return F.B_}).includes(a[Q].B_)}),[2,{proofs:this.constructProofs(f,A,p,i)}]}})})},e.prototype.createMintQuote=function(n,t){return ir(this,void 0,void 0,function(){return Yn(this,function(i){switch(i.label){case 0:return[4,this.mint.createMintQuote({unit:this._unit,amount:n,description:t})];case 1:return[2,i.sent()]}})})},e.prototype.checkMintQuote=function(n){return ir(this,void 0,void 0,function(){return Yn(this,function(t){switch(t.label){case 0:return[4,this.mint.checkMintQuote(n)];case 1:return[2,t.sent()]}})})},e.prototype.mintProofs=function(n,t,r){var i;return ir(this,void 0,void 0,function(){var o,s,c,l,d;return Yn(this,function(f){switch(f.label){case 0:return[4,this.getKeys(r?.keysetId)];case 1:return o=f.sent(),!r?.outputAmounts&&r?.proofsWeHave&&(r.outputAmounts={keepAmounts:tH(r.proofsWeHave,n,o.keys,this._denominationTarget),sendAmounts:[]}),s=this.createRandomBlindedMessages(n,o,null===(i=r?.outputAmounts)||void 0===i?void 0:i.keepAmounts,r?.counter,r?.pubkey),c=s.secrets,l=s.blindingFactors,[4,this.mint.mint({outputs:s.blindedMessages,quote:t})];case 2:return d=f.sent().signatures,[2,this.constructProofs(d,l,c,o)]}})})},e.prototype.createMeltQuote=function(n){return ir(this,void 0,void 0,function(){return Yn(this,function(i){switch(i.label){case 0:return[4,this.mint.createMeltQuote({unit:this._unit,request:n})];case 1:return[2,i.sent()]}})})},e.prototype.checkMeltQuote=function(n){return ir(this,void 0,void 0,function(){return Yn(this,function(r){switch(r.label){case 0:return[4,this.mint.checkMeltQuote(n)];case 1:return[2,r.sent()]}})})},e.prototype.meltProofs=function(n,t,r){return ir(this,void 0,void 0,function(){var i,o,s,a,c,l,u,d;return Yn(this,function(f){switch(f.label){case 0:return[4,this.getKeys(r?.keysetId)];case 1:return i=f.sent(),o=this.createBlankOutputs(Kc(t)-n.amount,i.id,r?.counter),s=o.blindedMessages,a=o.secrets,c=o.blindingFactors,null!=r?.privkey&&(t=(0,nb.getSignedProofs)(t.map(function(A){return{amount:A.amount,C:(0,Ma.pointFromHex)(A.C),id:A.id,secret:(new TextEncoder).encode(A.secret)}}),r.privkey).map(function(A){return(0,Pf.R_)(A)})),t=Dm(t),l={quote:n.quote,inputs:t,outputs:Fa([],s,!0)},[4,this.mint.melt(l)];case 2:return u=f.sent(),d=[],u.change&&(d=this.constructProofs(u.change,c,a,i)),[2,{quote:u,change:d}]}})})},e.prototype.createSwapPayload=function(n,t,r,i,o,s,a){var c=t.reduce(function(A,p){return A+p.amount},0);i&&i.sendAmounts&&!i.keepAmounts&&(i.keepAmounts=sd(c-n-this.getFeesForProofs(t),r.keys));var l=this.createRandomBlindedMessages(c-n-this.getFeesForProofs(t),r,i?.keepAmounts,o);this._seed&&o&&(o+=l.secrets.length);var u=this.createRandomBlindedMessages(n,r,i?.sendAmounts,o,s);a&&(t=(0,nb.getSignedProofs)(t.map(function(A){return{amount:A.amount,C:(0,Ma.pointFromHex)(A.C),id:A.id,secret:(new TextEncoder).encode(A.secret)}}),a).map(function(A){return(0,Pf.R_)(A)})),t=Dm(t);var d={blindedMessages:Fa(Fa([],l.blindedMessages,!0),u.blindedMessages,!0),secrets:Fa(Fa([],l.secrets,!0),u.secrets,!0),blindingFactors:Fa(Fa([],l.blindingFactors,!0),u.blindingFactors,!0)};return{payload:{inputs:t,outputs:Fa([],d.blindedMessages,!0)},blindingData:d}},e.prototype.checkProofsStates=function(n){return ir(this,void 0,void 0,function(){var t,r,i,o,s,a,c;return Yn(this,function(l){switch(l.label){case 0:t=new TextEncoder,r=n.map(function(u){return(0,Ma.hashToCurve)(t.encode(u.secret)).toHex(!0)}),i=100,o=[],s=function(u){var d,f,A,p,C;return Yn(this,function(E){switch(E.label){case 0:return d=r.slice(u,u+i),[4,a.mint.check({Ys:d})];case 1:for(f=E.sent().states,A={},f.forEach(function(Q){A[Q.Y]=Q}),p=0;p<d.length;p++){if(!(C=A[d[p]]))throw new Error("Could not find state for proof with Y: "+d[p]);o.push(C)}return[2]}})},a=this,c=0,l.label=1;case 1:return c<r.length?[5,s(c)]:[3,4];case 2:l.sent(),l.label=3;case 3:return c+=i,[3,1];case 4:return[2,o]}})})},e.prototype.onMintQuoteUpdates=function(n,t,r){return ir(this,void 0,void 0,function(){var i,o=this;return Yn(this,function(s){switch(s.label){case 0:return[4,this.mint.connectWebSocket()];case 1:if(s.sent(),!this.mint.webSocketConnection)throw new Error("failed to establish WebSocket connection.");return i=this.mint.webSocketConnection.createSubscription({kind:"bolt11_mint_quote",filters:n},t,r),[2,function(){var a;null===(a=o.mint.webSocketConnection)||void 0===a||a.cancelSubscription(i,t)}]}})})},e.prototype.onMeltQuotePaid=function(n,t,r){return ir(this,void 0,void 0,function(){return Yn(this,function(i){return[2,this.onMeltQuoteUpdates([n],function(o){o.state===ad.PAID&&t(o)},r)]})})},e.prototype.onMintQuotePaid=function(n,t,r){return ir(this,void 0,void 0,function(){return Yn(this,function(i){return[2,this.onMintQuoteUpdates([n],function(o){o.state===km.PAID&&t(o)},r)]})})},e.prototype.onMeltQuoteUpdates=function(n,t,r){return ir(this,void 0,void 0,function(){var i,o=this;return Yn(this,function(s){switch(s.label){case 0:return[4,this.mint.connectWebSocket()];case 1:if(s.sent(),!this.mint.webSocketConnection)throw new Error("failed to establish WebSocket connection.");return i=this.mint.webSocketConnection.createSubscription({kind:"bolt11_melt_quote",filters:n},t,r),[2,function(){var a;null===(a=o.mint.webSocketConnection)||void 0===a||a.cancelSubscription(i,t)}]}})})},e.prototype.onProofStateUpdates=function(n,t,r){return ir(this,void 0,void 0,function(){var i,o,s,a,c,l,u=this;return Yn(this,function(d){switch(d.label){case 0:return[4,this.mint.connectWebSocket()];case 1:if(d.sent(),!this.mint.webSocketConnection)throw new Error("failed to establish WebSocket connection.");for(i=new TextEncoder,o={},s=0;s<n.length;s++)a=(0,Ma.hashToCurve)(i.encode(n[s].secret)).toHex(!0),o[a]=n[s];return c=Object.keys(o),l=this.mint.webSocketConnection.createSubscription({kind:"proof_state",filters:c},function(f){t(jc(jc({},f),{proof:o[f.Y]}))},r),[2,function(){var f;null===(f=u.mint.webSocketConnection)||void 0===f||f.cancelSubscription(l,t)}]}})})},e.prototype.createRandomBlindedMessages=function(n,t,r,i,o){var s=sd(n,t.keys,r);return this.createBlindedMessages(s,t.id,i,o)},e.prototype.createBlindedMessages=function(n,t,r,i){if(null!=r&&!this._seed)throw new Error("Cannot create deterministic messages without seed. Instantiate CashuWallet with a bip39seed, or omit counter param.");for(var o=[],s=[],a=[],c=0;c<n.length;c++){var l=void 0,u=void 0;if(i?u=(0,nb.createP2PKsecret)(i):this._seed&&null!=r?(u=(0,pH.uz)(this._seed,t,r+c),l=upe((0,pH.cv)(this._seed,t,r+c))):u=l3(32),!i){var d=vc(u);u=(new TextEncoder).encode(d)}s.push(u);var f=(0,Pf.Jr)(u,l),A=f.B_;a.push(f.r);var C=new Spe(n[c],A,t);o.push(C.getSerializedBlindedMessage())}return{blindedMessages:o,secrets:s,blindingFactors:a,amounts:n}},e.prototype.createBlankOutputs=function(n,t,r){var i=Math.ceil(Math.log2(n))||1;i<0&&(i=0);var o=i?Array(i).fill(1):[],s=this.createBlindedMessages(o,t,r);return{blindedMessages:s.blindedMessages,secrets:s.secrets,blindingFactors:s.blindingFactors}},e.prototype.constructProofs=function(n,t,r,i){return n.map(function(o,s){var a,c=null==o.dleq?void 0:{s:_c(o.dleq.s),e:_c(o.dleq.e),r:t[s]},l={id:o.id,amount:o.amount,C_:(0,Ma.pointFromHex)(o.C_),dleq:c},u=t[s],d=r[s],f=(0,Ma.pointFromHex)(i.keys[o.amount]),A=(0,Pf.pK)(l,u,d,f);return jc(jc(jc({},(0,Pf.R_)(A)),c&&{dleqValid:(0,eH.BV)(d,c,A.C,f)}),c&&{dleq:{s:vc(c.s),e:vc(c.e),r:dpe(null!==(a=c.r)&&void 0!==a?a:BigInt(0))}})})},e}();let Npe=(()=>{class e{storageService;wallets=new Map;constructor(t){this.storageService=t}getMints(){return this.storageService.getBrowserSessionHandler().browserSessionData?.cashuMints??[]}getMint(t){return this.getMints().find(r=>r.id===t)}getMintByUrl(t){const r=t.replace(/\/$/,"");return this.getMints().find(i=>i.mintUrl===r)}addMint(t,r){var i=this;return I(function*(){return yield i.testMintConnection(r),yield i.storageService.addCashuMint({name:t,mintUrl:r,unit:"sat"})})()}deleteMint(t){var r=this;return I(function*(){r.wallets.delete(t),yield r.storageService.deleteCashuMint(t)})()}getWallet(t){var r=this;return I(function*(){const i=r.wallets.get(t);if(i)return i;const o=r.getMint(t);if(!o)throw new Error("Mint not found");const s=new hH(o.mintUrl),a=new Fpe(s,{unit:o.unit||"sat"});yield a.loadMint();const c={wallet:a,mint:s,mintId:t};return r.wallets.set(t,c),c})()}testMintConnection(t){return I(function*(){const r=t.replace(/\/$/,""),o=yield new hH(r).getInfo();return{name:o.name,description:o.description,version:o.version,contact:o.contact?.map(s=>({method:s.method,info:s.info})),nuts:o.nuts}})()}decodeToken(t){try{const r=cH(t),i=r.proofs,o=i.reduce((s,a)=>s+a.amount,0);return{mint:r.mint,unit:r.unit||"sat",amount:o,proofs:i}}catch{return null}}receive(t){var r=this;return I(function*(){const i=r.decodeToken(t);if(!i)throw new Error("Invalid token format");let o=r.getMintByUrl(i.mint);if(!o){const A=new URL(i.mint);o=yield r.storageService.addCashuMint({name:A.hostname,mintUrl:i.mint,unit:i.unit||"sat"})}const{wallet:s}=yield r.getWallet(o.id),a=yield s.receive(t),c=(new Date).toISOString(),l=a.map(A=>({id:A.id,amount:A.amount,secret:A.secret,C:A.C,receivedAt:c})),d=[...o.proofs||[],...l];return yield r.storageService.updateCashuMintProofs(o.id,d),{amount:l.reduce((A,p)=>A+p.amount,0),mintUrl:i.mint,mintId:o.id}})()}send(t,r){var i=this;return I(function*(){const o=i.getMint(t);if(!o)throw new Error("Mint not found");const s=i.getBalance(t);if(s<r)throw new Error(`Insufficient balance. Have ${s} sats, need ${r} sats`);const{wallet:a}=yield i.getWallet(t),c=o.proofs.map(C=>({id:C.id,amount:C.amount,secret:C.secret,C:C.C})),{send:l,keep:u}=yield a.send(r,c),f=aH({mint:o.mintUrl,proofs:l,unit:o.unit||"sat"}),A=(new Date).toISOString(),p=u.map(C=>({id:C.id,amount:C.amount,secret:C.secret,C:C.C,receivedAt:A}));return yield i.storageService.updateCashuMintProofs(t,p),{token:f,amount:r}})()}checkProofsSpent(t){var r=this;return I(function*(){const i=r.getMint(t);if(!i)throw new Error("Mint not found");if(0===i.proofs.length)return 0;const{wallet:o}=yield r.getWallet(t),s=i.proofs.map(u=>({secret:u.secret})),a=yield o.checkProofsStates(s),c=[];let l=0;for(let u=0;u<i.proofs.length;u++)a[u].state!==lH.SPENT?c.push(i.proofs[u]):l+=i.proofs[u].amount;return l>0&&(yield r.storageService.updateCashuMintProofs(t,c)),l})()}createMintQuote(t,r){var i=this;return I(function*(){if(!i.getMint(t))throw new Error("Mint not found");if(r<=0)throw new Error("Amount must be greater than 0");const{wallet:s}=yield i.getWallet(t),a=yield s.createMintQuote(r);return{quoteId:a.quote,invoice:a.request,amount:r,state:a.state,expiry:a.expiry}})()}checkMintQuote(t,r){var i=this;return I(function*(){if(!i.getMint(t))throw new Error("Mint not found");const{wallet:s}=yield i.getWallet(t),a=yield s.checkMintQuote(r);return{quoteId:a.quote,invoice:a.request,amount:0,state:a.state,expiry:a.expiry}})()}mintTokens(t,r,i){var o=this;return I(function*(){const s=o.getMint(t);if(!s)throw new Error("Mint not found");const{wallet:a}=yield o.getWallet(t),c=yield a.mintProofs(r,i),l=(new Date).toISOString(),u=c.map(p=>({id:p.id,amount:p.amount,secret:p.secret,C:p.C,receivedAt:l})),f=[...s.proofs||[],...u];return yield o.storageService.updateCashuMintProofs(t,f),{amount:u.reduce((p,C)=>p+C.amount,0),mintId:t}})()}getBalance(t){const r=this.getMint(t);return r?r.proofs.reduce((i,o)=>i+o.amount,0):0}getProofs(t){const r=this.getMint(t);return r?r.proofs:[]}getTotalBalance(){return this.getMints().reduce((r,i)=>r+this.getBalance(i.id),0)}getCachedTotalBalance(){return this.getTotalBalance()}formatBalance(t){return void 0===t?"\u2014":t.toLocaleString("en-US")}static \u0275fac=function(r){return new(r||e)(_t(lr))};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var rb=L(8314);const IH=(e,n)=>n.id,xpe=(e,n)=>n.secret,Tpe=(e,n)=>n.payment_hash,Ope=(e,n)=>n.timestamp;function Rpe(e,n){if(1&e){const t=pt();y(0,"button",15),_e("click",function(){return Qe(t),De(Ee().onTestPrompt())}),y(1,"span",3),R(2,"\u2728"),v()()}}function Ppe(e,n){if(1&e){const t=pt();y(0,"button",16),_e("click",function(){return Qe(t),De(Ee().goBack())}),y(1,"span",3),R(2,"\u2190"),v()()}}function Upe(e,n){if(1&e){const t=pt();y(0,"div",10)(1,"button",17),_e("click",function(){return Qe(t),De(Ee().setSection("cashu"))}),y(2,"span",3),R(3,"\u{1f95c}"),v(),y(4,"span",18),R(5,"Cashu"),v(),y(6,"span",19),R(7),v()(),y(8,"button",17),_e("click",function(){return Qe(t),De(Ee().setSection("lightning"))}),y(9,"span",3),R(10,"\u26a1"),v(),y(11,"span",18),R(12,"Lightning"),v(),y(13,"span",19),R(14),v()()()}if(2&e){const t=Ee();J(7),Zt("",t.formatCashuBalance(t.totalCashuBalance)," sats"),J(7),Zt("",t.formatBalance(t.totalLightningBalance)," sats")}}function Hpe(e,n){if(1&e){const t=pt();y(0,"div",26)(1,"p")(2,"strong"),R(3,"Browser Sync is enabled"),v()(),y(4,"p"),R(5," Sync storage is limited to ~100KB shared across all your vault data (identities, permissions, relays, and Cashu tokens). This limits your Cashu wallet to approximately 300-400 tokens. "),v(),y(6,"p"),R(7," For larger Cashu holdings, consider disabling browser sync which provides ~5MB of local storage (~18,000+ tokens). "),v(),y(8,"button",29),_e("click",function(){return Qe(t),De(Ee(4).navigateToSettings())}),R(9," Change Sync Settings "),v()()}}function Lpe(e,n){1&e&&(y(0,"div",27)(1,"p")(2,"strong"),R(3,"Local Storage Mode"),v()(),y(4,"p"),R(5," You have ~5MB of local storage available, which can hold thousands of Cashu tokens. Your data stays on this device only. "),v()())}function Gpe(e,n){if(1&e){const t=pt();y(0,"div",23)(1,"h3"),R(2,"Welcome to Cashu Wallet"),v(),y(3,"div",25)(4,"h4"),R(5,"Storage Considerations"),v(),At(6,Hpe,10,0,"div",26)(7,Lpe,6,0,"div",27),v(),y(8,"div",25)(9,"h4"),R(10,"Backup Your Wallet"),v(),y(11,"p")(12,"strong"),R(13,"Important:"),v(),R(14," Cashu tokens are bearer assets. If you lose your vault backup, you lose your tokens permanently. "),v(),y(15,"p"),R(16," Vault exports are saved to your browser's downloads folder. Configure this to point to either: "),v(),y(17,"ul")(18,"li"),R(19,"Your backup storage device (external drive, NAS)"),v(),y(20,"li"),R(21,"A folder synced by your backup tool (Syncthing, rsync, etc.)"),v()(),y(22,"p",28)(23,"code"),R(24),v()(),y(25,"button",29),_e("click",function(){return Qe(t),De(Ee(3).navigateToSettings())}),R(26," Go to Backup Settings "),v()(),y(27,"button",30),_e("click",function(){return Qe(t),De(Ee(3).dismissCashuInfo())}),R(28," Got it, let me add a mint "),v()()}if(2&e){const t=Ee(3);J(6),tt(t.currentSyncFlow===t.BrowserSyncFlow.BROWSER_SYNC?6:7),J(18),ft(t.browserDownloadSettingsUrl)}}function Vpe(e,n){if(1&e){const t=pt();y(0,"div",24)(1,"span",31),R(2,"No mints connected yet."),v(),y(3,"button",32),_e("click",function(){return Qe(t),De(Ee(3).showCashuInfo=!0)}),R(4," Show storage info "),v()()}}function qpe(e,n){if(1&e&&(y(0,"div",20),At(1,Gpe,29,2,"div",23)(2,Vpe,5,0,"div",24),v()),2&e){const t=Ee(2);J(),tt(t.showCashuInfo?1:2)}}function zpe(e,n){if(1&e){const t=pt();y(0,"button",34),_e("click",function(){const i=Qe(t).$implicit;return De(Ee(3).selectMint(i.id))}),y(1,"span",35),R(2),v(),y(3,"span",36),R(4),v()()}if(2&e){const t=n.$implicit,r=Ee(3);J(2),ft(t.name),J(2),Zt("",r.formatCashuBalance(t.cachedBalance)," sats")}}function Kpe(e,n){if(1&e&&(y(0,"div",21),Rr(1,zpe,5,2,"button",33,IH),v()),2&e){const t=Ee(2);J(),Pr(t.mints)}}function Jpe(e,n){if(1&e){const t=pt();y(0,"div",11),At(1,qpe,3,1,"div",20)(2,Kpe,3,0,"div",21),y(3,"button",22),_e("click",function(){return Qe(t),De(Ee().showAddMint())}),y(4,"span",3),R(5,"+"),v(),y(6,"span"),R(7,"Add Mint"),v()()()}if(2&e){const t=Ee();J(),tt(0===t.mints.length?1:2)}}function jpe(e,n){if(1&e&&(y(0,"div",42),R(1),v()),2&e){const t=Ee(2);J(),ft(t.refreshError)}}function Ype(e,n){1&e&&(y(0,"div",49),R(1,"No tokens stored"),v())}function Wpe(e,n){if(1&e&&(y(0,"div",56)(1,"span",57),R(2),v(),y(3,"span",58),R(4),v()()),2&e){const t=n.$implicit,r=Ee(3);J(2),ft(t.amount),J(2),ft(r.formatProofTime(t.receivedAt))}}function $pe(e,n){if(1&e&&(y(0,"div",50),Rr(1,Wpe,5,2,"div",56,xpe),v()),2&e){const t=Ee(2);J(),Pr(t.selectedMintProofs)}}function Zpe(e,n){if(1&e){const t=pt();y(0,"div",12)(1,"div",37)(2,"div",38)(3,"span",39),R(4),v(),y(5,"span",40),R(6,"sats"),v()(),y(7,"button",41),_e("click",function(){return Qe(t),De(Ee().refreshMint())}),y(8,"span",3),R(9,"\u{1f504}"),v()()(),At(10,jpe,2,1,"div",42),y(11,"div",43)(12,"button",44),_e("click",function(){return Qe(t),De(Ee().showDeposit())}),R(13," Deposit "),v(),y(14,"button",45),_e("click",function(){return Qe(t),De(Ee().showReceive())}),R(15," Receive "),v(),y(16,"button",46),_e("click",function(){return Qe(t),De(Ee().showSend())}),R(17," Send "),v()(),y(18,"div",47)(19,"div",48),R(20),v(),At(21,Ype,2,0,"div",49)(22,$pe,3,0,"div",50),v(),y(23,"div",51)(24,"div",52)(25,"span",53),R(26,"Mint URL"),v(),y(27,"span",54),R(28),v()(),y(29,"div",52)(30,"span",53),R(31,"Unit"),v(),y(32,"span",54),R(33),v()()(),y(34,"button",55),_e("click",function(){return Qe(t),De(Ee().deleteMint())}),R(35," Delete Mint "),v()()}if(2&e){const t=Ee();J(4),ft(t.formatCashuBalance(t.selectedMintBalance)),J(3),gt("disabled",t.refreshingMint),J(),er("spinning",t.refreshingMint),J(2),tt(t.refreshError?10:-1),J(6),gt("disabled",0===t.selectedMintBalance),J(4),Zt("Tokens (",t.selectedMintProofs.length,")"),J(),tt(0===t.selectedMintProofs.length?21:22),J(7),ft(t.selectedMint.mintUrl),J(5),ft(t.selectedMint.unit)}}function Xpe(e,n){if(1&e&&(y(0,"div",64),R(1),v()),2&e){const t=Ee(2);J(),ft(t.mintError)}}function eIe(e,n){if(1&e&&(y(0,"div",65),R(1),v()),2&e){const t=Ee(2);J(),ft(t.mintTestResult)}}function tIe(e,n){if(1&e){const t=pt();y(0,"div",13)(1,"div",59)(2,"label",60),R(3,"Mint Name"),v(),y(4,"input",61),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.newMintName,i)||(o.newMintName=i),De(i)}),v()(),y(5,"div",59)(6,"label",62),R(7,"Mint URL"),v(),y(8,"input",63),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.newMintUrl,i)||(o.newMintUrl=i),De(i)}),v()(),At(9,Xpe,2,1,"div",64)(10,eIe,2,1,"div",65),y(11,"div",66)(12,"button",67),_e("click",function(){return Qe(t),De(Ee().testMint())}),R(13),v(),y(14,"button",68),_e("click",function(){return Qe(t),De(Ee().addMint())}),R(15),v()()()}if(2&e){const t=Ee();J(4),sn("ngModel",t.newMintName),gt("disabled",t.addingMint),J(4),sn("ngModel",t.newMintUrl),gt("disabled",t.addingMint),J(),tt(t.mintError?9:-1),J(),tt(t.mintTestResult?10:-1),J(2),gt("disabled",t.testingMint||t.addingMint),J(),Zt(" ",t.testingMint?"Testing...":"Test Connection"," "),J(),gt("disabled",t.addingMint),J(),Zt(" ",t.addingMint?"Adding...":"Add Mint"," ")}}function nIe(e,n){if(1&e&&(y(0,"div",64),R(1),v()),2&e){const t=Ee(2);J(),ft(t.receiveError)}}function rIe(e,n){if(1&e&&(y(0,"div",65),R(1),v()),2&e){const t=Ee(2);J(),ft(t.receiveResult)}}function iIe(e,n){if(1&e){const t=pt();y(0,"div",13)(1,"div",59)(2,"label",69),R(3,"Paste Cashu Token"),v(),y(4,"textarea",70),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.receiveToken,i)||(o.receiveToken=i),De(i)}),v()(),At(5,nIe,2,1,"div",64)(6,rIe,2,1,"div",65),y(7,"div",66)(8,"button",71),_e("click",function(){return Qe(t),De(Ee().receiveTokens())}),R(9),v()()()}if(2&e){const t=Ee();J(4),sn("ngModel",t.receiveToken),gt("disabled",t.receivingToken),J(),tt(t.receiveError?5:-1),J(),tt(t.receiveResult?6:-1),J(2),gt("disabled",t.receivingToken),J(),Zt(" ",t.receivingToken?"Receiving...":"Receive Tokens"," ")}}function oIe(e,n){if(1&e&&(y(0,"div",64),R(1),v()),2&e){const t=Ee(2);J(),ft(t.sendError)}}function sIe(e,n){if(1&e){const t=pt();y(0,"div",75)(1,"span",76),R(2,"Token to Share"),v(),y(3,"textarea",77),R(4),v(),y(5,"button",78),_e("click",function(){return Qe(t),De(Ee(2).copyToken())}),R(6," Copy Token "),v()()}if(2&e){const t=Ee(2);J(4),ft(t.sendResult)}}function aIe(e,n){if(1&e){const t=pt();y(0,"div",66)(1,"button",71),_e("click",function(){return Qe(t),De(Ee(2).sendTokens())}),R(2),v()()}if(2&e){const t=Ee(2);J(),gt("disabled",t.sendingToken||t.sendAmount<=0),J(),Zt(" ",t.sendingToken?"Creating...":"Create Token"," ")}}function cIe(e,n){if(1&e){const t=pt();y(0,"div",13)(1,"div",72),R(2),v(),y(3,"div",59)(4,"label",73),R(5,"Amount (sats)"),v(),y(6,"input",74),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.sendAmount,i)||(o.sendAmount=i),De(i)}),v()(),At(7,oIe,2,1,"div",64)(8,sIe,7,1,"div",75)(9,aIe,3,2,"div",66),v()}if(2&e){const t=Ee();J(2),Zt(" Available: ",t.formatCashuBalance(t.selectedMintBalance)," sats "),J(4),sn("ngModel",t.sendAmount),gt("max",t.selectedMintBalance)("disabled",t.sendingToken),J(),tt(t.sendError?7:-1),J(),tt(t.sendResult?8:-1),J(),tt(t.sendResult?-1:9)}}function lIe(e,n){if(1&e&&(y(0,"div",64),R(1),v()),2&e){const t=Ee(3);J(),ft(t.depositError)}}function uIe(e,n){if(1&e){const t=pt();y(0,"div",59)(1,"label",80),R(2,"Amount (sats)"),v(),y(3,"input",81),an("ngModelChange",function(i){Qe(t);const o=Ee(2);return dn(o.depositAmount,i)||(o.depositAmount=i),De(i)}),v()(),At(4,lIe,2,1,"div",64),y(5,"div",66)(6,"button",71),_e("click",function(){return Qe(t),De(Ee(2).createDepositInvoice())}),R(7),v()()}if(2&e){const t=Ee(2);J(3),sn("ngModel",t.depositAmount),gt("disabled",t.creatingDepositQuote),J(),tt(t.depositError?4:-1),J(2),gt("disabled",t.creatingDepositQuote||t.depositAmount<=0),J(),Zt(" ",t.creatingDepositQuote?"Creating...":"Create Invoice"," ")}}function dIe(e,n){1&e&&ot(0,"img",82),2&e&>("src",Ee(3).depositInvoiceQr,ec)}function AIe(e,n){1&e&&(y(0,"span",87),R(1,"checking"),v())}function fIe(e,n){if(1&e&&(y(0,"span",86),R(1,"Waiting for payment..."),v(),At(2,AIe,2,0,"span",87)),2&e){const t=Ee(3);J(2),tt(t.checkingDepositPayment?2:-1)}}function gIe(e,n){1&e&&(y(0,"span",84),R(1,"Payment received! Claiming tokens..."),v())}function hIe(e,n){1&e&&(y(0,"span",85),R(1,"\u2713 Tokens received!"),v())}function pIe(e,n){if(1&e&&(y(0,"div",64),R(1),v()),2&e){const t=Ee(3);J(),ft(t.depositError)}}function IIe(e,n){if(1&e&&(y(0,"div",65),R(1),v()),2&e){const t=Ee(3);J(),ft(t.depositSuccess)}}function mIe(e,n){if(1&e){const t=pt();y(0,"div",88),R(1),v(),y(2,"button",78),_e("click",function(){return Qe(t),De(Ee(3).copyDepositInvoice())}),R(3," Copy Invoice "),v()}if(2&e){const t=Ee(3);J(),ft(t.depositInvoice)}}function CIe(e,n){if(1&e&&(y(0,"div",79),At(1,dIe,1,1,"img",82),y(2,"div",83),At(3,fIe,3,1)(4,gIe,2,0,"span",84)(5,hIe,2,0,"span",85),v(),At(6,pIe,2,1,"div",64)(7,IIe,2,1,"div",65)(8,mIe,4,1),v()),2&e){const t=Ee(2);J(),tt(t.depositInvoiceQr?1:-1),J(2),tt("UNPAID"===t.depositQuoteState?3:"PAID"===t.depositQuoteState?4:"ISSUED"===t.depositQuoteState?5:-1),J(3),tt(t.depositError?6:-1),J(),tt(t.depositSuccess?7:-1),J(),tt("UNPAID"===t.depositQuoteState?8:-1)}}function yIe(e,n){if(1&e&&(y(0,"div",13),At(1,uIe,8,5)(2,CIe,9,5,"div",79),v()),2&e){const t=Ee();J(),tt(t.depositInvoice?-1:1),J(),tt(t.depositInvoice?2:-1)}}function EIe(e,n){1&e&&(y(0,"div",24)(1,"span",31),R(2," No wallets connected yet. "),v()())}function BIe(e,n){if(1&e){const t=pt();y(0,"button",34),_e("click",function(){const i=Qe(t).$implicit;return De(Ee(3).selectConnection(i.id))}),y(1,"span",35),R(2),v(),y(3,"span",36),R(4),v()()}if(2&e){const t=n.$implicit,r=Ee(3);J(2),ft(t.name),J(2),Zt("",r.formatBalance(t.cachedBalance)," sats")}}function wIe(e,n){if(1&e&&(y(0,"div",21),Rr(1,BIe,5,2,"button",33,IH),v()),2&e){const t=Ee(2);J(),Pr(t.connections)}}function vIe(e,n){if(1&e){const t=pt();y(0,"div",11),At(1,EIe,3,0,"div",24)(2,wIe,3,0,"div",21),y(3,"button",22),_e("click",function(){return Qe(t),De(Ee().showAddConnection())}),y(4,"span",3),R(5,"+"),v(),y(6,"span"),R(7,"Add NWC Connection"),v()()()}if(2&e){const t=Ee();J(),tt(0===t.connections.length?1:2)}}function _Ie(e,n){if(1&e){const t=pt();y(0,"button",98),_e("click",function(){return Qe(t),De(Ee(2).copyLightningAddress())}),y(1,"span",53),R(2,"Lightning Address"),v(),y(3,"span",54),R(4),y(5,"span",99),R(6),v()()()}if(2&e){const t=Ee(2);J(4),Zt(" ",t.selectedConnection.lud16," "),J(2),ft(t.addressCopied?"\u2713 Copied":"(tap to copy)")}}function bIe(e,n){1&e&&(y(0,"div",93),R(1,"Loading..."),v())}function QIe(e,n){1&e&&(y(0,"div",94),R(1,"Transaction history not supported by this wallet"),v())}function DIe(e,n){if(1&e&&(y(0,"div",95),R(1),v()),2&e){const t=Ee(2);J(),ft(t.transactionsError)}}function SIe(e,n){1&e&&(y(0,"div",49),R(1,"No transactions yet"),v())}function kIe(e,n){if(1&e&&(y(0,"div",101)(1,"span",102),R(2),v(),y(3,"span",103),R(4),v(),y(5,"span",104),R(6),v(),y(7,"span",105),R(8),v()()),2&e){const t=n.$implicit,r=Ee(3);er("incoming","incoming"===t.type)("outgoing","outgoing"===t.type),J(2),ft("incoming"===t.type?"\u2b07":"\u2b06"),J(2),ft("incoming"===t.type?"Received":"Sent"),J(2),ft(r.formatBalance(t.amount)),J(2),ft(r.formatTransactionTime(t.created_at))}}function MIe(e,n){if(1&e&&(y(0,"div",96),Rr(1,kIe,9,8,"div",100,Tpe),v()),2&e){const t=Ee(2);J(),Pr(t.transactions)}}function FIe(e,n){if(1&e){const t=pt();y(0,"div",12)(1,"div",37)(2,"div",38)(3,"span",39),R(4),v(),y(5,"span",40),R(6,"sats"),v()(),y(7,"button",89),_e("click",function(){return Qe(t),De(Ee().refreshWallet())}),y(8,"span",3),R(9,"\u{1f504}"),v()()(),y(10,"div",43)(11,"button",45),_e("click",function(){return Qe(t),De(Ee().showLnReceive())}),R(12," Receive "),v(),y(13,"button",90),_e("click",function(){return Qe(t),De(Ee().showLnPay())}),R(14," Pay "),v()(),y(15,"div",51)(16,"div",52)(17,"span",53),R(18,"Relay"),v(),y(19,"span",54),R(20),v()(),At(21,_Ie,7,2,"button",91),v(),y(22,"div",92)(23,"div",48),R(24,"Transactions"),v(),At(25,bIe,2,0,"div",93)(26,QIe,2,0,"div",94)(27,DIe,2,1,"div",95)(28,SIe,2,0,"div",49)(29,MIe,3,0,"div",96),v(),y(30,"button",97),_e("click",function(){return Qe(t),De(Ee().deleteConnection())}),R(31," Delete Wallet "),v()()}if(2&e){const t=Ee();J(4),ft(t.formatBalance(t.selectedConnection.cachedBalance)),J(16),ft(t.selectedConnection.relayUrl),J(),tt(t.selectedConnection.lud16?21:-1),J(4),tt(t.loadingTransactions?25:t.transactionsNotSupported?26:t.transactionsError?27:0===t.transactions.length?28:29)}}function NIe(e,n){if(1&e&&(y(0,"div",64),R(1),v()),2&e){const t=Ee(2);J(),ft(t.lnReceiveError)}}function xIe(e,n){if(1&e){const t=pt();y(0,"div",66)(1,"button",71),_e("click",function(){return Qe(t),De(Ee(2).createReceiveInvoice())}),R(2),v()()}if(2&e){const t=Ee(2);J(),gt("disabled",t.generatingInvoice||t.lnReceiveAmount<=0),J(),Zt(" ",t.generatingInvoice?"Generating...":"Generate Invoice"," ")}}function TIe(e,n){1&e&&ot(0,"img",82),2&e&>("src",Ee(3).generatedInvoiceQr,ec)}function OIe(e,n){if(1&e){const t=pt();y(0,"div",79),At(1,TIe,1,1,"img",82),y(2,"div",88),R(3),v(),y(4,"button",78),_e("click",function(){return Qe(t),De(Ee(2).copyInvoice())}),R(5),v()()}if(2&e){const t=Ee(2);J(),tt(t.generatedInvoiceQr?1:-1),J(2),ft(t.generatedInvoice),J(2),Zt(" ",t.invoiceCopied?"Copied!":"Copy Invoice"," ")}}function RIe(e,n){if(1&e){const t=pt();y(0,"div",13)(1,"div",59)(2,"label",106),R(3,"Amount (sats)"),v(),y(4,"input",107),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.lnReceiveAmount,i)||(o.lnReceiveAmount=i),De(i)}),v()(),y(5,"div",59)(6,"label",108),R(7,"Description (optional)"),v(),y(8,"input",109),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.lnReceiveDescription,i)||(o.lnReceiveDescription=i),De(i)}),v()(),At(9,NIe,2,1,"div",64)(10,xIe,3,2,"div",66)(11,OIe,6,3,"div",79),v()}if(2&e){const t=Ee();J(4),sn("ngModel",t.lnReceiveAmount),gt("disabled",t.generatingInvoice),J(4),sn("ngModel",t.lnReceiveDescription),gt("disabled",t.generatingInvoice),J(),tt(t.lnReceiveError?9:-1),J(),tt(t.generatedInvoice?-1:10),J(),tt(t.generatedInvoice?11:-1)}}function PIe(e,n){if(1&e&&(y(0,"div",64),R(1),v()),2&e){const t=Ee(2);J(),ft(t.paymentError)}}function UIe(e,n){1&e&&(y(0,"div",119),R(1,"Payment Successful!"),v())}function HIe(e,n){if(1&e){const t=pt();y(0,"div",66)(1,"button",67),_e("click",function(){return Qe(t),De(Ee(2).closePayModal())}),R(2," Cancel "),v(),y(3,"button",68),_e("click",function(){return Qe(t),De(Ee(2).payInvoiceOrAddress())}),R(4),v()()}if(2&e){const t=Ee(2);J(),gt("disabled",t.paying),J(2),gt("disabled",t.paying||!t.payInput.trim()),J(),Zt(" ",t.paying?"Paying...":"Pay"," ")}}function LIe(e,n){if(1&e){const t=pt();y(0,"div",110),_e("click",function(){return Qe(t),De(Ee().closePayModal())})("keydown.escape",function(){return Qe(t),De(Ee().closePayModal())}),y(1,"div",111),_e("click",function(i){return Qe(t),De(i.stopPropagation())})("keydown",function(i){return Qe(t),De(i.stopPropagation())}),y(2,"div",112)(3,"span"),R(4,"Pay Invoice"),v(),y(5,"button",113),_e("click",function(){return Qe(t),De(Ee().closePayModal())}),R(6,"\xd7"),v()(),y(7,"div",114)(8,"div",59)(9,"label",115),R(10,"Lightning Address or Invoice"),v(),y(11,"textarea",116),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.payInput,i)||(o.payInput=i),De(i)}),v()(),y(12,"div",59)(13,"label",117),R(14,"Amount (sats) - required for addresses"),v(),y(15,"input",118),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.payAmount,i)||(o.payAmount=i),De(i)}),v()(),At(16,PIe,2,1,"div",64)(17,UIe,2,0,"div",119)(18,HIe,5,3,"div",66),v()()()}if(2&e){const t=Ee();J(11),sn("ngModel",t.payInput),gt("disabled",t.paying),J(4),sn("ngModel",t.payAmount),gt("disabled",t.paying),J(),tt(t.paymentError?16:-1),J(),tt(t.paymentSuccess?17:-1),J(),tt(t.paymentSuccess?-1:18)}}function GIe(e,n){if(1&e&&(y(0,"div",64),R(1),v()),2&e){const t=Ee(2);J(),ft(t.connectionError)}}function VIe(e,n){if(1&e&&(y(0,"div",65),R(1),v()),2&e){const t=Ee(2);J(),ft(t.connectionTestResult)}}function qIe(e,n){if(1&e&&(y(0,"div",129)(1,"span",130),R(2),mA(3,"date"),v(),y(4,"span",131),R(5),v()()),2&e){const t=n.$implicit;er("log-warn","warn"===t.level)("log-error","error"===t.level),J(2),ft(pB(3,6,t.timestamp,"HH:mm:ss")),J(3),ft(t.message)}}function zIe(e,n){if(1&e){const t=pt();y(0,"div",124)(1,"div",125)(2,"span"),R(3,"Connection Log"),v(),y(4,"button",126),_e("click",function(){return Qe(t),De(Ee(2).nwcService.clearLogs())}),R(5,"Clear"),v()(),y(6,"div",127),Rr(7,qIe,6,9,"div",128,Ope),v()()}if(2&e){const t=Ee(2);J(7),Pr(t.nwcService.logs)}}function KIe(e,n){if(1&e){const t=pt();y(0,"div",13)(1,"div",59)(2,"label",120),R(3,"Wallet Name"),v(),y(4,"input",121),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.newWalletName,i)||(o.newWalletName=i),De(i)}),v()(),y(5,"div",59)(6,"label",122),R(7,"NWC Connection URL"),v(),y(8,"textarea",123),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.newWalletUrl,i)||(o.newWalletUrl=i),De(i)}),v()(),At(9,GIe,2,1,"div",64)(10,VIe,2,1,"div",65)(11,zIe,9,0,"div",124),y(12,"div",66)(13,"button",67),_e("click",function(){return Qe(t),De(Ee().testConnection())}),R(14),v(),y(15,"button",68),_e("click",function(){return Qe(t),De(Ee().addConnection())}),R(16),v()()()}if(2&e){const t=Ee();J(4),sn("ngModel",t.newWalletName),gt("disabled",t.addingConnection),J(4),sn("ngModel",t.newWalletUrl),gt("disabled",t.addingConnection),J(),tt(t.connectionError?9:-1),J(),tt(t.connectionTestResult?10:-1),J(),tt(t.nwcService.logs.length>0?11:-1),J(2),gt("disabled",t.testingConnection||t.addingConnection),J(),Zt(" ",t.testingConnection?"Testing...":"Test Connection"," "),J(),gt("disabled",t.addingConnection),J(),Zt(" ",t.addingConnection?"Adding...":"Add Wallet"," ")}}let JIe=(()=>{class e extends Nr{#e=de(Si);#t=de(An);nwcService=de(Lhe);cashuService=de(Npe);activeSection="main";selectedConnectionId=null;selectedMintId=null;newWalletName="";newWalletUrl="";addingConnection=!1;testingConnection=!1;connectionError="";connectionTestResult="";newMintName="";newMintUrl="";addingMint=!1;testingMint=!1;mintError="";mintTestResult="";receiveToken="";receivingToken=!1;receiveError="";receiveResult="";sendAmount=0;sendingToken=!1;sendError="";sendResult="";depositAmount=0;creatingDepositQuote=!1;depositQuoteId="";depositInvoice="";depositInvoiceQr="";depositError="";depositSuccess="";checkingDepositPayment=!1;depositQuoteState="UNPAID";depositPollingInterval=null;loadingBalances=!1;balanceError="";transactions=[];loadingTransactions=!1;transactionsError="";transactionsNotSupported=!1;lnReceiveAmount=0;lnReceiveDescription="";generatingInvoice=!1;generatedInvoice="";generatedInvoiceQr="";lnReceiveError="";invoiceCopied=!1;showPayModal=!1;payInput="";payAmount=0;paying=!1;paymentSuccess=!1;paymentError="";addressCopied=!1;showCashuInfo=!0;currentSyncFlow=Ec.NO_SYNC;BrowserSyncFlow=Ec;browserDownloadSettingsUrl="about:preferences#general";refreshingMint=!1;refreshError="";get title(){switch(this.activeSection){case"cashu":return"Cashu";case"cashu-detail":return this.selectedMint?.name??"Mint";case"cashu-add":return"Add Mint";case"cashu-receive":case"lightning-receive":return"Receive";case"cashu-send":return"Send";case"cashu-mint":return"Deposit";case"lightning":return"Lightning";case"lightning-detail":return this.selectedConnection?.name??"Wallet";case"lightning-add":return"Add Wallet";case"lightning-pay":return"Pay";default:return"Wallet"}}get showBackButton(){return"main"!==this.activeSection}get connections(){return this.nwcService.getConnections()}get selectedConnection(){if(this.selectedConnectionId)return this.nwcService.getConnection(this.selectedConnectionId)}get totalLightningBalance(){return this.nwcService.getCachedTotalBalance()}get mints(){return this.cashuService.getMints()}get selectedMint(){if(this.selectedMintId)return this.cashuService.getMint(this.selectedMintId)}get totalCashuBalance(){return this.cashuService.getCachedTotalBalance()}get selectedMintBalance(){return this.selectedMintId?this.cashuService.getBalance(this.selectedMintId):0}get selectedMintProofs(){return this.selectedMintId?this.cashuService.getProofs(this.selectedMintId):[]}ngOnInit(){this.currentSyncFlow=this.storage.getSyncFlow(),this.connections.length>0&&this.refreshAllBalances()}ngOnDestroy(){this.nwcService.disconnectAll(),this.stopDepositPolling()}setSection(t){this.activeSection=t,this.connectionError="",this.connectionTestResult=""}goBack(){switch(this.activeSection){case"lightning-detail":case"lightning-add":this.activeSection="lightning",this.selectedConnectionId=null,this.resetAddForm(),this.resetLightningForms();break;case"lightning-receive":case"lightning-pay":this.activeSection="lightning-detail",this.resetLightningForms();break;case"cashu-detail":case"cashu-add":this.activeSection="cashu",this.selectedMintId=null,this.resetAddMintForm();break;case"cashu-receive":case"cashu-send":case"cashu-mint":this.activeSection="cashu-detail",this.resetReceiveSendForm(),this.resetDepositForm();break;case"lightning":case"cashu":this.activeSection="main"}}selectConnection(t){this.selectedConnectionId=t,this.activeSection="lightning-detail",this.loadTransactions(t)}resetLightningForms(){this.lnReceiveAmount=0,this.lnReceiveDescription="",this.generatingInvoice=!1,this.generatedInvoice="",this.generatedInvoiceQr="",this.lnReceiveError="",this.invoiceCopied=!1,this.payInput="",this.payAmount=0,this.paying=!1,this.paymentSuccess=!1,this.paymentError="",this.showPayModal=!1}showAddConnection(){this.resetAddForm(),this.activeSection="lightning-add"}resetAddForm(){this.newWalletName="",this.newWalletUrl="",this.connectionError="",this.connectionTestResult="",this.addingConnection=!1,this.testingConnection=!1}testConnection(){var t=this;return I(function*(){if(t.newWalletUrl.trim()){t.testingConnection=!0,t.connectionError="",t.connectionTestResult="",t.nwcService.clearLogs();try{const r=yield t.nwcService.testConnection(t.newWalletUrl);t.connectionTestResult="Connected! "+(r.alias?"Wallet: "+r.alias:""),t.nwcService.clearLogs()}catch(r){t.connectionError=r instanceof Error?r.message:"Connection test failed"}finally{t.testingConnection=!1}}else t.connectionError="Please enter an NWC URL"})()}addConnection(){var t=this;return I(function*(){if(t.newWalletName.trim())if(t.newWalletUrl.trim()){t.addingConnection=!0,t.connectionError="";try{yield t.nwcService.addConnection(t.newWalletName.trim(),t.newWalletUrl.trim());const r=t.nwcService.getConnections(),i=r[r.length-1];if(i)try{yield t.nwcService.getBalance(i.id)}catch{}t.goBack()}catch(r){t.connectionError=r instanceof Error?r.message:"Failed to add connection"}finally{t.addingConnection=!1}}else t.connectionError="Please enter an NWC URL";else t.connectionError="Please enter a wallet name"})()}deleteConnection(){var t=this;return I(function*(){if(!t.selectedConnectionId)return;const r=t.selectedConnection;if(confirm(`Delete wallet "${r?.name}"? This cannot be undone.`))try{yield t.nwcService.deleteConnection(t.selectedConnectionId),t.goBack()}catch(i){console.error("Failed to delete connection:",i)}})()}selectMint(t){this.selectedMintId=t,this.activeSection="cashu-detail",this.refreshMint()}refreshMint(){var t=this;return I(function*(){if(t.selectedMintId&&!t.refreshingMint){t.refreshingMint=!0,t.refreshError="";try{const r=yield t.cashuService.checkProofsSpent(t.selectedMintId);r>0&&console.log(`Removed ${r} sats of spent proofs`)}catch(r){t.refreshError=r instanceof Error?r.message:"Failed to refresh",console.error("Failed to refresh mint:",r)}finally{t.refreshingMint=!1}}})()}showAddMint(){this.resetAddMintForm(),this.activeSection="cashu-add"}showReceive(){this.resetReceiveSendForm(),this.activeSection="cashu-receive"}showSend(){this.resetReceiveSendForm(),this.activeSection="cashu-send"}resetAddMintForm(){this.newMintName="",this.newMintUrl="",this.mintError="",this.mintTestResult="",this.addingMint=!1,this.testingMint=!1}resetReceiveSendForm(){this.receiveToken="",this.receivingToken=!1,this.receiveError="",this.receiveResult="",this.sendAmount=0,this.sendingToken=!1,this.sendError="",this.sendResult=""}resetDepositForm(){this.depositAmount=0,this.creatingDepositQuote=!1,this.depositQuoteId="",this.depositInvoice="",this.depositInvoiceQr="",this.depositError="",this.depositSuccess="",this.checkingDepositPayment=!1,this.depositQuoteState="UNPAID",this.stopDepositPolling()}stopDepositPolling(){this.depositPollingInterval&&(clearInterval(this.depositPollingInterval),this.depositPollingInterval=null)}testMint(){var t=this;return I(function*(){if(t.newMintUrl.trim()){t.testingMint=!0,t.mintError="",t.mintTestResult="";try{const r=yield t.cashuService.testMintConnection(t.newMintUrl.trim());t.mintTestResult="Connected! "+(r.name?"Mint: "+r.name:"")}catch(r){t.mintError=r instanceof Error?r.message:"Connection test failed"}finally{t.testingMint=!1}}else t.mintError="Please enter a mint URL"})()}addMint(){var t=this;return I(function*(){if(t.newMintName.trim())if(t.newMintUrl.trim()){t.addingMint=!0,t.mintError="";try{yield t.cashuService.addMint(t.newMintName.trim(),t.newMintUrl.trim()),t.goBack()}catch(r){t.mintError=r instanceof Error?r.message:"Failed to add mint"}finally{t.addingMint=!1}}else t.mintError="Please enter a mint URL";else t.mintError="Please enter a mint name"})()}deleteMint(){var t=this;return I(function*(){if(!t.selectedMintId)return;const r=t.selectedMint;if(confirm(`Delete mint "${r?.name}"? Any tokens stored will be lost. This cannot be undone.`))try{yield t.cashuService.deleteMint(t.selectedMintId),t.goBack()}catch(i){console.error("Failed to delete mint:",i)}})()}receiveTokens(){var t=this;return I(function*(){if(t.receiveToken.trim()){t.receivingToken=!0,t.receiveError="",t.receiveResult="";try{const r=yield t.cashuService.receive(t.receiveToken.trim());t.receiveResult=`Received ${r.amount} sats!`,t.receiveToken=""}catch(r){t.receiveError=r instanceof Error?r.message:"Failed to receive token"}finally{t.receivingToken=!1}}else t.receiveError="Please paste a Cashu token"})()}sendTokens(){var t=this;return I(function*(){if(!t.selectedMintId)return;if(t.sendAmount<=0)return void(t.sendError="Please enter a valid amount");const r=t.selectedMintBalance;if(t.sendAmount>r)t.sendError=`Insufficient balance. You have ${r} sats`;else{t.sendingToken=!0,t.sendError="",t.sendResult="";try{const i=yield t.cashuService.send(t.selectedMintId,t.sendAmount);t.sendResult=i.token,t.sendAmount=0}catch(i){t.sendError=i instanceof Error?i.message:"Failed to create token"}finally{t.sendingToken=!1}}})()}copyToken(){this.sendResult&&navigator.clipboard.writeText(this.sendResult)}checkProofs(){var t=this;return I(function*(){if(t.selectedMintId)try{const r=yield t.cashuService.checkProofsSpent(t.selectedMintId);r>0?alert(`Removed ${r} sats of spent proofs.`):alert("All proofs are valid.")}catch(r){console.error("Failed to check proofs:",r)}})()}showDeposit(){this.resetDepositForm(),this.activeSection="cashu-mint"}createDepositInvoice(){var t=this;return I(function*(){if(t.selectedMintId){if(t.depositAmount<=0)return void(t.depositError="Please enter an amount");t.creatingDepositQuote=!0,t.depositError="",t.depositInvoice="",t.depositInvoiceQr="";try{const r=yield t.cashuService.createMintQuote(t.selectedMintId,t.depositAmount);t.depositQuoteId=r.quoteId,t.depositInvoice=r.invoice,t.depositQuoteState=r.state,t.depositInvoiceQr=yield rb.dY(r.invoice,{width:200,margin:2,color:{dark:"#000000",light:"#ffffff"}}),t.startDepositPolling()}catch(r){t.depositError=r instanceof Error?r.message:"Failed to create invoice"}finally{t.creatingDepositQuote=!1}}})()}startDepositPolling(){var t=this;this.depositPollingInterval=setInterval(I(function*(){yield t.checkDepositPayment()}),3e3)}checkDepositPayment(){var t=this;return I(function*(){if(t.selectedMintId&&t.depositQuoteId){t.checkingDepositPayment=!0;try{const r=yield t.cashuService.checkMintQuote(t.selectedMintId,t.depositQuoteId);t.depositQuoteState=r.state,"PAID"===r.state?(t.stopDepositPolling(),yield t.claimDepositTokens()):"ISSUED"===r.state&&(t.stopDepositPolling(),t.depositSuccess="Tokens already claimed!")}catch(r){console.error("Failed to check payment:",r)}finally{t.checkingDepositPayment=!1}}})()}claimDepositTokens(){var t=this;return I(function*(){if(t.selectedMintId&&t.depositQuoteId)try{const r=yield t.cashuService.mintTokens(t.selectedMintId,t.depositAmount,t.depositQuoteId);t.depositSuccess=`Received ${r.amount} sats!`,t.depositQuoteState="ISSUED"}catch(r){t.depositError=r instanceof Error?r.message:"Failed to claim tokens"}})()}copyDepositInvoice(){var t=this;return I(function*(){t.depositInvoice&&(yield navigator.clipboard.writeText(t.depositInvoice))})()}formatCashuBalance(t){return this.cashuService.formatBalance(t)}refreshBalance(t){var r=this;return I(function*(){try{yield r.nwcService.getBalance(t)}catch(i){console.error("Failed to refresh balance:",i)}})()}refreshAllBalances(){var t=this;return I(function*(){t.loadingBalances=!0,t.balanceError="";try{yield t.nwcService.getAllBalances()}catch{t.balanceError="Failed to refresh some balances"}finally{t.loadingBalances=!1}})()}formatBalance(t){return void 0===t?"\u2014":(t/1e3).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:3})}loadTransactions(t){var r=this;return I(function*(){r.loadingTransactions=!0,r.transactionsError="",r.transactionsNotSupported=!1;try{r.transactions=yield r.nwcService.listTransactions(t,{limit:20})}catch(i){const o=i instanceof Error?i.message:"Unknown error";o.includes("NOT_IMPLEMENTED")||o.includes("not supported")?r.transactionsNotSupported=!0:r.transactionsError=o,r.transactions=[]}finally{r.loadingTransactions=!1}})()}refreshWallet(){var t=this;return I(function*(){t.selectedConnectionId&&(yield Promise.all([t.refreshBalance(t.selectedConnectionId),t.loadTransactions(t.selectedConnectionId)]))})()}showLnReceive(){this.resetLightningForms(),this.activeSection="lightning-receive"}showLnPay(){this.resetLightningForms(),this.showPayModal=!0}closePayModal(){this.showPayModal=!1,this.resetLightningForms()}createReceiveInvoice(){var t=this;return I(function*(){if(t.selectedConnectionId){if(t.lnReceiveAmount<=0)return void(t.lnReceiveError="Please enter an amount");t.generatingInvoice=!0,t.lnReceiveError="",t.generatedInvoice="",t.generatedInvoiceQr="";try{const r=yield t.nwcService.makeInvoice(t.selectedConnectionId,1e3*t.lnReceiveAmount,t.lnReceiveDescription||void 0);t.generatedInvoice=r.invoice,t.generatedInvoiceQr=yield rb.dY(r.invoice,{width:200,margin:2,color:{dark:"#000000",light:"#ffffff"}})}catch(r){t.lnReceiveError=r instanceof Error?r.message:"Failed to create invoice"}finally{t.generatingInvoice=!1}}})()}copyInvoice(){var t=this;return I(function*(){t.generatedInvoice&&(yield navigator.clipboard.writeText(t.generatedInvoice),t.invoiceCopied=!0,setTimeout(()=>t.invoiceCopied=!1,2e3))})()}copyLightningAddress(){var t=this;return I(function*(){const r=t.selectedConnection?.lud16;r&&(yield navigator.clipboard.writeText(r),t.addressCopied=!0,setTimeout(()=>t.addressCopied=!1,2e3))})()}payInvoiceOrAddress(){var t=this;return I(function*(){if(t.selectedConnectionId&&t.payInput.trim()){t.paying=!0,t.paymentError="",t.paymentSuccess=!1;try{let r=t.payInput.trim();if(t.nwcService.isLightningAddress(r)){if(t.payAmount<=0)return t.paymentError="Please enter an amount for lightning address payments",void(t.paying=!1);r=yield t.nwcService.resolveLightningAddress(r,1e3*t.payAmount)}yield t.nwcService.payInvoice(t.selectedConnectionId,r,t.payAmount>0?1e3*t.payAmount:void 0),t.paymentSuccess=!0,yield t.refreshWallet(),setTimeout(()=>{t.closePayModal()},2e3)}catch(r){t.paymentError=r instanceof Error?r.message:"Payment failed"}finally{t.paying=!1}}else t.paymentError="Please enter a lightning address or invoice"})()}formatTransactionTime(t){const r=new Date(1e3*t),i=new Date;return r.toDateString()===i.toDateString()?r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString("en-US",{month:"short",day:"numeric"})}formatProofTime(t){if(!t)return"\u2014";const r=new Date(t),i=new Date;return r.toDateString()===i.toDateString()?r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}onClickLock(){var t=this;return I(function*(){t.#e.logVaultLock(),yield t.storage.lockVault(),t.#t.navigateByUrl("/vault-login")})()}dismissCashuInfo(){this.showCashuInfo=!1}navigateToSettings(){this.#t.navigateByUrl("/home/settings")}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-wallet"]],features:[Nt],decls:29,vars:9,consts:[[1,"sam-text-header"],[1,"header-buttons"],["title","Lock",1,"header-btn",3,"click"],[1,"emoji"],["title","Test Permission Prompt",1,"header-btn"],["title","Go Back",1,"back-btn"],[1,"section-btns"],["title","Cashu",1,"section-btn",3,"click"],["title","Lightning",1,"section-btn",3,"click"],[1,"wallet-container"],[1,"wallet-menu"],[1,"lightning-section"],[1,"wallet-detail"],[1,"add-wallet-form"],["role","dialog","aria-modal","true","tabindex","-1",1,"modal-overlay"],["title","Test Permission Prompt",1,"header-btn",3,"click"],["title","Go Back",1,"back-btn",3,"click"],[1,"wallet-menu-item",3,"click"],[1,"label"],[1,"balance"],[1,"cashu-onboarding"],[1,"wallet-list"],[1,"add-wallet-btn",3,"click"],[1,"info-panel"],[1,"empty-state"],[1,"info-section"],[1,"warning-box"],[1,"success-box"],[1,"browser-url"],[1,"link-btn",3,"click"],[1,"dismiss-btn",3,"click"],[1,"sam-text-muted"],[1,"show-info-btn",3,"click"],[1,"wallet-list-item"],[1,"wallet-list-item",3,"click"],[1,"wallet-name"],[1,"wallet-balance"],[1,"balance-row"],[1,"balance-display","compact"],[1,"balance-value"],[1,"balance-unit"],["title","Refresh",1,"refresh-icon-btn",3,"click","disabled"],[1,"error-message","small"],[1,"action-buttons"],[1,"action-btn","deposit-btn",3,"click"],[1,"action-btn","receive-btn",3,"click"],[1,"action-btn","send-btn",3,"click","disabled"],[1,"token-section"],[1,"section-title"],[1,"empty-text"],[1,"token-list"],[1,"wallet-info"],[1,"info-row"],[1,"info-label"],[1,"info-value"],[1,"delete-btn",3,"click"],[1,"token-item"],[1,"token-amount"],[1,"token-time"],[1,"form-group"],["for","mintName"],["id","mintName","type","text","placeholder","My Mint",3,"ngModelChange","ngModel","disabled"],["for","mintUrl"],["id","mintUrl","type","text","placeholder","https://mint.example.com",3,"ngModelChange","ngModel","disabled"],[1,"error-message"],[1,"success-message"],[1,"form-actions"],[1,"test-btn",3,"click","disabled"],[1,"add-btn",3,"click","disabled"],["for","receiveToken"],["id","receiveToken","placeholder","cashuB...","rows","5",3,"ngModelChange","ngModel","disabled"],[1,"add-btn","full-width",3,"click","disabled"],[1,"balance-info"],["for","sendAmount"],["id","sendAmount","type","number","placeholder","0","min","1",3,"ngModelChange","ngModel","max","disabled"],[1,"token-result"],[1,"token-label"],["readonly","","rows","4"],[1,"copy-btn",3,"click"],[1,"invoice-result"],["for","depositAmount"],["id","depositAmount","type","number","placeholder","1000","min","1",3,"ngModelChange","ngModel","disabled"],["alt","Invoice QR Code",1,"qr-code",3,"src"],[1,"deposit-status"],[1,"status-paid"],[1,"status-issued"],[1,"status-waiting"],[1,"status-checking"],[1,"invoice-text"],["title","Refresh",1,"refresh-icon-btn",3,"click"],[1,"action-btn","send-btn",3,"click"],[1,"info-row-btn"],[1,"transaction-section"],[1,"loading-text"],[1,"not-supported-text"],[1,"error-text"],[1,"transaction-list"],[1,"delete-btn-small",3,"click"],[1,"info-row-btn",3,"click"],[1,"copy-hint"],[1,"transaction-item",3,"incoming","outgoing"],[1,"transaction-item"],[1,"tx-icon"],[1,"tx-type"],[1,"tx-amount"],[1,"tx-time"],["for","lnReceiveAmount"],["id","lnReceiveAmount","type","number","placeholder","1000","min","1",3,"ngModelChange","ngModel","disabled"],["for","lnReceiveDescription"],["id","lnReceiveDescription","type","text","placeholder","Payment for...",3,"ngModelChange","ngModel","disabled"],["role","dialog","aria-modal","true","tabindex","-1",1,"modal-overlay",3,"click","keydown.escape"],["role","document",1,"modal-content",3,"click","keydown"],[1,"modal-header"],[1,"modal-close",3,"click"],[1,"modal-body"],["for","payInput"],["id","payInput","placeholder","user@domain.com or lnbc1...","rows","3",3,"ngModelChange","ngModel","disabled"],["for","payAmount"],["id","payAmount","type","number","placeholder","Optional for invoices","min","1",3,"ngModelChange","ngModel","disabled"],[1,"success-message","payment-success"],["for","walletName"],["id","walletName","type","text","placeholder","My Lightning Wallet",3,"ngModelChange","ngModel","disabled"],["for","walletUrl"],["id","walletUrl","placeholder","nostr+walletconnect://...","rows","3",3,"ngModelChange","ngModel","disabled"],[1,"nwc-log"],[1,"log-header"],[1,"log-clear-btn",3,"click"],[1,"log-entries"],[1,"log-entry",3,"log-warn","log-error"],[1,"log-entry"],[1,"log-time"],[1,"log-message"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"div",1)(2,"button",2),_e("click",function(){return i.onClickLock()}),y(3,"span",3),R(4,"\u{1f512}"),v()(),At(5,Rpe,3,0,"button",4),v(),At(6,Ppe,3,0,"button",5),y(7,"span"),R(8),v(),y(9,"div",6)(10,"button",7),_e("click",function(){return i.setSection("cashu")}),y(11,"span",3),R(12,"\u{1f95c}"),v()(),y(13,"button",8),_e("click",function(){return i.setSection("lightning")}),y(14,"span",3),R(15,"\u26a1"),v()()()(),y(16,"div",9),At(17,Upe,15,2,"div",10)(18,Jpe,8,1,"div",11)(19,Zpe,36,10,"div",12)(20,tIe,16,10,"div",13)(21,iIe,10,6,"div",13)(22,cIe,10,7,"div",13)(23,yIe,3,2,"div",13)(24,vIe,8,1,"div",11)(25,FIe,32,4,"div",12)(26,RIe,12,7,"div",13)(27,LIe,19,7,"div",14)(28,KIe,17,11,"div",13),v()),2&r&&(J(5),tt(i.devMode?5:-1),J(),tt(i.showBackButton?6:-1),J(2),ft(i.title),J(2),er("active",i.activeSection.startsWith("cashu")),J(3),er("active",i.activeSection.startsWith("lightning")),J(4),tt("main"===i.activeSection?17:"cashu"===i.activeSection?18:"cashu-detail"===i.activeSection&&i.selectedMint?19:"cashu-add"===i.activeSection?20:"cashu-receive"===i.activeSection?21:"cashu-send"===i.activeSection?22:"cashu-mint"===i.activeSection&&i.selectedMint?23:"lightning"===i.activeSection?24:"lightning-detail"===i.activeSection&&i.selectedConnection?25:"lightning-receive"===i.activeSection&&i.selectedConnection?26:-1),J(10),tt(i.showPayModal&&i.selectedConnection?27:"lightning-add"===i.activeSection?28:-1))},dependencies:[T$,t0,Ko,mo,nw,Co,aw,sw,qi],styles:['[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n padding-top: var(--size);\n padding-bottom: var(--size);\n overflow: hidden;\n}\n[_nghost-%COMP%] > *[_ngcontent-%COMP%]:not(.sam-text-header) {\n margin-left: var(--size);\n margin-right: var(--size);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] {\n margin-bottom: var(--size);\n flex-shrink: 0;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .back-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: background-color 0.2s;\n margin-right: 4px;\n color: var(--foreground);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .back-btn[_ngcontent-%COMP%]:hover {\n background-color: var(--background-light);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .back-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 20px;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .section-btns[_ngcontent-%COMP%] {\n position: absolute;\n right: 0;\n display: flex;\n gap: 4px;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .section-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: background-color 0.2s;\n opacity: 0.5;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .section-btn[_ngcontent-%COMP%]:hover {\n background-color: var(--background-light);\n opacity: 0.8;\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .section-btn.active[_ngcontent-%COMP%] {\n opacity: 1;\n background-color: var(--background-light);\n}\n[_nghost-%COMP%] .sam-text-header[_ngcontent-%COMP%] .section-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 20px;\n}\n\n.wallet-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n}\n\n.wallet-menu[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size-h);\n}\n\n.wallet-menu-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--size);\n padding: var(--size);\n background: var(--background-light);\n border: none;\n border-radius: var(--radius-md);\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n.wallet-menu-item[_ngcontent-%COMP%]:hover {\n background: var(--background-light-hover);\n}\n.wallet-menu-item[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 24px;\n}\n.wallet-menu-item[_ngcontent-%COMP%] .label[_ngcontent-%COMP%] {\n flex: 1;\n font-size: 1rem;\n color: var(--foreground);\n text-align: left;\n}\n.wallet-menu-item[_ngcontent-%COMP%] .balance[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n color: var(--muted-foreground);\n}\n\n.empty-state[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n color: var(--muted-foreground);\n padding: var(--size-2x);\n gap: var(--size-h);\n}\n\n.cashu-onboarding[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] {\n padding: var(--size);\n background: var(--background-light);\n border-radius: var(--radius-md);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0 0 var(--size) 0;\n font-size: 1.1rem;\n color: var(--foreground);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-panel[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] {\n margin: 0 0 var(--size-h) 0;\n font-size: 0.9rem;\n color: var(--muted-foreground);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%] {\n margin-bottom: var(--size);\n padding-bottom: var(--size);\n border-bottom: 1px solid var(--border);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%]:last-of-type {\n border-bottom: none;\n margin-bottom: 0;\n padding-bottom: 0;\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0 0 var(--size-h) 0;\n font-size: 0.85rem;\n line-height: 1.4;\n color: var(--muted-foreground);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child {\n margin-bottom: 0;\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%] {\n color: var(--foreground);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] {\n margin: var(--size-h) 0;\n padding-left: var(--size);\n font-size: 0.85rem;\n color: var(--muted-foreground);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] {\n margin-bottom: 4px;\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%] .browser-url[_ngcontent-%COMP%] {\n margin-top: var(--size-h);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .info-section[_ngcontent-%COMP%] .browser-url[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-size: 0.75rem;\n background: var(--background);\n padding: 4px 8px;\n border-radius: 4px;\n -webkit-user-select: all;\n user-select: all;\n}\n.cashu-onboarding[_ngcontent-%COMP%] .warning-box[_ngcontent-%COMP%] {\n background: rgba(255, 193, 7, 0.1);\n border: 1px solid var(--warning, #ffc107);\n border-radius: var(--radius-sm);\n padding: var(--size-h);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .success-box[_ngcontent-%COMP%] {\n background: rgba(34, 197, 94, 0.1);\n border: 1px solid var(--success, #22c55e);\n border-radius: var(--radius-sm);\n padding: var(--size-h);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .link-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: 1px solid var(--primary);\n color: var(--primary);\n padding: var(--size-h) var(--size);\n border-radius: var(--radius-sm);\n cursor: pointer;\n font-size: 0.85rem;\n margin-top: var(--size-h);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .link-btn[_ngcontent-%COMP%]:hover {\n background: var(--primary);\n color: white;\n}\n.cashu-onboarding[_ngcontent-%COMP%] .dismiss-btn[_ngcontent-%COMP%] {\n width: 100%;\n padding: var(--size-h);\n background: var(--primary);\n color: white;\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n font-size: 0.9rem;\n margin-top: var(--size);\n}\n.cashu-onboarding[_ngcontent-%COMP%] .dismiss-btn[_ngcontent-%COMP%]:hover {\n opacity: 0.9;\n}\n.cashu-onboarding[_ngcontent-%COMP%] .show-info-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n color: var(--primary);\n cursor: pointer;\n font-size: 0.8rem;\n text-decoration: underline;\n padding: 0;\n}\n.cashu-onboarding[_ngcontent-%COMP%] .show-info-btn[_ngcontent-%COMP%]:hover {\n opacity: 0.8;\n}\n\n.lightning-section[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size);\n height: 100%;\n}\n\n.wallet-list[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size-h);\n}\n\n.wallet-list-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--size);\n background: var(--background-light);\n border: none;\n border-radius: var(--radius-md);\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n.wallet-list-item[_ngcontent-%COMP%]:hover {\n background: var(--background-light-hover);\n}\n.wallet-list-item[_ngcontent-%COMP%] .wallet-name[_ngcontent-%COMP%] {\n font-size: 1rem;\n color: var(--foreground);\n}\n.wallet-list-item[_ngcontent-%COMP%] .wallet-balance[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n color: var(--muted-foreground);\n}\n\n.add-wallet-btn[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--size-h);\n padding: var(--size);\n background: transparent;\n border: 1px dashed var(--border);\n border-radius: var(--radius-md);\n cursor: pointer;\n color: var(--muted-foreground);\n transition: all 0.15s ease;\n margin-top: auto;\n}\n.add-wallet-btn[_ngcontent-%COMP%]:hover {\n border-color: var(--foreground);\n color: var(--foreground);\n background: var(--background-light);\n}\n.add-wallet-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 20px;\n}\n\n.wallet-detail[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size);\n padding-top: var(--size);\n}\n\n.balance-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--size);\n padding: var(--size) 0;\n}\n\n.balance-display[_ngcontent-%COMP%] {\n text-align: center;\n padding: var(--size-2x) 0;\n}\n.balance-display[_ngcontent-%COMP%] .balance-value[_ngcontent-%COMP%] {\n font-size: 2.5rem;\n font-weight: 600;\n color: var(--foreground);\n}\n.balance-display[_ngcontent-%COMP%] .balance-unit[_ngcontent-%COMP%] {\n font-size: 1.25rem;\n color: var(--muted-foreground);\n margin-left: var(--size-h);\n}\n.balance-display.compact[_ngcontent-%COMP%] {\n padding: 0;\n}\n.balance-display.compact[_ngcontent-%COMP%] .balance-value[_ngcontent-%COMP%] {\n font-size: 1.5rem;\n}\n.balance-display.compact[_ngcontent-%COMP%] .balance-unit[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n}\n\n.refresh-icon-btn[_ngcontent-%COMP%] {\n background: var(--background-light);\n border: none;\n border-radius: 50%;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n.refresh-icon-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--background-light-hover);\n}\n.refresh-icon-btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.7;\n cursor: not-allowed;\n}\n.refresh-icon-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 16px;\n}\n.refresh-icon-btn[_ngcontent-%COMP%] .emoji.spinning[_ngcontent-%COMP%] {\n animation: _ngcontent-%COMP%_spin 1s linear infinite;\n}\n\n@keyframes _ngcontent-%COMP%_spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.balance-updated[_ngcontent-%COMP%] {\n text-align: center;\n font-size: 0.75rem;\n color: var(--muted-foreground);\n margin-top: calc(-1 * var(--size-h));\n}\n\n.action-buttons[_ngcontent-%COMP%] {\n display: flex;\n gap: var(--size);\n justify-content: center;\n margin-bottom: var(--size);\n}\n\n.action-btn[_ngcontent-%COMP%] {\n flex: 1;\n max-width: 120px;\n padding: var(--size) var(--size-2x);\n border-radius: var(--radius-md);\n cursor: pointer;\n font-size: 1rem;\n font-weight: 500;\n transition: all 0.15s ease;\n}\n.action-btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.action-btn.deposit-btn[_ngcontent-%COMP%] {\n background: var(--success, #22c55e);\n border: none;\n color: white;\n}\n.action-btn.deposit-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n opacity: 0.9;\n}\n.action-btn.receive-btn[_ngcontent-%COMP%] {\n background: var(--primary);\n border: none;\n color: var(--primary-foreground, white);\n}\n.action-btn.receive-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n opacity: 0.9;\n}\n.action-btn.send-btn[_ngcontent-%COMP%] {\n background: var(--background-light);\n border: 1px solid var(--border);\n color: var(--foreground);\n}\n.action-btn.send-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--background-light-hover);\n}\n\n.refresh-btn[_ngcontent-%COMP%] {\n padding: var(--size-h) var(--size);\n background: var(--background-light);\n border: none;\n border-radius: var(--radius-md);\n cursor: pointer;\n color: var(--foreground);\n transition: background-color 0.15s ease;\n}\n.refresh-btn[_ngcontent-%COMP%]:hover {\n background: var(--background-light-hover);\n}\n\n.wallet-info[_ngcontent-%COMP%] {\n background: var(--background-light);\n border-radius: var(--radius-md);\n padding: var(--size);\n}\n.wallet-info[_ngcontent-%COMP%] .info-row[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: var(--size-h) 0;\n}\n.wallet-info[_ngcontent-%COMP%] .info-row[_ngcontent-%COMP%]:not(:last-child) {\n border-bottom: 1px solid var(--border);\n}\n.wallet-info[_ngcontent-%COMP%] .info-row[_ngcontent-%COMP%] .info-label[_ngcontent-%COMP%] {\n font-size: 0.75rem;\n color: var(--muted-foreground);\n text-transform: uppercase;\n}\n.wallet-info[_ngcontent-%COMP%] .info-row[_ngcontent-%COMP%] .info-value[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n color: var(--foreground);\n word-break: break-all;\n}\n.wallet-info[_ngcontent-%COMP%] .info-row[_ngcontent-%COMP%] .copy-hint[_ngcontent-%COMP%] {\n font-size: 0.7rem;\n color: var(--muted-foreground);\n margin-left: var(--size-h);\n}\n.wallet-info[_ngcontent-%COMP%] .info-row-btn[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: var(--size-h) var(--size);\n background: transparent;\n border: none;\n text-align: left;\n width: 100%;\n cursor: pointer;\n transition: background-color 0.15s ease;\n border-radius: var(--radius-sm);\n margin: calc(-1 * var(--size-h)) calc(-1 * var(--size));\n}\n.wallet-info[_ngcontent-%COMP%] .info-row-btn[_ngcontent-%COMP%]:hover {\n background: var(--background);\n}\n.wallet-info[_ngcontent-%COMP%] .info-row-btn[_ngcontent-%COMP%] .info-label[_ngcontent-%COMP%] {\n font-size: 0.75rem;\n color: var(--muted-foreground);\n text-transform: uppercase;\n}\n.wallet-info[_ngcontent-%COMP%] .info-row-btn[_ngcontent-%COMP%] .info-value[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n color: var(--foreground);\n word-break: break-all;\n}\n.wallet-info[_ngcontent-%COMP%] .info-row-btn[_ngcontent-%COMP%] .copy-hint[_ngcontent-%COMP%] {\n font-size: 0.7rem;\n color: var(--muted-foreground);\n margin-left: var(--size-h);\n}\n.wallet-info[_ngcontent-%COMP%] .info-row.clickable[_ngcontent-%COMP%] {\n cursor: pointer;\n transition: background-color 0.15s ease;\n margin: calc(-1 * var(--size-h)) calc(-1 * var(--size));\n padding: var(--size-h) var(--size);\n border-radius: var(--radius-sm);\n}\n.wallet-info[_ngcontent-%COMP%] .info-row.clickable[_ngcontent-%COMP%]:hover {\n background: var(--background);\n}\n\n.transaction-section[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size-h);\n}\n.transaction-section[_ngcontent-%COMP%] .section-title[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--foreground);\n}\n.transaction-section[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%], \n.transaction-section[_ngcontent-%COMP%] .empty-text[_ngcontent-%COMP%], \n.transaction-section[_ngcontent-%COMP%] .not-supported-text[_ngcontent-%COMP%], \n.transaction-section[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%] {\n font-size: 0.75rem;\n color: var(--muted-foreground);\n text-align: center;\n padding: var(--size);\n}\n.transaction-section[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%] {\n color: var(--destructive);\n}\n\n.token-section[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size-h);\n}\n.token-section[_ngcontent-%COMP%] .section-title[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--foreground);\n}\n.token-section[_ngcontent-%COMP%] .empty-text[_ngcontent-%COMP%] {\n font-size: 0.75rem;\n color: var(--muted-foreground);\n text-align: center;\n padding: var(--size);\n}\n\n.token-list[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n max-height: 150px;\n overflow-y: auto;\n background: var(--background-light);\n border-radius: var(--radius-md);\n padding: var(--size-h);\n}\n\n.token-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--size-h);\n border-radius: var(--radius-sm);\n font-size: 0.75rem;\n}\n.token-item[_ngcontent-%COMP%] .token-amount[_ngcontent-%COMP%] {\n color: var(--success, #22c55e);\n font-weight: 500;\n}\n.token-item[_ngcontent-%COMP%] .token-amount[_ngcontent-%COMP%]::after {\n content: " sats";\n font-weight: 400;\n color: var(--muted-foreground);\n}\n.token-item[_ngcontent-%COMP%] .token-time[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n font-size: 0.7rem;\n}\n\n.transaction-list[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n max-height: 150px;\n overflow-y: auto;\n background: var(--background-light);\n border-radius: var(--radius-md);\n padding: var(--size-h);\n}\n\n.transaction-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--size-h);\n padding: var(--size-h);\n border-radius: var(--radius-sm);\n font-size: 0.75rem;\n}\n.transaction-item.incoming[_ngcontent-%COMP%] .tx-icon[_ngcontent-%COMP%], \n.transaction-item.incoming[_ngcontent-%COMP%] .tx-amount[_ngcontent-%COMP%] {\n color: var(--success, #22c55e);\n}\n.transaction-item.outgoing[_ngcontent-%COMP%] .tx-icon[_ngcontent-%COMP%], \n.transaction-item.outgoing[_ngcontent-%COMP%] .tx-amount[_ngcontent-%COMP%] {\n color: var(--destructive);\n}\n.transaction-item[_ngcontent-%COMP%] .tx-icon[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n}\n.transaction-item[_ngcontent-%COMP%] .tx-type[_ngcontent-%COMP%] {\n color: var(--foreground);\n min-width: 50px;\n}\n.transaction-item[_ngcontent-%COMP%] .tx-amount[_ngcontent-%COMP%] {\n flex: 1;\n text-align: right;\n font-weight: 500;\n}\n.transaction-item[_ngcontent-%COMP%] .tx-amount[_ngcontent-%COMP%]::after {\n content: " sats";\n font-weight: 400;\n color: var(--muted-foreground);\n}\n.transaction-item[_ngcontent-%COMP%] .tx-time[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n font-size: 0.7rem;\n min-width: 45px;\n text-align: right;\n}\n\n.delete-btn[_ngcontent-%COMP%] {\n padding: var(--size-h) var(--size);\n background: transparent;\n border: 1px solid var(--destructive);\n border-radius: var(--radius-md);\n cursor: pointer;\n color: var(--destructive);\n transition: all 0.15s ease;\n margin-top: var(--size);\n}\n.delete-btn[_ngcontent-%COMP%]:hover {\n background: var(--destructive);\n color: white;\n}\n\n.delete-btn-small[_ngcontent-%COMP%] {\n padding: 6px var(--size);\n background: transparent;\n border: 1px solid var(--destructive);\n border-radius: var(--radius-md);\n cursor: pointer;\n color: var(--destructive);\n font-size: 0.75rem;\n transition: all 0.15s ease;\n margin-top: auto;\n align-self: center;\n}\n.delete-btn-small[_ngcontent-%COMP%]:hover {\n background: var(--destructive);\n color: white;\n}\n\n.add-wallet-form[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size);\n}\n\n.form-group[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size-h);\n}\n.form-group[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n color: var(--foreground);\n font-weight: 500;\n}\n.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%], \n.form-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] {\n padding: var(--size-h) var(--size);\n background: var(--background-light);\n border: 1px solid var(--border);\n border-radius: var(--radius-md);\n color: var(--foreground);\n font-size: 0.875rem;\n font-family: inherit;\n resize: vertical;\n}\n.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder, \n.form-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder {\n color: var(--muted-foreground);\n}\n.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, \n.form-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: var(--primary);\n}\n.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled, \n.form-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.form-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] {\n min-height: 80px;\n}\n\n.error-message[_ngcontent-%COMP%] {\n padding: var(--size-h) var(--size);\n background: color-mix(in srgb, var(--destructive) 10%, transparent);\n border: 1px solid var(--destructive);\n border-radius: var(--radius-md);\n color: var(--destructive);\n font-size: 0.875rem;\n}\n.error-message.small[_ngcontent-%COMP%] {\n padding: 4px var(--size-h);\n font-size: 0.75rem;\n text-align: center;\n}\n\n.success-message[_ngcontent-%COMP%] {\n padding: var(--size-h) var(--size);\n background: color-mix(in srgb, var(--success, #22c55e) 10%, transparent);\n border: 1px solid var(--success, #22c55e);\n border-radius: var(--radius-md);\n color: var(--success, #22c55e);\n font-size: 0.875rem;\n}\n\n.form-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: var(--size-h);\n margin-top: var(--size-h);\n}\n.form-actions[_ngcontent-%COMP%] .test-btn[_ngcontent-%COMP%], \n.form-actions[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] {\n flex: 1;\n padding: var(--size-h) var(--size);\n border-radius: var(--radius-md);\n cursor: pointer;\n font-size: 0.875rem;\n transition: all 0.15s ease;\n}\n.form-actions[_ngcontent-%COMP%] .test-btn[_ngcontent-%COMP%]:disabled, \n.form-actions[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.form-actions[_ngcontent-%COMP%] .test-btn[_ngcontent-%COMP%] {\n background: var(--background-light);\n border: 1px solid var(--border);\n color: var(--foreground);\n}\n.form-actions[_ngcontent-%COMP%] .test-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--background-light-hover);\n}\n.form-actions[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] {\n background: var(--primary);\n border: none;\n color: var(--primary-foreground, white);\n}\n.form-actions[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n opacity: 0.9;\n}\n.form-actions[_ngcontent-%COMP%] .add-btn.full-width[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.balance-info[_ngcontent-%COMP%] {\n text-align: center;\n font-size: 0.875rem;\n color: var(--muted-foreground);\n margin-bottom: var(--size);\n}\n\n.token-result[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--size-h);\n}\n.token-result[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n color: var(--foreground);\n font-weight: 500;\n}\n.token-result[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] {\n padding: var(--size-h) var(--size);\n background: var(--background-light);\n border: 1px solid var(--border);\n border-radius: var(--radius-md);\n color: var(--foreground);\n font-size: 0.75rem;\n font-family: monospace;\n resize: none;\n word-break: break-all;\n}\n.token-result[_ngcontent-%COMP%] .copy-btn[_ngcontent-%COMP%] {\n padding: var(--size-h) var(--size);\n background: var(--primary);\n border: none;\n border-radius: var(--radius-md);\n cursor: pointer;\n color: var(--primary-foreground, white);\n font-size: 0.875rem;\n transition: all 0.15s ease;\n}\n.token-result[_ngcontent-%COMP%] .copy-btn[_ngcontent-%COMP%]:hover {\n opacity: 0.9;\n}\n\n.nwc-log[_ngcontent-%COMP%] {\n background: var(--background-light);\n border: 1px solid var(--border);\n border-radius: var(--radius-md);\n overflow: hidden;\n}\n.nwc-log[_ngcontent-%COMP%] .log-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: var(--size-h) var(--size);\n background: var(--background);\n border-bottom: 1px solid var(--border);\n font-size: 0.75rem;\n font-weight: 500;\n color: var(--muted-foreground);\n}\n.nwc-log[_ngcontent-%COMP%] .log-clear-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n color: var(--muted-foreground);\n font-size: 0.7rem;\n cursor: pointer;\n padding: 2px 6px;\n border-radius: var(--radius-sm);\n}\n.nwc-log[_ngcontent-%COMP%] .log-clear-btn[_ngcontent-%COMP%]:hover {\n background: var(--background-light-hover);\n color: var(--foreground);\n}\n.nwc-log[_ngcontent-%COMP%] .log-entries[_ngcontent-%COMP%] {\n max-height: 150px;\n overflow-y: auto;\n font-family: monospace;\n font-size: 0.7rem;\n}\n.nwc-log[_ngcontent-%COMP%] .log-entry[_ngcontent-%COMP%] {\n display: flex;\n gap: var(--size-h);\n padding: 4px var(--size);\n border-bottom: 1px solid var(--border);\n color: var(--foreground);\n}\n.nwc-log[_ngcontent-%COMP%] .log-entry[_ngcontent-%COMP%]:last-child {\n border-bottom: none;\n}\n.nwc-log[_ngcontent-%COMP%] .log-entry.log-warn[_ngcontent-%COMP%] {\n background: color-mix(in srgb, orange 10%, transparent);\n color: orange;\n}\n.nwc-log[_ngcontent-%COMP%] .log-entry.log-error[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--destructive) 10%, transparent);\n color: var(--destructive);\n}\n.nwc-log[_ngcontent-%COMP%] .log-entry[_ngcontent-%COMP%] .log-time[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n flex-shrink: 0;\n}\n.nwc-log[_ngcontent-%COMP%] .log-entry[_ngcontent-%COMP%] .log-message[_ngcontent-%COMP%] {\n word-break: break-word;\n}\n\n.invoice-result[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--size);\n padding: var(--size);\n background: var(--background-light);\n border-radius: var(--radius-md);\n}\n.invoice-result[_ngcontent-%COMP%] .qr-code[_ngcontent-%COMP%] {\n width: 180px;\n height: 180px;\n border-radius: var(--radius-md);\n background: white;\n padding: var(--size-h);\n}\n.invoice-result[_ngcontent-%COMP%] .invoice-text[_ngcontent-%COMP%] {\n font-size: 0.7rem;\n font-family: monospace;\n color: var(--muted-foreground);\n word-break: break-all;\n text-align: center;\n max-height: 60px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.invoice-result[_ngcontent-%COMP%] .copy-btn[_ngcontent-%COMP%] {\n padding: var(--size-h) var(--size);\n background: var(--primary);\n border: none;\n border-radius: var(--radius-md);\n cursor: pointer;\n color: var(--primary-foreground, white);\n font-size: 0.875rem;\n transition: all 0.15s ease;\n}\n.invoice-result[_ngcontent-%COMP%] .copy-btn[_ngcontent-%COMP%]:hover {\n opacity: 0.9;\n}\n.invoice-result[_ngcontent-%COMP%] .deposit-status[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--size-h);\n font-size: 0.875rem;\n padding: var(--size-h) 0;\n}\n.invoice-result[_ngcontent-%COMP%] .deposit-status[_ngcontent-%COMP%] .status-waiting[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n}\n.invoice-result[_ngcontent-%COMP%] .deposit-status[_ngcontent-%COMP%] .status-checking[_ngcontent-%COMP%] {\n font-size: 0.7rem;\n color: var(--muted-foreground);\n animation: _ngcontent-%COMP%_pulse 1.5s ease-in-out infinite;\n}\n.invoice-result[_ngcontent-%COMP%] .deposit-status[_ngcontent-%COMP%] .status-paid[_ngcontent-%COMP%] {\n color: var(--primary);\n font-weight: 500;\n}\n.invoice-result[_ngcontent-%COMP%] .deposit-status[_ngcontent-%COMP%] .status-issued[_ngcontent-%COMP%] {\n color: var(--success, #22c55e);\n font-weight: 500;\n}\n\n@keyframes _ngcontent-%COMP%_pulse {\n 0%, 100% {\n opacity: 0.4;\n }\n 50% {\n opacity: 1;\n }\n}\n.modal-overlay[_ngcontent-%COMP%] {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n padding: var(--size);\n}\n\n.modal-content[_ngcontent-%COMP%] {\n background: var(--background);\n border-radius: var(--radius-md);\n width: 100%;\n max-width: 320px;\n max-height: 90vh;\n overflow-y: auto;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n}\n\n.modal-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: var(--size);\n border-bottom: 1px solid var(--border);\n font-weight: 500;\n}\n.modal-header[_ngcontent-%COMP%] .modal-close[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n color: var(--muted-foreground);\n line-height: 1;\n padding: 0;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.modal-header[_ngcontent-%COMP%] .modal-close[_ngcontent-%COMP%]:hover {\n color: var(--foreground);\n}\n\n.modal-body[_ngcontent-%COMP%] {\n padding: var(--size);\n display: flex;\n flex-direction: column;\n gap: var(--size);\n}\n.modal-body[_ngcontent-%COMP%] .payment-success[_ngcontent-%COMP%] {\n text-align: center;\n font-weight: 500;\n padding: var(--size);\n}']})}return e})();const jIe=(e,n)=>n.id;function YIe(e,n){if(1&e){const t=pt();y(0,"button",16),_e("click",function(){return Qe(t),De(Ee().onTestPrompt())}),y(1,"span",4),R(2,"\u2728"),v()()}}function WIe(e,n){1&e&&(y(0,"div",14)(1,"span"),R(2,"No backups yet"),v()())}function $Ie(e,n){if(1&e){const t=pt();y(0,"div",15)(1,"div",17)(2,"span",18),R(3),v(),y(4,"div",19)(5,"span",20),R(6),v(),y(7,"span",21),R(8),v()()(),y(9,"div",22)(10,"button",23),_e("click",function(){const i=Qe(t).$implicit,o=Ee();return De(Dn(25).show("Restore this backup? A backup of your current state will be created first.",o.restoreBackup.bind(o,i.id)))}),R(11),v(),y(12,"button",24),_e("click",function(){const i=Qe(t).$implicit,o=Ee();return De(Dn(25).show("Delete this backup? This cannot be undone.",o.deleteBackup.bind(o,i.id)))}),R(13," Delete "),v()()()}if(2&e){const t=n.$implicit,r=Ee();J(3),ft(r.formatDate(t.createdAt)),J(2),mh(r.getReasonClass(t.reason)),J(),Zt(" ",r.getReasonLabel(t.reason)," "),J(2),Zt("",t.identityCount," identity(ies)"),J(2),gt("disabled",null!==r.restoringBackupId),J(),Zt(" ",r.restoringBackupId===t.id?"Restoring...":"Restore"," ")}}let ZIe=(()=>{class e extends Nr{#e=de(An);#t=de(Uu);#n=de(Si);backups=[];maxBackups=5;restoringBackupId=null;ngOnInit(){this.loadBackups(),this.maxBackups=this.storage.getSignerMetaHandler().getMaxBackups()}loadBackups(){this.backups=this.storage.getSignerMetaHandler().getBackups()}onMaxBackupsChange(t){var r=this;return I(function*(){const o=parseInt(t.target.value,10);!isNaN(o)&&o>=1&&o<=20&&(r.maxBackups=o,yield r.storage.getSignerMetaHandler().setMaxBackups(o))})()}createManualBackup(){var t=this;return I(function*(){const r=t.storage.getBrowserSyncHandler().browserSyncData;r&&(yield t.storage.getSignerMetaHandler().createBackup(r,"manual"),t.loadBackups())})()}restoreBackup(t){var r=this;return I(function*(){r.restoringBackupId=t;try{const i=r.storage.getBrowserSyncHandler().browserSyncData;i&&(yield r.storage.getSignerMetaHandler().createBackup(i,"pre-restore"));const o=r.storage.getSignerMetaHandler().getBackupData(t);if(!o)throw new Error("Backup not found");yield r.storage.deleteVault(!0),yield r.storage.importVault(o),r.#n.logVaultImport("Backup Restore"),r.storage.isInitialized=!1,r.#t.startOver(Hu())}catch(i){console.error("Failed to restore backup:",i),r.restoringBackupId=null}})()}deleteBackup(t){var r=this;return I(function*(){yield r.storage.getSignerMetaHandler().deleteBackup(t),r.loadBackups()})()}formatDate(t){const r=new Date(t);return r.toLocaleDateString()+" "+r.toLocaleTimeString()}getReasonLabel(t){switch(t){case"auto":return"Auto";case"manual":return"Manual";case"pre-restore":return"Pre-Restore";default:return"Unknown"}}getReasonClass(t){switch(t){case"auto":return"reason-auto";case"manual":return"reason-manual";case"pre-restore":return"reason-prerestore";default:return""}}goBack(){this.#e.navigateByUrl("/home/settings")}onClickLock(){var t=this;return I(function*(){t.#n.logVaultLock(),yield t.storage.lockVault(),t.#e.navigateByUrl("/vault-login")})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-backups"]],features:[Nt],decls:26,vars:3,consts:[["confirm",""],[1,"sam-text-header"],[1,"header-buttons"],["title","Lock",1,"header-btn",3,"click"],[1,"emoji"],["title","Test Permission Prompt",1,"header-btn"],["title","Go Back",1,"back-btn",3,"click"],[1,"backup-settings"],[1,"setting-row"],["for","maxBackups"],["id","maxBackups","type","number","min","1","max","20",3,"change","value"],[1,"setting-note"],[1,"btn","btn-primary","create-btn",3,"click"],[1,"backups-list"],[1,"empty-state"],[1,"backup-item"],["title","Test Permission Prompt",1,"header-btn",3,"click"],[1,"backup-info"],[1,"backup-date"],[1,"backup-meta"],[1,"backup-reason"],[1,"backup-identities"],[1,"backup-actions"],[1,"btn","btn-sm","btn-secondary",3,"click","disabled"],[1,"btn","btn-sm","btn-danger",3,"click"]],template:function(r,i){if(1&r){const o=pt();y(0,"div",1)(1,"div",2)(2,"button",3),_e("click",function(){return Qe(o),De(i.onClickLock())}),y(3,"span",4),R(4,"\u{1f512}"),v()(),At(5,YIe,3,0,"button",5),v(),y(6,"button",6),_e("click",function(){return Qe(o),De(i.goBack())}),y(7,"span",4),R(8,"\u2190"),v()(),y(9,"span"),R(10,"Backups"),v()(),y(11,"div",7)(12,"div",8)(13,"label",9),R(14,"Max Auto Backups:"),v(),y(15,"input",10),_e("change",function(a){return Qe(o),De(i.onMaxBackupsChange(a))}),v()(),y(16,"p",11),R(17," Automatic backups are created when significant changes are made. Manual and pre-restore backups are not counted toward this limit. "),v()(),y(18,"button",12),_e("click",function(){return Qe(o),De(i.createManualBackup())}),R(19," Create Backup Now\n"),v(),y(20,"div",13),At(21,WIe,3,0,"div",14),Rr(22,$Ie,14,7,"div",15,jIe),v(),ot(24,"lib-confirm",null,0)}2&r&&(J(5),tt(i.devMode?5:-1),J(10),gt("value",i.maxBackups),J(6),tt(0===i.backups.length?21:-1),J(),Pr(i.backups))},dependencies:[Tf],styles:["[_nghost-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n padding: 8px;\n gap: 12px;\n}\n\n.sam-text-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 18px;\n font-weight: bold;\n padding-bottom: 8px;\n border-bottom: 1px solid var(--border);\n}\n\n.lock-btn[_ngcontent-%COMP%], \n.back-btn[_ngcontent-%COMP%] {\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n border-radius: 4px;\n}\n.lock-btn[_ngcontent-%COMP%]:hover, \n.back-btn[_ngcontent-%COMP%]:hover {\n background: var(--muted);\n}\n.lock-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%], \n.back-btn[_ngcontent-%COMP%] .emoji[_ngcontent-%COMP%] {\n font-size: 16px;\n}\n\n.backup-settings[_ngcontent-%COMP%] {\n background: var(--muted);\n padding: 12px;\n border-radius: 8px;\n}\n\n.setting-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.setting-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-weight: 500;\n}\n.setting-row[_ngcontent-%COMP%] input[type=number][_ngcontent-%COMP%] {\n width: 60px;\n padding: 4px 8px;\n border: 1px solid var(--border);\n border-radius: 4px;\n background: var(--background);\n color: var(--foreground);\n}\n\n.setting-note[_ngcontent-%COMP%] {\n margin-top: 8px;\n font-size: 12px;\n color: var(--muted-foreground);\n}\n\n.create-btn[_ngcontent-%COMP%] {\n align-self: flex-start;\n}\n\n.backups-list[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.empty-state[_ngcontent-%COMP%] {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n color: var(--muted-foreground);\n}\n\n.backup-item[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px;\n background: var(--card);\n border: 1px solid var(--border);\n border-radius: 8px;\n gap: 12px;\n}\n\n.backup-info[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n min-width: 0;\n}\n\n.backup-date[_ngcontent-%COMP%] {\n font-weight: 500;\n font-size: 13px;\n}\n\n.backup-meta[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n font-size: 11px;\n}\n\n.backup-reason[_ngcontent-%COMP%] {\n padding: 2px 6px;\n border-radius: 4px;\n font-weight: 500;\n}\n.backup-reason.reason-auto[_ngcontent-%COMP%] {\n background: var(--muted);\n color: var(--muted-foreground);\n}\n.backup-reason.reason-manual[_ngcontent-%COMP%] {\n background: rgba(34, 197, 94, 0.2);\n color: rgb(34, 197, 94);\n}\n.backup-reason.reason-prerestore[_ngcontent-%COMP%] {\n background: rgba(234, 179, 8, 0.2);\n color: rgb(234, 179, 8);\n}\n\n.backup-identities[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n}\n\n.backup-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n flex-shrink: 0;\n}\n\n.btn[_ngcontent-%COMP%] {\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n font-weight: 500;\n transition: background-color 0.2s;\n}\n.btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.btn-primary[_ngcontent-%COMP%] {\n background: var(--primary);\n color: var(--primary-foreground);\n}\n.btn-primary[_ngcontent-%COMP%]:hover:not(:disabled) {\n opacity: 0.9;\n}\n\n.btn-secondary[_ngcontent-%COMP%] {\n background: var(--secondary);\n color: var(--secondary-foreground);\n}\n.btn-secondary[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--muted);\n}\n\n.btn-danger[_ngcontent-%COMP%] {\n background: rgba(239, 68, 68, 0.2);\n color: rgb(239, 68, 68);\n}\n.btn-danger[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: rgba(239, 68, 68, 0.3);\n}\n\n.btn-sm[_ngcontent-%COMP%] {\n padding: 4px 10px;\n font-size: 12px;\n}"]})}return e})();function XIe(e,n){if(1&e&&(y(0,"div",12)(1,"div",13),ot(2,"i",14),y(3,"span"),R(4),v()()()),2&e){const t=Ee();J(4),ft(t.alertMessage)}}let eme=(()=>{class e extends Nr{identity={nick:"",privkeyInput:""};canSave=!1;alertMessage;#e=de(lr);#t=de(An);ngAfterViewInit(){document.getElementById("nickElement")?.focus()}toggleType(t){t.type="password"===t.type?"text":"password"}onClickGeneratePrivkey(){const r=vc(lie());this.identity.privkeyInput=rr.privkey2nsec(r),this.validateCanSave()}validateCanSave(){if(this.identity.nick&&this.identity.privkeyInput)try{rr.getNostrPrivkeyObject(this.identity.privkeyInput.toLocaleLowerCase()),this.canSave=!0}catch(t){console.log(t),this.canSave=!1}else this.canSave=!1}onClickSave(){var t=this;return I(function*(){if(t.canSave&&t.identity.nick&&t.identity.privkeyInput)try{yield t.#e.addIdentity({nick:t.identity.nick,privkeyString:t.identity.privkeyInput}),t.#t.navigateByUrl("/home/identities")}catch(r){t.alertMessage=r?.message,setTimeout(()=>{t.alertMessage=void 0},4500)}})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-new-identity"]],features:[Nt],decls:18,vars:8,consts:[["privkeyInputElement",""],[1,"sam-text-header"],[1,"content"],["id","nickElement","type","text","placeholder","Nick","autocomplete","off",1,"form-control","form-control-lg",2,"font-size","1rem",3,"ngModelChange","ngModel"],[1,"sam-mt","input-group","mb-3"],["id","privkeyInputElement","type","password","placeholder","Private Key (HEX or NSEC)","autocomplete","off",1,"form-control","form-control-lg",2,"font-size","1rem",3,"ngModelChange","ngModel"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"bi","bi-eye"],["type","button",1,"btn","btn-link",3,"click"],[1,"sam-footer-grid-2"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[2,"position","absolute","bottom","60px","align-self","center","margin-left","16px","margin-right","16px"],["role","alert",1,"alert","alert-danger","sam-flex-row","gap"],[1,"bi","bi-exclamation-triangle"]],template:function(r,i){if(1&r){const o=pt();y(0,"div",1)(1,"span"),R(2,"New Identity"),v()(),y(3,"div",2)(4,"input",3),an("ngModelChange",function(a){return Qe(o),dn(i.identity.nick,a)||(i.identity.nick=a),De(a)}),_e("ngModelChange",function(){return Qe(o),De(i.validateCanSave())}),v(),y(5,"div",4)(6,"input",5,0),an("ngModelChange",function(a){return Qe(o),dn(i.identity.privkeyInput,a)||(i.identity.privkeyInput=a),De(a)}),_e("ngModelChange",function(){return Qe(o),De(i.validateCanSave())}),v(),y(8,"button",6),_e("click",function(){Qe(o);const a=Dn(7);return De(i.toggleType(a))}),ot(9,"i",7),v()(),y(10,"button",8),_e("click",function(){return Qe(o),De(i.onClickGeneratePrivkey())}),R(11," Generate private key "),v()(),y(12,"div",9)(13,"button",10),_e("click",function(){return Qe(o),De(i.navigateBack())}),R(14," Cancel "),v(),y(15,"button",11),_e("click",function(){return Qe(o),De(i.onClickSave())}),R(16," Save "),v()(),At(17,XIe,5,1,"div",12)}if(2&r){const o=Dn(7);J(4),sn("ngModel",i.identity.nick),J(2),sn("ngModel",i.identity.privkeyInput),J(3),er("bi-eye","password"===o.type)("bi-eye-slash","text"===o.type),J(6),gt("disabled",!i.canSave),J(2),tt(i.alertMessage?17:-1)}},dependencies:[Ko,mo,Co,qi],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] {\n padding-left: var(--size);\n padding-right: var(--size);\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n}"]})}return e})(),tme=(()=>{class e{identity;previousRoute;#e=de(Vi);#t=de(lr);#n=de(An);constructor(){this.previousRoute=this.#n.getCurrentNavigation()?.previousNavigation?.extractedUrl.toString()}ngOnInit(){const t=this.#e.snapshot.params.id;t&&(this.identity=this.#t.getBrowserSessionHandler().browserSessionData?.identities.find(r=>r.id===t))}onClickCancel(){this.previousRoute&&this.#n.navigateByUrl(this.previousRoute)}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-edit-identity"]],decls:6,vars:1,consts:[[1,"custom-header"],["icon","chevron-left",1,"button",3,"click"],[1,"text"],[1,"edit-identity-outlet"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"lib-icon-button",1),_e("click",function(){return i.onClickCancel()}),v(),y(2,"span",2),R(3),v()(),y(4,"div",3),ot(5,"router-outlet"),v()),2&r&&(J(3),Zt("",null==i.identity?null:i.identity.nick," "))},dependencies:[du,xs],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow-y: hidden;\n overflow-x: hidden;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] {\n padding-top: var(--size);\n padding-bottom: var(--size);\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: auto;\n align-items: center;\n background: var(--background);\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .button[_ngcontent-%COMP%] {\n grid-column-start: 1;\n grid-column-end: 2;\n grid-row-start: 1;\n grid-row-end: 2;\n justify-self: start;\n margin-left: 16px;\n z-index: 1;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] {\n grid-column-start: 1;\n grid-column-end: 2;\n grid-row-start: 1;\n grid-row-end: 2;\n font-size: 20px;\n font-weight: 500;\n justify-self: center;\n height: 32px;\n overflow-x: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: 70%;\n}\n[_nghost-%COMP%] .edit-identity-outlet[_ngcontent-%COMP%] {\n flex-grow: 1;\n overflow-y: hidden;\n}"]})}return e})(),nme=(()=>{class e{identity;#e=de(Vi);#t=de(lr);#n=de(An);ngOnInit(){const t=this.#e.parent?.snapshot.params.id;t&&this.#r(t)}onClickNavigateTo(t){this.#n.navigateByUrl(`/edit-identity/${this.identity?.id}/${t}`)}onConfirmDeletion(){var t=this;return I(function*(){yield t.#t.deleteIdentity(t.identity?.id),yield t.#n.navigateByUrl("/home/identities")})()}#r(t){this.identity=this.#t.getBrowserSessionHandler().browserSessionData?.identities.find(r=>r.id===t)}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-edit-identity-home"]],decls:8,vars:0,consts:[["confirm",""],["text","Keys",3,"click"],["text","Relays",3,"click"],["text","Permissions",3,"click"],[1,"sam-flex-grow"],["type","button",1,"btn","btn-danger",3,"click"]],template:function(r,i){if(1&r){const o=pt();y(0,"lib-nav-item",1),_e("click",function(){return Qe(o),De(i.onClickNavigateTo("keys"))}),v(),y(1,"lib-nav-item",2),_e("click",function(){return Qe(o),De(i.onClickNavigateTo("relays"))}),v(),y(2,"lib-nav-item",3),_e("click",function(){return Qe(o),De(i.onClickNavigateTo("permissions"))}),v(),ot(3,"div",4),y(4,"button",5),_e("click",function(){return Qe(o),De(Dn(7).show("Do you really want to delete this identity?",i.onConfirmDeletion.bind(i)))}),R(5," Delete Identity\n"),v(),ot(6,"lib-confirm",null,0)}},dependencies:[KU,Tf],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n padding-left: var(--size);\n padding-right: var(--size);\n padding-bottom: var(--size);\n}"]})}return e})();function rme(e,n){if(1&e){const t=pt();y(0,"span"),R(1,"Public Key"),v(),y(2,"div",8)(3,"span",9),R(4,"NPUB"),v(),y(5,"div",10),ot(6,"input",11,1),y(8,"button",12),_e("click",function(){Qe(t);const i=Ee(),o=Dn(6);return i.copyToClipboard(i.identity.pubkeyNpub),De(o.show("Copied to clipboard"))}),ot(9,"i",13),v()()(),y(10,"div",8)(11,"span",9),R(12,"HEX"),v(),y(13,"div",10),ot(14,"input",14,2),y(16,"button",12),_e("click",function(){Qe(t);const i=Ee(),o=Dn(6);return i.copyToClipboard(i.identity.pubkeyHex),De(o.show("Copied to clipboard"))}),ot(17,"i",13),v()()(),y(18,"span",15),R(19,"Private Key"),v(),y(20,"div",8)(21,"span",9),R(22,"NSEC"),v(),y(23,"div",10),ot(24,"input",16,3),y(26,"button",12),_e("click",function(){Qe(t);const i=Ee(),o=Dn(6);return i.copyToClipboard(i.identity.privkeyNsec),De(o.show("Copied to clipboard"))}),ot(27,"i",13),v(),y(28,"button",12),_e("click",function(){Qe(t);const i=Dn(25);return De(Ee().toggleType(i))}),ot(29,"i",17),v()()(),y(30,"div",8)(31,"span",9),R(32,"HEX"),v(),y(33,"div",10),ot(34,"input",18,4),y(36,"button",12),_e("click",function(){Qe(t);const i=Ee(),o=Dn(6);return i.copyToClipboard(i.identity.privkeyHex),De(o.show("Copied to clipboard"))}),ot(37,"i",13),v(),y(38,"button",12),_e("click",function(){Qe(t);const i=Dn(35);return De(Ee().toggleType(i))}),ot(39,"i",17),v()()(),y(40,"span",15),R(41,"Encrypted Key (NIP-49)"),v(),y(42,"button",19),_e("click",function(){return Qe(t),De(Ee().navigateToNcryptsec())}),R(43," Get ncryptsec\n"),v()}if(2&e){const t=Dn(7),r=Dn(15),i=Dn(25),o=Dn(35),s=Ee();J(6),gt("ngModel",s.identity.pubkeyNpub)("readOnly",!0),J(3),er("bi-eye","password"===t.type)("bi-eye-slash","text"===t.type),J(5),gt("ngModel",s.identity.pubkeyHex)("readOnly",!0),J(3),er("bi-eye","password"===r.type)("bi-eye-slash","text"===r.type),J(7),gt("ngModel",s.identity.privkeyNsec)("readOnly",!0),J(5),er("bi-eye","password"===i.type)("bi-eye-slash","text"===i.type),J(5),gt("ngModel",s.identity.privkeyHex)("readOnly",!0),J(5),er("bi-eye","password"===o.type)("bi-eye-slash","text"===o.type)}}let ime=(()=>{class e extends Nr{identity;#e=de(Vi);#t=de(lr);#n=de(An);ngOnInit(){const t=this.#e.parent?.snapshot.params.id;t&&this.#r(t)}copyToClipboard(t){navigator.clipboard.writeText(t)}toggleType(t){t.type="password"===t.type?"text":"password"}navigateToNcryptsec(){this.identity&&this.#n.navigateByUrl(`/edit-identity/${this.identity.id}/ncryptsec`)}#r(t){var r=this;return I(function*(){const i=r.#t.getBrowserSessionHandler().browserSessionData?.identities.find(s=>s.id===t);if(!i)return;const o=rr.pubkeyFromPrivkey(i.privkey);r.identity={id:i.id,nick:i.nick,privkeyHex:i.privkey,privkeyNsec:rr.privkey2nsec(i.privkey),pubkeyHex:o,pubkeyNpub:rr.pubkey2npub(o)}})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-keys"]],features:[Nt],decls:7,vars:2,consts:[["toast",""],["pubkeyNpubInput",""],["pubkeyHexInput",""],["privkeyNsecInput",""],["privkeyHexInput",""],[1,"header-pane"],["icon","chevron-left",3,"click"],[3,"bottom"],[1,"sam-mt-h","sam-flex-row","gap"],[1,"text-muted",2,"width","48px"],[1,"input-group"],["id","pubkeyNpubInput","type","text",1,"form-control",3,"ngModel","readOnly"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"bi","bi-copy"],["id","pubkeyHexInput","type","text",1,"form-control",3,"ngModel","readOnly"],[1,"sam-mt-2"],["id","privkeyNsecInput","type","password",1,"form-control",3,"ngModel","readOnly"],[1,"bi","bi-eye"],["id","privkeyHexInput","type","password",1,"form-control",3,"ngModel","readOnly"],[1,"btn","btn-primary","sam-mt-h",3,"click"]],template:function(r,i){if(1&r){const o=pt();y(0,"div",5)(1,"lib-icon-button",6),_e("click",function(){return Qe(o),De(i.navigateBack())}),v(),y(2,"span"),R(3,"Keys"),v()(),At(4,rme,44,24),ot(5,"lib-toast",7,0)}2&r&&(J(4),tt(i.identity?4:-1),J(),gt("bottom",16))},dependencies:[xs,Ko,mo,Co,qi,id],styles:["[_nghost-%COMP%] {\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n padding-left: var(--size);\n padding-right: var(--size);\n}\n[_nghost-%COMP%] .header-pane[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n column-gap: var(--size-h);\n align-items: center;\n padding-bottom: var(--size);\n background-color: var(--background);\n position: sticky;\n top: 0;\n}"]})}return e})();const ome=["passwordInput"];function sme(e,n){if(1&e){const t=pt();y(0,"div",4)(1,"button",12),_e("click",function(){Qe(t);const i=Ee(),o=Dn(17);return i.copyToClipboard(i.ncryptsec),De(o.show("Copied to clipboard"))}),ot(2,"img",13),v()()}if(2&e){const t=Ee();J(2),gt("src",t.ncryptsecQr,ec)}}function ame(e,n){1&e&&(ot(0,"span",14),R(1," Generating... "))}function cme(e,n){1&e&&R(0," Generate ncryptsec ")}let lme=(()=>{class e extends Nr{passwordInput;privkeyHex="";ncryptsecPassword="";ncryptsec="";ncryptsecQr="";isGenerating=!1;#e=de(Vi);#t=de(lr);ngOnInit(){const t=this.#e.parent?.snapshot.params.id;t&&this.#n(t)}ngAfterViewInit(){this.passwordInput.nativeElement.focus()}generateNcryptsec(){var t=this;return I(function*(){if(t.privkeyHex&&t.ncryptsecPassword){t.isGenerating=!0,t.ncryptsec="",t.ncryptsecQr="";try{t.ncryptsec=yield rr.privkeyToNcryptsec(t.privkeyHex,t.ncryptsecPassword),t.ncryptsecQr=yield rb.dY(t.ncryptsec,{width:250,margin:2,color:{dark:"#000000",light:"#ffffff"}})}catch(r){console.error("Failed to generate ncryptsec:",r)}finally{t.isGenerating=!1}}})()}copyToClipboard(t){navigator.clipboard.writeText(t)}#n(t){const r=this.#t.getBrowserSessionHandler().browserSessionData?.identities.find(i=>i.id===t);r&&(this.privkeyHex=r.privkey)}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-ncryptsec"]],viewQuery:function(r,i){if(1&r&&uc(ome,5),2&r){let o;Zs(o=Xs())&&(i.passwordInput=o.first)}},features:[Nt],decls:18,vars:6,consts:[["passwordInput",""],["toast",""],[1,"header-pane"],["icon","chevron-left",3,"click"],[1,"qr-container"],[1,"password-section"],["for","ncryptsecPasswordInput"],[1,"input-group","sam-mt-h"],["id","ncryptsecPasswordInput","type","password","placeholder","Enter encryption password",1,"form-control",3,"ngModelChange","keyup.enter","ngModel","disabled"],["type","button",1,"btn","btn-primary","generate-btn",3,"click","disabled"],[1,"description"],[3,"bottom"],["type","button","title","Copy to clipboard",1,"qr-button",3,"click"],["alt","ncryptsec QR code",1,"qr-code",3,"src"],["role","status",1,"spinner-border","spinner-border-sm"]],template:function(r,i){if(1&r){const o=pt();y(0,"div",2)(1,"lib-icon-button",3),_e("click",function(){return Qe(o),De(i.navigateBack())}),v(),y(2,"span"),R(3,"Get ncryptsec"),v()(),At(4,sme,3,1,"div",4),y(5,"div",5)(6,"label",6),R(7,"Password"),v(),y(8,"div",7)(9,"input",8,0),an("ngModelChange",function(a){return Qe(o),dn(i.ncryptsecPassword,a)||(i.ncryptsecPassword=a),De(a)}),_e("keyup.enter",function(){return Qe(o),De(i.generateNcryptsec())}),v()()(),y(11,"button",9),_e("click",function(){return Qe(o),De(i.generateNcryptsec())}),At(12,ame,2,0)(13,cme,1,0),v(),y(14,"p",10),R(15," Enter a password to encrypt your private key. The resulting ncryptsec can be used to securely backup or transfer your key.\n"),v(),ot(16,"lib-toast",11,1)}2&r&&(J(4),tt(i.ncryptsec?4:-1),J(5),sn("ngModel",i.ncryptsecPassword),gt("disabled",i.isGenerating),J(2),gt("disabled",!i.ncryptsecPassword||i.isGenerating),J(),tt(i.isGenerating?12:13),J(4),gt("bottom",16))},dependencies:[xs,Ko,mo,Co,qi,id],styles:["[_nghost-%COMP%] {\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n padding-left: var(--size);\n padding-right: var(--size);\n}\n[_nghost-%COMP%] .header-pane[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n column-gap: var(--size-h);\n align-items: center;\n padding-bottom: var(--size);\n background-color: var(--background);\n position: sticky;\n top: 0;\n}\n\n.description[_ngcontent-%COMP%] {\n color: var(--text-muted);\n font-size: 0.9rem;\n margin-bottom: var(--size);\n}\n\n.password-section[_ngcontent-%COMP%] {\n margin-bottom: var(--size);\n}\n.password-section[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-weight: 500;\n margin-bottom: var(--size-q);\n}\n\n.generate-btn[_ngcontent-%COMP%] {\n width: 100%;\n margin-bottom: var(--size);\n}\n\n.qr-container[_ngcontent-%COMP%] {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: var(--size);\n}\n\n.qr-button[_ngcontent-%COMP%] {\n background: white;\n padding: var(--size);\n border-radius: 8px;\n border: none;\n cursor: pointer;\n transition: transform 0.15s ease, box-shadow 0.15s ease;\n}\n.qr-button[_ngcontent-%COMP%]:hover {\n transform: scale(1.02);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n}\n.qr-button[_ngcontent-%COMP%]:active {\n transform: scale(0.98);\n}\n\n.qr-code[_ngcontent-%COMP%] {\n width: 250px;\n height: 250px;\n display: block;\n}"]})}return e})();const mH=new Map([{kind:0,name:"Metadata",description:"User profile information (name, about, picture, nip05, etc.)",nip:"01",classification:"replaceable",deprecated:!1,spec:null},{kind:1,name:"Short Text Note",description:"Short-form text post (like a tweet)",nip:"01",classification:"regular",deprecated:!1,spec:null},{kind:2,name:"Recommend Relay",description:"Relay recommendation",nip:"01",classification:"regular",deprecated:!0,spec:null},{kind:3,name:"Follows",description:"Following list with optional relay hints",nip:"02",classification:"replaceable",deprecated:!1,spec:null},{kind:4,name:"Encrypted Direct Message",description:"Private message using NIP-04 encryption",nip:"04",classification:"regular",deprecated:!0,spec:null},{kind:5,name:"Event Deletion Request",description:"Request to delete events",nip:"09",classification:"regular",deprecated:!1,spec:null},{kind:6,name:"Repost",description:"Share/repost another text note",nip:"18",classification:"regular",deprecated:!1,spec:null},{kind:7,name:"Reaction",description:"Like, emoji reaction to an event",nip:"25",classification:"regular",deprecated:!1,spec:null},{kind:8,name:"Badge Award",description:"Award a badge to someone",nip:"58",classification:"regular",deprecated:!1,spec:null},{kind:9,name:"Chat Message",description:"Chat message",nip:"C7",classification:"regular",deprecated:!1,spec:null},{kind:10,name:"Group Chat Threaded Reply",description:"Threaded reply in group chat",nip:"29",classification:"regular",deprecated:!0,spec:null},{kind:11,name:"Thread",description:"Thread event",nip:"7D",classification:"regular",deprecated:!1,spec:null},{kind:12,name:"Group Thread Reply",description:"Reply in group thread",nip:"29",classification:"regular",deprecated:!0,spec:null},{kind:13,name:"Seal",description:"Sealed/encrypted event wrapper",nip:"59",classification:"regular",deprecated:!1,spec:null},{kind:14,name:"Direct Message",description:"Private direct message using NIP-17",nip:"17",classification:"regular",deprecated:!1,spec:null},{kind:15,name:"File Message",description:"File message in DMs",nip:"17",classification:"regular",deprecated:!1,spec:null},{kind:16,name:"Generic Repost",description:"Repost any event kind",nip:"18",classification:"regular",deprecated:!1,spec:null},{kind:17,name:"Reaction to Website",description:"Reaction to a website URL",nip:"25",classification:"regular",deprecated:!1,spec:null},{kind:20,name:"Picture",description:"Picture-first feed post",nip:"68",classification:"regular",deprecated:!1,spec:null},{kind:21,name:"Video Event",description:"Horizontal video event",nip:"71",classification:"regular",deprecated:!1,spec:null},{kind:22,name:"Short-form Video",description:"Short-form portrait video (like TikTok)",nip:"71",classification:"regular",deprecated:!1,spec:null},{kind:40,name:"Channel Creation",description:"Create a public chat channel",nip:"28",classification:"regular",deprecated:!1,spec:null},{kind:41,name:"Channel Metadata",description:"Set channel name, about, picture",nip:"28",classification:"regular",deprecated:!1,spec:null},{kind:42,name:"Channel Message",description:"Post message in channel",nip:"28",classification:"regular",deprecated:!1,spec:null},{kind:43,name:"Channel Hide Message",description:"Hide a message in channel",nip:"28",classification:"regular",deprecated:!1,spec:null},{kind:44,name:"Channel Mute User",description:"Mute a user in channel",nip:"28",classification:"regular",deprecated:!1,spec:null},{kind:62,name:"Request to Vanish",description:"Request permanent deletion of all user data",nip:"62",classification:"regular",deprecated:!1,spec:null},{kind:64,name:"Chess (PGN)",description:"Chess game in PGN format",nip:"64",classification:"regular",deprecated:!1,spec:null},{kind:443,name:"KeyPackage",description:"Marmot protocol key package",nip:null,classification:"regular",deprecated:!1,spec:"Marmot"},{kind:444,name:"Welcome Message",description:"Marmot protocol welcome message",nip:null,classification:"regular",deprecated:!1,spec:"Marmot"},{kind:445,name:"Group Event",description:"Marmot protocol group event",nip:null,classification:"regular",deprecated:!1,spec:"Marmot"},{kind:818,name:"Merge Requests",description:"Git merge request",nip:"54",classification:"regular",deprecated:!1,spec:null},{kind:1018,name:"Poll Response",description:"Response to a poll",nip:"88",classification:"regular",deprecated:!1,spec:null},{kind:1021,name:"Bid",description:"Auction bid",nip:"15",classification:"regular",deprecated:!1,spec:null},{kind:1022,name:"Bid Confirmation",description:"Confirmation of auction bid",nip:"15",classification:"regular",deprecated:!1,spec:null},{kind:1040,name:"OpenTimestamps",description:"OpenTimestamps attestation",nip:"03",classification:"regular",deprecated:!1,spec:null},{kind:1059,name:"Gift Wrap",description:"Encrypted gift-wrapped event",nip:"59",classification:"regular",deprecated:!1,spec:null},{kind:1060,name:"Gift Wrap (Kind 4)",description:"Gift wrap variant for NIP-04 compatibility",nip:"59",classification:"regular",deprecated:!1,spec:null},{kind:1063,name:"File Metadata",description:"Metadata for shared files",nip:"94",classification:"regular",deprecated:!1,spec:null},{kind:1068,name:"Poll",description:"Create a poll",nip:"88",classification:"regular",deprecated:!1,spec:null},{kind:1111,name:"Comment",description:"Comment on events or external content",nip:"22",classification:"regular",deprecated:!1,spec:null},{kind:1222,name:"Voice Message",description:"Voice message",nip:"A0",classification:"regular",deprecated:!1,spec:null},{kind:1244,name:"Voice Message Comment",description:"Comment on voice message",nip:"A0",classification:"regular",deprecated:!1,spec:null},{kind:1311,name:"Live Chat Message",description:"Message in live stream chat",nip:"53",classification:"regular",deprecated:!1,spec:null},{kind:1337,name:"Code Snippet",description:"Code snippet post",nip:"C0",classification:"regular",deprecated:!1,spec:null},{kind:1517,name:"Bitcoin Block",description:"Bitcoin block data",nip:null,classification:"regular",deprecated:!1,spec:"Nostrocket"},{kind:1617,name:"Patches",description:"Git patches",nip:"34",classification:"regular",deprecated:!1,spec:null},{kind:1618,name:"Pull Requests",description:"Git pull request",nip:"34",classification:"regular",deprecated:!1,spec:null},{kind:1619,name:"Pull Request Updates",description:"Updates to git pull request",nip:"34",classification:"regular",deprecated:!1,spec:null},{kind:1621,name:"Issues",description:"Git issues",nip:"34",classification:"regular",deprecated:!1,spec:null},{kind:1622,name:"Git Replies",description:"Replies on git objects",nip:"34",classification:"regular",deprecated:!0,spec:null},{kind:1630,name:"Status",description:"Git status",nip:"34",classification:"regular",deprecated:!1,spec:null},{kind:1631,name:"Status",description:"Git status",nip:"34",classification:"regular",deprecated:!1,spec:null},{kind:1632,name:"Status",description:"Git status",nip:"34",classification:"regular",deprecated:!1,spec:null},{kind:1633,name:"Status",description:"Git status",nip:"34",classification:"regular",deprecated:!1,spec:null},{kind:1808,name:"Live Stream",description:"Live streaming event",nip:null,classification:"regular",deprecated:!1,spec:"zap.stream"},{kind:1971,name:"Problem Tracker",description:"Problem tracking",nip:null,classification:"regular",deprecated:!1,spec:"Nostrocket"},{kind:1984,name:"Reporting",description:"Report content or users",nip:"56",classification:"regular",deprecated:!1,spec:null},{kind:1985,name:"Label",description:"Label/tag content with namespace",nip:"32",classification:"regular",deprecated:!1,spec:null},{kind:1986,name:"Relay Reviews",description:"Reviews of relays",nip:null,classification:"regular",deprecated:!1,spec:null},{kind:1987,name:"AI Embeddings",description:"AI embeddings/vector lists",nip:null,classification:"regular",deprecated:!1,spec:"NKBIP-02"},{kind:2003,name:"Torrent",description:"Torrent magnet link",nip:"35",classification:"regular",deprecated:!1,spec:null},{kind:2004,name:"Torrent Comment",description:"Comment on torrent",nip:"35",classification:"regular",deprecated:!1,spec:null},{kind:2022,name:"Coinjoin Pool",description:"Coinjoin coordination",nip:null,classification:"regular",deprecated:!1,spec:"joinstr"},{kind:4550,name:"Community Post Approval",description:"Approve post in community",nip:"72",classification:"regular",deprecated:!1,spec:null},{kind:5e3,name:"Job Request",description:"Data vending machine job request (start of range)",nip:"90",classification:"regular",deprecated:!1,spec:null},{kind:6e3,name:"Job Result",description:"Data vending machine job result (start of range)",nip:"90",classification:"regular",deprecated:!1,spec:null},{kind:7e3,name:"Job Feedback",description:"Feedback on job request/result",nip:"90",classification:"regular",deprecated:!1,spec:null},{kind:7374,name:"Reserved Cashu Wallet Tokens",description:"Reserved Cashu wallet tokens",nip:"60",classification:"regular",deprecated:!1,spec:null},{kind:7375,name:"Cashu Wallet Tokens",description:"Cashu wallet tokens",nip:"60",classification:"regular",deprecated:!1,spec:null},{kind:7376,name:"Cashu Wallet History",description:"Cashu wallet transaction history",nip:"60",classification:"regular",deprecated:!1,spec:null},{kind:7516,name:"Geocache Log",description:"Geocaching log entry",nip:null,classification:"regular",deprecated:!1,spec:"geocaching"},{kind:7517,name:"Geocache Proof of Find",description:"Proof of geocache find",nip:null,classification:"regular",deprecated:!1,spec:"geocaching"},{kind:8e3,name:"Add User",description:"Add user to group",nip:"43",classification:"regular",deprecated:!1,spec:null},{kind:8001,name:"Remove User",description:"Remove user from group",nip:"43",classification:"regular",deprecated:!1,spec:null},{kind:9e3,name:"Group Control Events",description:"Group control events (start of range)",nip:"29",classification:"regular",deprecated:!1,spec:null},{kind:9041,name:"Zap Goal",description:"Fundraising goal for zaps",nip:"75",classification:"regular",deprecated:!1,spec:null},{kind:9321,name:"Nutzap",description:"Cashu nutzap",nip:"61",classification:"regular",deprecated:!1,spec:null},{kind:9467,name:"Tidal Login",description:"Tidal streaming login",nip:null,classification:"regular",deprecated:!1,spec:"Tidal-nostr"},{kind:9734,name:"Zap Request",description:"Request Lightning payment",nip:"57",classification:"regular",deprecated:!1,spec:null},{kind:9735,name:"Zap",description:"Lightning payment receipt",nip:"57",classification:"regular",deprecated:!1,spec:null},{kind:9802,name:"Highlights",description:"Highlighted text selection",nip:"84",classification:"regular",deprecated:!1,spec:null},{kind:1e4,name:"Mute List",description:"List of muted users/content",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10001,name:"Pin List",description:"Pinned events",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10002,name:"Relay List Metadata",description:"User's preferred relays for read/write",nip:"65",classification:"replaceable",deprecated:!1,spec:null},{kind:10003,name:"Bookmark List",description:"Bookmarked events",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10004,name:"Communities List",description:"Communities user belongs to",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10005,name:"Public Chats List",description:"Public chats user is in",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10006,name:"Blocked Relays List",description:"Relays user has blocked",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10007,name:"Search Relays List",description:"Preferred search relays",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10008,name:"Relay Group Configuration",description:"Relay group configuration",nip:null,classification:"replaceable",deprecated:!1,spec:null},{kind:10009,name:"User Groups",description:"Groups user belongs to",nip:"29",classification:"replaceable",deprecated:!1,spec:null},{kind:10012,name:"Favorite Relays List",description:"User's favorite relays",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10013,name:"Private Event Relay List",description:"Relays for private events",nip:"37",classification:"replaceable",deprecated:!1,spec:null},{kind:10015,name:"Interests List",description:"User interests/topics",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10019,name:"Nutzap Mint Recommendation",description:"Recommended Cashu mints for nutzaps",nip:"61",classification:"replaceable",deprecated:!1,spec:null},{kind:10020,name:"Media Follows",description:"Followed media accounts",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10030,name:"User Emoji List",description:"Custom emoji list",nip:"51",classification:"replaceable",deprecated:!1,spec:null},{kind:10050,name:"DM Relays List",description:"Relays to receive DMs on",nip:"17",classification:"replaceable",deprecated:!1,spec:null},{kind:10051,name:"KeyPackage Relays List",description:"Marmot key package relays",nip:null,classification:"replaceable",deprecated:!1,spec:"Marmot"},{kind:10063,name:"User Server List",description:"Blossom server list",nip:null,classification:"replaceable",deprecated:!1,spec:"Blossom"},{kind:10096,name:"File Storage Server List",description:"File storage servers",nip:"96",classification:"replaceable",deprecated:!0,spec:null},{kind:10166,name:"Relay Monitor Announcement",description:"Relay monitoring announcement",nip:"66",classification:"replaceable",deprecated:!1,spec:null},{kind:10312,name:"Room Presence",description:"Presence in live room",nip:"53",classification:"replaceable",deprecated:!1,spec:null},{kind:10377,name:"Proxy Announcement",description:"Nostr proxy announcement",nip:null,classification:"replaceable",deprecated:!1,spec:"Nostr Epoxy"},{kind:11111,name:"Transport Method Announcement",description:"Transport method announcement",nip:null,classification:"replaceable",deprecated:!1,spec:"Nostr Epoxy"},{kind:12345,name:"Relay Policy Configuration",description:"Relay-internal policy configuration (admin only)",nip:null,classification:"replaceable",deprecated:!1,spec:"orly"},{kind:13004,name:"JWT Binding",description:"Link between JWT certificate and pubkey",nip:null,classification:"replaceable",deprecated:!1,spec:null},{kind:13194,name:"Wallet Service Info",description:"NWC wallet service information",nip:"47",classification:"replaceable",deprecated:!1,spec:null},{kind:13534,name:"Membership Lists",description:"Group membership lists",nip:"43",classification:"replaceable",deprecated:!1,spec:null},{kind:14388,name:"User Sound Effect Lists",description:"Sound effect lists",nip:null,classification:"replaceable",deprecated:!1,spec:"Corny Chat"},{kind:17375,name:"Cashu Wallet Event",description:"Cashu wallet event",nip:"60",classification:"replaceable",deprecated:!1,spec:null},{kind:21e3,name:"Lightning Pub RPC",description:"Lightning.Pub RPC",nip:null,classification:"ephemeral",deprecated:!1,spec:"Lightning.Pub"},{kind:22242,name:"Client Authentication",description:"Authenticate to relay",nip:"42",classification:"ephemeral",deprecated:!1,spec:null},{kind:23194,name:"Wallet Request",description:"NWC wallet request",nip:"47",classification:"ephemeral",deprecated:!1,spec:null},{kind:23195,name:"Wallet Response",description:"NWC wallet response",nip:"47",classification:"ephemeral",deprecated:!1,spec:null},{kind:23196,name:"Wallet Notification (NIP-04)",description:"NWC wallet notification (NIP-04 encrypted)",nip:"47",classification:"ephemeral",deprecated:!1,spec:null},{kind:23197,name:"Wallet Notification",description:"NWC wallet notification",nip:"47",classification:"ephemeral",deprecated:!1,spec:null},{kind:24133,name:"Nostr Connect",description:"Remote signer connection",nip:"46",classification:"ephemeral",deprecated:!1,spec:null},{kind:24242,name:"Blobs Stored on Mediaservers",description:"Blossom blob storage",nip:null,classification:"ephemeral",deprecated:!1,spec:"Blossom"},{kind:27235,name:"HTTP Auth",description:"Authenticate HTTP requests",nip:"98",classification:"ephemeral",deprecated:!1,spec:null},{kind:28934,name:"Join Request",description:"Request to join group",nip:"43",classification:"ephemeral",deprecated:!1,spec:null},{kind:28935,name:"Invite Request",description:"Invite to group",nip:"43",classification:"ephemeral",deprecated:!1,spec:null},{kind:28936,name:"Leave Request",description:"Leave group request",nip:"43",classification:"ephemeral",deprecated:!1,spec:null},{kind:3e4,name:"Follow Sets",description:"Categorized people lists",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30001,name:"Generic Lists",description:"Generic categorized lists",nip:"51",classification:"parameterized",deprecated:!0,spec:null},{kind:30002,name:"Relay Sets",description:"Categorized relay lists",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30003,name:"Bookmark Sets",description:"Categorized bookmark lists",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30004,name:"Curation Sets",description:"Curated content sets",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30005,name:"Video Sets",description:"Video playlists",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30007,name:"Kind Mute Sets",description:"Muted event kinds",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30008,name:"Profile Badges",description:"Badges displayed on profile",nip:"58",classification:"parameterized",deprecated:!1,spec:null},{kind:30009,name:"Badge Definition",description:"Define a badge/achievement",nip:"58",classification:"parameterized",deprecated:!1,spec:null},{kind:30015,name:"Interest Sets",description:"Interest/topic sets",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30017,name:"Stall",description:"Marketplace stall definition",nip:"15",classification:"parameterized",deprecated:!1,spec:null},{kind:30018,name:"Product",description:"Marketplace product listing",nip:"15",classification:"parameterized",deprecated:!1,spec:null},{kind:30019,name:"Marketplace UI/UX",description:"Marketplace interface settings",nip:"15",classification:"parameterized",deprecated:!1,spec:null},{kind:30020,name:"Product Sold as Auction",description:"Auction product listing",nip:"15",classification:"parameterized",deprecated:!1,spec:null},{kind:30023,name:"Long-form Content",description:"Blog post, article in markdown",nip:"23",classification:"parameterized",deprecated:!1,spec:null},{kind:30024,name:"Draft Long-form Content",description:"Draft article",nip:"23",classification:"parameterized",deprecated:!1,spec:null},{kind:30030,name:"Emoji Sets",description:"Custom emoji sets",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30040,name:"Curated Publication Index",description:"Publication index",nip:null,classification:"parameterized",deprecated:!1,spec:"NKBIP-01"},{kind:30041,name:"Curated Publication Content",description:"Publication content",nip:null,classification:"parameterized",deprecated:!1,spec:"NKBIP-01"},{kind:30063,name:"Release Artifact Sets",description:"Software release artifacts",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30078,name:"Application-specific Data",description:"App-specific key-value storage",nip:"78",classification:"parameterized",deprecated:!1,spec:null},{kind:30166,name:"Relay Discovery",description:"Relay discovery/monitoring",nip:"66",classification:"parameterized",deprecated:!1,spec:null},{kind:30267,name:"App Curation Sets",description:"Curated app sets",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:30311,name:"Live Event",description:"Live streaming event",nip:"53",classification:"parameterized",deprecated:!1,spec:null},{kind:30312,name:"Interactive Room",description:"Interactive live room",nip:"53",classification:"parameterized",deprecated:!1,spec:null},{kind:30313,name:"Conference Event",description:"Conference/meetup event",nip:"53",classification:"parameterized",deprecated:!1,spec:null},{kind:30315,name:"User Statuses",description:"User status updates",nip:"38",classification:"parameterized",deprecated:!1,spec:null},{kind:30388,name:"Slide Set",description:"Presentation slides",nip:null,classification:"parameterized",deprecated:!1,spec:"Corny Chat"},{kind:30402,name:"Classified Listing",description:"Classified ad listing",nip:"99",classification:"parameterized",deprecated:!1,spec:null},{kind:30403,name:"Draft Classified Listing",description:"Draft classified ad",nip:"99",classification:"parameterized",deprecated:!1,spec:null},{kind:30617,name:"Repository Announcements",description:"Git repository announcement",nip:"34",classification:"parameterized",deprecated:!1,spec:null},{kind:30618,name:"Repository State Announcements",description:"Git repository state",nip:"34",classification:"parameterized",deprecated:!1,spec:null},{kind:30818,name:"Wiki Article",description:"Wiki article",nip:"54",classification:"parameterized",deprecated:!1,spec:null},{kind:30819,name:"Redirects",description:"URL redirects",nip:"54",classification:"parameterized",deprecated:!1,spec:null},{kind:31234,name:"Draft Event",description:"Draft of any event",nip:"37",classification:"parameterized",deprecated:!1,spec:null},{kind:31388,name:"Link Set",description:"Link collection",nip:null,classification:"parameterized",deprecated:!1,spec:"Corny Chat"},{kind:31890,name:"Feed",description:"Custom feed definition",nip:null,classification:"parameterized",deprecated:!1,spec:"NUD: Custom Feeds"},{kind:31922,name:"Date-Based Calendar Event",description:"All-day calendar event",nip:"52",classification:"parameterized",deprecated:!1,spec:null},{kind:31923,name:"Time-Based Calendar Event",description:"Calendar event with time",nip:"52",classification:"parameterized",deprecated:!1,spec:null},{kind:31924,name:"Calendar",description:"Calendar definition",nip:"52",classification:"parameterized",deprecated:!1,spec:null},{kind:31925,name:"Calendar Event RSVP",description:"RSVP to calendar event",nip:"52",classification:"parameterized",deprecated:!1,spec:null},{kind:31989,name:"Handler Recommendation",description:"Recommended app for event kind",nip:"89",classification:"parameterized",deprecated:!1,spec:null},{kind:31990,name:"Handler Information",description:"App handler declaration",nip:"89",classification:"parameterized",deprecated:!1,spec:null},{kind:32123,name:"WaveLake Track",description:"WaveLake music track",nip:null,classification:"parameterized",deprecated:!1,spec:"WaveLake"},{kind:32267,name:"Software Application",description:"Software application listing",nip:null,classification:"parameterized",deprecated:!1,spec:null},{kind:32388,name:"User Room Favorites",description:"Favorite rooms",nip:null,classification:"parameterized",deprecated:!1,spec:"Corny Chat"},{kind:33388,name:"High Scores",description:"Game high scores",nip:null,classification:"parameterized",deprecated:!1,spec:"Corny Chat"},{kind:34235,name:"Video Event Horizontal",description:"Horizontal video event",nip:"71",classification:"parameterized",deprecated:!1,spec:null},{kind:34236,name:"Video Event Vertical",description:"Vertical video event",nip:"71",classification:"parameterized",deprecated:!1,spec:null},{kind:34388,name:"Sound Effects",description:"Sound effect definitions",nip:null,classification:"parameterized",deprecated:!1,spec:"Corny Chat"},{kind:34550,name:"Community Definition",description:"Define a community",nip:"72",classification:"parameterized",deprecated:!1,spec:null},{kind:37516,name:"Geocache Listing",description:"Geocache location listing",nip:null,classification:"parameterized",deprecated:!1,spec:"geocaching"},{kind:38172,name:"Cashu Mint Announcement",description:"Cashu mint announcement",nip:"87",classification:"parameterized",deprecated:!1,spec:null},{kind:38173,name:"Fedimint Announcement",description:"Fedimint announcement",nip:"87",classification:"parameterized",deprecated:!1,spec:null},{kind:38383,name:"Peer-to-peer Order Events",description:"P2P trading orders",nip:"69",classification:"parameterized",deprecated:!1,spec:null},{kind:39e3,name:"Group Metadata Events",description:"Group metadata (start of range)",nip:"29",classification:"parameterized",deprecated:!1,spec:null},{kind:39089,name:"Starter Packs",description:"Starter pack lists",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:39092,name:"Media Starter Packs",description:"Media starter packs",nip:"51",classification:"parameterized",deprecated:!1,spec:null},{kind:39701,name:"Web Bookmarks",description:"Web URL bookmarks",nip:"B0",classification:"parameterized",deprecated:!1,spec:null},{kind:39998,name:"ACL Event",description:"Access control list event",nip:null,classification:"parameterized",deprecated:!1,spec:null}].map(e=>[e.kind,e]));function gme(e,n){1&e&&(y(0,"span",2),R(1," Nothing configured so far.\n"),v())}function hme(e,n){if(1&e){const t=pt();y(0,"button",5),_e("click",function(){return Qe(t),De(Ee().onClickRemoveAllPermissions())}),R(1," Remove All Permissions\n"),v()}}function pme(e,n){if(1&e&&(y(0,"span",9),R(1),v()),2&e){const t=Ee().$implicit;gt("title",Ee(2).getKindTooltip(t.kind)),J(),Zt("(kind ",t.kind,")")}}function Ime(e,n){if(1&e){const t=pt();y(0,"div",7)(1,"span"),R(2),v(),y(3,"span",8),R(4),v(),At(5,pme,2,2,"span",9),ot(6,"div",10),y(7,"lib-icon-button",11),_e("click",function(){const i=Qe(t).$implicit;return De(Ee(2).onClickRevokePermission(i))}),v()()}if(2&e){const t=n.$implicit;J(),er("action-allow","allow"===t.methodPolicy)("action-deny","deny"===t.methodPolicy),J(),ft(t.methodPolicy),J(2),ft(t.method),J(),tt(typeof t.kind<"u"?5:-1)}}function mme(e,n){if(1&e&&(y(0,"div",4)(1,"span",6),R(2),v(),Rr(3,Ime,8,7,"div",7,eu),v()),2&e){const t=n.$implicit;J(2),Zt(" ",t.host," "),J(),Pr(t.permissions)}}let Cme=(()=>{class e extends Nr{identity;hostsPermissions=[];#e=de(Vi);#t=de(lr);ngOnInit(){const t=this.#e.parent?.snapshot.params.id;t&&this.#n(t)}onClickRevokePermission(t){var r=this;return I(function*(){yield r.#t.deletePermission(t.id),r.#r(r.identity?.id)})()}onClickRemoveAllPermissions(){var t=this;return I(function*(){const r=t.hostsPermissions.flatMap(i=>i.permissions);for(const i of r)yield t.#t.deletePermission(i.id);t.#r(t.identity?.id)})()}#n(t){this.identity=this.#t.getBrowserSessionHandler().browserSessionData?.identities.find(r=>r.id===t),this.identity&&this.#r(t)}#r(t){t&&(this.hostsPermissions=[],(this.#t.getBrowserSessionHandler().browserSessionData?.permissions??[]).filter(i=>i.identityId===t).sortBy(i=>i.host).groupBy(i=>i.host,i=>i).forEach((i,o)=>{this.hostsPermissions.push({host:o,permissions:i.sortBy(s=>s.method)})}))}getKindTooltip(t){return function fme(e){const n=mH.get(e);return n?n.name:`Kind ${e}`}(t)}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-permissions"]],features:[Nt],decls:8,vars:1,consts:[[1,"header-pane"],["icon","chevron-left",3,"click"],[1,"text-muted",2,"font-size","12px"],[1,"btn","btn-danger","btn-sm","remove-all-btn"],[1,"permissions-card"],[1,"btn","btn-danger","btn-sm","remove-all-btn",3,"click"],[2,"margin-bottom","4px","font-weight","500"],[1,"permission"],[1,"text-muted"],[3,"title"],[1,"sam-flex-grow"],["icon","trash","title","Revoke permission",3,"click"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"lib-icon-button",1),_e("click",function(){return i.navigateBack()}),v(),y(2,"span"),R(3,"Permissions"),v()(),At(4,gme,2,0,"span",2)(5,hme,2,0,"button",3),Rr(6,mme,5,1,"div",4,eu)),2&r&&(J(4),tt(0===i.hostsPermissions.length?4:5),J(2),Pr(i.hostsPermissions))},dependencies:[xs],styles:["[_nghost-%COMP%] {\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n padding-left: var(--size);\n padding-right: var(--size);\n}\n[_nghost-%COMP%] .header-pane[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n column-gap: var(--size-h);\n align-items: center;\n padding-bottom: var(--size);\n background-color: var(--background);\n position: sticky;\n top: 0;\n}\n[_nghost-%COMP%] .remove-all-btn[_ngcontent-%COMP%] {\n margin-bottom: var(--size);\n}\n[_nghost-%COMP%] .permissions-card[_ngcontent-%COMP%] {\n background: var(--background-light);\n border-radius: 8px;\n padding: calc(var(--size) / 2) var(--size);\n display: flex;\n flex-direction: column;\n margin-bottom: 4px;\n}\n[_nghost-%COMP%] .permissions-card[_ngcontent-%COMP%] .permission[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: var(--size);\n font-size: 12px;\n margin-left: -8px;\n padding-left: 8px;\n margin-right: -8px;\n padding-right: 8px;\n border-radius: 4px;\n}\n[_nghost-%COMP%] .permissions-card[_ngcontent-%COMP%] .permission[_ngcontent-%COMP%]:hover {\n background: var(--background-light-hover);\n}\n[_nghost-%COMP%] .permissions-card[_ngcontent-%COMP%] .permission[_ngcontent-%COMP%] .action-allow[_ngcontent-%COMP%] {\n background: var(--bs-green);\n border-radius: 4px;\n padding: 0 4px;\n width: 40px;\n text-align: center;\n}\n[_nghost-%COMP%] .permissions-card[_ngcontent-%COMP%] .permission[_ngcontent-%COMP%] .action-deny[_ngcontent-%COMP%] {\n background: var(--bs-danger-border-subtle);\n border-radius: 4px;\n padding: 0 4px;\n width: 40px;\n text-align: center;\n}"]})}return e})();const Mm="relayListCache";let yH=(()=>{class e{#e={};#t=null;#n=new Map;#r=!1;#a=null;initialize(){var t=this;return I(function*(){if(!t.#r){if(t.#a)return t.#a;t.#a=t.#o(),yield t.#a,t.#r=!0}})()}#o(){var t=this;return I(function*(){try{if(typeof chrome<"u"&&chrome.storage?.session){const r=yield chrome.storage.session.get(Mm);r[Mm]&&(t.#e=r[Mm],t.#i())}}catch(r){console.error("Failed to load relay list cache from storage:",r)}})()}#s(){var t=this;return I(function*(){try{typeof chrome<"u"&&chrome.storage?.session&&(yield chrome.storage.session.set({[Mm]:t.#e}))}catch(r){console.error("Failed to save relay list cache to storage:",r)}})()}#i(){const t=Date.now();for(const r of Object.keys(this.#e))t-this.#e[r].fetchedAt>864e5&&delete this.#e[r]}#l(){return this.#t||(this.#t=new u_),this.#t}getCachedRelayList(t){const r=this.#e[t];return r?Date.now()-r.fetchedAt>864e5?(delete this.#e[t],null):r.relays:null}fetchRelayList(t){var r=this;return I(function*(){yield r.initialize();const i=r.getCachedRelayList(t);if(i)return i;const o=r.#n.get(t);if(o)return o;const s=r.#c(t);r.#n.set(t,s);try{return yield s}finally{r.#n.delete(t)}})()}#c(t){var r=this;return I(function*(){const i=r.#l();try{const o=yield r.#u(i,Lu,[{kinds:[10002],authors:[t]}],1e4);if(0===o.length)return[];const s=o.reduce((c,l)=>l.created_at>c.created_at?l:c),a=[];for(const c of s.tags)if("r"===c[0]&&c[1]){const u=c[2];let d=!0,f=!0;"read"===u?f=!1:"write"===u&&(d=!1),a.push({url:c[1],read:d,write:f})}return r.#e[t]={pubkey:t,relays:a,fetchedAt:Date.now()},yield r.#s(),a}catch(o){return console.error(`Failed to fetch relay list for ${t}:`,o),[]}})()}#u(t,r,i,o){return I(function*(){return new Promise(s=>{const a=[];let c=!1;const l=setTimeout(()=>{c||(c=!0,s(a))},o),u=t.subscribeMany(r,i,{onevent(d){a.push(d)},oneose(){c||(c=!0,clearTimeout(l),u.close(),s(a))}})})})()}clearCache(){var t=this;return I(function*(){t.#e={},yield t.#s()})()}clearCacheForPubkey(t){var r=this;return I(function*(){delete r.#e[t],yield r.#s()})()}static \u0275fac=function(r){return new(r||e)};static \u0275prov=rt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Eme=(()=>{class e{type;model;readonly=!1;modelChange=new Pn;get isRead(){return"read"===this.type}get isSelected(){return this.model}get isReadonly(){return this.readonly}onClick(){this.readonly||(this.model=!this.model,this.modelChange.emit(this.model))}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["lib-relay-rw"]],hostVars:6,hostBindings:function(r,i){1&r&&_e("click",function(){return i.onClick()}),2&r&&er("read",i.isRead)("is-selected",i.isSelected)("is-readonly",i.isReadonly)},inputs:{type:"type",model:"model",readonly:"readonly"},outputs:{modelChange:"modelChange"},decls:2,vars:1,template:function(r,i){1&r&&(y(0,"span"),R(1),v()),2&r&&(J(),ft(i.type))},styles:["[_nghost-%COMP%] {\n border-radius: 4px;\n padding: 0px 4px;\n font-size: 12px;\n text-align: center;\n border: 1px solid transparent;\n min-width: 40px;\n min-height: 20px;\n cursor: pointer;\n}\n.is-readonly[_nghost-%COMP%] {\n cursor: default;\n opacity: 0.8;\n}\n.read[_nghost-%COMP%]:not(.is-selected) {\n border: 1px solid var(--bs-green);\n}\n.read.is-selected[_nghost-%COMP%] {\n background: var(--bs-green);\n}\n[_nghost-%COMP%]:not(.read):not(.is-selected) {\n border: 1px solid var(--bs-primary);\n}\n[_nghost-%COMP%]:not(.read).is-selected {\n background: var(--bs-primary);\n}"]})}return e})(),Bme=(()=>{class e{transform(t){return t.toLowerCase().replaceAll("wss://","")}static \u0275fac=function(r){return new(r||e)};static \u0275pipe=Or({name:"visualRelay",type:e,pure:!0})}return e})();const wme=e=>({relay:e}),vme=(e,n)=>n.url;function _me(e,n){if(1&e&&(y(0,"div",9)(1,"div",10)(2,"span"),R(3),mA(4,"visualRelay"),v(),y(5,"div",11),ot(6,"lib-relay-rw",12)(7,"lib-relay-rw",13),v()()()),2&e){const t=n.relay;J(3),ft(hB(4,5,t.url)),J(3),gt("model",t.read)("readonly",!0),J(),gt("model",t.write)("readonly",!0)}}function bme(e,n){1&e&&(y(0,"div",6),ot(1,"i",14),y(2,"span"),R(3,"Fetching relay list..."),v()())}function Qme(e,n){if(1&e&&(y(0,"div",7),ot(1,"i",15),y(2,"span"),R(3),v()()),2&e){const t=Ee();J(3),ft(t.errorMessage)}}function Dme(e,n){1&e&&(y(0,"div",8),ot(1,"i",16),y(2,"span"),R(3,"No relay list found"),v(),y(4,"span",17),R(5,"Publish a NIP-65 relay list using a Nostr client to see your relays here."),v()())}function Sme(e,n){1&e&&sB(0)}function kme(e,n){if(1&e&&At(0,Sme,1,0,"ng-container",18),2&e){const t=n.$implicit;Ee(),gt("ngTemplateOutlet",Dn(1))("ngTemplateOutletContext",function yF(e,n,t,r){return EF(be(),zr(),e,n,t,r)}(2,wme,t))}}let Mme=(()=>{class e extends Nr{identity;relays=[];loading=!0;errorMessage="";#e=de(Vi);#t=de(lr);#n=de(yH);ngOnInit(){const t=this.#e.parent?.snapshot.params.id;t?this.#r(t):this.loading=!1}#r(t){var r=this;return I(function*(){try{if(r.loading=!0,r.errorMessage="",r.identity=r.#t.getBrowserSessionHandler().browserSessionData?.identities.find(s=>s.id===t),!r.identity)return r.loading=!1,void(r.errorMessage="Identity not found");const i=rr.pubkeyFromPrivkey(r.identity.privkey),o=yield r.#n.fetchRelayList(i);r.relays=o,r.loading=!1}catch(i){console.error("Failed to load relay list:",i),r.loading=!1,r.errorMessage="Failed to fetch relay list"}})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-relays"]],features:[Nt],decls:16,vars:3,consts:[["relayTemplate",""],[1,"header-pane"],["icon","chevron-left",3,"click"],[1,"header-title"],[1,"info-banner"],[1,"emoji"],[1,"loading-state"],[1,"error-state"],[1,"empty-state"],[1,"sam-flex-row","gap","relay"],[1,"sam-flex-column","sam-flex-grow"],[1,"sam-flex-row","gap-h"],["type","read",3,"model","readonly"],["type","write",3,"model","readonly"],[1,"bi","bi-circle","color-activity"],[1,"bi","bi-exclamation-triangle","sam-color-danger"],[1,"bi","bi-broadcast"],[1,"hint"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(r,i){if(1&r){const o=pt();At(0,_me,8,7,"ng-template",null,0,bF),y(2,"div",1)(3,"lib-icon-button",2),_e("click",function(){return Qe(o),De(i.navigateBack())}),v(),y(4,"span",3),R(5,"Relays"),v()(),y(6,"div",4)(7,"span",5),R(8,"\u{1f4a1}"),v(),y(9,"span"),R(10,"These relays are fetched from your NIP-65 relay list (kind 10002). To update your relay list, use a Nostr client that supports NIP-65."),v()(),At(11,bme,4,0,"div",6)(12,Qme,4,1,"div",7)(13,Dme,6,0,"div",8),Rr(14,kme,1,4,"ng-container",null,vme)}2&r&&(J(11),tt(i.loading?11:-1),J(),tt(!i.loading&&i.errorMessage?12:-1),J(),tt(i.loading||i.errorMessage||0!==i.relays.length?-1:13),J(),Pr(i.relays))},dependencies:[xs,Eme,h2,Bme],styles:["[_nghost-%COMP%] {\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n padding-left: var(--size);\n padding-right: var(--size);\n}\n[_nghost-%COMP%] .header-pane[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n column-gap: var(--size-h);\n align-items: center;\n padding-bottom: var(--size);\n background-color: var(--background);\n position: sticky;\n top: 0;\n}\n[_nghost-%COMP%] .header-title[_ngcontent-%COMP%] {\n font-family: var(--font-heading);\n font-size: 20px;\n font-weight: 700;\n letter-spacing: 0.05rem;\n}\n[_nghost-%COMP%] .info-banner[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n gap: var(--size-h);\n padding: var(--size-h) var(--size);\n margin-bottom: var(--size);\n background: var(--background-light);\n border-radius: var(--radius-md);\n border: 1px solid var(--border);\n}\n[_nghost-%COMP%] .info-banner[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--primary);\n font-size: 14px;\n margin-top: 2px;\n}\n[_nghost-%COMP%] .info-banner[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 12px;\n color: var(--muted-foreground);\n line-height: 1.4;\n}\n[_nghost-%COMP%] .loading-state[_ngcontent-%COMP%], \n[_nghost-%COMP%] .empty-state[_ngcontent-%COMP%], \n[_nghost-%COMP%] .error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--size-h);\n padding: var(--size-2);\n color: var(--muted-foreground);\n}\n[_nghost-%COMP%] .loading-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%], \n[_nghost-%COMP%] .empty-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%], \n[_nghost-%COMP%] .error-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 32px;\n}\n[_nghost-%COMP%] .loading-state[_ngcontent-%COMP%] span[_ngcontent-%COMP%], \n[_nghost-%COMP%] .empty-state[_ngcontent-%COMP%] span[_ngcontent-%COMP%], \n[_nghost-%COMP%] .error-state[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 14px;\n}\n[_nghost-%COMP%] .loading-state[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%], \n[_nghost-%COMP%] .empty-state[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%], \n[_nghost-%COMP%] .error-state[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%] {\n font-size: 12px;\n text-align: center;\n max-width: 280px;\n}\n[_nghost-%COMP%] .color-activity[_ngcontent-%COMP%] {\n color: var(--muted-foreground);\n animation: _ngcontent-%COMP%_pulse 1.5s infinite;\n}\n@keyframes _ngcontent-%COMP%_pulse {\n 0%, 100% {\n opacity: 0.4;\n }\n 50% {\n opacity: 1;\n }\n}\n[_nghost-%COMP%] .relay[_ngcontent-%COMP%] {\n margin-bottom: 4px;\n padding: 4px 8px 6px 8px;\n border-radius: 8px;\n background: var(--background-light);\n}"]})}return e})();const Nme=["passwordInputElement"],xme=["derivingModal"];function Tme(e,n){1&e&&(y(0,"div",19)(1,"div",20),ot(2,"i",21),y(3,"span"),R(4,"Invalid password"),v()()())}function Pme(e,n){if(1&e&&(y(0,"option",7)(1,"span"),R(2),v()()),2&e){const t=n.$implicit;gt("ngValue",t),J(2),ft(t.fileName)}}const Hme=["toast"],Lme=["confirm"];function Gme(e,n){1&e&&(y(0,"div",13)(1,"span"),R(2,"\u26a0 All sites will be auto-approved without prompting"),v()())}function Vme(e,n){if(1&e&&(y(0,"div",11)(1,"span",12),R(2,"No whitelisted apps yet"),v()(),At(3,Gme,3,0,"div",13)),2&e){const t=Ee();J(3),tt(t.isRecklessMode?3:-1)}}function qme(e,n){if(1&e){const t=pt();y(0,"div",10)(1,"span",14),R(2),v(),y(3,"button",15),_e("click",function(){const i=Qe(t).$implicit;return De(Ee().onClickRemoveHost(i))}),ot(4,"i",16),v()()}if(2&e){const t=n.$implicit;J(2),ft(t)}}function EH(e,n,t){const r={kind:22242,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",n]],content:""},i=function BH(e){const n=new Uint8Array(e.length/2);for(let t=0;t<n.length;t++)n[t]=parseInt(e.substr(2*t,2),16);return n}(t);return wo(r,i)}function ob(){return(ob=I(function*(e,n,t,r=15e3){return new Promise(i=>{const o=setTimeout(()=>{s&&s.readyState===WebSocket.OPEN&&s.close(),i({relay:e,success:!1,message:"Timeout"})},r);let s,a=!1,c=!1;try{s=new WebSocket(e)}catch(u){return clearTimeout(o),void i({relay:e,success:!1,message:`Connection failed: ${u}`})}const l=()=>{!c&&s.readyState===WebSocket.OPEN&&(c=!0,s.send(JSON.stringify(["EVENT",n])))};s.onopen=()=>{setTimeout(()=>{a||l()},500)},s.onmessage=u=>{try{const d=JSON.parse(u.data),f=d[0];if("AUTH"===f){const p=EH(e,d[1],t);s.send(JSON.stringify(["AUTH",p])),a=!0}else if("OK"===f){const p=d[2],C=d[3]||"";d[1]===n.id?(clearTimeout(o),s.close(),p?i({relay:e,success:!0,message:"Published successfully"}):C.includes("auth-required")&&!a?i({relay:e,success:!1,message:"Auth required but no challenge received"}):i({relay:e,success:!1,message:C||"Publish rejected"})):a&&!c&&(p?l():(clearTimeout(o),s.close(),i({relay:e,success:!1,message:`Authentication failed: ${C}`})))}else"NOTICE"===f&&console.log(`Relay ${e} notice: ${d[1]}`)}catch{}},s.onerror=()=>{clearTimeout(o),i({relay:e,success:!1,message:"Connection error"})},s.onclose=()=>{clearTimeout(o)}})})).apply(this,arguments)}function sb(){return sb=I(function*(e,n,t){return yield Promise.all(e.map(i=>function jme(e,n,t){return ob.apply(this,arguments)}(i,n,t)))}),sb.apply(this,arguments)}function Wme(e,n){1&e&&(y(0,"div",2)(1,"span",3),R(2,"Loading profile..."),v()())}function $me(e,n){1&e&&R(0," Saving... ")}function Zme(e,n){1&e&&R(0," Save ")}function Xme(e,n){if(1&e&&(y(0,"div",27)(1,"div",28),ot(2,"i",29),y(3,"span"),R(4),v()()()),2&e){const t=Ee(2);J(4),ft(t.alertMessage)}}function eCe(e,n){if(1&e){const t=pt();y(0,"div",4)(1,"div",5)(2,"label",6),R(3,"Name"),v(),y(4,"input",7),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.name,i)||(o.profile.name=i),De(i)}),v()(),y(5,"div",5)(6,"label",8),R(7,"Display Name"),v(),y(8,"input",9),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.display_name,i)||(o.profile.display_name=i),De(i)}),v()(),y(9,"div",5)(10,"label",10),R(11,"Avatar URL"),v(),y(12,"input",11),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.picture,i)||(o.profile.picture=i),De(i)}),v()(),y(13,"div",5)(14,"label",12),R(15,"Banner URL"),v(),y(16,"input",13),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.banner,i)||(o.profile.banner=i),De(i)}),v()(),y(17,"div",5)(18,"label",14),R(19,"Website"),v(),y(20,"input",15),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.website,i)||(o.profile.website=i),De(i)}),v()(),y(21,"div",5)(22,"label",16),R(23,"About"),v(),y(24,"textarea",17),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.about,i)||(o.profile.about=i),De(i)}),v()(),y(25,"div",5)(26,"label",18),R(27,"NIP-05 Identifier"),v(),y(28,"input",19),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.nip05,i)||(o.profile.nip05=i),De(i)}),v()(),y(29,"div",5)(30,"label",20),R(31,"Lightning Address (LUD-16)"),v(),y(32,"input",21),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.lud16,i)||(o.profile.lud16=i),De(i)}),v()(),y(33,"div",5)(34,"label",22),R(35,"LNURL"),v(),y(36,"input",23),an("ngModelChange",function(i){Qe(t);const o=Ee();return dn(o.profile.lnurl,i)||(o.profile.lnurl=i),De(i)}),v()()(),y(37,"div",24)(38,"button",25),_e("click",function(){return Qe(t),De(Ee().onClickCancel())}),R(39," Cancel "),v(),y(40,"button",26),_e("click",function(){return Qe(t),De(Ee().onClickSave())}),At(41,$me,1,0)(42,Zme,1,0),v()(),At(43,Xme,5,1,"div",27)}if(2&e){const t=Ee();J(4),sn("ngModel",t.profile.name),J(4),sn("ngModel",t.profile.display_name),J(4),sn("ngModel",t.profile.picture),J(4),sn("ngModel",t.profile.banner),J(4),sn("ngModel",t.profile.website),J(4),sn("ngModel",t.profile.about),J(4),sn("ngModel",t.profile.nip05),J(4),sn("ngModel",t.profile.lud16),J(4),sn("ngModel",t.profile.lnurl),J(4),gt("disabled",t.saving),J(),tt(t.saving?41:42),J(2),tt(t.alertMessage?43:-1)}}const tCe=[{path:"welcome",component:(()=>{class e{router=de(An);#e=de(lr);onClickSync(t){var r=this;return I(function*(){const i=t?Ec.BROWSER_SYNC:Ec.NO_SYNC;if(yield r.#e.enableBrowserSyncFlow(i),i===Ec.BROWSER_SYNC){const o=yield r.#e.loadAndMigrateBrowserSyncData();if(typeof o<"u"&&Object.keys(o).length>0)return void(yield r.router.navigateByUrl("/vault-login"))}yield r.router.navigateByUrl("/vault-create/home")})()}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-welcome"]],decls:37,vars:0,consts:[[1,"sam-text-header","sam-mb-h"],[1,"sam-text-muted","sam-text-md","sam-text-align-center2"],[1,"sam-mt","sam-text-lg"],["type","button",1,"sam-mt","btn","btn-primary",3,"click"],[1,"sam-text-muted","sam-text-md"],["type","button",1,"sam-mt","sam-mb-2","btn","btn-secondary",3,"click"],[1,"storage-info"],[1,"sam-flex-grow"],[1,"sam-text-muted","sam-text-md","sam-mb"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"span"),R(2,"Smesh Signer Setup - Sync Preference"),v()(),y(3,"span",1),R(4," Smesh Signer always encrypts sensitive data like private keys and site permissions independent of the chosen sync mode.\n"),v(),y(5,"span",2),R(6,"Sync : Mozilla Firefox"),v(),y(7,"span",1),R(8," Your encrypted data is synced between browser instances. You need to be signed in with your account.\n"),v(),y(9,"button",3),_e("click",function(){return i.onClickSync(!0)}),y(10,"span"),R(11," Sync ON"),v()(),y(12,"span",2),R(13,"Offline"),v(),y(14,"span",4),R(15," Your encrypted data is never uploaded to any servers. It remains in your local browser instance.\n"),v(),y(16,"button",5),_e("click",function(){return i.onClickSync(!1)}),y(17,"span"),R(18," Sync OFF"),v()(),y(19,"div",6)(20,"details")(21,"summary"),R(22,"Important for Cashu wallet users"),v(),y(23,"p"),R(24," Browser sync storage is limited to ~100KB shared across all data (identities, permissions, relays, and Cashu tokens). "),v(),y(25,"p"),R(26," If you plan to use the Cashu ecash wallet with significant balances, choose "),y(27,"strong"),R(28,'"Sync OFF"'),v(),R(29," which provides ~5MB of local storage (enough for ~18,000+ tokens vs ~300-400 with sync). "),v(),y(30,"p")(31,"strong"),R(32,"Note:"),v(),R(33," Cashu tokens are bearer assets. If you lose your vault backup, you lose your tokens permanently. Make sure to configure regular backups. "),v()()(),ot(34,"div",7),y(35,"span",8),R(36," Your preference can later be changed at any time.\n"),v())},styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n padding-left: var(--size);\n padding-right: var(--size);\n}\n\n.storage-info[_ngcontent-%COMP%] {\n margin-top: 1rem;\n width: 100%;\n}\n.storage-info[_ngcontent-%COMP%] details[_ngcontent-%COMP%] {\n background: rgba(255, 193, 7, 0.1);\n border: 1px solid var(--warning, #ffc107);\n border-radius: 6px;\n padding: 0.5rem;\n}\n.storage-info[_ngcontent-%COMP%] details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] {\n cursor: pointer;\n font-weight: 500;\n font-size: 0.9rem;\n color: var(--warning, #ffc107);\n}\n.storage-info[_ngcontent-%COMP%] details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:hover {\n text-decoration: underline;\n}\n.storage-info[_ngcontent-%COMP%] details[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0.75rem 0 0 0;\n font-size: 0.85rem;\n line-height: 1.4;\n color: var(--text-muted, #6c757d);\n}\n.storage-info[_ngcontent-%COMP%] details[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child {\n margin-bottom: 0.5rem;\n}\n.storage-info[_ngcontent-%COMP%] details[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%] {\n color: var(--text, #212529);\n}"]})}return e})()},{path:"vault-login",component:(()=>{class e{passwordInput;derivingModal;loginPassword="";showInvalidPasswordAlert=!1;#e=de(lr);router=de(An);#t=de(Uu);#n=de(om);#r=de(Si);ngAfterViewInit(){this.passwordInput.nativeElement.focus()}toggleType(t){t.type="password"===t.type?"text":"password"}loginVault(){var t=this;return I(function*(){if(t.loginPassword){t.derivingModal.show("Unlocking vault");try{yield t.#e.unlockVault(t.loginPassword)}catch{return t.derivingModal.hide(),t.showInvalidPasswordAlert=!0,void window.setTimeout(()=>{t.showInvalidPasswordAlert=!1},2e3)}t.derivingModal.hide(),t.#r.logVaultUnlock(),t.#a(),t.router.navigateByUrl("/home/identity")}})()}#a(){var t=this;return I(function*(){try{const r=t.#e.getBrowserSessionHandler().browserSessionData?.identities??[];if(0===r.length)return;const i=r.map(o=>rr.pubkeyFromPrivkey(o.privkey));yield t.#n.fetchProfiles(i)}catch(r){console.error("Failed to fetch profiles:",r)}})()}onClickResetExtension(){var t=this;return I(function*(){try{t.#r.logVaultReset(),yield t.#e.resetExtension(),t.#t.startOver(Hu())}catch(r){console.error("reset failed:",r)}})()}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-vault-login"]],viewQuery:function(r,i){if(1&r&&(uc(Nme,5),uc(xme,5)),2&r){let o;Zs(o=Xs())&&(i.passwordInput=o.first),Zs(o=Xs())&&(i.derivingModal=o.first)}},decls:27,vars:7,consts:[["derivingModal",""],["passwordInputElement",""],["confirm",""],[1,"sam-text-header"],[1,"brand"],[1,"content-login-vault"],[1,"sam-flex-column","gap",2,"align-items","center"],[1,"logo-frame"],["src","logo.svg","height","120","width","120","alt",""],[1,"sam-mt-2","input-group"],["type","password","placeholder","vault password",1,"form-control",3,"ngModelChange","keyup.enter","ngModel"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"bi","bi-eye"],["type","button",1,"sam-mt","btn","btn-primary",3,"click","disabled"],[1,"sam-flex-row","gap-h"],[1,"bi","bi-box-arrow-in-right"],[1,"bottom-links"],["type","button",1,"link-btn",3,"click"],["type","button",1,"link-btn","danger",3,"click"],[2,"position","absolute","bottom","0","align-self","center"],["role","alert",1,"alert","alert-danger","sam-flex-row","gap"],[1,"bi","bi-exclamation-triangle"]],template:function(r,i){if(1&r){const o=pt();ot(0,"app-deriving-modal",null,0),y(2,"div",3)(3,"span",4),R(4,"Smesh Signer"),v()(),y(5,"div",5)(6,"div",6)(7,"div",7),ot(8,"img",8),v(),y(9,"div",9)(10,"input",10,1),an("ngModelChange",function(a){return Qe(o),dn(i.loginPassword,a)||(i.loginPassword=a),De(a)}),_e("keyup.enter",function(){return Qe(o),De(i.loginPassword&&i.loginVault())}),v(),y(12,"button",11),_e("click",function(){Qe(o);const a=Dn(11);return De(i.toggleType(a))}),ot(13,"i",12),v()(),y(14,"button",13),_e("click",function(){return Qe(o),De(i.loginVault())}),y(15,"div",14),ot(16,"i",15),y(17,"span"),R(18,"Sign in"),v()()()()(),y(19,"div",16)(20,"button",17),_e("click",function(){return Qe(o),De(i.router.navigateByUrl("/vault-import"))}),R(21," Import a different vault "),v(),y(22,"button",18),_e("click",function(){return Qe(o),De(Dn(26).show("Do you really want to reset the extension? All data will be lost.",i.onClickResetExtension.bind(i)))}),R(23," Reset Extension "),v()(),At(24,Tme,5,0,"div",19),ot(25,"lib-confirm",null,2)}if(2&r){const o=Dn(11);J(10),sn("ngModel",i.loginPassword),J(3),er("bi-eye","password"===o.type)("bi-eye-slash","text"===o.type),J(),gt("disabled",!i.loginPassword),J(10),tt(i.showInvalidPasswordAlert?24:-1)}},dependencies:[Ko,mo,Co,qi,Tf,aP],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-items: center;\n position: relative;\n}\n[_nghost-%COMP%] .content-login-vault[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n padding: 0 var(--size) var(--size) var(--size);\n}\n[_nghost-%COMP%] .bottom-links[_ngcontent-%COMP%] {\n position: absolute;\n bottom: var(--size);\n left: var(--size);\n right: var(--size);\n display: flex;\n justify-content: space-between;\n}\n[_nghost-%COMP%] .link-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n color: var(--muted-foreground);\n font-size: 0.75rem;\n cursor: pointer;\n padding: 4px 8px;\n}\n[_nghost-%COMP%] .link-btn[_ngcontent-%COMP%]:hover {\n color: var(--foreground);\n text-decoration: underline;\n}\n[_nghost-%COMP%] .link-btn.danger[_ngcontent-%COMP%]:hover {\n color: var(--destructive);\n}"]})}return e})()},{path:"vault-create",component:(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-vault-create"]],decls:1,vars:0,template:function(r,i){1&r&&ot(0,"router-outlet")},dependencies:[du],encapsulation:2})}return e})(),children:[{path:"home",component:jle},{path:"new",component:$le}]},{path:"vault-import",component:(()=>{class e extends Nr{snapshots=[];selectedSnapshot;#e=de(lr);#t=de(Uu);openOptionsPage(){return I(function*(){yield nn().runtime.openOptionsPage()})()}ngOnInit(){this.#n()}onClickImport(){var t=this;return I(function*(){if(t.selectedSnapshot)try{yield t.#e.deleteVault(!0),yield t.#e.importVault(t.selectedSnapshot.data),t.#e.isInitialized=!1,t.#t.startOver(Hu())}catch(r){console.log(r)}})()}#n(){var t=this;return I(function*(){t.snapshots=(t.#e.getSignerMetaHandler().signerMetaData?.vaultSnapshots??[]).sortBy(r=>r.fileName,"desc")})()}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-vault-import"]],features:[Nt],decls:16,vars:2,consts:[[1,"custom-header"],["icon","chevron-left",1,"button",3,"click"],[1,"text"],[1,"sam-pl","sam-pr","sam-flex-column","gap"],[1,"sam-text-muted"],["href","options.html","target","_blank"],[1,"form-select","sam-text-sm",3,"ngModelChange","ngModel"],[3,"ngValue"],[1,"sam-flex-grow"],[1,"import-button","btn","btn-primary",3,"click","disabled"]],template:function(r,i){1&r&&(y(0,"div",0)(1,"lib-icon-button",1),_e("click",function(){return i.navigateBack()}),v(),y(2,"span",2),R(3,"Import Vault "),v()(),y(4,"div",3)(5,"span",4),R(6," You can select any snapshot that you have previously imported on the "),y(7,"a",5),R(8,"options page"),v(),R(9,". "),v(),y(10,"select",6),an("ngModelChange",function(s){return dn(i.selectedSnapshot,s)||(i.selectedSnapshot=s),s}),Rr(11,Pme,3,2,"option",7,eu),v()(),ot(13,"div",8),y(14,"button",9),_e("click",function(){return i.onClickImport()}),R(15," Import\n"),v()),2&r&&(J(10),sn("ngModel",i.selectedSnapshot),J(),Pr(i.snapshots),J(3),gt("disabled",!i.selectedSnapshot))},dependencies:[xs,Ko,rw,ow,tf,Co,qi],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n overflow-x: hidden;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] {\n padding-top: var(--size);\n padding-bottom: var(--size);\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: auto;\n align-items: center;\n background: var(--background);\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .button[_ngcontent-%COMP%] {\n grid-column-start: 1;\n grid-column-end: 2;\n grid-row-start: 1;\n grid-row-end: 2;\n justify-self: start;\n margin-left: 16px;\n z-index: 1;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] {\n grid-column-start: 1;\n grid-column-end: 2;\n grid-row-start: 1;\n grid-row-end: 2;\n font-size: 20px;\n font-weight: 500;\n justify-self: center;\n height: 32px;\n overflow-x: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: 70%;\n}\n[_nghost-%COMP%] .import-button[_ngcontent-%COMP%] {\n margin: var(--size);\n}"]})}return e})()},{path:"home",component:Zle,children:[{path:"identities",component:lhe},{path:"identity",component:Bhe},{path:"info",component:_he},{path:"settings",component:Dhe},{path:"logs",component:Nhe},{path:"bookmarks",component:Hhe},{path:"wallet",component:JIe},{path:"backups",component:ZIe}]},{path:"new-identity",component:eme},{path:"whitelisted-apps",component:(()=>{class e extends Nr{toast;confirm;storage=de(lr);#e=de(An);get whitelistedHosts(){return this.storage.getSignerMetaHandler().signerMetaData?.whitelistedHosts??[]}get isRecklessMode(){return this.storage.getSignerMetaHandler().signerMetaData?.recklessMode??!1}onClickWhitelistCurrentTab(){var t=this;return I(function*(){try{const r=yield nn().tabs.query({active:!0,currentWindow:!0});if(0===r.length||!r[0].url)return void t.toast.show("No active tab found");const o=new URL(r[0].url).host;if(!o)return void t.toast.show("Cannot get host from current tab");if(t.whitelistedHosts.includes(o))return void t.toast.show(`${o} is already whitelisted`);yield t.storage.getSignerMetaHandler().addWhitelistedHost(o),t.toast.show(`Added ${o} to whitelist`)}catch(r){console.error("Error getting current tab:",r),t.toast.show("Error getting current tab")}})()}onClickRemoveHost(t){var r=this;this.confirm.show(`Remove ${t} from whitelist?`,I(function*(){yield r.storage.getSignerMetaHandler().removeWhitelistedHost(t),r.toast.show(`Removed ${t} from whitelist`)}))}onClickBack(){this.#e.navigateByUrl("/home/identities")}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-whitelisted-apps"]],viewQuery:function(r,i){if(1&r&&(uc(Hme,5),uc(Lme,5)),2&r){let o;Zs(o=Xs())&&(i.toast=o.first),Zs(o=Xs())&&(i.confirm=o.first)}},features:[Nt],decls:18,vars:1,consts:[["toast",""],["confirm",""],[1,"custom-header"],[1,"back-btn",3,"click"],[1,"bi","bi-chevron-left"],[1,"text"],[1,"content"],[1,"btn","btn-primary","whitelist-btn",3,"click"],[1,"bi","bi-plus-lg"],[1,"hosts-list"],[1,"host-item"],[1,"empty-state"],[1,"sam-text-muted"],[1,"warning-note"],[1,"host-name"],["title","Remove from whitelist",1,"remove-btn",3,"click"],[1,"bi","bi-trash"]],template:function(r,i){if(1&r){const o=pt();y(0,"div",2)(1,"button",3),_e("click",function(){return Qe(o),De(i.onClickBack())}),ot(2,"i",4),v(),y(3,"span",5),R(4,"Whitelisted Apps"),v()(),y(5,"div",6)(6,"button",7),_e("click",function(){return Qe(o),De(i.onClickWhitelistCurrentTab())}),ot(7,"i",8),y(8,"span"),R(9,"Whitelist current tab"),v()(),y(10,"div",9),At(11,Vme,4,1),Rr(12,qme,5,1,"div",10,eu),v()(),ot(14,"lib-toast",null,0)(16,"lib-confirm",null,1)}2&r&&(J(11),tt(0===i.whitelistedHosts.length?11:-1),J(),Pr(i.whitelistedHosts))},dependencies:[id,Tf],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] {\n padding: var(--size);\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: auto;\n align-items: center;\n background: var(--background);\n position: sticky;\n top: 0;\n z-index: 10;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .back-btn[_ngcontent-%COMP%] {\n grid-column-start: 1;\n grid-column-end: 2;\n grid-row-start: 1;\n grid-row-end: 2;\n justify-self: start;\n background: transparent;\n border: none;\n color: var(--foreground);\n padding: 4px 8px;\n cursor: pointer;\n border-radius: 4px;\n z-index: 1;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .back-btn[_ngcontent-%COMP%]:hover {\n background: var(--background-light);\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .back-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 20px;\n}\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] {\n grid-column-start: 1;\n grid-column-end: 2;\n grid-row-start: 1;\n grid-row-end: 2;\n font-family: var(--font-heading);\n font-size: 20px;\n font-weight: 700;\n letter-spacing: 0.05rem;\n justify-self: center;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] {\n padding: 0 var(--size) var(--size) var(--size);\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .whitelist-btn[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 8px;\n margin-bottom: var(--size);\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] {\n flex-grow: 1;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n text-align: center;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] .warning-note[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px;\n background: rgba(255, 193, 7, 0.15);\n border: 1px solid rgba(255, 193, 7, 0.4);\n border-radius: 8px;\n text-align: center;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] .warning-note[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 13px;\n color: #ffc107;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] .host-item[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 12px;\n background: var(--background-light);\n border-radius: 8px;\n margin-bottom: 8px;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] .host-item[_ngcontent-%COMP%] .host-name[_ngcontent-%COMP%] {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] .host-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%] {\n background: transparent;\n border: none;\n color: var(--muted-foreground);\n padding: 4px 8px;\n cursor: pointer;\n border-radius: 4px;\n transition: color 0.15s ease, background-color 0.15s ease;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] .host-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:hover {\n color: var(--destructive);\n background: var(--background-light-hover);\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] .hosts-list[_ngcontent-%COMP%] .host-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 14px;\n}"]})}return e})()},{path:"profile-edit",component:(()=>{class e extends Nr{#e=de(lr);#t=de(An);#n=de(om);#r=de(yH);profile={name:"",display_name:"",picture:"",banner:"",website:"",about:"",nip05:"",lud16:"",lnurl:""};#a={};#o=[];loading=!0;saving=!1;alertMessage;#s;#i;ngOnInit(){var t=this;return I(function*(){yield t.#l()})()}#l(){var t=this;return I(function*(){try{const r=t.#e.getBrowserSessionHandler().browserSessionData?.selectedIdentityId??null,i=t.#e.getBrowserSessionHandler().browserSessionData?.identities.find(s=>s.id===r);if(!i)return void(t.loading=!1);t.#s=i.privkey,t.#i=rr.pubkeyFromPrivkey(i.privkey),yield t.#n.initialize();const o=t.#n.getCachedProfile(t.#i);o&&(t.profile={name:o.name||"",display_name:o.display_name||o.displayName||"",picture:o.picture||"",banner:o.banner||"",website:o.website||"",about:o.about||"",nip05:o.nip05||"",lud16:o.lud16||"",lnurl:o.lud06||""}),yield t.#c(),t.loading=!1}catch(r){console.error("Failed to load profile:",r),t.loading=!1}})()}#c(){var t=this;return I(function*(){if(!t.#i)return;const r=new u_;try{const i=yield t.#u(r,Lu,[{kinds:[0],authors:[t.#i]}],1e4);if(i.length>0){const o=i.reduce((s,a)=>a.created_at>s.created_at?a:s);t.#o=o.tags.filter(s=>"name"!==s[0]&&"display_name"!==s[0]&&"picture"!==s[0]&&"banner"!==s[0]&&"website"!==s[0]&&"about"!==s[0]&&"nip05"!==s[0]&&"lud16"!==s[0]&&"client"!==s[0]);try{t.#a=JSON.parse(o.content),t.profile={name:t.#a.name||"",display_name:t.#a.display_name||t.#a.displayName||"",picture:t.#a.picture||"",banner:t.#a.banner||"",website:t.#a.website||"",about:t.#a.about||"",nip05:t.#a.nip05||"",lud16:t.#a.lud16||"",lnurl:t.#a.lnurl||""}}catch{console.error("Failed to parse profile content")}}}finally{r.close(Lu)}})()}#u(t,r,i,o){return I(function*(){return new Promise(s=>{const a=[];let c=!1;const l=setTimeout(()=>{c||(c=!0,s(a))},o),u=t.subscribeMany(r,i,{onevent(d){a.push(d)},oneose(){c||(c=!0,clearTimeout(l),u.close(),s(a))}})})})()}onClickSave(){var t=this;return I(function*(){if(!t.saving&&t.#s&&t.#i){t.saving=!0,t.alertMessage=void 0;try{const r={...t.#a};r.name=t.profile.name,r.display_name=t.profile.display_name,r.displayName=t.profile.display_name,r.picture=t.profile.picture,r.banner=t.profile.banner,r.website=t.profile.website,r.about=t.profile.about,r.nip05=t.profile.nip05,r.lud16=t.profile.lud16,t.profile.lnurl&&(r.lnurl=t.profile.lnurl),r.pubkey=t.#i;const i=[...t.#o];t.profile.name&&i.push(["name",t.profile.name]),t.profile.display_name&&i.push(["display_name",t.profile.display_name]),t.profile.picture&&i.push(["picture",t.profile.picture]),t.profile.banner&&i.push(["banner",t.profile.banner]),t.profile.website&&i.push(["website",t.profile.website]),t.profile.about&&i.push(["about",t.profile.about]),t.profile.nip05&&i.push(["nip05",t.profile.nip05]),t.profile.lud16&&i.push(["lud16",t.profile.lud16]),i.some(A=>"alt"===A[0])||i.push(["alt",`User profile for ${t.profile.name||t.profile.display_name||"user"}`]),i.push(["client","smesh-signer"]);const o={kind:0,created_at:Math.floor(Date.now()/1e3),tags:i,content:JSON.stringify(r)},s=_c(t.#s),a=wo(o,s);yield t.#r.initialize();const c=yield t.#r.fetchRelayList(t.#i);let l;c.length>0?(l=c.filter(A=>A.write).map(A=>A.url),0===l.length&&(l=c.map(A=>A.url))):l=Lu;const u=yield function Yme(e,n,t){return sb.apply(this,arguments)}(l,a,t.#s),d=u.filter(A=>A.success),f=u.filter(A=>!A.success);if(f.length>0&&console.log("Some relays failed:",f.map(A=>`${A.relay}: ${A.message}`)),0===d.length)throw new Error("Failed to publish to any relay");console.log(`Profile published to ${d.length}/${u.length} relays`),yield t.#n.clearCacheForPubkey(t.#i),yield t.#n.fetchProfile(t.#i),t.#t.navigateByUrl("/home/identity")}catch(r){console.error("Failed to save profile:",r),t.alertMessage=r instanceof Error?r.message:"Failed to save profile",setTimeout(()=>{t.alertMessage=void 0},4500)}finally{t.saving=!1}}})()}onClickCancel(){this.#t.navigateByUrl("/home/identity")}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Jt(e)))(i||e)}})();static \u0275cmp=Wt({type:e,selectors:[["app-profile-edit"]],features:[Nt],decls:7,vars:1,consts:[["toast",""],[1,"sam-text-header"],[1,"loading-container"],[1,"sam-text-muted"],[1,"content"],[1,"form-group"],["for","name"],["id","name","type","text","placeholder","Your name","autocomplete","off",1,"form-control",3,"ngModelChange","ngModel"],["for","display_name"],["id","display_name","type","text","placeholder","Display name","autocomplete","off",1,"form-control",3,"ngModelChange","ngModel"],["for","picture"],["id","picture","type","url","placeholder","https://example.com/avatar.jpg","autocomplete","off",1,"form-control",3,"ngModelChange","ngModel"],["for","banner"],["id","banner","type","url","placeholder","https://example.com/banner.jpg","autocomplete","off",1,"form-control",3,"ngModelChange","ngModel"],["for","website"],["id","website","type","url","placeholder","https://yourwebsite.com","autocomplete","off",1,"form-control",3,"ngModelChange","ngModel"],["for","about"],["id","about","placeholder","Tell us about yourself...","rows","4",1,"form-control",3,"ngModelChange","ngModel"],["for","nip05"],["id","nip05","type","text","placeholder","you@example.com","autocomplete","off",1,"form-control",3,"ngModelChange","ngModel"],["for","lud16"],["id","lud16","type","text","placeholder","you@getalby.com","autocomplete","off",1,"form-control",3,"ngModelChange","ngModel"],["for","lnurl"],["id","lnurl","type","text","placeholder","lnurl1...","autocomplete","off",1,"form-control",3,"ngModelChange","ngModel"],[1,"sam-footer-grid-2"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"alert-container"],["role","alert",1,"alert","alert-danger","sam-flex-row","gap"],[1,"bi","bi-exclamation-triangle"]],template:function(r,i){1&r&&(y(0,"div",1)(1,"span"),R(2,"Edit Profile"),v()(),At(3,Wme,3,0,"div",2)(4,eCe,44,12),ot(5,"lib-toast",null,0)),2&r&&(J(3),tt(i.loading?3:4))},dependencies:[Ko,mo,Co,qi,id],styles:["[_nghost-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n[_nghost-%COMP%] .loading-container[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n[_nghost-%COMP%] .content[_ngcontent-%COMP%] {\n padding-left: var(--size);\n padding-right: var(--size);\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 12px;\n overflow-y: auto;\n padding-bottom: var(--size);\n}\n[_nghost-%COMP%] .form-group[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n[_nghost-%COMP%] .form-group[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-size: 12px;\n font-weight: 500;\n color: var(--muted-foreground);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n[_nghost-%COMP%] .form-group[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%] {\n font-size: 14px;\n background: var(--background-light);\n border: 1px solid var(--border);\n color: var(--foreground);\n border-radius: var(--radius);\n padding: 8px 12px;\n}\n[_nghost-%COMP%] .form-group[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: var(--primary);\n box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);\n}\n[_nghost-%COMP%] .form-group[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]::placeholder {\n color: var(--muted-foreground);\n opacity: 0.6;\n}\n[_nghost-%COMP%] .form-group[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%] {\n resize: vertical;\n min-height: 80px;\n}\n[_nghost-%COMP%] .alert-container[_ngcontent-%COMP%] {\n position: absolute;\n bottom: 70px;\n left: var(--size);\n right: var(--size);\n}"]})}return e})()},{path:"edit-identity/:id",component:tme,children:[{path:"home",component:nme},{path:"keys",component:ime},{path:"ncryptsec",component:lme},{path:"permissions",component:Cme},{path:"relays",component:Mme}]}],nCe={providers:[function Uj(e){const n=e?.ignoreChangesOutsideZone,t=e?.scheduleInRootZone,r=EB({ngZoneFactory:()=>{const i=BB(e);return i.scheduleInRootZone=t,i.shouldCoalesceEventChangeDetection&&li("NgZone_CoalesceEvent"),new tn(i)},ignoreChangesOutsideZone:n,scheduleInRootZone:t});return Ls([{provide:Pj,useValue:!0},{provide:_d,useValue:!1},r])}({eventCoalescing:!0}),function hee(e,...n){return Ls([{provide:YA,multi:!0,useValue:e},[],{provide:Vi,useFactory:qx,deps:[An]},{provide:Gl,multi:!0,useFactory:zx},n.map(t=>t.\u0275providers)])}(tCe)]};let rCe=(()=>{class e{#e=de(Uu);#t=de(Si);ngOnInit(){this.#t.initialize("Smesh Signer Firefox Extension"),this.#e.startOver(Hu())}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=Wt({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(r,i){1&r&&ot(0,"router-outlet")},dependencies:[du],encapsulation:2})}return e})();Array.prototype.empty||(Array.prototype.empty=function(){return 0===this.length}),Array.prototype.sortBy||(Array.prototype.sortBy=function(e,n){if(0===this.length)return[];let t=!0;"desc"===n&&(t=!1);const r=Array.from(this),i=e(r[0]);if("string"==typeof i)r.sort((o,s)=>t?(""+e(o)).localeCompare(e(s)):(""+e(s)).localeCompare(e(o)));else{if("number"!=typeof i)throw new Error("sortBy is not implemented for that type!");r.sort(t?(o,s)=>Number(e(o))-Number(e(s)):(o,s)=>Number(e(s))-Number(e(o)))}return r}),Array.prototype.groupBy||(Array.prototype.groupBy=function(e,n){const t=new Map,r=new Set(this.map(i=>e(i)));for(const i of r){const o=this.filter(s=>e(s)===i);t.set(i,n(o))}return t}),function MW(e,n,t){return AY({rootComponent:e,platformRef:t?.platformRef,...zN(n)})}(rCe,nCe).catch(e=>console.error(e))},4521(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.getHash=function S(I){return{hash:I}},g.createCurve=function _(I,T){const O=b=>(0,B.weierstrass)({...I,hash:b});return{...O(T),create:O}};const B=L(3040)},5299(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.wNAF=void 0,g.negateCt=T,g.normalizeZ=function O(q,j){const H=(0,S.FpInvertBatch)(q.Fp,j.map(U=>U.Z));return j.map((U,$)=>q.fromAffine(U.toAffine(H[$])))},g.mulEndoUnsafe=function fe(q,j,H,U){let $=j,ce=q.ZERO,te=q.ZERO;for(;H>_||U>_;)H&I&&(ce=ce.add($)),U&I&&(te=te.add($)),$=$.double(),H>>=I,U>>=I;return{p1:ce,p2:te}},g.pippenger=function ae(q,j,H,U){ee(H,q),Ie(U,j);const $=H.length,ce=U.length;if($!==ce)throw new Error("arrays of points and scalars must have equal length");const te=q.ZERO,K=(0,B.bitLen)(BigInt($));let D=1;K>12?D=K-3:K>4?D=K-2:K>0&&(D=2);const re=(0,B.bitMask)(D),P=new Array(Number(re)+1).fill(te);let pe=te;for(let Me=Math.floor((j.BITS-1)/D)*D;Me>=0;Me-=D){P.fill(te);for(let N=0;N<ce;N++){const V=Number(U[N]>>BigInt(Me)&re);P[V]=P[V].add(H[N])}let G=te;for(let N=P.length-1,M=te;N>0;N--)M=M.add(P[N]),G=G.add(M);if(pe=pe.add(G),0!==Me)for(let N=0;N<D;N++)pe=pe.double()}return pe},g.precomputeMSMUnsafe=function X(q,j,H,U){b(U,j.BITS),ee(H,q);const $=q.ZERO,ce=2**U-1,te=Math.ceil(j.BITS/U),K=(0,B.bitMask)(U),D=H.map(re=>{const P=[];for(let k=0,pe=re;k<ce;k++)P.push(pe),pe=pe.add(re);return P});return re=>{if(Ie(re,j),re.length>H.length)throw new Error("array of scalars must be smaller than array of points");let P=$;for(let k=0;k<te;k++){if(P!==$)for(let Me=0;Me<U;Me++)P=P.double();const pe=BigInt(te*U-(k+1)*U);for(let Me=0;Me<re.length;Me++){const N=Number(re[Me]>>pe&K);N&&(P=P.add(D[Me][N-1]))}}return P}},g.validateBasic=function ge(q){return(0,S.validateField)(q.Fp),(0,B.validateObject)(q,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,S.nLength)(q.n,q.nBitLength),...q,p:q.Fp.ORDER})},g._createCurveFields=function Te(q,j,H={},U){if(void 0===U&&(U="edwards"===q),!j||"object"!=typeof j)throw new Error(`expected valid ${q} CURVE object`);for(const D of["p","n","h"]){const re=j[D];if(!("bigint"==typeof re&&re>_))throw new Error(`CURVE.${D} must be positive bigint`)}const $=Se(j.p,H.Fp,U),ce=Se(j.n,H.Fn,U),K=["Gx","Gy","a","weierstrass"===q?"b":"d"];for(const D of K)if(!$.isValid(j[D]))throw new Error(`CURVE.${D} must be valid field element of CURVE.Fp`);return{CURVE:j=Object.freeze(Object.assign({},j)),Fp:$,Fn:ce}};const B=L(1780),S=L(3834),_=BigInt(0),I=BigInt(1);function T(q,j){const H=j.negate();return q?H:j}function b(q,j){if(!Number.isSafeInteger(q)||q<=0||q>j)throw new Error("invalid window size, expected [1.."+j+"], got W="+q)}function Z(q,j){b(q,j);const $=2**q;return{windows:Math.ceil(j/q)+1,windowSize:2**(q-1),mask:(0,B.bitMask)(q),maxNumber:$,shiftBy:BigInt(q)}}function ne(q,j,H){const{windowSize:U,mask:$,maxNumber:ce,shiftBy:te}=H;let K=Number(q&$),D=q>>te;K>U&&(K-=ce,D+=I);const re=j*U;return{nextN:D,offset:re+Math.abs(K)-1,isZero:0===K,isNeg:K<0,isNegF:j%2!=0,offsetF:re}}function ee(q,j){if(!Array.isArray(q))throw new Error("array expected");q.forEach((H,U)=>{if(!(H instanceof j))throw new Error("invalid point at index "+U)})}function Ie(q,j){if(!Array.isArray(q))throw new Error("array of scalars expected");q.forEach((H,U)=>{if(!j.isValid(H))throw new Error("invalid scalar at index "+U)})}const Ae=new WeakMap,z=new WeakMap;function W(q){return z.get(q)||1}function oe(q){if(q!==_)throw new Error("invalid wNAF")}function Se(q,j,H){if(j){if(j.ORDER!==q)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,S.validateField)(j),j}return(0,S.Field)(q,{isLE:H})}g.wNAF=class me{constructor(j,H){this.BASE=j.BASE,this.ZERO=j.ZERO,this.Fn=j.Fn,this.bits=H}_unsafeLadder(j,H,U=this.ZERO){let $=j;for(;H>_;)H&I&&(U=U.add($)),$=$.double(),H>>=I;return U}precomputeWindow(j,H){const{windows:U,windowSize:$}=Z(H,this.bits),ce=[];let te=j,K=te;for(let D=0;D<U;D++){K=te,ce.push(K);for(let re=1;re<$;re++)K=K.add(te),ce.push(K);te=K.double()}return ce}wNAF(j,H,U){if(!this.Fn.isValid(U))throw new Error("invalid scalar");let $=this.ZERO,ce=this.BASE;const te=Z(j,this.bits);for(let K=0;K<te.windows;K++){const{nextN:D,offset:re,isZero:P,isNeg:k,isNegF:pe,offsetF:Me}=ne(U,K,te);U=D,P?ce=ce.add(T(pe,H[Me])):$=$.add(T(k,H[re]))}return oe(U),{p:$,f:ce}}wNAFUnsafe(j,H,U,$=this.ZERO){const ce=Z(j,this.bits);for(let te=0;te<ce.windows&&U!==_;te++){const{nextN:K,offset:D,isZero:re,isNeg:P}=ne(U,te,ce);if(U=K,!re){const k=H[D];$=$.add(P?k.negate():k)}}return oe(U),$}getPrecomputes(j,H,U){let $=Ae.get(H);return $||($=this.precomputeWindow(H,j),1!==j&&("function"==typeof U&&($=U($)),Ae.set(H,$))),$}cached(j,H,U){const $=W(j);return this.wNAF($,this.getPrecomputes($,j,U),H)}unsafe(j,H,U,$){const ce=W(j);return 1===ce?this._unsafeLadder(j,H,$):this.wNAFUnsafe(ce,this.getPrecomputes(ce,j,U),H,$)}createCache(j,H){b(H,this.bits),z.set(j,H),Ae.delete(j)}hasCache(j){return 1!==W(j)}}},5752(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g._DST_scalar=void 0,g.expand_message_xmd=Z,g.expand_message_xof=ne,g.hash_to_field=ee,g.isogenyMap=function Ie(z,W){const oe=W.map(me=>Array.from(me).reverse());return(me,fe)=>{const[ae,X,ge,Se]=oe.map(j=>j.reduce((H,U)=>z.add(z.mul(H,me),U))),[Te,q]=(0,S.FpInvertBatch)(z,[X,Se],!0);return me=z.mul(ae,Te),fe=z.mul(fe,z.mul(ge,q)),{x:me,y:fe}}},g.createHasher=function Ae(z,W,oe){if("function"!=typeof W)throw new Error("mapToCurve() must be defined");function me(ae){return z.fromAffine(W(ae))}function fe(ae){const X=ae.clearCofactor();return X.equals(z.ZERO)?z.ZERO:(X.assertValidity(),X)}return{defaults:oe,hashToCurve(ae,X){const Se=ee(ae,2,Object.assign({},oe,X)),Te=me(Se[0]),q=me(Se[1]);return fe(Te.add(q))},encodeToCurve:(ae,X)=>fe(me(ee(ae,1,Object.assign({},oe,oe.encodeDST?{DST:oe.encodeDST}:{},X))[0])),mapToCurve(ae){if(!Array.isArray(ae))throw new Error("expected array of bigints");for(const X of ae)if("bigint"!=typeof X)throw new Error("expected array of bigints");return fe(me(ae))},hashToScalar:(ae,X)=>ee(ae,1,Object.assign({},oe,{p:z.Fn.ORDER,m:1,DST:g._DST_scalar},X))[0][0]}};const B=L(1780),S=L(3834),_=B.bytesToNumberBE;function I(z,W){if(O(z),O(W),z<0||z>=1<<8*W)throw new Error("invalid I2OSP input: "+z);const oe=Array.from({length:W}).fill(0);for(let me=W-1;me>=0;me--)oe[me]=255&z,z>>>=8;return new Uint8Array(oe)}function T(z,W){const oe=new Uint8Array(z.length);for(let me=0;me<z.length;me++)oe[me]=z[me]^W[me];return oe}function O(z){if(!Number.isSafeInteger(z))throw new Error("number expected")}function b(z){if(!(0,B.isBytes)(z)&&"string"!=typeof z)throw new Error("DST must be Uint8Array or string");return"string"==typeof z?(0,B.utf8ToBytes)(z):z}function Z(z,W,oe,me){(0,B.abytes)(z),O(oe),(W=b(W)).length>255&&(W=me((0,B.concatBytes)((0,B.utf8ToBytes)("H2C-OVERSIZE-DST-"),W)));const{outputLen:fe,blockLen:ae}=me,X=Math.ceil(oe/fe);if(oe>65535||X>255)throw new Error("expand_message_xmd: invalid lenInBytes");const ge=(0,B.concatBytes)(W,I(W.length,1)),Se=I(0,ae),Te=I(oe,2),q=new Array(X),j=me((0,B.concatBytes)(Se,z,Te,I(0,1),ge));q[0]=me((0,B.concatBytes)(j,I(1,1),ge));for(let U=1;U<=X;U++){const $=[T(j,q[U-1]),I(U+1,1),ge];q[U]=me((0,B.concatBytes)(...$))}return(0,B.concatBytes)(...q).slice(0,oe)}function ne(z,W,oe,me,fe){if((0,B.abytes)(z),O(oe),(W=b(W)).length>255){const ae=Math.ceil(2*me/8);W=fe.create({dkLen:ae}).update((0,B.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(W).digest()}if(oe>65535||W.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return fe.create({dkLen:oe}).update(z).update(I(oe,2)).update(W).update(I(W.length,1)).digest()}function ee(z,W,oe){(0,B._validateObject)(oe,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:me,k:fe,m:ae,hash:X,expand:ge,DST:Se}=oe;if(!(0,B.isHash)(oe.hash))throw new Error("expected valid hash");(0,B.abytes)(z),O(W);const Te=me.toString(2).length,q=Math.ceil((Te+fe)/8),j=W*ae*q;let H;if("xmd"===ge)H=Z(z,Se,j,X);else if("xof"===ge)H=ne(z,Se,j,fe,X);else{if("_internal_pass"!==ge)throw new Error('expand must be "xmd" or "xof"');H=z}const U=new Array(W);for(let $=0;$<W;$++){const ce=new Array(ae);for(let te=0;te<ae;te++){const K=q*(te+$*ae),D=H.subarray(K,K+q);ce[te]=(0,S.mod)(_(D),me)}U[$]=ce}return U}g._DST_scalar=(0,B.utf8ToBytes)("HashToScalar-")},3834(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.isNegativeLE=void 0,g.mod=Ae,g.pow=function z(N,M,V){return H(D(V),N,M)},g.pow2=function W(N,M,V){let ie=N;for(;M-- >S;)ie*=ie,ie%=V;return ie},g.invert=oe,g.tonelliShanks=ge,g.FpSqrt=Se,g.validateField=function j(N){const V=q.reduce((ie,ke)=>(ie[ke]="function",ie),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});return(0,B._validateObject)(N,V),N},g.FpPow=H,g.FpInvertBatch=U,g.FpDiv=function $(N,M,V){return N.mul(M,"bigint"==typeof V?oe(V,N.ORDER):N.inv(V))},g.FpLegendre=ce,g.FpIsSquare=function te(N,M){return 1===ce(N,M)},g.nLength=K,g.Field=D,g.FpSqrtOdd=function re(N,M){if(!N.isOdd)throw new Error("Field doesn't have isOdd");const V=N.sqrt(M);return N.isOdd(V)?V:N.neg(V)},g.FpSqrtEven=function P(N,M){if(!N.isOdd)throw new Error("Field doesn't have isOdd");const V=N.sqrt(M);return N.isOdd(V)?N.neg(V):V},g.hashToPrivateScalar=function k(N,M,V=!1){const ie=(N=(0,B.ensureBytes)("privateHash",N)).length,ke=K(M).nByteLength+8;if(ke<24||ie<ke||ie>1024)throw new Error("hashToPrivateScalar: expected "+ke+"-1024 bytes of input, got "+ie);return Ae(V?(0,B.bytesToNumberLE)(N):(0,B.bytesToNumberBE)(N),M-_)+_},g.getFieldBytesLength=pe,g.getMinHashLength=Me,g.mapHashToField=function G(N,M,V=!1){const ie=N.length,ke=pe(M),Oe=Me(M);if(ie<16||ie<Oe||ie>1024)throw new Error("expected "+Oe+"-1024 bytes of input, got "+ie);const Fe=Ae(V?(0,B.bytesToNumberLE)(N):(0,B.bytesToNumberBE)(N),M-_)+_;return V?(0,B.numberToBytesLE)(Fe,ke):(0,B.numberToBytesBE)(Fe,ke)};const B=L(1780),S=BigInt(0),_=BigInt(1),I=BigInt(2),T=BigInt(3),O=BigInt(4),b=BigInt(5),Z=BigInt(7),ne=BigInt(8),ee=BigInt(9),Ie=BigInt(16);function Ae(N,M){const V=N%M;return V>=S?V:M+V}function oe(N,M){if(N===S)throw new Error("invert: expected non-zero number");if(M<=S)throw new Error("invert: expected positive modulus, got "+M);let V=Ae(N,M),ie=M,ke=S,Oe=_,Ce=_,Fe=S;for(;V!==S;){const je=ie/V,nt=ie%V,ut=ke-Ce*je,ve=Oe-Fe*je;ie=V,V=nt,ke=Ce,Oe=Fe,Ce=ut,Fe=ve}if(ie!==_)throw new Error("invert: does not exist");return Ae(ke,M)}function me(N,M,V){if(!N.eql(N.sqr(M),V))throw new Error("Cannot find square root")}function fe(N,M){const ie=N.pow(M,(N.ORDER+_)/O);return me(N,ie,M),ie}function ae(N,M){const V=(N.ORDER-b)/ne,ie=N.mul(M,I),ke=N.pow(ie,V),Oe=N.mul(M,ke),Ce=N.mul(N.mul(Oe,I),ke),Fe=N.mul(Oe,N.sub(Ce,N.ONE));return me(N,Fe,M),Fe}function ge(N){if(N<T)throw new Error("sqrt is not defined for small field");let M=N-_,V=0;for(;M%I===S;)M/=I,V++;let ie=I;const ke=D(N);for(;1===ce(ke,ie);)if(ie++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===V)return fe;let Oe=ke.pow(ie,M);const Ce=(M+_)/I;return function(xe,je){if(xe.is0(je))return je;if(1!==ce(xe,je))throw new Error("Cannot find square root");let nt=V,ut=xe.mul(xe.ONE,Oe),ve=xe.pow(je,M),et=xe.pow(je,Ce);for(;!xe.eql(ve,xe.ONE);){if(xe.is0(ve))return xe.ZERO;let Pt=1,Gt=xe.sqr(ve);for(;!xe.eql(Gt,xe.ONE);)if(Pt++,Gt=xe.sqr(Gt),Pt===nt)throw new Error("Cannot find square root");const fn=_<<BigInt(nt-Pt-1),In=xe.pow(ut,fn);nt=Pt,ut=xe.sqr(In),ve=xe.mul(ve,ut),et=xe.mul(et,In)}return et}}function Se(N){return N%O===T?fe:N%ne===b?ae:N%Ie===ee?function X(N){const M=D(N),V=ge(N),ie=V(M,M.neg(M.ONE)),ke=V(M,ie),Oe=V(M,M.neg(ie)),Ce=(N+Z)/Ie;return(Fe,xe)=>{let je=Fe.pow(xe,Ce),nt=Fe.mul(je,ie);const ut=Fe.mul(je,ke),ve=Fe.mul(je,Oe),et=Fe.eql(Fe.sqr(nt),xe),Pt=Fe.eql(Fe.sqr(ut),xe);je=Fe.cmov(je,nt,et),nt=Fe.cmov(ve,ut,Pt);const Gt=Fe.eql(Fe.sqr(nt),xe),fn=Fe.cmov(je,nt,Gt);return me(Fe,fn,xe),fn}}(N):ge(N)}g.isNegativeLE=(N,M)=>(Ae(N,M)&_)===_;const q=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function H(N,M,V){if(V<S)throw new Error("invalid exponent, negatives unsupported");if(V===S)return N.ONE;if(V===_)return M;let ie=N.ONE,ke=M;for(;V>S;)V&_&&(ie=N.mul(ie,ke)),ke=N.sqr(ke),V>>=_;return ie}function U(N,M,V=!1){const ie=new Array(M.length).fill(V?N.ZERO:void 0),ke=M.reduce((Ce,Fe,xe)=>N.is0(Fe)?Ce:(ie[xe]=Ce,N.mul(Ce,Fe)),N.ONE),Oe=N.inv(ke);return M.reduceRight((Ce,Fe,xe)=>N.is0(Fe)?Ce:(ie[xe]=N.mul(Ce,ie[xe]),N.mul(Ce,Fe)),Oe),ie}function ce(N,M){const ie=N.pow(M,(N.ORDER-_)/I),ke=N.eql(ie,N.ONE),Oe=N.eql(ie,N.ZERO),Ce=N.eql(ie,N.neg(N.ONE));if(!ke&&!Oe&&!Ce)throw new Error("invalid Legendre symbol result");return ke?1:Oe?0:-1}function K(N,M){void 0!==M&&(0,B.anumber)(M);const V=void 0!==M?M:N.toString(2).length;return{nBitLength:V,nByteLength:Math.ceil(V/8)}}function D(N,M,V=!1,ie={}){if(N<=S)throw new Error("invalid field: expected ORDER > 0, got "+N);let ke,Oe,Fe,Ce=!1;if("object"==typeof M&&null!=M){if(ie.sqrt||V)throw new Error("cannot specify opts in two arguments");M.BITS&&(ke=M.BITS),M.sqrt&&(Oe=M.sqrt),"boolean"==typeof M.isLE&&(V=M.isLE),"boolean"==typeof M.modFromBytes&&(Ce=M.modFromBytes),Fe=M.allowedLengths}else"number"==typeof M&&(ke=M),ie.sqrt&&(Oe=ie.sqrt);const{nBitLength:xe,nByteLength:je}=K(N,ke);if(je>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let nt;const ut=Object.freeze({ORDER:N,isLE:V,BITS:xe,BYTES:je,MASK:(0,B.bitMask)(xe),ZERO:S,ONE:_,allowedLengths:Fe,create:ve=>Ae(ve,N),isValid:ve=>{if("bigint"!=typeof ve)throw new Error("invalid field element: expected bigint, got "+typeof ve);return S<=ve&&ve<N},is0:ve=>ve===S,isValidNot0:ve=>!ut.is0(ve)&&ut.isValid(ve),isOdd:ve=>(ve&_)===_,neg:ve=>Ae(-ve,N),eql:(ve,et)=>ve===et,sqr:ve=>Ae(ve*ve,N),add:(ve,et)=>Ae(ve+et,N),sub:(ve,et)=>Ae(ve-et,N),mul:(ve,et)=>Ae(ve*et,N),pow:(ve,et)=>H(ut,ve,et),div:(ve,et)=>Ae(ve*oe(et,N),N),sqrN:ve=>ve*ve,addN:(ve,et)=>ve+et,subN:(ve,et)=>ve-et,mulN:(ve,et)=>ve*et,inv:ve=>oe(ve,N),sqrt:Oe||(ve=>(nt||(nt=Se(N)),nt(ut,ve))),toBytes:ve=>V?(0,B.numberToBytesLE)(ve,je):(0,B.numberToBytesBE)(ve,je),fromBytes:(ve,et=!0)=>{if(Fe){if(!Fe.includes(ve.length)||ve.length>je)throw new Error("Field.fromBytes: expected "+Fe+" bytes, got "+ve.length);const Gt=new Uint8Array(je);Gt.set(ve,V?0:Gt.length-ve.length),ve=Gt}if(ve.length!==je)throw new Error("Field.fromBytes: expected "+je+" bytes, got "+ve.length);let Pt=V?(0,B.bytesToNumberLE)(ve):(0,B.bytesToNumberBE)(ve);if(Ce&&(Pt=Ae(Pt,N)),!et&&!ut.isValid(Pt))throw new Error("invalid field element: outside of range 0..ORDER");return Pt},invertBatch:ve=>U(ut,ve),cmov:(ve,et,Pt)=>Pt?et:ve});return Object.freeze(ut)}function pe(N){if("bigint"!=typeof N)throw new Error("field order must be bigint");const M=N.toString(2).length;return Math.ceil(M/8)}function Me(N){const M=pe(N);return M+Math.ceil(M/2)}},4097(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.isHash=g.validateObject=g.memoized=g.notImplemented=g.createHmacDrbg=g.bitMask=g.bitSet=g.bitGet=g.bitLen=g.aInRange=g.inRange=g.asciiToBytes=g.copyBytes=g.equalBytes=g.ensureBytes=g.numberToVarBytesBE=g.numberToBytesLE=g.numberToBytesBE=g.bytesToNumberLE=g.bytesToNumberBE=g.hexToNumber=g.numberToHexUnpadded=g.abool=g.utf8ToBytes=g.randomBytes=g.isBytes=g.hexToBytes=g.concatBytes=g.bytesToUtf8=g.bytesToHex=g.anumber=g.abytes=void 0;const B=L(1780);g.abytes=B.abytes,g.anumber=B.anumber,g.bytesToHex=B.bytesToHex,g.bytesToUtf8=B.bytesToUtf8,g.concatBytes=B.concatBytes,g.hexToBytes=B.hexToBytes,g.isBytes=B.isBytes,g.randomBytes=B.randomBytes,g.utf8ToBytes=B.utf8ToBytes,g.abool=B.abool,g.numberToHexUnpadded=B.numberToHexUnpadded,g.hexToNumber=B.hexToNumber,g.bytesToNumberBE=B.bytesToNumberBE,g.bytesToNumberLE=B.bytesToNumberLE,g.numberToBytesBE=B.numberToBytesBE,g.numberToBytesLE=B.numberToBytesLE,g.numberToVarBytesBE=B.numberToVarBytesBE,g.ensureBytes=B.ensureBytes,g.equalBytes=B.equalBytes,g.copyBytes=B.copyBytes,g.asciiToBytes=B.asciiToBytes,g.inRange=B.inRange,g.aInRange=B.aInRange,g.bitLen=B.bitLen,g.bitGet=B.bitGet,g.bitSet=B.bitSet,g.bitMask=B.bitMask,g.createHmacDrbg=B.createHmacDrbg,g.notImplemented=B.notImplemented,g.memoized=B.memoized,g.validateObject=B.validateObject,g.isHash=B.isHash},3040(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.DER=g.DERErr=void 0,g._splitEndoScalar=b,g._normFnElement=me,g.weierstrassN=fe,g.SWUFpSqrtRatio=X,g.mapToCurveSimpleSWU=function ge(D,re){(0,T.validateField)(D);const{A:P,B:k,Z:pe}=re;if(!D.isValid(P)||!D.isValid(k)||!D.isValid(pe))throw new Error("mapToCurveSimpleSWU: invalid opts");const Me=X(D,pe);if(!D.isOdd)throw new Error("Field does not have .isOdd()");return G=>{let N,M,V,ie,ke,Oe,Ce,Fe;N=D.sqr(G),N=D.mul(N,pe),M=D.sqr(N),M=D.add(M,N),V=D.add(M,D.ONE),V=D.mul(V,k),ie=D.cmov(pe,D.neg(M),!D.eql(M,D.ZERO)),ie=D.mul(ie,P),M=D.sqr(V),Oe=D.sqr(ie),ke=D.mul(Oe,P),M=D.add(M,ke),M=D.mul(M,V),Oe=D.mul(Oe,ie),ke=D.mul(Oe,k),M=D.add(M,ke),Ce=D.mul(N,V);const{isValid:xe,value:je}=Me(M,Oe);Fe=D.mul(N,G),Fe=D.mul(Fe,je),Ce=D.cmov(Ce,V,xe),Fe=D.cmov(Fe,je,xe);const nt=D.isOdd(G)===D.isOdd(Fe);Fe=D.cmov(D.neg(Fe),Fe,nt);const ut=(0,T.FpInvertBatch)(D,[ie],!0)[0];return Ce=D.mul(Ce,ut),{x:Ce,y:Fe}}},g.ecdh=Te,g.ecdsa=q,g.weierstrassPoints=function j(D){const{CURVE:re,curveOpts:P}=H(D);return function ce(D,re){const{Fp:P,Fn:k}=re;const Me=$(P,D.a,D.b);return Object.assign({},{CURVE:D,Point:re,ProjectivePoint:re,normPrivateKeyToScalar:G=>me(k,G),weierstrassEquation:Me,isWithinCurveOrder:function pe(G){return(0,_.inRange)(G,Ae,k.ORDER)}})}(D,fe(re,P))},g._legacyHelperEquat=$,g.weierstrass=function K(D){const{CURVE:re,curveOpts:P,hash:k,ecdsaOpts:pe}=function U(D){const{CURVE:re,curveOpts:P}=H(D);return{CURVE:re,curveOpts:P,hash:D.hash,ecdsaOpts:{hmac:D.hmac,randomBytes:D.randomBytes,lowS:D.lowS,bits2int:D.bits2int,bits2int_modN:D.bits2int_modN}}}(D);return function te(D,re){const P=re.Point;return Object.assign({},re,{ProjectivePoint:P,CURVE:Object.assign({},D,(0,T.nLength)(P.Fn.ORDER,P.Fn.BITS))})}(D,q(fe(re,P),k,pe))};const B=L(4882),S=L(6492),_=L(1780),I=L(5299),T=L(3834),O=(D,re)=>(D+(D>=0?re:-re)/z)/re;function b(D,re,P){const[[k,pe],[Me,G]]=re,N=O(G*D,P),M=O(-pe*D,P);let V=D-N*k-M*Me,ie=-N*pe-M*G;const ke=V<Ie,Oe=ie<Ie;ke&&(V=-V),Oe&&(ie=-ie);const Ce=(0,_.bitMask)(Math.ceil((0,_.bitLen)(P)/2))+Ae;if(V<Ie||V>=Ce||ie<Ie||ie>=Ce)throw new Error("splitScalar (endomorphism): failed, k="+D);return{k1neg:ke,k1:V,k2neg:Oe,k2:ie}}function Z(D){if(!["compact","recovered","der"].includes(D))throw new Error('Signature format must be "compact", "recovered", or "der"');return D}function ne(D,re){const P={};for(let k of Object.keys(re))P[k]=void 0===D[k]?re[k]:D[k];return(0,_._abool2)(P.lowS,"lowS"),(0,_._abool2)(P.prehash,"prehash"),void 0!==P.format&&Z(P.format),P}class ee extends Error{constructor(re=""){super(re)}}g.DERErr=ee,g.DER={Err:ee,_tlv:{encode:(D,re)=>{const{Err:P}=g.DER;if(D<0||D>256)throw new P("tlv.encode: wrong tag");if(1&re.length)throw new P("tlv.encode: unpadded data");const k=re.length/2,pe=(0,_.numberToHexUnpadded)(k);if(pe.length/2&128)throw new P("tlv.encode: long form length too big");const Me=k>127?(0,_.numberToHexUnpadded)(pe.length/2|128):"";return(0,_.numberToHexUnpadded)(D)+Me+pe+re},decode(D,re){const{Err:P}=g.DER;let k=0;if(D<0||D>256)throw new P("tlv.encode: wrong tag");if(re.length<2||re[k++]!==D)throw new P("tlv.decode: wrong tlv");const pe=re[k++];let G=0;if(128&pe){const M=127&pe;if(!M)throw new P("tlv.decode(long): indefinite length not supported");if(M>4)throw new P("tlv.decode(long): byte length is too big");const V=re.subarray(k,k+M);if(V.length!==M)throw new P("tlv.decode: length bytes not complete");if(0===V[0])throw new P("tlv.decode(long): zero leftmost byte");for(const ie of V)G=G<<8|ie;if(k+=M,G<128)throw new P("tlv.decode(long): not minimal encoding")}else G=pe;const N=re.subarray(k,k+G);if(N.length!==G)throw new P("tlv.decode: wrong value length");return{v:N,l:re.subarray(k+G)}}},_int:{encode(D){const{Err:re}=g.DER;if(D<Ie)throw new re("integer: negative integers are not allowed");let P=(0,_.numberToHexUnpadded)(D);if(8&Number.parseInt(P[0],16)&&(P="00"+P),1&P.length)throw new re("unexpected DER parsing assertion: unpadded hex");return P},decode(D){const{Err:re}=g.DER;if(128&D[0])throw new re("invalid signature integer: negative");if(0===D[0]&&!(128&D[1]))throw new re("invalid signature integer: unnecessary leading zero");return(0,_.bytesToNumberBE)(D)}},toSig(D){const{Err:re,_int:P,_tlv:k}=g.DER,pe=(0,_.ensureBytes)("signature",D),{v:Me,l:G}=k.decode(48,pe);if(G.length)throw new re("invalid signature: left bytes after parsing");const{v:N,l:M}=k.decode(2,Me),{v:V,l:ie}=k.decode(2,M);if(ie.length)throw new re("invalid signature: left bytes after parsing");return{r:P.decode(N),s:P.decode(V)}},hexFromSig(D){const{_tlv:re,_int:P}=g.DER,k=re.encode(2,P.encode(D.r)),pe=re.encode(2,P.encode(D.s));return re.encode(48,k+pe)}};const Ie=BigInt(0),Ae=BigInt(1),z=BigInt(2),W=BigInt(3),oe=BigInt(4);function me(D,re){const{BYTES:P}=D;let k;if("bigint"==typeof re)k=re;else{let pe=(0,_.ensureBytes)("private key",re);try{k=D.fromBytes(pe)}catch{throw new Error(`invalid private key: expected ui8a of size ${P}, got ${typeof re}`)}}if(!D.isValidNot0(k))throw new Error("invalid private key: out of range [1..N-1]");return k}function fe(D,re={}){const P=(0,I._createCurveFields)("weierstrass",D,re),{Fp:k,Fn:pe}=P;let Me=P.CURVE;const{h:G,n:N}=Me;(0,_._validateObject)(re,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:M}=re;if(M&&(!k.is0(Me.a)||"bigint"!=typeof M.beta||!Array.isArray(M.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const V=Se(k,pe);function ie(){if(!k.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const Ce=re.toBytes||function ke(Kt,Ke,Ne){const{x:He,y:w}=Ke.toAffine(),h=k.toBytes(He);if((0,_._abool2)(Ne,"isCompressed"),Ne){ie();const m=!k.isOdd(w);return(0,_.concatBytes)(ae(m),h)}return(0,_.concatBytes)(Uint8Array.of(4),h,k.toBytes(w))},Fe=re.fromBytes||function Oe(Kt){(0,_._abytes2)(Kt,void 0,"Point");const{publicKey:Ke,publicKeyUncompressed:Ne}=V,He=Kt.length,w=Kt[0],h=Kt.subarray(1);if(He!==Ke||2!==w&&3!==w){if(He===Ne&&4===w){const m=k.BYTES,x=k.fromBytes(h.subarray(0,m)),Y=k.fromBytes(h.subarray(m,2*m));if(!je(x,Y))throw new Error("bad point: is not on curve");return{x,y:Y}}throw new Error(`bad point: got length ${He}, expected compressed=${Ke} or uncompressed=${Ne}`)}{const m=k.fromBytes(h);if(!k.isValid(m))throw new Error("bad point: is not on curve, wrong x");const x=xe(m);let Y;try{Y=k.sqrt(x)}catch(at){const Et=at instanceof Error?": "+at.message:"";throw new Error("bad point: is not on curve, sqrt error"+Et)}return ie(),!(1&~w)!==k.isOdd(Y)&&(Y=k.neg(Y)),{x:m,y:Y}}};function xe(Kt){const Ke=k.sqr(Kt),Ne=k.mul(Ke,Kt);return k.add(k.add(Ne,k.mul(Kt,Me.a)),Me.b)}function je(Kt,Ke){const Ne=k.sqr(Ke),He=xe(Kt);return k.eql(Ne,He)}if(!je(Me.Gx,Me.Gy))throw new Error("bad curve params: generator point");const nt=k.mul(k.pow(Me.a,W),oe),ut=k.mul(k.sqr(Me.b),BigInt(27));if(k.is0(k.add(nt,ut)))throw new Error("bad curve params: a or b");function ve(Kt,Ke,Ne=!1){if(!k.isValid(Ke)||Ne&&k.is0(Ke))throw new Error(`bad point coordinate ${Kt}`);return Ke}function et(Kt){if(!(Kt instanceof wt))throw new Error("ProjectivePoint expected")}function Pt(Kt){if(!M||!M.basises)throw new Error("no endo");return b(Kt,M.basises,pe.ORDER)}const Gt=(0,_.memoized)((Kt,Ke)=>{const{X:Ne,Y:He,Z:w}=Kt;if(k.eql(w,k.ONE))return{x:Ne,y:He};const h=Kt.is0();null==Ke&&(Ke=h?k.ONE:k.inv(w));const m=k.mul(Ne,Ke),x=k.mul(He,Ke),Y=k.mul(w,Ke);if(h)return{x:k.ZERO,y:k.ZERO};if(!k.eql(Y,k.ONE))throw new Error("invZ was invalid");return{x:m,y:x}}),fn=(0,_.memoized)(Kt=>{if(Kt.is0()){if(re.allowInfinityPoint&&!k.is0(Kt.Y))return;throw new Error("bad point: ZERO")}const{x:Ke,y:Ne}=Kt.toAffine();if(!k.isValid(Ke)||!k.isValid(Ne))throw new Error("bad point: x or y not field elements");if(!je(Ke,Ne))throw new Error("bad point: equation left != right");if(!Kt.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function In(Kt,Ke,Ne,He,w){return Ne=new wt(k.mul(Ne.X,Kt),Ne.Y,Ne.Z),Ke=(0,I.negateCt)(He,Ke),Ne=(0,I.negateCt)(w,Ne),Ke.add(Ne)}class wt{constructor(Ke,Ne,He){this.X=ve("x",Ke),this.Y=ve("y",Ne,!0),this.Z=ve("z",He),Object.freeze(this)}static CURVE(){return Me}static fromAffine(Ke){const{x:Ne,y:He}=Ke||{};if(!Ke||!k.isValid(Ne)||!k.isValid(He))throw new Error("invalid affine point");if(Ke instanceof wt)throw new Error("projective point not allowed");return k.is0(Ne)&&k.is0(He)?wt.ZERO:new wt(Ne,He,k.ONE)}static fromBytes(Ke){const Ne=wt.fromAffine(Fe((0,_._abytes2)(Ke,void 0,"point")));return Ne.assertValidity(),Ne}static fromHex(Ke){return wt.fromBytes((0,_.ensureBytes)("pointHex",Ke))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(Ke=8,Ne=!0){return Qn.createCache(this,Ke),Ne||this.multiply(W),this}assertValidity(){fn(this)}hasEvenY(){const{y:Ke}=this.toAffine();if(!k.isOdd)throw new Error("Field doesn't support isOdd");return!k.isOdd(Ke)}equals(Ke){et(Ke);const{X:Ne,Y:He,Z:w}=this,{X:h,Y:m,Z:x}=Ke,Y=k.eql(k.mul(Ne,x),k.mul(h,w)),ue=k.eql(k.mul(He,x),k.mul(m,w));return Y&&ue}negate(){return new wt(this.X,k.neg(this.Y),this.Z)}double(){const{a:Ke,b:Ne}=Me,He=k.mul(Ne,W),{X:w,Y:h,Z:m}=this;let x=k.ZERO,Y=k.ZERO,ue=k.ZERO,ye=k.mul(w,w),at=k.mul(h,h),Et=k.mul(m,m),dt=k.mul(w,h);return dt=k.add(dt,dt),ue=k.mul(w,m),ue=k.add(ue,ue),x=k.mul(Ke,ue),Y=k.mul(He,Et),Y=k.add(x,Y),x=k.sub(at,Y),Y=k.add(at,Y),Y=k.mul(x,Y),x=k.mul(dt,x),ue=k.mul(He,ue),Et=k.mul(Ke,Et),dt=k.sub(ye,Et),dt=k.mul(Ke,dt),dt=k.add(dt,ue),ue=k.add(ye,ye),ye=k.add(ue,ye),ye=k.add(ye,Et),ye=k.mul(ye,dt),Y=k.add(Y,ye),Et=k.mul(h,m),Et=k.add(Et,Et),ye=k.mul(Et,dt),x=k.sub(x,ye),ue=k.mul(Et,at),ue=k.add(ue,ue),ue=k.add(ue,ue),new wt(x,Y,ue)}add(Ke){et(Ke);const{X:Ne,Y:He,Z:w}=this,{X:h,Y:m,Z:x}=Ke;let Y=k.ZERO,ue=k.ZERO,ye=k.ZERO;const at=Me.a,Et=k.mul(Me.b,W);let dt=k.mul(Ne,h),Dt=k.mul(He,m),vt=k.mul(w,x),xr=k.add(Ne,He),wn=k.add(h,m);xr=k.mul(xr,wn),wn=k.add(dt,Dt),xr=k.sub(xr,wn),wn=k.add(Ne,w);let Mn=k.add(h,x);return wn=k.mul(wn,Mn),Mn=k.add(dt,vt),wn=k.sub(wn,Mn),Mn=k.add(He,w),Y=k.add(m,x),Mn=k.mul(Mn,Y),Y=k.add(Dt,vt),Mn=k.sub(Mn,Y),ye=k.mul(at,wn),Y=k.mul(Et,vt),ye=k.add(Y,ye),Y=k.sub(Dt,ye),ye=k.add(Dt,ye),ue=k.mul(Y,ye),Dt=k.add(dt,dt),Dt=k.add(Dt,dt),vt=k.mul(at,vt),wn=k.mul(Et,wn),Dt=k.add(Dt,vt),vt=k.sub(dt,vt),vt=k.mul(at,vt),wn=k.add(wn,vt),dt=k.mul(Dt,wn),ue=k.add(ue,dt),dt=k.mul(Mn,wn),Y=k.mul(xr,Y),Y=k.sub(Y,dt),dt=k.mul(xr,Dt),ye=k.mul(Mn,ye),ye=k.add(ye,dt),new wt(Y,ue,ye)}subtract(Ke){return this.add(Ke.negate())}is0(){return this.equals(wt.ZERO)}multiply(Ke){const{endo:Ne}=re;if(!pe.isValidNot0(Ke))throw new Error("invalid scalar: out of range");let He,w;const h=m=>Qn.cached(this,m,x=>(0,I.normalizeZ)(wt,x));if(Ne){const{k1neg:m,k1:x,k2neg:Y,k2:ue}=Pt(Ke),{p:ye,f:at}=h(x),{p:Et,f:dt}=h(ue);w=at.add(dt),He=In(Ne.beta,ye,Et,m,Y)}else{const{p:m,f:x}=h(Ke);He=m,w=x}return(0,I.normalizeZ)(wt,[He,w])[0]}multiplyUnsafe(Ke){const{endo:Ne}=re,He=this;if(!pe.isValid(Ke))throw new Error("invalid scalar: out of range");if(Ke===Ie||He.is0())return wt.ZERO;if(Ke===Ae)return He;if(Qn.hasCache(this))return this.multiply(Ke);if(Ne){const{k1neg:w,k1:h,k2neg:m,k2:x}=Pt(Ke),{p1:Y,p2:ue}=(0,I.mulEndoUnsafe)(wt,He,h,x);return In(Ne.beta,Y,ue,w,m)}return Qn.unsafe(He,Ke)}multiplyAndAddUnsafe(Ke,Ne,He){const w=this.multiplyUnsafe(Ne).add(Ke.multiplyUnsafe(He));return w.is0()?void 0:w}toAffine(Ke){return Gt(this,Ke)}isTorsionFree(){const{isTorsionFree:Ke}=re;return G===Ae||(Ke?Ke(wt,this):Qn.unsafe(this,N).is0())}clearCofactor(){const{clearCofactor:Ke}=re;return G===Ae?this:Ke?Ke(wt,this):this.multiplyUnsafe(G)}isSmallOrder(){return this.multiplyUnsafe(G).is0()}toBytes(Ke=!0){return(0,_._abool2)(Ke,"isCompressed"),this.assertValidity(),Ce(wt,this,Ke)}toHex(Ke=!0){return(0,_.bytesToHex)(this.toBytes(Ke))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(Ke=!0){return this.toBytes(Ke)}_setWindowSize(Ke){this.precompute(Ke)}static normalizeZ(Ke){return(0,I.normalizeZ)(wt,Ke)}static msm(Ke,Ne){return(0,I.pippenger)(wt,pe,Ke,Ne)}static fromPrivateKey(Ke){return wt.BASE.multiply(me(pe,Ke))}}wt.BASE=new wt(Me.Gx,Me.Gy,k.ONE),wt.ZERO=new wt(k.ZERO,k.ONE,k.ZERO),wt.Fp=k,wt.Fn=pe;const Zn=pe.BITS,Qn=new I.wNAF(wt,re.endo?Math.ceil(Zn/2):Zn);return wt.BASE.precompute(8),wt}function ae(D){return Uint8Array.of(D?2:3)}function X(D,re){const P=D.ORDER;let k=Ie;for(let Fe=P-Ae;Fe%z===Ie;Fe/=z)k+=Ae;const pe=k,Me=z<<pe-Ae-Ae,G=Me*z,N=(P-Ae)/G,M=(N-Ae)/z,V=G-Ae,ie=Me,ke=D.pow(re,N),Oe=D.pow(re,(N+Ae)/z);let Ce=(Fe,xe)=>{let je=ke,nt=D.pow(xe,V),ut=D.sqr(nt);ut=D.mul(ut,xe);let ve=D.mul(Fe,ut);ve=D.pow(ve,M),ve=D.mul(ve,nt),nt=D.mul(ve,xe),ut=D.mul(ve,Fe);let et=D.mul(ut,nt);ve=D.pow(et,ie);let Pt=D.eql(ve,D.ONE);nt=D.mul(ut,Oe),ve=D.mul(et,je),ut=D.cmov(nt,ut,Pt),et=D.cmov(ve,et,Pt);for(let Gt=pe;Gt>Ae;Gt--){let fn=Gt-z;fn=z<<fn-Ae;let In=D.pow(et,fn);const wt=D.eql(In,D.ONE);nt=D.mul(ut,je),je=D.mul(je,je),In=D.mul(et,je),ut=D.cmov(nt,ut,wt),et=D.cmov(In,et,wt)}return{isValid:Pt,value:ut}};if(D.ORDER%oe===W){const Fe=(D.ORDER-W)/oe,xe=D.sqrt(D.neg(re));Ce=(je,nt)=>{let ut=D.sqr(nt);const ve=D.mul(je,nt);ut=D.mul(ut,ve);let et=D.pow(ut,Fe);et=D.mul(et,ve);const Pt=D.mul(et,xe),Gt=D.mul(D.sqr(et),nt),fn=D.eql(Gt,je);return{isValid:fn,value:D.cmov(Pt,et,fn)}}}return Ce}function Se(D,re){return{secretKey:re.BYTES,publicKey:1+D.BYTES,publicKeyUncompressed:1+2*D.BYTES,publicKeyHasPrefix:!0,signature:2*re.BYTES}}function Te(D,re={}){const{Fn:P}=D,k=re.randomBytes||_.randomBytes,pe=Object.assign(Se(D.Fp,P),{seed:(0,T.getMinHashLength)(P.ORDER)});function Me(Ce){try{return!!me(P,Ce)}catch{return!1}}function N(Ce=k(pe.seed)){return(0,T.mapHashToField)((0,_._abytes2)(Ce,pe.seed,"seed"),P.ORDER)}function M(Ce,Fe=!0){return D.BASE.multiply(me(P,Ce)).toBytes(Fe)}function ie(Ce){if("bigint"==typeof Ce)return!1;if(Ce instanceof D)return!0;const{secretKey:Fe,publicKey:xe,publicKeyUncompressed:je}=pe;if(P.allowedLengths||Fe===xe)return;const nt=(0,_.ensureBytes)("key",Ce).length;return nt===xe||nt===je}return Object.freeze({getPublicKey:M,getSharedSecret:function ke(Ce,Fe,xe=!0){if(!0===ie(Ce))throw new Error("first arg must be private key");if(!1===ie(Fe))throw new Error("second arg must be public key");const je=me(P,Ce);return D.fromHex(Fe).multiply(je).toBytes(xe)},keygen:function V(Ce){const Fe=N(Ce);return{secretKey:Fe,publicKey:M(Fe)}},Point:D,utils:{isValidSecretKey:Me,isValidPublicKey:function G(Ce,Fe){const{publicKey:xe,publicKeyUncompressed:je}=pe;try{const nt=Ce.length;return!(!0===Fe&&nt!==xe||!1===Fe&&nt!==je||!D.fromBytes(Ce))}catch{return!1}},randomSecretKey:N,isValidPrivateKey:Me,randomPrivateKey:N,normPrivateKeyToScalar:Ce=>me(P,Ce),precompute:(Ce=8,Fe=D.BASE)=>Fe.precompute(Ce,!1)},lengths:pe})}function q(D,re,P={}){(0,S.ahash)(re),(0,_._validateObject)(P,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const k=P.randomBytes||_.randomBytes,pe=P.hmac||((Ne,...He)=>(0,B.hmac)(re,Ne,(0,_.concatBytes)(...He))),{Fp:Me,Fn:G}=D,{ORDER:N,BITS:M}=G,{keygen:V,getPublicKey:ie,getSharedSecret:ke,utils:Oe,lengths:Ce}=Te(D,P),Fe={prehash:!1,lowS:"boolean"==typeof P.lowS&&P.lowS,format:void 0,extraEntropy:!1},xe="compact";function je(Ne){return Ne>N>>Ae}function nt(Ne,He){if(!G.isValidNot0(He))throw new Error(`invalid signature ${Ne}: out of range 1..Point.Fn.ORDER`);return He}class ve{constructor(He,w,h){this.r=nt("r",He),this.s=nt("s",w),null!=h&&(this.recovery=h),Object.freeze(this)}static fromBytes(He,w=xe){let h;if(function ut(Ne,He){Z(He);const w=Ce.signature;(0,_._abytes2)(Ne,"compact"===He?w:"recovered"===He?w+1:void 0,`${He} signature`)}(He,w),"der"===w){const{r:ue,s:ye}=g.DER.toSig((0,_._abytes2)(He));return new ve(ue,ye)}"recovered"===w&&(h=He[0],w="compact",He=He.subarray(1));const m=G.BYTES,x=He.subarray(0,m),Y=He.subarray(m,2*m);return new ve(G.fromBytes(x),G.fromBytes(Y),h)}static fromHex(He,w){return this.fromBytes((0,_.hexToBytes)(He),w)}addRecoveryBit(He){return new ve(this.r,this.s,He)}recoverPublicKey(He){const w=Me.ORDER,{r:h,s:m,recovery:x}=this;if(null==x||![0,1,2,3].includes(x))throw new Error("recovery id invalid");if(N*z<w&&x>1)throw new Error("recovery id is ambiguous for h>1 curve");const ue=2===x||3===x?h+N:h;if(!Me.isValid(ue))throw new Error("recovery id 2 or 3 invalid");const ye=Me.toBytes(ue),at=D.fromBytes((0,_.concatBytes)(ae(!(1&x)),ye)),Et=G.inv(ue),dt=Pt((0,_.ensureBytes)("msgHash",He)),Dt=G.create(-dt*Et),vt=G.create(m*Et),xr=D.BASE.multiplyUnsafe(Dt).add(at.multiplyUnsafe(vt));if(xr.is0())throw new Error("point at infinify");return xr.assertValidity(),xr}hasHighS(){return je(this.s)}toBytes(He=xe){if(Z(He),"der"===He)return(0,_.hexToBytes)(g.DER.hexFromSig(this));const w=G.toBytes(this.r),h=G.toBytes(this.s);if("recovered"===He){if(null==this.recovery)throw new Error("recovery bit must be present");return(0,_.concatBytes)(Uint8Array.of(this.recovery),w,h)}return(0,_.concatBytes)(w,h)}toHex(He){return(0,_.bytesToHex)(this.toBytes(He))}assertValidity(){}static fromCompact(He){return ve.fromBytes((0,_.ensureBytes)("sig",He),"compact")}static fromDER(He){return ve.fromBytes((0,_.ensureBytes)("sig",He),"der")}normalizeS(){return this.hasHighS()?new ve(this.r,G.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,_.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,_.bytesToHex)(this.toBytes("compact"))}}const et=P.bits2int||function(He){if(He.length>8192)throw new Error("input is too large");const w=(0,_.bytesToNumberBE)(He),h=8*He.length-M;return h>0?w>>BigInt(h):w},Pt=P.bits2int_modN||function(He){return G.create(et(He))},Gt=(0,_.bitMask)(M);function fn(Ne){return(0,_.aInRange)("num < 2^"+M,Ne,Ie,Gt),G.toBytes(Ne)}function In(Ne,He){return(0,_._abytes2)(Ne,void 0,"message"),He?(0,_._abytes2)(re(Ne),void 0,"prehashed message"):Ne}return Object.freeze({keygen:V,getPublicKey:ie,getSharedSecret:ke,utils:Oe,lengths:Ce,Point:D,sign:function Zn(Ne,He,w={}){Ne=(0,_.ensureBytes)("message",Ne);const{seed:h,k2sig:m}=function wt(Ne,He,w){if(["recovered","canonical"].some(Dt=>Dt in w))throw new Error("sign() legacy options not supported");const{lowS:h,prehash:m,extraEntropy:x}=ne(w,Fe);Ne=In(Ne,m);const Y=Pt(Ne),ue=me(G,He),ye=[fn(ue),fn(Y)];if(null!=x&&!1!==x){const Dt=!0===x?k(Ce.secretKey):x;ye.push((0,_.ensureBytes)("extraEntropy",Dt))}const at=(0,_.concatBytes)(...ye),Et=Y;return{seed:at,k2sig:function dt(Dt){const vt=et(Dt);if(!G.isValidNot0(vt))return;const xr=G.inv(vt),wn=D.BASE.multiply(vt).toAffine(),Mn=G.create(wn.x);if(Mn===Ie)return;const is=G.create(xr*G.create(Et+Mn*ue));if(is===Ie)return;let Hf=(wn.x===Mn?0:2)|Number(wn.y&Ae),Wc=is;return h&&je(is)&&(Wc=G.neg(is),Hf^=1),new ve(Mn,Wc,Hf)}}}(Ne,He,w);return(0,_.createHmacDrbg)(re.outputLen,G.BYTES,pe)(h,m)},verify:function Kt(Ne,He,w,h={}){const{lowS:m,prehash:x,format:Y}=ne(h,Fe);if(w=(0,_.ensureBytes)("publicKey",w),He=In((0,_.ensureBytes)("message",He),x),"strict"in h)throw new Error("options.strict was renamed to lowS");const ue=void 0===Y?function Qn(Ne){let He;const w="string"==typeof Ne||(0,_.isBytes)(Ne),h=!w&&null!==Ne&&"object"==typeof Ne&&"bigint"==typeof Ne.r&&"bigint"==typeof Ne.s;if(!w&&!h)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(h)He=new ve(Ne.r,Ne.s);else if(w){try{He=ve.fromBytes((0,_.ensureBytes)("sig",Ne),"der")}catch(m){if(!(m instanceof g.DER.Err))throw m}if(!He)try{He=ve.fromBytes((0,_.ensureBytes)("sig",Ne),"compact")}catch{return!1}}return He||!1}(Ne):ve.fromBytes((0,_.ensureBytes)("sig",Ne),Y);if(!1===ue)return!1;try{const ye=D.fromBytes(w);if(m&&ue.hasHighS())return!1;const{r:at,s:Et}=ue,dt=Pt(He),Dt=G.inv(Et),vt=G.create(dt*Dt),xr=G.create(at*Dt),wn=D.BASE.multiplyUnsafe(vt).add(ye.multiplyUnsafe(xr));return!wn.is0()&&G.create(wn.x)===at}catch{return!1}},recoverPublicKey:function Ke(Ne,He,w={}){const{prehash:h}=ne(w,Fe);return He=In(He,h),ve.fromBytes(Ne,"recovered").recoverPublicKey(He).toBytes()},Signature:ve,hash:re})}function H(D){const re={a:D.a,b:D.b,p:D.Fp.ORDER,n:D.n,h:D.h,Gx:D.Gx,Gy:D.Gy},P=D.Fp;let k=D.allowedPrivateKeyLengths?Array.from(new Set(D.allowedPrivateKeyLengths.map(G=>Math.ceil(G/2)))):void 0;return{CURVE:re,curveOpts:{Fp:P,Fn:(0,T.Field)(re.n,{BITS:D.nBitLength,allowedLengths:k,modFromBytes:D.wrapPrivateKey}),allowInfinityPoint:D.allowInfinityPoint,endo:D.endo,isTorsionFree:D.isTorsionFree,clearCofactor:D.clearCofactor,fromBytes:D.fromBytes,toBytes:D.toBytes}}}function $(D,re,P){return function k(pe){const Me=D.sqr(pe),G=D.mul(Me,pe);return D.add(D.add(G,D.mul(pe,re)),P)}}},1717(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.encodeToCurve=g.hashToCurve=g.secp256k1_hasher=g.schnorr=g.secp256k1=void 0;const B=L(7361),S=L(6492),_=L(4521),I=L(5752),T=L(3834),O=L(3040),b=L(1780),Z={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},ne={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},ee=BigInt(0),Ie=BigInt(1),Ae=BigInt(2),W=(0,T.Field)(Z.p,{sqrt:function z(te){const K=Z.p,D=BigInt(3),re=BigInt(6),P=BigInt(11),k=BigInt(22),pe=BigInt(23),Me=BigInt(44),G=BigInt(88),N=te*te*te%K,M=N*N*te%K,V=(0,T.pow2)(M,D,K)*M%K,ie=(0,T.pow2)(V,D,K)*M%K,ke=(0,T.pow2)(ie,Ae,K)*N%K,Oe=(0,T.pow2)(ke,P,K)*ke%K,Ce=(0,T.pow2)(Oe,k,K)*Oe%K,Fe=(0,T.pow2)(Ce,Me,K)*Ce%K,xe=(0,T.pow2)(Fe,G,K)*Fe%K,je=(0,T.pow2)(xe,Me,K)*Ce%K,nt=(0,T.pow2)(je,D,K)*M%K,ut=(0,T.pow2)(nt,pe,K)*Oe%K,ve=(0,T.pow2)(ut,re,K)*N%K,et=(0,T.pow2)(ve,Ae,K);if(!W.eql(W.sqr(et),te))throw new Error("Cannot find square root");return et}});g.secp256k1=(0,_.createCurve)({...Z,Fp:W,lowS:!0,endo:ne},B.sha256);const oe={};function me(te,...K){let D=oe[te];if(void 0===D){const re=(0,B.sha256)((0,b.utf8ToBytes)(te));D=(0,b.concatBytes)(re,re),oe[te]=D}return(0,B.sha256)((0,b.concatBytes)(D,...K))}const fe=te=>te.toBytes(!0).slice(1),ae=g.secp256k1.Point,X=te=>te%Ae===ee;function ge(te){const{Fn:K,BASE:D}=ae,re=(0,O._normFnElement)(K,te),P=D.multiply(re);return{scalar:X(P.y)?re:K.neg(re),bytes:fe(P)}}function Se(te){const K=W;if(!K.isValidNot0(te))throw new Error("invalid x: Fail if x \u2265 p");const D=K.create(te*te),re=K.create(D*te+BigInt(7));let P=K.sqrt(re);X(P)||(P=K.neg(P));const k=ae.fromAffine({x:te,y:P});return k.assertValidity(),k}const Te=b.bytesToNumberBE;function q(...te){return ae.Fn.create(Te(me("BIP0340/challenge",...te)))}function j(te){return ge(te).bytes}function H(te,K,D=(0,S.randomBytes)(32)){const{Fn:re}=ae,P=(0,b.ensureBytes)("message",te),{bytes:k,scalar:pe}=ge(K),Me=(0,b.ensureBytes)("auxRand",D,32),G=re.toBytes(pe^Te(me("BIP0340/aux",Me))),N=me("BIP0340/nonce",G,k,P),{bytes:M,scalar:V}=ge(N),ie=q(M,k,P),ke=new Uint8Array(64);if(ke.set(M,0),ke.set(re.toBytes(re.create(V+ie*pe)),32),!U(ke,P,k))throw new Error("sign: Invalid signature produced");return ke}function U(te,K,D){const{Fn:re,BASE:P}=ae,k=(0,b.ensureBytes)("signature",te,64),pe=(0,b.ensureBytes)("message",K),Me=(0,b.ensureBytes)("publicKey",D,32);try{const G=Se(Te(Me)),N=Te(k.subarray(0,32));if(!(0,b.inRange)(N,Ie,Z.p))return!1;const M=Te(k.subarray(32,64));if(!(0,b.inRange)(M,Ie,Z.n))return!1;const V=q(re.toBytes(N),fe(G),pe),ie=P.multiplyUnsafe(M).add(G.multiplyUnsafe(re.neg(V))),{x:ke,y:Oe}=ie.toAffine();return!(ie.is0()||!X(Oe)||ke!==N)}catch{return!1}}g.schnorr=(()=>{const D=(P=(0,S.randomBytes)(48))=>(0,T.mapHashToField)(P,Z.n);return{keygen:function re(P){const k=D(P);return{secretKey:k,publicKey:j(k)}},getPublicKey:j,sign:H,verify:U,Point:ae,utils:{randomSecretKey:D,randomPrivateKey:D,taggedHash:me,lift_x:Se,pointToBytes:fe,numberToBytesBE:b.numberToBytesBE,bytesToNumberBE:b.bytesToNumberBE,mod:T.mod},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();const $=(0,I.isogenyMap)(W,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(te=>te.map(K=>BigInt(K)))),ce=(0,O.mapToCurveSimpleSWU)(W,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:W.create(BigInt("-11"))});g.secp256k1_hasher=(0,I.createHasher)(g.secp256k1.Point,te=>{const{x:K,y:D}=ce(W.create(te[0]));return $(K,D)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:W.ORDER,m:1,k:128,expand:"xmd",hash:B.sha256}),g.hashToCurve=g.secp256k1_hasher.hashToCurve,g.encodeToCurve=g.secp256k1_hasher.encodeToCurve},1780(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.notImplemented=g.bitMask=g.utf8ToBytes=g.randomBytes=g.isBytes=g.hexToBytes=g.concatBytes=g.bytesToUtf8=g.bytesToHex=g.anumber=g.abytes=void 0,g.abool=function T(P,k){if("boolean"!=typeof k)throw new Error(P+" boolean expected, got "+k)},g._abool2=function O(P,k=""){if("boolean"!=typeof P)throw new Error((k&&`"${k}"`)+"expected boolean, got type="+typeof P);return P},g._abytes2=function b(P,k,pe=""){const Me=(0,B.isBytes)(P),G=P?.length,N=void 0!==k;if(!Me||N&&G!==k)throw new Error((pe&&`"${pe}" `)+"expected Uint8Array"+(N?` of length ${k}`:"")+", got "+(Me?`length=${G}`:"type="+typeof P));return P},g.numberToHexUnpadded=Z,g.hexToNumber=ne,g.bytesToNumberBE=function ee(P){return ne((0,B.bytesToHex)(P))},g.bytesToNumberLE=function Ie(P){return(0,B.abytes)(P),ne((0,B.bytesToHex)(Uint8Array.from(P).reverse()))},g.numberToBytesBE=Ae,g.numberToBytesLE=function z(P,k){return Ae(P,k).reverse()},g.numberToVarBytesBE=function W(P){return(0,B.hexToBytes)(Z(P))},g.ensureBytes=function oe(P,k,pe){let Me;if("string"==typeof k)try{Me=(0,B.hexToBytes)(k)}catch(N){throw new Error(P+" must be hex string or Uint8Array, cause: "+N)}else{if(!(0,B.isBytes)(k))throw new Error(P+" must be hex string or Uint8Array");Me=Uint8Array.from(k)}const G=Me.length;if("number"==typeof pe&&G!==pe)throw new Error(P+" of length "+pe+" expected, got "+G);return Me},g.equalBytes=function me(P,k){if(P.length!==k.length)return!1;let pe=0;for(let Me=0;Me<P.length;Me++)pe|=P[Me]^k[Me];return 0===pe},g.copyBytes=function fe(P){return Uint8Array.from(P)},g.asciiToBytes=function ae(P){return Uint8Array.from(P,(k,pe)=>{const Me=k.charCodeAt(0);if(1!==k.length||Me>127)throw new Error(`string contains non-ASCII character "${P[pe]}" with code ${Me} at position ${pe}`);return Me})},g.inRange=ge,g.aInRange=function Se(P,k,pe,Me){if(!ge(k,pe,Me))throw new Error("expected valid "+P+": "+pe+" <= n < "+Me+", got "+k)},g.bitLen=function Te(P){let k;for(k=0;P>_;P>>=I,k+=1);return k},g.bitGet=function q(P,k){return P>>BigInt(k)&I},g.bitSet=function j(P,k,pe){return P|(pe?I:_)<<BigInt(k)},g.createHmacDrbg=function U(P,k,pe){if("number"!=typeof P||P<2)throw new Error("hashLen must be a number");if("number"!=typeof k||k<2)throw new Error("qByteLen must be a number");if("function"!=typeof pe)throw new Error("hmacFn must be a function");const Me=xe=>new Uint8Array(xe),G=xe=>Uint8Array.of(xe);let N=Me(P),M=Me(P),V=0;const ie=()=>{N.fill(1),M.fill(0),V=0},ke=(...xe)=>pe(M,N,...xe),Oe=(xe=Me(0))=>{M=ke(G(0),xe),N=ke(),0!==xe.length&&(M=ke(G(1),xe),N=ke())},Ce=()=>{if(V++>=1e3)throw new Error("drbg: tried 1000 values");let xe=0;const je=[];for(;xe<k;){N=ke();const nt=N.slice();je.push(nt),xe+=N.length}return(0,B.concatBytes)(...je)};return(xe,je)=>{let nt;for(ie(),Oe(xe);!(nt=je(Ce()));)Oe();return ie(),nt}},g.validateObject=function ce(P,k,pe={}){const Me=(G,N,M)=>{const V=$[N];if("function"!=typeof V)throw new Error("invalid validator function");const ie=P[G];if(!(M&&void 0===ie||V(ie,P)))throw new Error("param "+String(G)+" is invalid. Expected "+N+", got "+ie)};for(const[G,N]of Object.entries(k))Me(G,N,!1);for(const[G,N]of Object.entries(pe))Me(G,N,!0);return P},g.isHash=function te(P){return"function"==typeof P&&Number.isSafeInteger(P.outputLen)},g._validateObject=function K(P,k,pe={}){if(!P||"object"!=typeof P)throw new Error("expected valid options object");function Me(G,N,M){const V=P[G];if(M&&void 0===V)return;const ie=typeof V;if(ie!==N||null===V)throw new Error(`param "${G}" is invalid: expected ${N}, got ${ie}`)}Object.entries(k).forEach(([G,N])=>Me(G,N,!1)),Object.entries(pe).forEach(([G,N])=>Me(G,N,!0))},g.memoized=function re(P){const k=new WeakMap;return(pe,...Me)=>{const G=k.get(pe);if(void 0!==G)return G;const N=P(pe,...Me);return k.set(pe,N),N}};const B=L(6492);var S=L(6492);Object.defineProperty(g,"abytes",{enumerable:!0,get:function(){return S.abytes}}),Object.defineProperty(g,"anumber",{enumerable:!0,get:function(){return S.anumber}}),Object.defineProperty(g,"bytesToHex",{enumerable:!0,get:function(){return S.bytesToHex}}),Object.defineProperty(g,"bytesToUtf8",{enumerable:!0,get:function(){return S.bytesToUtf8}}),Object.defineProperty(g,"concatBytes",{enumerable:!0,get:function(){return S.concatBytes}}),Object.defineProperty(g,"hexToBytes",{enumerable:!0,get:function(){return S.hexToBytes}}),Object.defineProperty(g,"isBytes",{enumerable:!0,get:function(){return S.isBytes}}),Object.defineProperty(g,"randomBytes",{enumerable:!0,get:function(){return S.randomBytes}}),Object.defineProperty(g,"utf8ToBytes",{enumerable:!0,get:function(){return S.utf8ToBytes}});const _=BigInt(0),I=BigInt(1);function Z(P){const k=P.toString(16);return 1&k.length?"0"+k:k}function ne(P){if("string"!=typeof P)throw new Error("hex string expected, got "+typeof P);return""===P?_:BigInt("0x"+P)}function Ae(P,k){return(0,B.hexToBytes)(P.toString(16).padStart(2*k,"0"))}const X=P=>"bigint"==typeof P&&_<=P;function ge(P,k,pe){return X(P)&&X(k)&&X(pe)&&k<=P&&P<pe}g.bitMask=P=>(I<<BigInt(P))-I;const $={bigint:P=>"bigint"==typeof P,function:P=>"function"==typeof P,boolean:P=>"boolean"==typeof P,string:P=>"string"==typeof P,stringOrUint8Array:P=>"string"==typeof P||(0,B.isBytes)(P),isSafeInteger:P=>Number.isSafeInteger(P),array:P=>Array.isArray(P),field:(P,k)=>k.Fp.isValid(P),hash:P=>"function"==typeof P&&Number.isSafeInteger(P.outputLen)};g.notImplemented=()=>{throw new Error("not implemented")}},1689(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SHA512_IV=g.SHA384_IV=g.SHA224_IV=g.SHA256_IV=g.HashMD=void 0,g.setBigUint64=S,g.Chi=function _(O,b,Z){return O&b^~O&Z},g.Maj=function I(O,b,Z){return O&b^O&Z^b&Z};const B=L(6492);function S(O,b,Z,ne){if("function"==typeof O.setBigUint64)return O.setBigUint64(b,Z,ne);const ee=BigInt(32),Ie=BigInt(4294967295),Ae=Number(Z>>ee&Ie),z=Number(Z&Ie),oe=ne?0:4;O.setUint32(b+(ne?4:0),Ae,ne),O.setUint32(b+oe,z,ne)}g.HashMD=class T extends B.Hash{constructor(b,Z,ne,ee){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=b,this.outputLen=Z,this.padOffset=ne,this.isLE=ee,this.buffer=new Uint8Array(b),this.view=(0,B.createView)(this.buffer)}update(b){(0,B.aexists)(this),b=(0,B.toBytes)(b),(0,B.abytes)(b);const{view:Z,buffer:ne,blockLen:ee}=this,Ie=b.length;for(let Ae=0;Ae<Ie;){const z=Math.min(ee-this.pos,Ie-Ae);if(z!==ee)ne.set(b.subarray(Ae,Ae+z),this.pos),this.pos+=z,Ae+=z,this.pos===ee&&(this.process(Z,0),this.pos=0);else{const W=(0,B.createView)(b);for(;ee<=Ie-Ae;Ae+=ee)this.process(W,Ae)}}return this.length+=b.length,this.roundClean(),this}digestInto(b){(0,B.aexists)(this),(0,B.aoutput)(b,this),this.finished=!0;const{buffer:Z,view:ne,blockLen:ee,isLE:Ie}=this;let{pos:Ae}=this;Z[Ae++]=128,(0,B.clean)(this.buffer.subarray(Ae)),this.padOffset>ee-Ae&&(this.process(ne,0),Ae=0);for(let fe=Ae;fe<ee;fe++)Z[fe]=0;S(ne,ee-8,BigInt(8*this.length),Ie),this.process(ne,0);const z=(0,B.createView)(b),W=this.outputLen;if(W%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const oe=W/4,me=this.get();if(oe>me.length)throw new Error("_sha2: outputLen bigger than state");for(let fe=0;fe<oe;fe++)z.setUint32(4*fe,me[fe],Ie)}digest(){const{buffer:b,outputLen:Z}=this;this.digestInto(b);const ne=b.slice(0,Z);return this.destroy(),ne}_cloneInto(b){b||(b=new this.constructor),b.set(...this.get());const{blockLen:Z,buffer:ne,length:ee,finished:Ie,destroyed:Ae,pos:z}=this;return b.destroyed=Ae,b.finished=Ie,b.length=ee,b.pos=z,ee%Z&&b.buffer.set(ne),b}clone(){return this._cloneInto()}},g.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),g.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),g.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),g.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])},5059(Xe,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.toBig=g.shrSL=g.shrSH=g.rotrSL=g.rotrSH=g.rotrBL=g.rotrBH=g.rotr32L=g.rotr32H=g.rotlSL=g.rotlSH=g.rotlBL=g.rotlBH=g.add5L=g.add5H=g.add4L=g.add4H=g.add3L=g.add3H=void 0,g.add=fe,g.fromBig=S,g.split=_;const L=BigInt(2**32-1),B=BigInt(32);function S(H,U=!1){return U?{h:Number(H&L),l:Number(H>>B&L)}:{h:0|Number(H>>B&L),l:0|Number(H&L)}}function _(H,U=!1){const $=H.length;let ce=new Uint32Array($),te=new Uint32Array($);for(let K=0;K<$;K++){const{h:D,l:re}=S(H[K],U);[ce[K],te[K]]=[D,re]}return[ce,te]}const I=(H,U)=>BigInt(H>>>0)<<B|BigInt(U>>>0);g.toBig=I;const T=(H,U,$)=>H>>>$;g.shrSH=T;const O=(H,U,$)=>H<<32-$|U>>>$;g.shrSL=O;const b=(H,U,$)=>H>>>$|U<<32-$;g.rotrSH=b;const Z=(H,U,$)=>H<<32-$|U>>>$;g.rotrSL=Z;const ne=(H,U,$)=>H<<64-$|U>>>$-32;g.rotrBH=ne;const ee=(H,U,$)=>H>>>$-32|U<<64-$;g.rotrBL=ee;const Ie=(H,U)=>U;g.rotr32H=Ie;const Ae=(H,U)=>H;g.rotr32L=Ae;const z=(H,U,$)=>H<<$|U>>>32-$;g.rotlSH=z;const W=(H,U,$)=>U<<$|H>>>32-$;g.rotlSL=W;const oe=(H,U,$)=>U<<$-32|H>>>64-$;g.rotlBH=oe;const me=(H,U,$)=>H<<$-32|U>>>64-$;function fe(H,U,$,ce){const te=(U>>>0)+(ce>>>0);return{h:H+$+(te/2**32|0)|0,l:0|te}}g.rotlBL=me;const ae=(H,U,$)=>(H>>>0)+(U>>>0)+($>>>0);g.add3L=ae;const X=(H,U,$,ce)=>U+$+ce+(H/2**32|0)|0;g.add3H=X;const ge=(H,U,$,ce)=>(H>>>0)+(U>>>0)+($>>>0)+(ce>>>0);g.add4L=ge;const Se=(H,U,$,ce,te)=>U+$+ce+te+(H/2**32|0)|0;g.add4H=Se;const Te=(H,U,$,ce,te)=>(H>>>0)+(U>>>0)+($>>>0)+(ce>>>0)+(te>>>0);g.add5L=Te;const q=(H,U,$,ce,te,K)=>U+$+ce+te+K+(H/2**32|0)|0;g.add5H=q,g.default={fromBig:S,split:_,toBig:I,shrSH:T,shrSL:O,rotrSH:b,rotrSL:Z,rotrBH:ne,rotrBL:ee,rotr32H:Ie,rotr32L:Ae,rotlSH:z,rotlSL:W,rotlBH:oe,rotlBL:me,add:fe,add3L:ae,add3H:X,add4L:ge,add4H:Se,add5H:q,add5L:Te}},9948(Xe,g){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.crypto=void 0,g.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},4882(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.hmac=g.HMAC=void 0;const B=L(6492);class S extends B.Hash{constructor(T,O){super(),this.finished=!1,this.destroyed=!1,(0,B.ahash)(T);const b=(0,B.toBytes)(O);if(this.iHash=T.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 Z=this.blockLen,ne=new Uint8Array(Z);ne.set(b.length>Z?T.create().update(b).digest():b);for(let ee=0;ee<ne.length;ee++)ne[ee]^=54;this.iHash.update(ne),this.oHash=T.create();for(let ee=0;ee<ne.length;ee++)ne[ee]^=106;this.oHash.update(ne),(0,B.clean)(ne)}update(T){return(0,B.aexists)(this),this.iHash.update(T),this}digestInto(T){(0,B.aexists)(this),(0,B.abytes)(T,this.outputLen),this.finished=!0,this.iHash.digestInto(T),this.oHash.update(T),this.oHash.digestInto(T),this.destroy()}digest(){const T=new Uint8Array(this.oHash.outputLen);return this.digestInto(T),T}_cloneInto(T){T||(T=Object.create(Object.getPrototypeOf(this),{}));const{oHash:O,iHash:b,finished:Z,destroyed:ne,blockLen:ee,outputLen:Ie}=this;return T.finished=Z,T.destroyed=ne,T.blockLen=ee,T.outputLen=Ie,T.oHash=O._cloneInto(T.oHash),T.iHash=b._cloneInto(T.iHash),T}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}g.HMAC=S,g.hmac=(I,T,O)=>new S(I,T).update(O).digest(),g.hmac.create=(I,T)=>new S(I,T)},2922(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ripemd160=g.RIPEMD160=g.md5=g.MD5=g.sha1=g.SHA1=void 0;const B=L(1689),S=L(6492),_=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),I=new Uint32Array(80);class T extends B.HashMD{constructor(){super(64,20,8,!1),this.A=0|_[0],this.B=0|_[1],this.C=0|_[2],this.D=0|_[3],this.E=0|_[4]}get(){const{A:U,B:$,C:ce,D:te,E:K}=this;return[U,$,ce,te,K]}set(U,$,ce,te,K){this.A=0|U,this.B=0|$,this.C=0|ce,this.D=0|te,this.E=0|K}process(U,$){for(let P=0;P<16;P++,$+=4)I[P]=U.getUint32($,!1);for(let P=16;P<80;P++)I[P]=(0,S.rotl)(I[P-3]^I[P-8]^I[P-14]^I[P-16],1);let{A:ce,B:te,C:K,D,E:re}=this;for(let P=0;P<80;P++){let k,pe;P<20?(k=(0,B.Chi)(te,K,D),pe=1518500249):P<40?(k=te^K^D,pe=1859775393):P<60?(k=(0,B.Maj)(te,K,D),pe=2400959708):(k=te^K^D,pe=3395469782);const Me=(0,S.rotl)(ce,5)+k+re+pe+I[P]|0;re=D,D=K,K=(0,S.rotl)(te,30),te=ce,ce=Me}ce=ce+this.A|0,te=te+this.B|0,K=K+this.C|0,D=D+this.D|0,re=re+this.E|0,this.set(ce,te,K,D,re)}roundClean(){(0,S.clean)(I)}destroy(){this.set(0,0,0,0,0),(0,S.clean)(this.buffer)}}g.SHA1=T,g.sha1=(0,S.createHasher)(()=>new T);const O=Math.pow(2,32),b=Array.from({length:64},(H,U)=>Math.floor(O*Math.abs(Math.sin(U+1)))),Z=_.slice(0,4),ne=new Uint32Array(16);class ee extends B.HashMD{constructor(){super(64,16,8,!0),this.A=0|Z[0],this.B=0|Z[1],this.C=0|Z[2],this.D=0|Z[3]}get(){const{A:U,B:$,C:ce,D:te}=this;return[U,$,ce,te]}set(U,$,ce,te){this.A=0|U,this.B=0|$,this.C=0|ce,this.D=0|te}process(U,$){for(let re=0;re<16;re++,$+=4)ne[re]=U.getUint32($,!0);let{A:ce,B:te,C:K,D}=this;for(let re=0;re<64;re++){let P,k,pe;re<16?(P=(0,B.Chi)(te,K,D),k=re,pe=[7,12,17,22]):re<32?(P=(0,B.Chi)(D,te,K),k=(5*re+1)%16,pe=[5,9,14,20]):re<48?(P=te^K^D,k=(3*re+5)%16,pe=[4,11,16,23]):(P=K^(te|~D),k=7*re%16,pe=[6,10,15,21]),P=P+ce+b[re]+ne[k],ce=D,D=K,K=te,te+=(0,S.rotl)(P,pe[re%4])}ce=ce+this.A|0,te=te+this.B|0,K=K+this.C|0,D=D+this.D|0,this.set(ce,te,K,D)}roundClean(){(0,S.clean)(ne)}destroy(){this.set(0,0,0,0),(0,S.clean)(this.buffer)}}g.MD5=ee,g.md5=(0,S.createHasher)(()=>new ee);const Ie=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Ae=Uint8Array.from(new Array(16).fill(0).map((H,U)=>U)),z=Ae.map(H=>(9*H+5)%16),W=(()=>{const $=[[Ae],[z]];for(let ce=0;ce<4;ce++)for(let te of $)te.push(te[ce].map(K=>Ie[K]));return $})(),oe=W[0],me=W[1],fe=[[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(H=>Uint8Array.from(H)),ae=oe.map((H,U)=>H.map($=>fe[U][$])),X=me.map((H,U)=>H.map($=>fe[U][$])),ge=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),Se=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function Te(H,U,$,ce){return 0===H?U^$^ce:1===H?U&$|~U&ce:2===H?(U|~$)^ce:3===H?U&ce|$&~ce:U^($|~ce)}const q=new Uint32Array(16);class j extends B.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:U,h1:$,h2:ce,h3:te,h4:K}=this;return[U,$,ce,te,K]}set(U,$,ce,te,K){this.h0=0|U,this.h1=0|$,this.h2=0|ce,this.h3=0|te,this.h4=0|K}process(U,$){for(let N=0;N<16;N++,$+=4)q[N]=U.getUint32($,!0);let ce=0|this.h0,te=ce,K=0|this.h1,D=K,re=0|this.h2,P=re,k=0|this.h3,pe=k,Me=0|this.h4,G=Me;for(let N=0;N<5;N++){const M=4-N,V=ge[N],ie=Se[N],ke=oe[N],Oe=me[N],Ce=ae[N],Fe=X[N];for(let xe=0;xe<16;xe++){const je=(0,S.rotl)(ce+Te(N,K,re,k)+q[ke[xe]]+V,Ce[xe])+Me|0;ce=Me,Me=k,k=0|(0,S.rotl)(re,10),re=K,K=je}for(let xe=0;xe<16;xe++){const je=(0,S.rotl)(te+Te(M,D,P,pe)+q[Oe[xe]]+ie,Fe[xe])+G|0;te=G,G=pe,pe=0|(0,S.rotl)(P,10),P=D,D=je}}this.set(this.h1+re+pe|0,this.h2+k+G|0,this.h3+Me+te|0,this.h4+ce+D|0,this.h0+K+P|0)}roundClean(){(0,S.clean)(q)}destroy(){this.destroyed=!0,(0,S.clean)(this.buffer),this.set(0,0,0,0,0)}}g.RIPEMD160=j,g.ripemd160=(0,S.createHasher)(()=>new j)},6420(Xe,g,L){"use strict";var B=L(9293).default;Object.defineProperty(g,"__esModule",{value:!0}),g.pbkdf2=function O(ne,ee,Ie,Ae){const{c:z,dkLen:W,DK:oe,PRF:me,PRFSalt:fe}=I(ne,ee,Ie,Ae);let ae;const X=new Uint8Array(4),ge=(0,_.createView)(X),Se=new Uint8Array(me.outputLen);for(let Te=1,q=0;q<W;Te++,q+=me.outputLen){const j=oe.subarray(q,q+me.outputLen);ge.setInt32(0,Te,!1),(ae=fe._cloneInto(ae)).update(X).digestInto(Se),j.set(Se.subarray(0,j.length));for(let H=1;H<z;H++){me._cloneInto(ae).update(Se).digestInto(Se);for(let U=0;U<j.length;U++)j[U]^=Se[U]}}return T(me,fe,oe,ae,Se)},g.pbkdf2Async=function b(ne,ee,Ie,Ae){return Z.apply(this,arguments)};const S=L(4882),_=L(6492);function I(ne,ee,Ie,Ae){(0,_.ahash)(ne);const z=(0,_.checkOpts)({dkLen:32,asyncTick:10},Ae),{c:W,dkLen:oe,asyncTick:me}=z;if((0,_.anumber)(W),(0,_.anumber)(oe),(0,_.anumber)(me),W<1)throw new Error("iterations (c) should be >= 1");const fe=(0,_.kdfInputToBytes)(ee),ae=(0,_.kdfInputToBytes)(Ie),X=new Uint8Array(oe),ge=S.hmac.create(ne,fe),Se=ge._cloneInto().update(ae);return{c:W,dkLen:oe,asyncTick:me,DK:X,PRF:ge,PRFSalt:Se}}function T(ne,ee,Ie,Ae,z){return ne.destroy(),ee.destroy(),Ae&&Ae.destroy(),(0,_.clean)(z),Ie}function Z(){return(Z=B(function*(ne,ee,Ie,Ae){const{c:z,dkLen:W,asyncTick:oe,DK:me,PRF:fe,PRFSalt:ae}=I(ne,ee,Ie,Ae);let X;const ge=new Uint8Array(4),Se=(0,_.createView)(ge),Te=new Uint8Array(fe.outputLen);for(let q=1,j=0;j<W;q++,j+=fe.outputLen){const H=me.subarray(j,j+fe.outputLen);Se.setInt32(0,q,!1),(X=ae._cloneInto(X)).update(ge).digestInto(Te),H.set(Te.subarray(0,H.length)),yield(0,_.asyncLoop)(z-1,oe,()=>{fe._cloneInto(X).update(Te).digestInto(Te);for(let U=0;U<H.length;U++)H[U]^=Te[U]})}return T(fe,ae,me,X,Te)})).apply(this,arguments)}},7361(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.sha512_224=g.sha512_256=g.sha384=g.sha512=g.sha224=g.sha256=g.SHA512_256=g.SHA512_224=g.SHA384=g.SHA512=g.SHA224=g.SHA256=void 0;const B=L(1689),S=L(5059),_=L(6492),I=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]),T=new Uint32Array(64);class O extends B.HashMD{constructor(ge=32){super(64,ge,8,!1),this.A=0|B.SHA256_IV[0],this.B=0|B.SHA256_IV[1],this.C=0|B.SHA256_IV[2],this.D=0|B.SHA256_IV[3],this.E=0|B.SHA256_IV[4],this.F=0|B.SHA256_IV[5],this.G=0|B.SHA256_IV[6],this.H=0|B.SHA256_IV[7]}get(){const{A:ge,B:Se,C:Te,D:q,E:j,F:H,G:U,H:$}=this;return[ge,Se,Te,q,j,H,U,$]}set(ge,Se,Te,q,j,H,U,$){this.A=0|ge,this.B=0|Se,this.C=0|Te,this.D=0|q,this.E=0|j,this.F=0|H,this.G=0|U,this.H=0|$}process(ge,Se){for(let K=0;K<16;K++,Se+=4)T[K]=ge.getUint32(Se,!1);for(let K=16;K<64;K++){const D=T[K-15],re=T[K-2],P=(0,_.rotr)(D,7)^(0,_.rotr)(D,18)^D>>>3,k=(0,_.rotr)(re,17)^(0,_.rotr)(re,19)^re>>>10;T[K]=k+T[K-7]+P+T[K-16]|0}let{A:Te,B:q,C:j,D:H,E:U,F:$,G:ce,H:te}=this;for(let K=0;K<64;K++){const re=te+((0,_.rotr)(U,6)^(0,_.rotr)(U,11)^(0,_.rotr)(U,25))+(0,B.Chi)(U,$,ce)+I[K]+T[K]|0,k=((0,_.rotr)(Te,2)^(0,_.rotr)(Te,13)^(0,_.rotr)(Te,22))+(0,B.Maj)(Te,q,j)|0;te=ce,ce=$,$=U,U=H+re|0,H=j,j=q,q=Te,Te=re+k|0}Te=Te+this.A|0,q=q+this.B|0,j=j+this.C|0,H=H+this.D|0,U=U+this.E|0,$=$+this.F|0,ce=ce+this.G|0,te=te+this.H|0,this.set(Te,q,j,H,U,$,ce,te)}roundClean(){(0,_.clean)(T)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,_.clean)(this.buffer)}}g.SHA256=O;class b extends O{constructor(){super(28),this.A=0|B.SHA224_IV[0],this.B=0|B.SHA224_IV[1],this.C=0|B.SHA224_IV[2],this.D=0|B.SHA224_IV[3],this.E=0|B.SHA224_IV[4],this.F=0|B.SHA224_IV[5],this.G=0|B.SHA224_IV[6],this.H=0|B.SHA224_IV[7]}}g.SHA224=b;const Z=S.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(X=>BigInt(X))),ne=Z[0],ee=Z[1],Ie=new Uint32Array(80),Ae=new Uint32Array(80);class z extends B.HashMD{constructor(ge=64){super(128,ge,16,!1),this.Ah=0|B.SHA512_IV[0],this.Al=0|B.SHA512_IV[1],this.Bh=0|B.SHA512_IV[2],this.Bl=0|B.SHA512_IV[3],this.Ch=0|B.SHA512_IV[4],this.Cl=0|B.SHA512_IV[5],this.Dh=0|B.SHA512_IV[6],this.Dl=0|B.SHA512_IV[7],this.Eh=0|B.SHA512_IV[8],this.El=0|B.SHA512_IV[9],this.Fh=0|B.SHA512_IV[10],this.Fl=0|B.SHA512_IV[11],this.Gh=0|B.SHA512_IV[12],this.Gl=0|B.SHA512_IV[13],this.Hh=0|B.SHA512_IV[14],this.Hl=0|B.SHA512_IV[15]}get(){const{Ah:ge,Al:Se,Bh:Te,Bl:q,Ch:j,Cl:H,Dh:U,Dl:$,Eh:ce,El:te,Fh:K,Fl:D,Gh:re,Gl:P,Hh:k,Hl:pe}=this;return[ge,Se,Te,q,j,H,U,$,ce,te,K,D,re,P,k,pe]}set(ge,Se,Te,q,j,H,U,$,ce,te,K,D,re,P,k,pe){this.Ah=0|ge,this.Al=0|Se,this.Bh=0|Te,this.Bl=0|q,this.Ch=0|j,this.Cl=0|H,this.Dh=0|U,this.Dl=0|$,this.Eh=0|ce,this.El=0|te,this.Fh=0|K,this.Fl=0|D,this.Gh=0|re,this.Gl=0|P,this.Hh=0|k,this.Hl=0|pe}process(ge,Se){for(let N=0;N<16;N++,Se+=4)Ie[N]=ge.getUint32(Se),Ae[N]=ge.getUint32(Se+=4);for(let N=16;N<80;N++){const M=0|Ie[N-15],V=0|Ae[N-15],ie=S.rotrSH(M,V,1)^S.rotrSH(M,V,8)^S.shrSH(M,V,7),ke=S.rotrSL(M,V,1)^S.rotrSL(M,V,8)^S.shrSL(M,V,7),Oe=0|Ie[N-2],Ce=0|Ae[N-2],Fe=S.rotrSH(Oe,Ce,19)^S.rotrBH(Oe,Ce,61)^S.shrSH(Oe,Ce,6),xe=S.rotrSL(Oe,Ce,19)^S.rotrBL(Oe,Ce,61)^S.shrSL(Oe,Ce,6),je=S.add4L(ke,xe,Ae[N-7],Ae[N-16]),nt=S.add4H(je,ie,Fe,Ie[N-7],Ie[N-16]);Ie[N]=0|nt,Ae[N]=0|je}let{Ah:Te,Al:q,Bh:j,Bl:H,Ch:U,Cl:$,Dh:ce,Dl:te,Eh:K,El:D,Fh:re,Fl:P,Gh:k,Gl:pe,Hh:Me,Hl:G}=this;for(let N=0;N<80;N++){const M=S.rotrSH(K,D,14)^S.rotrSH(K,D,18)^S.rotrBH(K,D,41),V=S.rotrSL(K,D,14)^S.rotrSL(K,D,18)^S.rotrBL(K,D,41),ie=K&re^~K&k,Oe=S.add5L(G,V,D&P^~D&pe,ee[N],Ae[N]),Ce=S.add5H(Oe,Me,M,ie,ne[N],Ie[N]),Fe=0|Oe,xe=S.rotrSH(Te,q,28)^S.rotrBH(Te,q,34)^S.rotrBH(Te,q,39),je=S.rotrSL(Te,q,28)^S.rotrBL(Te,q,34)^S.rotrBL(Te,q,39),nt=Te&j^Te&U^j&U,ut=q&H^q&$^H&$;Me=0|k,G=0|pe,k=0|re,pe=0|P,re=0|K,P=0|D,({h:K,l:D}=S.add(0|ce,0|te,0|Ce,0|Fe)),ce=0|U,te=0|$,U=0|j,$=0|H,j=0|Te,H=0|q;const ve=S.add3L(Fe,je,ut);Te=S.add3H(ve,Ce,xe,nt),q=0|ve}({h:Te,l:q}=S.add(0|this.Ah,0|this.Al,0|Te,0|q)),({h:j,l:H}=S.add(0|this.Bh,0|this.Bl,0|j,0|H)),({h:U,l:$}=S.add(0|this.Ch,0|this.Cl,0|U,0|$)),({h:ce,l:te}=S.add(0|this.Dh,0|this.Dl,0|ce,0|te)),({h:K,l:D}=S.add(0|this.Eh,0|this.El,0|K,0|D)),({h:re,l:P}=S.add(0|this.Fh,0|this.Fl,0|re,0|P)),({h:k,l:pe}=S.add(0|this.Gh,0|this.Gl,0|k,0|pe)),({h:Me,l:G}=S.add(0|this.Hh,0|this.Hl,0|Me,0|G)),this.set(Te,q,j,H,U,$,ce,te,K,D,re,P,k,pe,Me,G)}roundClean(){(0,_.clean)(Ie,Ae)}destroy(){(0,_.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}g.SHA512=z;class W extends z{constructor(){super(48),this.Ah=0|B.SHA384_IV[0],this.Al=0|B.SHA384_IV[1],this.Bh=0|B.SHA384_IV[2],this.Bl=0|B.SHA384_IV[3],this.Ch=0|B.SHA384_IV[4],this.Cl=0|B.SHA384_IV[5],this.Dh=0|B.SHA384_IV[6],this.Dl=0|B.SHA384_IV[7],this.Eh=0|B.SHA384_IV[8],this.El=0|B.SHA384_IV[9],this.Fh=0|B.SHA384_IV[10],this.Fl=0|B.SHA384_IV[11],this.Gh=0|B.SHA384_IV[12],this.Gl=0|B.SHA384_IV[13],this.Hh=0|B.SHA384_IV[14],this.Hl=0|B.SHA384_IV[15]}}g.SHA384=W;const oe=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),me=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class fe extends z{constructor(){super(28),this.Ah=0|oe[0],this.Al=0|oe[1],this.Bh=0|oe[2],this.Bl=0|oe[3],this.Ch=0|oe[4],this.Cl=0|oe[5],this.Dh=0|oe[6],this.Dl=0|oe[7],this.Eh=0|oe[8],this.El=0|oe[9],this.Fh=0|oe[10],this.Fl=0|oe[11],this.Gh=0|oe[12],this.Gl=0|oe[13],this.Hh=0|oe[14],this.Hl=0|oe[15]}}g.SHA512_224=fe;class ae extends z{constructor(){super(32),this.Ah=0|me[0],this.Al=0|me[1],this.Bh=0|me[2],this.Bl=0|me[3],this.Ch=0|me[4],this.Cl=0|me[5],this.Dh=0|me[6],this.Dl=0|me[7],this.Eh=0|me[8],this.El=0|me[9],this.Fh=0|me[10],this.Fl=0|me[11],this.Gh=0|me[12],this.Gl=0|me[13],this.Hh=0|me[14],this.Hl=0|me[15]}}g.SHA512_256=ae,g.sha256=(0,_.createHasher)(()=>new O),g.sha224=(0,_.createHasher)(()=>new b),g.sha512=(0,_.createHasher)(()=>new z),g.sha384=(0,_.createHasher)(()=>new W),g.sha512_256=(0,_.createHasher)(()=>new ae),g.sha512_224=(0,_.createHasher)(()=>new fe)},1806(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.sha224=g.SHA224=g.sha256=g.SHA256=void 0;const B=L(7361);g.SHA256=B.SHA256,g.sha256=B.sha256,g.SHA224=B.SHA224,g.sha224=B.sha224},6492(Xe,g,L){"use strict";var B=L(9293).default;Object.defineProperty(g,"__esModule",{value:!0}),g.wrapXOFConstructorWithOpts=g.wrapConstructorWithOpts=g.wrapConstructor=g.Hash=g.nextTick=g.swap32IfBE=g.byteSwapIfBE=g.swap8IfBE=g.isLE=void 0,g.isBytes=_,g.anumber=I,g.abytes=T,g.ahash=function O(G){if("function"!=typeof G||"function"!=typeof G.create)throw new Error("Hash should be wrapped by utils.createHasher");I(G.outputLen),I(G.blockLen)},g.aexists=function b(G,N=!0){if(G.destroyed)throw new Error("Hash instance has been destroyed");if(N&&G.finished)throw new Error("Hash#digest() has already been called")},g.aoutput=function Z(G,N){T(G);const M=N.outputLen;if(G.length<M)throw new Error("digestInto() expects output buffer of length at least "+M)},g.u8=function ne(G){return new Uint8Array(G.buffer,G.byteOffset,G.byteLength)},g.u32=function ee(G){return new Uint32Array(G.buffer,G.byteOffset,Math.floor(G.byteLength/4))},g.clean=function Ie(...G){for(let N=0;N<G.length;N++)G[N].fill(0)},g.createView=function Ae(G){return new DataView(G.buffer,G.byteOffset,G.byteLength)},g.rotr=function z(G,N){return G<<32-N|G>>>N},g.rotl=function W(G,N){return G<<N|G>>>32-N>>>0},g.byteSwap=oe,g.byteSwap32=me,g.bytesToHex=function X(G){if(T(G),fe)return G.toHex();let N="";for(let M=0;M<G.length;M++)N+=ae[G[M]];return N},g.hexToBytes=function Te(G){if("string"!=typeof G)throw new Error("hex string expected, got "+typeof G);if(fe)return Uint8Array.fromHex(G);const N=G.length,M=N/2;if(N%2)throw new Error("hex string expected, got unpadded hex of length "+N);const V=new Uint8Array(M);for(let ie=0,ke=0;ie<M;ie++,ke+=2){const Oe=Se(G.charCodeAt(ke)),Ce=Se(G.charCodeAt(ke+1));if(void 0===Oe||void 0===Ce)throw new Error('hex string expected, got non-hex character "'+(G[ke]+G[ke+1])+'" at index '+ke);V[ie]=16*Oe+Ce}return V},g.asyncLoop=function j(G,N,M){return H.apply(this,arguments)},g.utf8ToBytes=U,g.bytesToUtf8=function $(G){return(new TextDecoder).decode(G)},g.toBytes=ce,g.kdfInputToBytes=function te(G){return"string"==typeof G&&(G=U(G)),T(G),G},g.concatBytes=function K(...G){let N=0;for(let V=0;V<G.length;V++){const ie=G[V];T(ie),N+=ie.length}const M=new Uint8Array(N);for(let V=0,ie=0;V<G.length;V++){const ke=G[V];M.set(ke,ie),ie+=ke.length}return M},g.checkOpts=function D(G,N){if(void 0!==N&&"[object Object]"!=={}.toString.call(N))throw new Error("options should be object or undefined");return Object.assign(G,N)},g.createHasher=P,g.createOptHasher=k,g.createXOFer=pe,g.randomBytes=function Me(G=32){if(S.crypto&&"function"==typeof S.crypto.getRandomValues)return S.crypto.getRandomValues(new Uint8Array(G));if(S.crypto&&"function"==typeof S.crypto.randomBytes)return Uint8Array.from(S.crypto.randomBytes(G));throw new Error("crypto.getRandomValues must be defined")};const S=L(9948);function _(G){return G instanceof Uint8Array||ArrayBuffer.isView(G)&&"Uint8Array"===G.constructor.name}function I(G){if(!Number.isSafeInteger(G)||G<0)throw new Error("positive integer expected, got "+G)}function T(G,...N){if(!_(G))throw new Error("Uint8Array expected");if(N.length>0&&!N.includes(G.length))throw new Error("Uint8Array expected of length "+N+", got length="+G.length)}function oe(G){return G<<24&4278190080|G<<8&16711680|G>>>8&65280|G>>>24&255}function me(G){for(let N=0;N<G.length;N++)G[N]=oe(G[N]);return G}g.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],g.swap8IfBE=g.isLE?G=>G:G=>oe(G),g.byteSwapIfBE=g.swap8IfBE,g.swap32IfBE=g.isLE?G=>G:me;const fe="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,ae=Array.from({length:256},(G,N)=>N.toString(16).padStart(2,"0"));function Se(G){return G>=48&&G<=57?G-48:G>=65&&G<=70?G-55:G>=97&&G<=102?G-87:void 0}const q=function(){var G=B(function*(){});return function(){return G.apply(this,arguments)}}();function H(){return(H=B(function*(G,N,M){let V=Date.now();for(let ie=0;ie<G;ie++){M(ie);const ke=Date.now()-V;ke>=0&&ke<N||(yield(0,g.nextTick)(),V+=ke)}})).apply(this,arguments)}function U(G){if("string"!=typeof G)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(G))}function ce(G){return"string"==typeof G&&(G=U(G)),T(G),G}function P(G){const N=V=>G().update(ce(V)).digest(),M=G();return N.outputLen=M.outputLen,N.blockLen=M.blockLen,N.create=()=>G(),N}function k(G){const N=(V,ie)=>G(ie).update(ce(V)).digest(),M=G({});return N.outputLen=M.outputLen,N.blockLen=M.blockLen,N.create=V=>G(V),N}function pe(G){const N=(V,ie)=>G(ie).update(ce(V)).digest(),M=G({});return N.outputLen=M.outputLen,N.blockLen=M.blockLen,N.create=V=>G(V),N}g.nextTick=q,g.Hash=class re{},g.wrapConstructor=P,g.wrapConstructorWithOpts=k,g.wrapXOFConstructorWithOpts=pe},1976(Xe,g){"use strict";function L(M){return M instanceof Uint8Array||ArrayBuffer.isView(M)&&"Uint8Array"===M.constructor.name}function B(M,...V){if(!L(M))throw new Error("Uint8Array expected");if(V.length>0&&!V.includes(M.length))throw new Error("Uint8Array expected of length "+V+", got length="+M.length)}function S(M,V){return!!Array.isArray(V)&&(0===V.length||V.every(M?ie=>"string"==typeof ie:ie=>Number.isSafeInteger(ie)))}function _(M){if("function"!=typeof M)throw new Error("function expected");return!0}function I(M,V){if("string"!=typeof V)throw new Error(`${M}: string expected`);return!0}function T(M){if(!Number.isSafeInteger(M))throw new Error(`invalid integer: ${M}`)}function O(M){if(!Array.isArray(M))throw new Error("array expected")}function b(M,V){if(!S(!0,V))throw new Error(`${M}: array of strings expected`)}function Z(M,V){if(!S(!1,V))throw new Error(`${M}: array of numbers expected`)}function ne(...M){const V=Ce=>Ce,ie=(Ce,Fe)=>xe=>Ce(Fe(xe));return{encode:M.map(Ce=>Ce.encode).reduceRight(ie,V),decode:M.map(Ce=>Ce.decode).reduce(ie,V)}}function ee(M){const V="string"==typeof M?M.split(""):M,ie=V.length;b("alphabet",V);const ke=new Map(V.map((Oe,Ce)=>[Oe,Ce]));return{encode:Oe=>(O(Oe),Oe.map(Ce=>{if(!Number.isSafeInteger(Ce)||Ce<0||Ce>=ie)throw new Error(`alphabet.encode: digit index outside alphabet "${Ce}". Allowed: ${M}`);return V[Ce]})),decode:Oe=>(O(Oe),Oe.map(Ce=>{I("alphabet.decode",Ce);const Fe=ke.get(Ce);if(void 0===Fe)throw new Error(`Unknown letter: "${Ce}". Allowed: ${M}`);return Fe}))}}function Ie(M=""){return I("join",M),{encode:V=>(b("join.decode",V),V.join(M)),decode:V=>(I("join.decode",V),V.split(M))}}function Ae(M,V="="){return T(M),I("padding",V),{encode(ie){for(b("padding.encode",ie);ie.length*M%8;)ie.push(V);return ie},decode(ie){b("padding.decode",ie);let ke=ie.length;if(ke*M%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;ke>0&&ie[ke-1]===V;ke--)if((ke-1)*M%8==0)throw new Error("padding: invalid, string has too much padding");return ie.slice(0,ke)}}}function z(M){return _(M),{encode:V=>V,decode:V=>M(V)}}function W(M,V,ie){if(V<2)throw new Error(`convertRadix: invalid from=${V}, base cannot be less than 2`);if(ie<2)throw new Error(`convertRadix: invalid to=${ie}, base cannot be less than 2`);if(O(M),!M.length)return[];let ke=0;const Oe=[],Ce=Array.from(M,xe=>{if(T(xe),xe<0||xe>=V)throw new Error(`invalid integer: ${xe}`);return xe}),Fe=Ce.length;for(;;){let xe=0,je=!0;for(let nt=ke;nt<Fe;nt++){const ut=Ce[nt],ve=V*xe,et=ve+ut;if(!Number.isSafeInteger(et)||ve/V!==xe||et-ut!==ve)throw new Error("convertRadix: carry overflow");xe=et%ie;const Gt=Math.floor(et/ie);if(Ce[nt]=Gt,!Number.isSafeInteger(Gt)||Gt*ie+xe!==et)throw new Error("convertRadix: carry overflow");je&&(Gt?je=!1:ke=nt)}if(Oe.push(xe),je)break}for(let xe=0;xe<M.length-1&&0===M[xe];xe++)Oe.push(0);return Oe.reverse()}Object.defineProperty(g,"__esModule",{value:!0}),g.bytes=g.stringToBytes=g.str=g.bytesToString=g.hex=g.utf8=g.bech32m=g.bech32=g.base58check=g.createBase58check=g.base58xmr=g.base58xrp=g.base58flickr=g.base58=g.base64urlnopad=g.base64url=g.base64nopad=g.base64=g.base32crockford=g.base32hexnopad=g.base32hex=g.base32nopad=g.base32=g.base16=g.utils=void 0;const oe=(M,V)=>0===V?M:oe(V,M%V),me=(M,V)=>M+(V-oe(M,V)),fe=(()=>{let M=[];for(let V=0;V<40;V++)M.push(2**V);return M})();function ae(M,V,ie,ke){if(O(M),V<=0||V>32)throw new Error(`convertRadix2: wrong from=${V}`);if(ie<=0||ie>32)throw new Error(`convertRadix2: wrong to=${ie}`);if(me(V,ie)>32)throw new Error(`convertRadix2: carry overflow from=${V} to=${ie} carryBits=${me(V,ie)}`);let Oe=0,Ce=0;const Fe=fe[V],xe=fe[ie]-1,je=[];for(const nt of M){if(T(nt),nt>=Fe)throw new Error(`convertRadix2: invalid data word=${nt} from=${V}`);if(Oe=Oe<<V|nt,Ce+V>32)throw new Error(`convertRadix2: carry overflow pos=${Ce} from=${V}`);for(Ce+=V;Ce>=ie;Ce-=ie)je.push((Oe>>Ce-ie&xe)>>>0);const ut=fe[Ce];if(void 0===ut)throw new Error("invalid carry");Oe&=ut-1}if(Oe=Oe<<ie-Ce&xe,!ke&&Ce>=V)throw new Error("Excess padding");if(!ke&&Oe>0)throw new Error(`Non-zero padding: ${Oe}`);return ke&&Ce>0&&je.push(Oe>>>0),je}function X(M){return T(M),{encode:ie=>{if(!L(ie))throw new Error("radix.encode input should be Uint8Array");return W(Array.from(ie),256,M)},decode:ie=>(Z("radix.decode",ie),Uint8Array.from(W(ie,M,256)))}}function ge(M,V=!1){if(T(M),M<=0||M>32)throw new Error("radix2: bits should be in (0..32]");if(me(8,M)>32||me(M,8)>32)throw new Error("radix2: carry overflow");return{encode:ie=>{if(!L(ie))throw new Error("radix2.encode input should be Uint8Array");return ae(Array.from(ie),8,M,!V)},decode:ie=>(Z("radix2.decode",ie),Uint8Array.from(ae(ie,M,8,V)))}}function Se(M){return _(M),function(...V){try{return M.apply(null,V)}catch{}}}function Te(M,V){return T(M),_(V),{encode(ie){if(!L(ie))throw new Error("checksum.encode: input should be Uint8Array");const ke=V(ie).slice(0,M),Oe=new Uint8Array(ie.length+M);return Oe.set(ie),Oe.set(ke,ie.length),Oe},decode(ie){if(!L(ie))throw new Error("checksum.decode: input should be Uint8Array");const ke=ie.slice(0,-M),Oe=ie.slice(-M),Ce=V(ke).slice(0,M);for(let Fe=0;Fe<M;Fe++)if(Ce[Fe]!==Oe[Fe])throw new Error("Invalid checksum");return ke}}}g.utils={alphabet:ee,chain:ne,checksum:Te,convertRadix:W,convertRadix2:ae,radix:X,radix2:ge,join:Ie,padding:Ae},g.base16=ne(ge(4),ee("0123456789ABCDEF"),Ie("")),g.base32=ne(ge(5),ee("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Ae(5),Ie("")),g.base32nopad=ne(ge(5),ee("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Ie("")),g.base32hex=ne(ge(5),ee("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Ae(5),Ie("")),g.base32hexnopad=ne(ge(5),ee("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Ie("")),g.base32crockford=ne(ge(5),ee("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Ie(""),z(M=>M.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const q="function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64,j=(M,V)=>{I("base64",M);const ke=V?"base64url":"base64";if(M.length>0&&!(V?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/).test(M))throw new Error("invalid base64");return Uint8Array.fromBase64(M,{alphabet:ke,lastChunkHandling:"strict"})};g.base64=q?{encode:M=>(B(M),M.toBase64()),decode:M=>j(M,!1)}:ne(ge(6),ee("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ae(6),Ie("")),g.base64nopad=ne(ge(6),ee("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ie("")),g.base64url=q?{encode:M=>(B(M),M.toBase64({alphabet:"base64url"})),decode:M=>j(M,!0)}:ne(ge(6),ee("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Ae(6),Ie("")),g.base64urlnopad=ne(ge(6),ee("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Ie(""));const H=M=>ne(X(58),ee(M),Ie(""));g.base58=H("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),g.base58flickr=H("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),g.base58xrp=H("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const U=[0,2,3,5,6,7,9,10,11];g.base58xmr={encode(M){let V="";for(let ie=0;ie<M.length;ie+=8){const ke=M.subarray(ie,ie+8);V+=g.base58.encode(ke).padStart(U[ke.length],"1")}return V},decode(M){let V=[];for(let ie=0;ie<M.length;ie+=11){const ke=M.slice(ie,ie+11),Oe=U.indexOf(ke.length),Ce=g.base58.decode(ke);for(let Fe=0;Fe<Ce.length-Oe;Fe++)if(0!==Ce[Fe])throw new Error("base58xmr: wrong padding");V=V.concat(Array.from(Ce.slice(Ce.length-Oe)))}return Uint8Array.from(V)}},g.createBase58check=M=>ne(Te(4,V=>M(M(V))),g.base58),g.base58check=g.createBase58check;const ce=ne(ee("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Ie("")),te=[996825010,642813549,513874426,1027748829,705979059];function K(M){const V=M>>25;let ie=(33554431&M)<<5;for(let ke=0;ke<te.length;ke++)1==(V>>ke&1)&&(ie^=te[ke]);return ie}function D(M,V,ie=1){const ke=M.length;let Oe=1;for(let Ce=0;Ce<ke;Ce++){const Fe=M.charCodeAt(Ce);if(Fe<33||Fe>126)throw new Error(`Invalid prefix (${M})`);Oe=K(Oe)^Fe>>5}Oe=K(Oe);for(let Ce=0;Ce<ke;Ce++)Oe=K(Oe)^31&M.charCodeAt(Ce);for(let Ce of V)Oe=K(Oe)^Ce;for(let Ce=0;Ce<6;Ce++)Oe=K(Oe);return Oe^=ie,ce.encode(ae([Oe%fe[30]],30,5,!1))}function re(M){const V="bech32"===M?1:734539939,ie=ge(5),ke=ie.decode,Oe=ie.encode,Ce=Se(ke);function Fe(ve,et,Pt=90){I("bech32.encode prefix",ve),L(et)&&(et=Array.from(et)),Z("bech32.encode",et);const Gt=ve.length;if(0===Gt)throw new TypeError(`Invalid prefix length ${Gt}`);const fn=Gt+7+et.length;if(!1!==Pt&&fn>Pt)throw new TypeError(`Length ${fn} exceeds limit ${Pt}`);const In=ve.toLowerCase(),wt=D(In,et,V);return`${In}1${ce.encode(et)}${wt}`}function xe(ve,et=90){I("bech32.decode input",ve);const Pt=ve.length;if(Pt<8||!1!==et&&Pt>et)throw new TypeError(`invalid string length: ${Pt} (${ve}). Expected (8..${et})`);const Gt=ve.toLowerCase();if(ve!==Gt&&ve!==ve.toUpperCase())throw new Error("String must be lowercase or uppercase");const fn=Gt.lastIndexOf("1");if(0===fn||-1===fn)throw new Error('Letter "1" must be present between prefix and data only');const In=Gt.slice(0,fn),wt=Gt.slice(fn+1);if(wt.length<6)throw new Error("Data must be at least 6 characters long");const Zn=ce.decode(wt).slice(0,-6),Qn=D(In,Zn,V);if(!wt.endsWith(Qn))throw new Error(`Invalid checksum in ${ve}: expected "${Qn}"`);return{prefix:In,words:Zn}}return{encode:Fe,decode:xe,encodeFromBytes:function ut(ve,et){return Fe(ve,Oe(et))},decodeToBytes:function nt(ve){const{prefix:et,words:Pt}=xe(ve,!1);return{prefix:et,words:Pt,bytes:ke(Pt)}},decodeUnsafe:Se(xe),fromWords:ke,fromWordsUnsafe:Ce,toWords:Oe}}g.bech32=re("bech32"),g.bech32m=re("bech32m"),g.utf8={encode:M=>(new TextDecoder).decode(M),decode:M=>(new TextEncoder).encode(M)};const P="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex;g.hex=P?{encode:M=>(B(M),M.toHex()),decode:M=>(I("hex",M),Uint8Array.fromHex(M))}:ne(ge(4),ee("0123456789abcdef"),Ie(""),z(M=>{if("string"!=typeof M||M.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof M} with length ${M.length}`);return M.toLowerCase()}));const pe={utf8:g.utf8,hex:g.hex,base16:g.base16,base32:g.base32,base64:g.base64,base64url:g.base64url,base58:g.base58,base58xmr:g.base58xmr},Me="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";g.bytesToString=(M,V)=>{if("string"!=typeof M||!pe.hasOwnProperty(M))throw new TypeError(Me);if(!L(V))throw new TypeError("bytesToString() expects Uint8Array");return pe[M].encode(V)},g.str=g.bytesToString,g.stringToBytes=(M,V)=>{if(!pe.hasOwnProperty(M))throw new TypeError(Me);if("string"!=typeof V)throw new TypeError("stringToBytes() expects string");return pe[M].decode(V)},g.bytes=g.stringToBytes},8737(Xe,g,L){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.HDKey=g.HARDENED_OFFSET=void 0;const B=L(3834),S=L(1717),_=L(4882),I=L(2922),T=L(7361),O=L(6492),b=L(1976),Z=S.secp256k1.ProjectivePoint,ne=(0,b.createBase58check)(T.sha256);function ee(ae){(0,O.abytes)(ae);const X=0===ae.length?"0":(0,O.bytesToHex)(ae);return BigInt("0x"+X)}const Ae=(0,O.utf8ToBytes)("Bitcoin seed"),z={private:76066276,public:76067358};g.HARDENED_OFFSET=2147483648;const me=ae=>{if(!Number.isSafeInteger(ae)||ae<0||ae>2**32-1)throw new Error("invalid number, should be from 0 to 2**32-1, got "+ae);const X=new Uint8Array(4);return(0,O.createView)(X).setUint32(0,ae,!1),X};class fe{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return(0,O.createView)(this.pubHash).getUint32(0,!1)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){const X=this.privateKey;if(!X)throw new Error("No private key");return ne.encode(this.serialize(this.versions.private,(0,O.concatBytes)(new Uint8Array([0]),X)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return ne.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(X,ge=z){if((0,O.abytes)(X),8*X.length<128||8*X.length>512)throw new Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got "+X.length);const Se=(0,_.hmac)(T.sha512,Ae,X);return new fe({versions:ge,chainCode:Se.slice(32),privateKey:Se.slice(0,32)})}static fromExtendedKey(X,ge=z){const Se=ne.decode(X),Te=(0,O.createView)(Se),q=Te.getUint32(0,!1),j={versions:ge,depth:Se[4],parentFingerprint:Te.getUint32(5,!1),index:Te.getUint32(9,!1),chainCode:Se.slice(13,45)},H=Se.slice(45),U=0===H[0];if(q!==ge[U?"private":"public"])throw new Error("Version mismatch");return new fe(U?{...j,privateKey:H.slice(1)}:{...j,publicKey:H})}static fromJSON(X){return fe.fromExtendedKey(X.xpriv)}constructor(X){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!X||"object"!=typeof X)throw new Error("HDKey.constructor must not be called directly");if(this.versions=X.versions||z,this.depth=X.depth||0,this.chainCode=X.chainCode||null,this.index=X.index||0,this.parentFingerprint=X.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(X.publicKey&&X.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(X.privateKey){if(!S.secp256k1.utils.isValidPrivateKey(X.privateKey))throw new Error("Invalid private key");this.privKey="bigint"==typeof X.privateKey?X.privateKey:ee(X.privateKey),this.privKeyBytes=function Ie(ae){if("bigint"!=typeof ae)throw new Error("bigint expected");return(0,O.hexToBytes)(ae.toString(16).padStart(64,"0"))}(this.privKey),this.pubKey=S.secp256k1.getPublicKey(X.privateKey,!0)}else{if(!X.publicKey)throw new Error("HDKey: no public or private key provided");this.pubKey=Z.fromHex(X.publicKey).toRawBytes(!0)}this.pubHash=(0,I.ripemd160)((0,T.sha256)(this.pubKey))}derive(X){if(!/^[mM]'?/.test(X))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(X))return this;const ge=X.replace(/^[mM]'?\//,"").split("/");let Se=this;for(const Te of ge){const q=/^(\d+)('?)$/.exec(Te),j=q&&q[1];if(!q||3!==q.length||"string"!=typeof j)throw new Error("invalid child index: "+Te);let H=+j;if(!Number.isSafeInteger(H)||H>=g.HARDENED_OFFSET)throw new Error("Invalid index");"'"===q[2]&&(H+=g.HARDENED_OFFSET),Se=Se.deriveChild(H)}return Se}deriveChild(X){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let ge=me(X);if(X>=g.HARDENED_OFFSET){const H=this.privateKey;if(!H)throw new Error("Could not derive hardened child key");ge=(0,O.concatBytes)(new Uint8Array([0]),H,ge)}else ge=(0,O.concatBytes)(this.pubKey,ge);const Se=(0,_.hmac)(T.sha512,this.chainCode,ge),Te=ee(Se.slice(0,32)),q=Se.slice(32);if(!S.secp256k1.utils.isValidPrivateKey(Te))throw new Error("Tweak bigger than curve order");const j={versions:this.versions,chainCode:q,depth:this.depth+1,parentFingerprint:this.fingerprint,index:X};try{if(this.privateKey){const H=(0,B.mod)(this.privKey+Te,S.secp256k1.CURVE.n);if(!S.secp256k1.utils.isValidPrivateKey(H))throw new Error("The tweak was out of range or the resulted private key is invalid");j.privateKey=H}else{const H=Z.fromHex(this.pubKey).add(Z.fromPrivateKey(Te));if(H.equals(Z.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");j.publicKey=H.toRawBytes(!0)}return new fe(j)}catch{return this.deriveChild(X+1)}}sign(X){if(!this.privateKey)throw new Error("No privateKey set!");return(0,O.abytes)(X,32),S.secp256k1.sign(X,this.privKey).toCompactRawBytes()}verify(X,ge){if((0,O.abytes)(X,32),(0,O.abytes)(ge,64),!this.publicKey)throw new Error("No publicKey set!");let Se;try{Se=S.secp256k1.Signature.fromCompact(ge)}catch{return!1}return S.secp256k1.verify(Se,X,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(X,ge){if(!this.chainCode)throw new Error("No chainCode set");return(0,O.abytes)(ge,33),(0,O.concatBytes)(me(X),new Uint8Array([this.depth]),me(this.parentFingerprint),me(this.index),this.chainCode,ge)}}g.HDKey=fe},3981(Xe,g){"use strict";g.byteLength=function b(z){var W=O(z),me=W[1];return 3*(W[0]+me)/4-me},g.toByteArray=function ne(z){var W,Se,oe=O(z),me=oe[0],fe=oe[1],ae=new S(function Z(z,W,oe){return 3*(W+oe)/4-oe}(0,me,fe)),X=0,ge=fe>0?me-4:me;for(Se=0;Se<ge;Se+=4)W=B[z.charCodeAt(Se)]<<18|B[z.charCodeAt(Se+1)]<<12|B[z.charCodeAt(Se+2)]<<6|B[z.charCodeAt(Se+3)],ae[X++]=W>>16&255,ae[X++]=W>>8&255,ae[X++]=255&W;return 2===fe&&(W=B[z.charCodeAt(Se)]<<2|B[z.charCodeAt(Se+1)]>>4,ae[X++]=255&W),1===fe&&(W=B[z.charCodeAt(Se)]<<10|B[z.charCodeAt(Se+1)]<<4|B[z.charCodeAt(Se+2)]>>2,ae[X++]=W>>8&255,ae[X++]=255&W),ae},g.fromByteArray=function Ae(z){for(var W,oe=z.length,me=oe%3,fe=[],X=0,ge=oe-me;X<ge;X+=16383)fe.push(Ie(z,X,X+16383>ge?ge:X+16383));return 1===me?fe.push(L[(W=z[oe-1])>>2]+L[W<<4&63]+"=="):2===me&&fe.push(L[(W=(z[oe-2]<<8)+z[oe-1])>>10]+L[W>>4&63]+L[W<<2&63]+"="),fe.join("")};for(var L=[],B=[],S=typeof Uint8Array<"u"?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=0;I<64;++I)L[I]=_[I],B[_.charCodeAt(I)]=I;function O(z){var W=z.length;if(W%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var oe=z.indexOf("=");return-1===oe&&(oe=W),[oe,oe===W?0:4-oe%4]}function ee(z){return L[z>>18&63]+L[z>>12&63]+L[z>>6&63]+L[63&z]}function Ie(z,W,oe){for(var fe=[],ae=W;ae<oe;ae+=3)fe.push(ee((z[ae]<<16&16711680)+(z[ae+1]<<8&65280)+(255&z[ae+2])));return fe.join("")}B[45]=62,B[95]=63},3838(Xe,g,L){"use strict";const B=L(3981),S=L(2020),_="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=b,g.SlowBuffer=function ae(w){return+w!=w&&(w=0),b.alloc(+w)},g.INSPECT_MAX_BYTES=50;const I=2147483647;function O(w){if(w>I)throw new RangeError('The value "'+w+'" is invalid for option "size"');const h=new Uint8Array(w);return Object.setPrototypeOf(h,b.prototype),h}function b(w,h,m){if("number"==typeof w){if("string"==typeof h)throw new TypeError('The "string" argument must be of type string. Received type number');return Ie(w)}return Z(w,h,m)}function Z(w,h,m){if("string"==typeof w)return function Ae(w,h){if(("string"!=typeof h||""===h)&&(h="utf8"),!b.isEncoding(h))throw new TypeError("Unknown encoding: "+h);const m=0|X(w,h);let x=O(m);const Y=x.write(w,h);return Y!==m&&(x=x.slice(0,Y)),x}(w,h);if(ArrayBuffer.isView(w))return function W(w){if(Qn(w,Uint8Array)){const h=new Uint8Array(w);return oe(h.buffer,h.byteOffset,h.byteLength)}return z(w)}(w);if(null==w)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(Qn(w,ArrayBuffer)||w&&Qn(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Qn(w,SharedArrayBuffer)||w&&Qn(w.buffer,SharedArrayBuffer)))return oe(w,h,m);if("number"==typeof w)throw new TypeError('The "value" argument must not be of type number. Received type number');const x=w.valueOf&&w.valueOf();if(null!=x&&x!==w)return b.from(x,h,m);const Y=function me(w){if(b.isBuffer(w)){const h=0|fe(w.length),m=O(h);return 0===m.length||w.copy(m,0,0,h),m}return void 0!==w.length?"number"!=typeof w.length||Kt(w.length)?O(0):z(w):"Buffer"===w.type&&Array.isArray(w.data)?z(w.data):void 0}(w);if(Y)return Y;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof w[Symbol.toPrimitive])return b.from(w[Symbol.toPrimitive]("string"),h,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}function ne(w){if("number"!=typeof w)throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function Ie(w){return ne(w),O(w<0?0:0|fe(w))}function z(w){const h=w.length<0?0:0|fe(w.length),m=O(h);for(let x=0;x<h;x+=1)m[x]=255&w[x];return m}function oe(w,h,m){if(h<0||w.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<h+(m||0))throw new RangeError('"length" is outside of buffer bounds');let x;return x=void 0===h&&void 0===m?new Uint8Array(w):void 0===m?new Uint8Array(w,h):new Uint8Array(w,h,m),Object.setPrototypeOf(x,b.prototype),x}function fe(w){if(w>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return 0|w}function X(w,h){if(b.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||Qn(w,ArrayBuffer))return w.byteLength;if("string"!=typeof w)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);const m=w.length,x=arguments.length>2&&!0===arguments[2];if(!x&&0===m)return 0;let Y=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Gt(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*m;case"hex":return m>>>1;case"base64":return wt(w).length;default:if(Y)return x?-1:Gt(w).length;h=(""+h).toLowerCase(),Y=!0}}function ge(w,h,m){let x=!1;if((void 0===h||h<0)&&(h=0),h>this.length||((void 0===m||m>this.length)&&(m=this.length),m<=0)||(m>>>=0)<=(h>>>=0))return"";for(w||(w="utf8");;)switch(w){case"hex":return pe(this,h,m);case"utf8":case"utf-8":return K(this,h,m);case"ascii":return P(this,h,m);case"latin1":case"binary":return k(this,h,m);case"base64":return te(this,h,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me(this,h,m);default:if(x)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),x=!0}}function Se(w,h,m){const x=w[h];w[h]=w[m],w[m]=x}function Te(w,h,m,x,Y){if(0===w.length)return-1;if("string"==typeof m?(x=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),Kt(m=+m)&&(m=Y?0:w.length-1),m<0&&(m=w.length+m),m>=w.length){if(Y)return-1;m=w.length-1}else if(m<0){if(!Y)return-1;m=0}if("string"==typeof h&&(h=b.from(h,x)),b.isBuffer(h))return 0===h.length?-1:q(w,h,m,x,Y);if("number"==typeof h)return h&=255,"function"==typeof Uint8Array.prototype.indexOf?Y?Uint8Array.prototype.indexOf.call(w,h,m):Uint8Array.prototype.lastIndexOf.call(w,h,m):q(w,[h],m,x,Y);throw new TypeError("val must be string, number or Buffer")}function q(w,h,m,x,Y){let dt,ue=1,ye=w.length,at=h.length;if(void 0!==x&&("ucs2"===(x=String(x).toLowerCase())||"ucs-2"===x||"utf16le"===x||"utf-16le"===x)){if(w.length<2||h.length<2)return-1;ue=2,ye/=2,at/=2,m/=2}function Et(Dt,vt){return 1===ue?Dt[vt]:Dt.readUInt16BE(vt*ue)}if(Y){let Dt=-1;for(dt=m;dt<ye;dt++)if(Et(w,dt)===Et(h,-1===Dt?0:dt-Dt)){if(-1===Dt&&(Dt=dt),dt-Dt+1===at)return Dt*ue}else-1!==Dt&&(dt-=dt-Dt),Dt=-1}else for(m+at>ye&&(m=ye-at),dt=m;dt>=0;dt--){let Dt=!0;for(let vt=0;vt<at;vt++)if(Et(w,dt+vt)!==Et(h,vt)){Dt=!1;break}if(Dt)return dt}return-1}function j(w,h,m,x){m=Number(m)||0;const Y=w.length-m;x?(x=Number(x))>Y&&(x=Y):x=Y;const ue=h.length;let ye;for(x>ue/2&&(x=ue/2),ye=0;ye<x;++ye){const at=parseInt(h.substr(2*ye,2),16);if(Kt(at))return ye;w[m+ye]=at}return ye}function H(w,h,m,x){return Zn(Gt(h,w.length-m),w,m,x)}function U(w,h,m,x){return Zn(function fn(w){const h=[];for(let m=0;m<w.length;++m)h.push(255&w.charCodeAt(m));return h}(h),w,m,x)}function $(w,h,m,x){return Zn(wt(h),w,m,x)}function ce(w,h,m,x){return Zn(function In(w,h){let m,x,Y;const ue=[];for(let ye=0;ye<w.length&&!((h-=2)<0);++ye)m=w.charCodeAt(ye),x=m>>8,Y=m%256,ue.push(Y),ue.push(x);return ue}(h,w.length-m),w,m,x)}function te(w,h,m){return B.fromByteArray(0===h&&m===w.length?w:w.slice(h,m))}function K(w,h,m){m=Math.min(w.length,m);const x=[];let Y=h;for(;Y<m;){const ue=w[Y];let ye=null,at=ue>239?4:ue>223?3:ue>191?2:1;if(Y+at<=m){let Et,dt,Dt,vt;switch(at){case 1:ue<128&&(ye=ue);break;case 2:Et=w[Y+1],128==(192&Et)&&(vt=(31&ue)<<6|63&Et,vt>127&&(ye=vt));break;case 3:Et=w[Y+1],dt=w[Y+2],128==(192&Et)&&128==(192&dt)&&(vt=(15&ue)<<12|(63&Et)<<6|63&dt,vt>2047&&(vt<55296||vt>57343)&&(ye=vt));break;case 4:Et=w[Y+1],dt=w[Y+2],Dt=w[Y+3],128==(192&Et)&&128==(192&dt)&&128==(192&Dt)&&(vt=(15&ue)<<18|(63&Et)<<12|(63&dt)<<6|63&Dt,vt>65535&&vt<1114112&&(ye=vt))}}null===ye?(ye=65533,at=1):ye>65535&&(ye-=65536,x.push(ye>>>10&1023|55296),ye=56320|1023&ye),x.push(ye),Y+=at}return function re(w){const h=w.length;if(h<=D)return String.fromCharCode.apply(String,w);let m="",x=0;for(;x<h;)m+=String.fromCharCode.apply(String,w.slice(x,x+=D));return m}(x)}g.kMaxLength=I,!(b.TYPED_ARRAY_SUPPORT=function T(){try{const w=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(w,h),42===w.foo()}catch{return!1}}())&&typeof console<"u"&&"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(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}}),Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}}),b.poolSize=8192,b.from=function(w,h,m){return Z(w,h,m)},Object.setPrototypeOf(b.prototype,Uint8Array.prototype),Object.setPrototypeOf(b,Uint8Array),b.alloc=function(w,h,m){return function ee(w,h,m){return ne(w),w<=0?O(w):void 0!==h?"string"==typeof m?O(w).fill(h,m):O(w).fill(h):O(w)}(w,h,m)},b.allocUnsafe=function(w){return Ie(w)},b.allocUnsafeSlow=function(w){return Ie(w)},b.isBuffer=function(h){return null!=h&&!0===h._isBuffer&&h!==b.prototype},b.compare=function(h,m){if(Qn(h,Uint8Array)&&(h=b.from(h,h.offset,h.byteLength)),Qn(m,Uint8Array)&&(m=b.from(m,m.offset,m.byteLength)),!b.isBuffer(h)||!b.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===m)return 0;let x=h.length,Y=m.length;for(let ue=0,ye=Math.min(x,Y);ue<ye;++ue)if(h[ue]!==m[ue]){x=h[ue],Y=m[ue];break}return x<Y?-1:Y<x?1:0},b.isEncoding=function(h){switch(String(h).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}},b.concat=function(h,m){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(0===h.length)return b.alloc(0);let x;if(void 0===m)for(m=0,x=0;x<h.length;++x)m+=h[x].length;const Y=b.allocUnsafe(m);let ue=0;for(x=0;x<h.length;++x){let ye=h[x];if(Qn(ye,Uint8Array))ue+ye.length>Y.length?(b.isBuffer(ye)||(ye=b.from(ye)),ye.copy(Y,ue)):Uint8Array.prototype.set.call(Y,ye,ue);else{if(!b.isBuffer(ye))throw new TypeError('"list" argument must be an Array of Buffers');ye.copy(Y,ue)}ue+=ye.length}return Y},b.byteLength=X,b.prototype._isBuffer=!0,b.prototype.swap16=function(){const h=this.length;if(h%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<h;m+=2)Se(this,m,m+1);return this},b.prototype.swap32=function(){const h=this.length;if(h%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<h;m+=4)Se(this,m,m+3),Se(this,m+1,m+2);return this},b.prototype.swap64=function(){const h=this.length;if(h%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<h;m+=8)Se(this,m,m+7),Se(this,m+1,m+6),Se(this,m+2,m+5),Se(this,m+3,m+4);return this},b.prototype.toString=function(){const h=this.length;return 0===h?"":0===arguments.length?K(this,0,h):ge.apply(this,arguments)},b.prototype.toLocaleString=b.prototype.toString,b.prototype.equals=function(h){if(!b.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h||0===b.compare(this,h)},b.prototype.inspect=function(){let h="";const m=g.INSPECT_MAX_BYTES;return h=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(h+=" ... "),"<Buffer "+h+">"},_&&(b.prototype[_]=b.prototype.inspect),b.prototype.compare=function(h,m,x,Y,ue){if(Qn(h,Uint8Array)&&(h=b.from(h,h.offset,h.byteLength)),!b.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(void 0===m&&(m=0),void 0===x&&(x=h?h.length:0),void 0===Y&&(Y=0),void 0===ue&&(ue=this.length),m<0||x>h.length||Y<0||ue>this.length)throw new RangeError("out of range index");if(Y>=ue&&m>=x)return 0;if(Y>=ue)return-1;if(m>=x)return 1;if(this===h)return 0;let ye=(ue>>>=0)-(Y>>>=0),at=(x>>>=0)-(m>>>=0);const Et=Math.min(ye,at),dt=this.slice(Y,ue),Dt=h.slice(m,x);for(let vt=0;vt<Et;++vt)if(dt[vt]!==Dt[vt]){ye=dt[vt],at=Dt[vt];break}return ye<at?-1:at<ye?1:0},b.prototype.includes=function(h,m,x){return-1!==this.indexOf(h,m,x)},b.prototype.indexOf=function(h,m,x){return Te(this,h,m,x,!0)},b.prototype.lastIndexOf=function(h,m,x){return Te(this,h,m,x,!1)},b.prototype.write=function(h,m,x,Y){if(void 0===m)Y="utf8",x=this.length,m=0;else if(void 0===x&&"string"==typeof m)Y=m,x=this.length,m=0;else{if(!isFinite(m))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");m>>>=0,isFinite(x)?(x>>>=0,void 0===Y&&(Y="utf8")):(Y=x,x=void 0)}const ue=this.length-m;if((void 0===x||x>ue)&&(x=ue),h.length>0&&(x<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");let ye=!1;for(;;)switch(Y){case"hex":return j(this,h,m,x);case"utf8":case"utf-8":return H(this,h,m,x);case"ascii":case"latin1":case"binary":return U(this,h,m,x);case"base64":return $(this,h,m,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,h,m,x);default:if(ye)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),ye=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const D=4096;function P(w,h,m){let x="";m=Math.min(w.length,m);for(let Y=h;Y<m;++Y)x+=String.fromCharCode(127&w[Y]);return x}function k(w,h,m){let x="";m=Math.min(w.length,m);for(let Y=h;Y<m;++Y)x+=String.fromCharCode(w[Y]);return x}function pe(w,h,m){const x=w.length;(!h||h<0)&&(h=0),(!m||m<0||m>x)&&(m=x);let Y="";for(let ue=h;ue<m;++ue)Y+=Ke[w[ue]];return Y}function Me(w,h,m){const x=w.slice(h,m);let Y="";for(let ue=0;ue<x.length-1;ue+=2)Y+=String.fromCharCode(x[ue]+256*x[ue+1]);return Y}function G(w,h,m){if(w%1!=0||w<0)throw new RangeError("offset is not uint");if(w+h>m)throw new RangeError("Trying to access beyond buffer length")}function N(w,h,m,x,Y,ue){if(!b.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>Y||h<ue)throw new RangeError('"value" argument is out of bounds');if(m+x>w.length)throw new RangeError("Index out of range")}function M(w,h,m,x,Y){nt(h,x,Y,w,m,7);let ue=Number(h&BigInt(4294967295));w[m++]=ue,ue>>=8,w[m++]=ue,ue>>=8,w[m++]=ue,ue>>=8,w[m++]=ue;let ye=Number(h>>BigInt(32)&BigInt(4294967295));return w[m++]=ye,ye>>=8,w[m++]=ye,ye>>=8,w[m++]=ye,ye>>=8,w[m++]=ye,m}function V(w,h,m,x,Y){nt(h,x,Y,w,m,7);let ue=Number(h&BigInt(4294967295));w[m+7]=ue,ue>>=8,w[m+6]=ue,ue>>=8,w[m+5]=ue,ue>>=8,w[m+4]=ue;let ye=Number(h>>BigInt(32)&BigInt(4294967295));return w[m+3]=ye,ye>>=8,w[m+2]=ye,ye>>=8,w[m+1]=ye,ye>>=8,w[m]=ye,m+8}function ie(w,h,m,x,Y,ue){if(m+x>w.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function ke(w,h,m,x,Y){return h=+h,m>>>=0,Y||ie(w,0,m,4),S.write(w,h,m,x,23,4),m+4}function Oe(w,h,m,x,Y){return h=+h,m>>>=0,Y||ie(w,0,m,8),S.write(w,h,m,x,52,8),m+8}b.prototype.slice=function(h,m){const x=this.length;(h=~~h)<0?(h+=x)<0&&(h=0):h>x&&(h=x),(m=void 0===m?x:~~m)<0?(m+=x)<0&&(m=0):m>x&&(m=x),m<h&&(m=h);const Y=this.subarray(h,m);return Object.setPrototypeOf(Y,b.prototype),Y},b.prototype.readUintLE=b.prototype.readUIntLE=function(h,m,x){h>>>=0,m>>>=0,x||G(h,m,this.length);let Y=this[h],ue=1,ye=0;for(;++ye<m&&(ue*=256);)Y+=this[h+ye]*ue;return Y},b.prototype.readUintBE=b.prototype.readUIntBE=function(h,m,x){h>>>=0,m>>>=0,x||G(h,m,this.length);let Y=this[h+--m],ue=1;for(;m>0&&(ue*=256);)Y+=this[h+--m]*ue;return Y},b.prototype.readUint8=b.prototype.readUInt8=function(h,m){return h>>>=0,m||G(h,1,this.length),this[h]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(h,m){return h>>>=0,m||G(h,2,this.length),this[h]|this[h+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(h,m){return h>>>=0,m||G(h,2,this.length),this[h]<<8|this[h+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(h,m){return h>>>=0,m||G(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+16777216*this[h+3]},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(h,m){return h>>>=0,m||G(h,4,this.length),16777216*this[h]+(this[h+1]<<16|this[h+2]<<8|this[h+3])},b.prototype.readBigUInt64LE=Ne(function(h){ut(h>>>=0,"offset");const m=this[h],x=this[h+7];(void 0===m||void 0===x)&&ve(h,this.length-8);const Y=m+256*this[++h]+65536*this[++h]+this[++h]*2**24,ue=this[++h]+256*this[++h]+65536*this[++h]+x*2**24;return BigInt(Y)+(BigInt(ue)<<BigInt(32))}),b.prototype.readBigUInt64BE=Ne(function(h){ut(h>>>=0,"offset");const m=this[h],x=this[h+7];(void 0===m||void 0===x)&&ve(h,this.length-8);const Y=m*2**24+65536*this[++h]+256*this[++h]+this[++h],ue=this[++h]*2**24+65536*this[++h]+256*this[++h]+x;return(BigInt(Y)<<BigInt(32))+BigInt(ue)}),b.prototype.readIntLE=function(h,m,x){h>>>=0,m>>>=0,x||G(h,m,this.length);let Y=this[h],ue=1,ye=0;for(;++ye<m&&(ue*=256);)Y+=this[h+ye]*ue;return ue*=128,Y>=ue&&(Y-=Math.pow(2,8*m)),Y},b.prototype.readIntBE=function(h,m,x){h>>>=0,m>>>=0,x||G(h,m,this.length);let Y=m,ue=1,ye=this[h+--Y];for(;Y>0&&(ue*=256);)ye+=this[h+--Y]*ue;return ue*=128,ye>=ue&&(ye-=Math.pow(2,8*m)),ye},b.prototype.readInt8=function(h,m){return h>>>=0,m||G(h,1,this.length),128&this[h]?-1*(255-this[h]+1):this[h]},b.prototype.readInt16LE=function(h,m){h>>>=0,m||G(h,2,this.length);const x=this[h]|this[h+1]<<8;return 32768&x?4294901760|x:x},b.prototype.readInt16BE=function(h,m){h>>>=0,m||G(h,2,this.length);const x=this[h+1]|this[h]<<8;return 32768&x?4294901760|x:x},b.prototype.readInt32LE=function(h,m){return h>>>=0,m||G(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},b.prototype.readInt32BE=function(h,m){return h>>>=0,m||G(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},b.prototype.readBigInt64LE=Ne(function(h){ut(h>>>=0,"offset");const m=this[h],x=this[h+7];return(void 0===m||void 0===x)&&ve(h,this.length-8),(BigInt(this[h+4]+256*this[h+5]+65536*this[h+6]+(x<<24))<<BigInt(32))+BigInt(m+256*this[++h]+65536*this[++h]+this[++h]*2**24)}),b.prototype.readBigInt64BE=Ne(function(h){ut(h>>>=0,"offset");const m=this[h],x=this[h+7];(void 0===m||void 0===x)&&ve(h,this.length-8);const Y=(m<<24)+65536*this[++h]+256*this[++h]+this[++h];return(BigInt(Y)<<BigInt(32))+BigInt(this[++h]*2**24+65536*this[++h]+256*this[++h]+x)}),b.prototype.readFloatLE=function(h,m){return h>>>=0,m||G(h,4,this.length),S.read(this,h,!0,23,4)},b.prototype.readFloatBE=function(h,m){return h>>>=0,m||G(h,4,this.length),S.read(this,h,!1,23,4)},b.prototype.readDoubleLE=function(h,m){return h>>>=0,m||G(h,8,this.length),S.read(this,h,!0,52,8)},b.prototype.readDoubleBE=function(h,m){return h>>>=0,m||G(h,8,this.length),S.read(this,h,!1,52,8)},b.prototype.writeUintLE=b.prototype.writeUIntLE=function(h,m,x,Y){h=+h,m>>>=0,x>>>=0,Y||N(this,h,m,x,Math.pow(2,8*x)-1,0);let ue=1,ye=0;for(this[m]=255&h;++ye<x&&(ue*=256);)this[m+ye]=h/ue&255;return m+x},b.prototype.writeUintBE=b.prototype.writeUIntBE=function(h,m,x,Y){h=+h,m>>>=0,x>>>=0,Y||N(this,h,m,x,Math.pow(2,8*x)-1,0);let ue=x-1,ye=1;for(this[m+ue]=255&h;--ue>=0&&(ye*=256);)this[m+ue]=h/ye&255;return m+x},b.prototype.writeUint8=b.prototype.writeUInt8=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,1,255,0),this[m]=255&h,m+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,2,65535,0),this[m]=255&h,this[m+1]=h>>>8,m+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,2,65535,0),this[m]=h>>>8,this[m+1]=255&h,m+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,4,4294967295,0),this[m+3]=h>>>24,this[m+2]=h>>>16,this[m+1]=h>>>8,this[m]=255&h,m+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,4,4294967295,0),this[m]=h>>>24,this[m+1]=h>>>16,this[m+2]=h>>>8,this[m+3]=255&h,m+4},b.prototype.writeBigUInt64LE=Ne(function(h,m=0){return M(this,h,m,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=Ne(function(h,m=0){return V(this,h,m,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(h,m,x,Y){if(h=+h,m>>>=0,!Y){const Et=Math.pow(2,8*x-1);N(this,h,m,x,Et-1,-Et)}let ue=0,ye=1,at=0;for(this[m]=255&h;++ue<x&&(ye*=256);)h<0&&0===at&&0!==this[m+ue-1]&&(at=1),this[m+ue]=(h/ye|0)-at&255;return m+x},b.prototype.writeIntBE=function(h,m,x,Y){if(h=+h,m>>>=0,!Y){const Et=Math.pow(2,8*x-1);N(this,h,m,x,Et-1,-Et)}let ue=x-1,ye=1,at=0;for(this[m+ue]=255&h;--ue>=0&&(ye*=256);)h<0&&0===at&&0!==this[m+ue+1]&&(at=1),this[m+ue]=(h/ye|0)-at&255;return m+x},b.prototype.writeInt8=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,1,127,-128),h<0&&(h=255+h+1),this[m]=255&h,m+1},b.prototype.writeInt16LE=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,2,32767,-32768),this[m]=255&h,this[m+1]=h>>>8,m+2},b.prototype.writeInt16BE=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,2,32767,-32768),this[m]=h>>>8,this[m+1]=255&h,m+2},b.prototype.writeInt32LE=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,4,2147483647,-2147483648),this[m]=255&h,this[m+1]=h>>>8,this[m+2]=h>>>16,this[m+3]=h>>>24,m+4},b.prototype.writeInt32BE=function(h,m,x){return h=+h,m>>>=0,x||N(this,h,m,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[m]=h>>>24,this[m+1]=h>>>16,this[m+2]=h>>>8,this[m+3]=255&h,m+4},b.prototype.writeBigInt64LE=Ne(function(h,m=0){return M(this,h,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=Ne(function(h,m=0){return V(this,h,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeFloatLE=function(h,m,x){return ke(this,h,m,!0,x)},b.prototype.writeFloatBE=function(h,m,x){return ke(this,h,m,!1,x)},b.prototype.writeDoubleLE=function(h,m,x){return Oe(this,h,m,!0,x)},b.prototype.writeDoubleBE=function(h,m,x){return Oe(this,h,m,!1,x)},b.prototype.copy=function(h,m,x,Y){if(!b.isBuffer(h))throw new TypeError("argument should be a Buffer");if(x||(x=0),!Y&&0!==Y&&(Y=this.length),m>=h.length&&(m=h.length),m||(m=0),Y>0&&Y<x&&(Y=x),Y===x||0===h.length||0===this.length)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(x<0||x>=this.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length),h.length-m<Y-x&&(Y=h.length-m+x);const ue=Y-x;return this===h&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(m,x,Y):Uint8Array.prototype.set.call(h,this.subarray(x,Y),m),ue},b.prototype.fill=function(h,m,x,Y){if("string"==typeof h){if("string"==typeof m?(Y=m,m=0,x=this.length):"string"==typeof x&&(Y=x,x=this.length),void 0!==Y&&"string"!=typeof Y)throw new TypeError("encoding must be a string");if("string"==typeof Y&&!b.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);if(1===h.length){const ye=h.charCodeAt(0);("utf8"===Y&&ye<128||"latin1"===Y)&&(h=ye)}}else"number"==typeof h?h&=255:"boolean"==typeof h&&(h=Number(h));if(m<0||this.length<m||this.length<x)throw new RangeError("Out of range index");if(x<=m)return this;let ue;if(m>>>=0,x=void 0===x?this.length:x>>>0,h||(h=0),"number"==typeof h)for(ue=m;ue<x;++ue)this[ue]=h;else{const ye=b.isBuffer(h)?h:b.from(h,Y),at=ye.length;if(0===at)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(ue=0;ue<x-m;++ue)this[ue+m]=ye[ue%at]}return this};const Ce={};function Fe(w,h,m){Ce[w]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,delete this.name}get code(){return w}set code(Y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Y,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}function xe(w){let h="",m=w.length;const x="-"===w[0]?1:0;for(;m>=x+4;m-=3)h=`_${w.slice(m-3,m)}${h}`;return`${w.slice(0,m)}${h}`}function nt(w,h,m,x,Y,ue){if(w>m||w<h){const ye="bigint"==typeof h?"n":"";let at;throw at=ue>3?0===h||h===BigInt(0)?`>= 0${ye} and < 2${ye} ** ${8*(ue+1)}${ye}`:`>= -(2${ye} ** ${8*(ue+1)-1}${ye}) and < 2 ** ${8*(ue+1)-1}${ye}`:`>= ${h}${ye} and <= ${m}${ye}`,new Ce.ERR_OUT_OF_RANGE("value",at,w)}!function je(w,h,m){ut(h,"offset"),(void 0===w[h]||void 0===w[h+m])&&ve(h,w.length-(m+1))}(x,Y,ue)}function ut(w,h){if("number"!=typeof w)throw new Ce.ERR_INVALID_ARG_TYPE(h,"number",w)}function ve(w,h,m){throw Math.floor(w)!==w?(ut(w,m),new Ce.ERR_OUT_OF_RANGE(m||"offset","an integer",w)):h<0?new Ce.ERR_BUFFER_OUT_OF_BOUNDS:new Ce.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${h}`,w)}Fe("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Fe("ERR_INVALID_ARG_TYPE",function(w,h){return`The "${w}" argument must be of type number. Received type ${typeof h}`},TypeError),Fe("ERR_OUT_OF_RANGE",function(w,h,m){let x=`The value of "${w}" is out of range.`,Y=m;return Number.isInteger(m)&&Math.abs(m)>2**32?Y=xe(String(m)):"bigint"==typeof m&&(Y=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(Y=xe(Y)),Y+="n"),x+=` It must be ${h}. Received ${Y}`,x},RangeError);const et=/[^+/0-9A-Za-z-_]/g;function Gt(w,h){let m;h=h||1/0;const x=w.length;let Y=null;const ue=[];for(let ye=0;ye<x;++ye){if(m=w.charCodeAt(ye),m>55295&&m<57344){if(!Y){if(m>56319){(h-=3)>-1&&ue.push(239,191,189);continue}if(ye+1===x){(h-=3)>-1&&ue.push(239,191,189);continue}Y=m;continue}if(m<56320){(h-=3)>-1&&ue.push(239,191,189),Y=m;continue}m=65536+(Y-55296<<10|m-56320)}else Y&&(h-=3)>-1&&ue.push(239,191,189);if(Y=null,m<128){if((h-=1)<0)break;ue.push(m)}else if(m<2048){if((h-=2)<0)break;ue.push(m>>6|192,63&m|128)}else if(m<65536){if((h-=3)<0)break;ue.push(m>>12|224,m>>6&63|128,63&m|128)}else{if(!(m<1114112))throw new Error("Invalid code point");if((h-=4)<0)break;ue.push(m>>18|240,m>>12&63|128,m>>6&63|128,63&m|128)}}return ue}function wt(w){return B.toByteArray(function Pt(w){if((w=(w=w.split("=")[0]).trim().replace(et,"")).length<2)return"";for(;w.length%4!=0;)w+="=";return w}(w))}function Zn(w,h,m,x){let Y;for(Y=0;Y<x&&!(Y+m>=h.length||Y>=w.length);++Y)h[Y+m]=w[Y];return Y}function Qn(w,h){return w instanceof h||null!=w&&null!=w.constructor&&null!=w.constructor.name&&w.constructor.name===h.name}function Kt(w){return w!=w}const Ke=function(){const w="0123456789abcdef",h=new Array(256);for(let m=0;m<16;++m){const x=16*m;for(let Y=0;Y<16;++Y)h[x+Y]=w[m]+w[Y]}return h}();function Ne(w){return typeof BigInt>"u"?He:w}function He(){throw new Error("BigInt not supported")}},243(Xe){"use strict";var g={single_source_shortest_paths:function(L,B,S){var _={},I={};I[B]=0;var O,b,Z,ne,ee,Ae,T=g.PriorityQueue.make();for(T.push(B,0);!T.empty();)for(Z in ne=(O=T.pop()).cost,ee=L[b=O.value]||{})ee.hasOwnProperty(Z)&&(Ae=ne+ee[Z],(typeof I[Z]>"u"||I[Z]>Ae)&&(I[Z]=Ae,T.push(Z,Ae),_[Z]=b));if(typeof S<"u"&&typeof I[S]>"u"){var oe=["Could not find a path from ",B," to ",S,"."].join("");throw new Error(oe)}return _},extract_shortest_path_from_predecessor_list:function(L,B){for(var S=[],_=B;_;)S.push(_),_=L[_];return S.reverse(),S},find_path:function(L,B,S){var _=g.single_source_shortest_paths(L,B,S);return g.extract_shortest_path_from_predecessor_list(_,S)},PriorityQueue:{make:function(L){var _,B=g.PriorityQueue,S={};for(_ in L=L||{},B)B.hasOwnProperty(_)&&(S[_]=B[_]);return S.queue=[],S.sorter=L.sorter||B.default_sorter,S},default_sorter:function(L,B){return L.cost-B.cost},push:function(L,B){this.queue.push({value:L,cost:B}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};Xe.exports=g},2020(Xe,g){g.read=function(L,B,S,_,I){var T,O,b=8*I-_-1,Z=(1<<b)-1,ne=Z>>1,ee=-7,Ie=S?I-1:0,Ae=S?-1:1,z=L[B+Ie];for(Ie+=Ae,T=z&(1<<-ee)-1,z>>=-ee,ee+=b;ee>0;T=256*T+L[B+Ie],Ie+=Ae,ee-=8);for(O=T&(1<<-ee)-1,T>>=-ee,ee+=_;ee>0;O=256*O+L[B+Ie],Ie+=Ae,ee-=8);if(0===T)T=1-ne;else{if(T===Z)return O?NaN:1/0*(z?-1:1);O+=Math.pow(2,_),T-=ne}return(z?-1:1)*O*Math.pow(2,T-_)},g.write=function(L,B,S,_,I,T){var O,b,Z,ne=8*T-I-1,ee=(1<<ne)-1,Ie=ee>>1,Ae=23===I?Math.pow(2,-24)-Math.pow(2,-77):0,z=_?0:T-1,W=_?1:-1,oe=B<0||0===B&&1/B<0?1:0;for(B=Math.abs(B),isNaN(B)||B===1/0?(b=isNaN(B)?1:0,O=ee):(O=Math.floor(Math.log(B)/Math.LN2),B*(Z=Math.pow(2,-O))<1&&(O--,Z*=2),(B+=O+Ie>=1?Ae/Z:Ae*Math.pow(2,1-Ie))*Z>=2&&(O++,Z/=2),O+Ie>=ee?(b=0,O=ee):O+Ie>=1?(b=(B*Z-1)*Math.pow(2,I),O+=Ie):(b=B*Math.pow(2,Ie-1)*Math.pow(2,I),O=0));I>=8;L[S+z]=255&b,z+=W,b/=256,I-=8);for(O=O<<I|b,ne+=I;ne>0;L[S+z]=255&O,z+=W,O/=256,ne-=8);L[S+z-W]|=128*oe}},8314(Xe,g,L){const S=L(2836),_=L(9460),I=L(7030),T=L(6511);function O(b,Z,ne,ee,Ie){const Ae=[].slice.call(arguments,1),z=Ae.length,W="function"==typeof Ae[z-1];if(!W&&!S())throw new Error("Callback required as last argument");if(!W){if(z<1)throw new Error("Too few arguments provided");return 1===z?(ne=Z,Z=ee=void 0):2===z&&!Z.getContext&&(ee=ne,ne=Z,Z=void 0),new Promise(function(oe,me){try{const fe=_.create(ne,ee);oe(b(fe,Z,ee))}catch(fe){me(fe)}})}if(z<2)throw new Error("Too few arguments provided");2===z?(Ie=ne,ne=Z,Z=ee=void 0):3===z&&(Z.getContext&&typeof Ie>"u"?(Ie=ee,ee=void 0):(Ie=ee,ee=ne,ne=Z,Z=void 0));try{const oe=_.create(ne,ee);Ie(null,b(oe,Z,ee))}catch(oe){Ie(oe)}}O.bind(null,I.render),g.dY=O.bind(null,I.renderToDataURL),O.bind(null,function(b,Z,ne){return T.render(b,ne)})},2836(Xe){Xe.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},6214(Xe,g,L){const B=L(9089).getSymbolSize;g.getRowColCoords=function(_){if(1===_)return[];const I=Math.floor(_/7)+2,T=B(_),O=145===T?26:2*Math.ceil((T-13)/(2*I-2)),b=[T-7];for(let Z=1;Z<I-1;Z++)b[Z]=b[Z-1]-O;return b.push(6),b.reverse()},g.getPositions=function(_){const I=[],T=g.getRowColCoords(_),O=T.length;for(let b=0;b<O;b++)for(let Z=0;Z<O;Z++)0===b&&0===Z||0===b&&Z===O-1||b===O-1&&0===Z||I.push([T[b],T[Z]]);return I}},1018(Xe,g,L){const B=L(1677),S=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function _(I){this.mode=B.ALPHANUMERIC,this.data=I}_.getBitsLength=function(T){return 11*Math.floor(T/2)+T%2*6},_.prototype.getLength=function(){return this.data.length},_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)},_.prototype.write=function(T){let O;for(O=0;O+2<=this.data.length;O+=2){let b=45*S.indexOf(this.data[O]);b+=S.indexOf(this.data[O+1]),T.put(b,11)}this.data.length%2&&T.put(S.indexOf(this.data[O]),6)},Xe.exports=_},4662(Xe){function g(){this.buffer=[],this.length=0}g.prototype={get:function(L){const B=Math.floor(L/8);return 1==(this.buffer[B]>>>7-L%8&1)},put:function(L,B){for(let S=0;S<B;S++)this.putBit(1==(L>>>B-S-1&1))},getLengthInBits:function(){return this.length},putBit:function(L){const B=Math.floor(this.length/8);this.buffer.length<=B&&this.buffer.push(0),L&&(this.buffer[B]|=128>>>this.length%8),this.length++}},Xe.exports=g},5941(Xe){function g(L){if(!L||L<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=L,this.data=new Uint8Array(L*L),this.reservedBit=new Uint8Array(L*L)}g.prototype.set=function(L,B,S,_){const I=L*this.size+B;this.data[I]=S,_&&(this.reservedBit[I]=!0)},g.prototype.get=function(L,B){return this.data[L*this.size+B]},g.prototype.xor=function(L,B,S){this.data[L*this.size+B]^=S},g.prototype.isReserved=function(L,B){return this.reservedBit[L*this.size+B]},Xe.exports=g},4969(Xe,g,L){const B=L(1677);function S(_){this.mode=B.BYTE,this.data="string"==typeof _?(new TextEncoder).encode(_):new Uint8Array(_)}S.getBitsLength=function(I){return 8*I},S.prototype.getLength=function(){return this.data.length},S.prototype.getBitsLength=function(){return S.getBitsLength(this.data.length)},S.prototype.write=function(_){for(let I=0,T=this.data.length;I<T;I++)_.put(this.data[I],8)},Xe.exports=S},3677(Xe,g,L){const B=L(7424),S=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],_=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];g.getBlocksCount=function(T,O){switch(O){case B.L:return S[4*(T-1)+0];case B.M:return S[4*(T-1)+1];case B.Q:return S[4*(T-1)+2];case B.H:return S[4*(T-1)+3];default:return}},g.getTotalCodewordsCount=function(T,O){switch(O){case B.L:return _[4*(T-1)+0];case B.M:return _[4*(T-1)+1];case B.Q:return _[4*(T-1)+2];case B.H:return _[4*(T-1)+3];default:return}}},7424(Xe,g){g.L={bit:1},g.M={bit:0},g.Q={bit:3},g.H={bit:2},g.isValid=function(S){return S&&typeof S.bit<"u"&&S.bit>=0&&S.bit<4},g.from=function(S,_){if(g.isValid(S))return S;try{return function L(B){if("string"!=typeof B)throw new Error("Param is not a string");switch(B.toLowerCase()){case"l":case"low":return g.L;case"m":case"medium":return g.M;case"q":case"quartile":return g.Q;case"h":case"high":return g.H;default:throw new Error("Unknown EC Level: "+B)}}(S)}catch{return _}}},6269(Xe,g,L){const B=L(9089).getSymbolSize;g.getPositions=function(I){const T=B(I);return[[0,0],[T-7,0],[0,T-7]]}},6254(Xe,g,L){const B=L(9089),I=B.getBCHDigit(1335);g.getEncodedBits=function(O,b){const Z=O.bit<<3|b;let ne=Z<<10;for(;B.getBCHDigit(ne)-I>=0;)ne^=1335<<B.getBCHDigit(ne)-I;return 21522^(Z<<10|ne)}},6686(Xe,g){const L=new Uint8Array(512),B=new Uint8Array(256);(function(){let _=1;for(let I=0;I<255;I++)L[I]=_,B[_]=I,_<<=1,256&_&&(_^=285);for(let I=255;I<512;I++)L[I]=L[I-255]})(),g.log=function(_){if(_<1)throw new Error("log("+_+")");return B[_]},g.exp=function(_){return L[_]},g.mul=function(_,I){return 0===_||0===I?0:L[B[_]+B[I]]}},3264(Xe,g,L){const B=L(1677),S=L(9089);function _(I){this.mode=B.KANJI,this.data=I}_.getBitsLength=function(T){return 13*T},_.prototype.getLength=function(){return this.data.length},_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)},_.prototype.write=function(I){let T;for(T=0;T<this.data.length;T++){let O=S.toSJIS(this.data[T]);if(O>=33088&&O<=40956)O-=33088;else{if(!(O>=57408&&O<=60351))throw new Error("Invalid SJIS character: "+this.data[T]+"\nMake sure your charset is UTF-8");O-=49472}O=192*(O>>>8&255)+(255&O),I.put(O,13)}},Xe.exports=_},3361(Xe,g){g.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function B(S,_,I){switch(S){case g.Patterns.PATTERN000:return(_+I)%2==0;case g.Patterns.PATTERN001:return _%2==0;case g.Patterns.PATTERN010:return I%3==0;case g.Patterns.PATTERN011:return(_+I)%3==0;case g.Patterns.PATTERN100:return(Math.floor(_/2)+Math.floor(I/3))%2==0;case g.Patterns.PATTERN101:return _*I%2+_*I%3==0;case g.Patterns.PATTERN110:return(_*I%2+_*I%3)%2==0;case g.Patterns.PATTERN111:return(_*I%3+(_+I)%2)%2==0;default:throw new Error("bad maskPattern:"+S)}}g.isValid=function(_){return null!=_&&""!==_&&!isNaN(_)&&_>=0&&_<=7},g.from=function(_){return g.isValid(_)?parseInt(_,10):void 0},g.getPenaltyN1=function(_){const I=_.size;let T=0,O=0,b=0,Z=null,ne=null;for(let ee=0;ee<I;ee++){O=b=0,Z=ne=null;for(let Ie=0;Ie<I;Ie++){let Ae=_.get(ee,Ie);Ae===Z?O++:(O>=5&&(T+=O-5+3),Z=Ae,O=1),Ae=_.get(Ie,ee),Ae===ne?b++:(b>=5&&(T+=b-5+3),ne=Ae,b=1)}O>=5&&(T+=O-5+3),b>=5&&(T+=b-5+3)}return T},g.getPenaltyN2=function(_){const I=_.size;let T=0;for(let O=0;O<I-1;O++)for(let b=0;b<I-1;b++){const Z=_.get(O,b)+_.get(O,b+1)+_.get(O+1,b)+_.get(O+1,b+1);(4===Z||0===Z)&&T++}return 3*T},g.getPenaltyN3=function(_){const I=_.size;let T=0,O=0,b=0;for(let Z=0;Z<I;Z++){O=b=0;for(let ne=0;ne<I;ne++)O=O<<1&2047|_.get(Z,ne),ne>=10&&(1488===O||93===O)&&T++,b=b<<1&2047|_.get(ne,Z),ne>=10&&(1488===b||93===b)&&T++}return 40*T},g.getPenaltyN4=function(_){let I=0;const T=_.data.length;for(let b=0;b<T;b++)I+=_.data[b];return 10*Math.abs(Math.ceil(100*I/T/5)-10)},g.applyMask=function(_,I){const T=I.size;for(let O=0;O<T;O++)for(let b=0;b<T;b++)I.isReserved(b,O)||I.xor(b,O,B(_,b,O))},g.getBestMask=function(_,I){const T=Object.keys(g.Patterns).length;let O=0,b=1/0;for(let Z=0;Z<T;Z++){I(Z),g.applyMask(Z,_);const ne=g.getPenaltyN1(_)+g.getPenaltyN2(_)+g.getPenaltyN3(_)+g.getPenaltyN4(_);g.applyMask(Z,_),ne<b&&(b=ne,O=Z)}return O}},1677(Xe,g,L){const B=L(377),S=L(9359);g.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},g.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},g.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},g.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},g.MIXED={bit:-1},g.getCharCountIndicator=function(T,O){if(!T.ccBits)throw new Error("Invalid mode: "+T);if(!B.isValid(O))throw new Error("Invalid version: "+O);return O>=1&&O<10?T.ccBits[0]:O<27?T.ccBits[1]:T.ccBits[2]},g.getBestModeForData=function(T){return S.testNumeric(T)?g.NUMERIC:S.testAlphanumeric(T)?g.ALPHANUMERIC:S.testKanji(T)?g.KANJI:g.BYTE},g.toString=function(T){if(T&&T.id)return T.id;throw new Error("Invalid mode")},g.isValid=function(T){return T&&T.bit&&T.ccBits},g.from=function(T,O){if(g.isValid(T))return T;try{return function _(I){if("string"!=typeof I)throw new Error("Param is not a string");switch(I.toLowerCase()){case"numeric":return g.NUMERIC;case"alphanumeric":return g.ALPHANUMERIC;case"kanji":return g.KANJI;case"byte":return g.BYTE;default:throw new Error("Unknown mode: "+I)}}(T)}catch{return O}}},6628(Xe,g,L){const B=L(1677);function S(_){this.mode=B.NUMERIC,this.data=_.toString()}S.getBitsLength=function(I){return 10*Math.floor(I/3)+(I%3?I%3*3+1:0)},S.prototype.getLength=function(){return this.data.length},S.prototype.getBitsLength=function(){return S.getBitsLength(this.data.length)},S.prototype.write=function(I){let T,O,b;for(T=0;T+3<=this.data.length;T+=3)O=this.data.substr(T,3),b=parseInt(O,10),I.put(b,10);const Z=this.data.length-T;Z>0&&(O=this.data.substr(T),b=parseInt(O,10),I.put(b,3*Z+1))},Xe.exports=S},1744(Xe,g,L){const B=L(6686);g.mul=function(_,I){const T=new Uint8Array(_.length+I.length-1);for(let O=0;O<_.length;O++)for(let b=0;b<I.length;b++)T[O+b]^=B.mul(_[O],I[b]);return T},g.mod=function(_,I){let T=new Uint8Array(_);for(;T.length-I.length>=0;){const O=T[0];for(let Z=0;Z<I.length;Z++)T[Z]^=B.mul(I[Z],O);let b=0;for(;b<T.length&&0===T[b];)b++;T=T.slice(b)}return T},g.generateECPolynomial=function(_){let I=new Uint8Array([1]);for(let T=0;T<_;T++)I=g.mul(I,new Uint8Array([1,B.exp(T)]));return I}},9460(Xe,g,L){const B=L(9089),S=L(7424),_=L(4662),I=L(5941),T=L(6214),O=L(6269),b=L(3361),Z=L(3677),ne=L(6289),ee=L(1252),Ie=L(6254),Ae=L(1677),z=L(2868);function ae(q,j,H){const U=q.size,$=Ie.getEncodedBits(j,H);let ce,te;for(ce=0;ce<15;ce++)te=1==($>>ce&1),q.set(ce<6?ce:ce<8?ce+1:U-15+ce,8,te,!0),q.set(8,ce<8?U-ce-1:ce<9?15-ce-1+1:15-ce-1,te,!0);q.set(U-8,8,1,!0)}function Te(q,j,H,U){let $;if(Array.isArray(q))$=z.fromArray(q);else{if("string"!=typeof q)throw new Error("Invalid data");{let re=j;if(!re){const P=z.rawSplit(q);re=ee.getBestVersionForData(P,H)}$=z.fromString(q,re||40)}}const ce=ee.getBestVersionForData($,H);if(!ce)throw new Error("The amount of data is too big to be stored in a QR Code");if(j){if(j<ce)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+ce+".\n")}else j=ce;const te=function ge(q,j,H){const U=new _;H.forEach(function(D){U.put(D.mode.bit,4),U.put(D.getLength(),Ae.getCharCountIndicator(D.mode,q)),D.write(U)});const te=8*(B.getSymbolTotalCodewords(q)-Z.getTotalCodewordsCount(q,j));for(U.getLengthInBits()+4<=te&&U.put(0,4);U.getLengthInBits()%8!=0;)U.putBit(0);const K=(te-U.getLengthInBits())/8;for(let D=0;D<K;D++)U.put(D%2?17:236,8);return function Se(q,j,H){const U=B.getSymbolTotalCodewords(j),ce=U-Z.getTotalCodewordsCount(j,H),te=Z.getBlocksCount(j,H),D=te-U%te,re=Math.floor(U/te),P=Math.floor(ce/te),k=P+1,pe=re-P,Me=new ne(pe);let G=0;const N=new Array(te),M=new Array(te);let V=0;const ie=new Uint8Array(q.buffer);for(let xe=0;xe<te;xe++){const je=xe<D?P:k;N[xe]=ie.slice(G,G+je),M[xe]=Me.encode(N[xe]),G+=je,V=Math.max(V,je)}const ke=new Uint8Array(U);let Ce,Fe,Oe=0;for(Ce=0;Ce<V;Ce++)for(Fe=0;Fe<te;Fe++)Ce<N[Fe].length&&(ke[Oe++]=N[Fe][Ce]);for(Ce=0;Ce<pe;Ce++)for(Fe=0;Fe<te;Fe++)ke[Oe++]=M[Fe][Ce];return ke}(U,q,j)}(j,H,$),K=B.getSymbolSize(j),D=new I(K);return function W(q,j){const H=q.size,U=O.getPositions(j);for(let $=0;$<U.length;$++){const ce=U[$][0],te=U[$][1];for(let K=-1;K<=7;K++)if(!(ce+K<=-1||H<=ce+K))for(let D=-1;D<=7;D++)te+D<=-1||H<=te+D||q.set(ce+K,te+D,K>=0&&K<=6&&(0===D||6===D)||D>=0&&D<=6&&(0===K||6===K)||K>=2&&K<=4&&D>=2&&D<=4,!0)}}(D,j),function oe(q){const j=q.size;for(let H=8;H<j-8;H++){const U=H%2==0;q.set(H,6,U,!0),q.set(6,H,U,!0)}}(D),function me(q,j){const H=T.getPositions(j);for(let U=0;U<H.length;U++){const $=H[U][0],ce=H[U][1];for(let te=-2;te<=2;te++)for(let K=-2;K<=2;K++)q.set($+te,ce+K,-2===te||2===te||-2===K||2===K||0===te&&0===K,!0)}}(D,j),ae(D,H,0),j>=7&&function fe(q,j){const H=q.size,U=ee.getEncodedBits(j);let $,ce,te;for(let K=0;K<18;K++)$=Math.floor(K/3),ce=K%3+H-8-3,te=1==(U>>K&1),q.set($,ce,te,!0),q.set(ce,$,te,!0)}(D,j),function X(q,j){const H=q.size;let U=-1,$=H-1,ce=7,te=0;for(let K=H-1;K>0;K-=2)for(6===K&&K--;;){for(let D=0;D<2;D++)if(!q.isReserved($,K-D)){let re=!1;te<j.length&&(re=1==(j[te]>>>ce&1)),q.set($,K-D,re),ce--,-1===ce&&(te++,ce=7)}if($+=U,$<0||H<=$){$-=U,U=-U;break}}}(D,te),isNaN(U)&&(U=b.getBestMask(D,ae.bind(null,D,H))),b.applyMask(U,D),ae(D,H,U),{modules:D,version:j,errorCorrectionLevel:H,maskPattern:U,segments:$}}g.create=function(j,H){if(typeof j>"u"||""===j)throw new Error("No input text");let $,ce,U=S.M;return typeof H<"u"&&(U=S.from(H.errorCorrectionLevel,S.M),$=ee.from(H.version),ce=b.from(H.maskPattern),H.toSJISFunc&&B.setToSJISFunction(H.toSJISFunc)),Te(j,$,U,ce)}},6289(Xe,g,L){const B=L(1744);function S(_){this.genPoly=void 0,this.degree=_,this.degree&&this.initialize(this.degree)}S.prototype.initialize=function(I){this.degree=I,this.genPoly=B.generateECPolynomial(this.degree)},S.prototype.encode=function(I){if(!this.genPoly)throw new Error("Encoder not initialized");const T=new Uint8Array(I.length+this.degree);T.set(I);const O=B.mod(T,this.genPoly),b=this.degree-O.length;if(b>0){const Z=new Uint8Array(this.degree);return Z.set(O,b),Z}return O},Xe.exports=S},9359(Xe,g){const L="[0-9]+";let S="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";S=S.replace(/u/g,"\\u");const _="(?:(?![A-Z0-9 $%*+\\-./:]|"+S+")(?:.|[\r\n]))+";g.KANJI=new RegExp(S,"g"),g.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),g.BYTE=new RegExp(_,"g"),g.NUMERIC=new RegExp(L,"g"),g.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const I=new RegExp("^"+S+"$"),T=new RegExp("^"+L+"$"),O=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");g.testKanji=function(Z){return I.test(Z)},g.testNumeric=function(Z){return T.test(Z)},g.testAlphanumeric=function(Z){return O.test(Z)}},2868(Xe,g,L){const B=L(1677),S=L(6628),_=L(1018),I=L(4969),T=L(3264),O=L(9359),b=L(9089),Z=L(243);function ne(fe){return unescape(encodeURIComponent(fe)).length}function ee(fe,ae,X){const ge=[];let Se;for(;null!==(Se=fe.exec(X));)ge.push({data:Se[0],index:Se.index,mode:ae,length:Se[0].length});return ge}function Ie(fe){const ae=ee(O.NUMERIC,B.NUMERIC,fe),X=ee(O.ALPHANUMERIC,B.ALPHANUMERIC,fe);let ge,Se;return b.isKanjiModeEnabled()?(ge=ee(O.BYTE,B.BYTE,fe),Se=ee(O.KANJI,B.KANJI,fe)):(ge=ee(O.BYTE_KANJI,B.BYTE,fe),Se=[]),ae.concat(X,ge,Se).sort(function(q,j){return q.index-j.index}).map(function(q){return{data:q.data,mode:q.mode,length:q.length}})}function Ae(fe,ae){switch(ae){case B.NUMERIC:return S.getBitsLength(fe);case B.ALPHANUMERIC:return _.getBitsLength(fe);case B.KANJI:return T.getBitsLength(fe);case B.BYTE:return I.getBitsLength(fe)}}function me(fe,ae){let X;const ge=B.getBestModeForData(fe);if(X=B.from(ae,ge),X!==B.BYTE&&X.bit<ge.bit)throw new Error('"'+fe+'" cannot be encoded with mode '+B.toString(X)+".\n Suggested mode is: "+B.toString(ge));switch(X===B.KANJI&&!b.isKanjiModeEnabled()&&(X=B.BYTE),X){case B.NUMERIC:return new S(fe);case B.ALPHANUMERIC:return new _(fe);case B.KANJI:return new T(fe);case B.BYTE:return new I(fe)}}g.fromArray=function(ae){return ae.reduce(function(X,ge){return"string"==typeof ge?X.push(me(ge,null)):ge.data&&X.push(me(ge.data,ge.mode)),X},[])},g.fromString=function(ae,X){const Se=function W(fe){const ae=[];for(let X=0;X<fe.length;X++){const ge=fe[X];switch(ge.mode){case B.NUMERIC:ae.push([ge,{data:ge.data,mode:B.ALPHANUMERIC,length:ge.length},{data:ge.data,mode:B.BYTE,length:ge.length}]);break;case B.ALPHANUMERIC:ae.push([ge,{data:ge.data,mode:B.BYTE,length:ge.length}]);break;case B.KANJI:ae.push([ge,{data:ge.data,mode:B.BYTE,length:ne(ge.data)}]);break;case B.BYTE:ae.push([{data:ge.data,mode:B.BYTE,length:ne(ge.data)}])}}return ae}(Ie(ae,b.isKanjiModeEnabled())),Te=function oe(fe,ae){const X={},ge={start:{}};let Se=["start"];for(let Te=0;Te<fe.length;Te++){const q=fe[Te],j=[];for(let H=0;H<q.length;H++){const U=q[H],$=""+Te+H;j.push($),X[$]={node:U,lastCount:0},ge[$]={};for(let ce=0;ce<Se.length;ce++){const te=Se[ce];X[te]&&X[te].node.mode===U.mode?(ge[te][$]=Ae(X[te].lastCount+U.length,U.mode)-Ae(X[te].lastCount,U.mode),X[te].lastCount+=U.length):(X[te]&&(X[te].lastCount=U.length),ge[te][$]=Ae(U.length,U.mode)+4+B.getCharCountIndicator(U.mode,ae))}}Se=j}for(let Te=0;Te<Se.length;Te++)ge[Se[Te]].end=0;return{map:ge,table:X}}(Se,X),q=Z.find_path(Te.map,"start","end"),j=[];for(let H=1;H<q.length-1;H++)j.push(Te.table[q[H]].node);return g.fromArray(function z(fe){return fe.reduce(function(ae,X){const ge=ae.length-1>=0?ae[ae.length-1]:null;return ge&&ge.mode===X.mode?(ae[ae.length-1].data+=X.data,ae):(ae.push(X),ae)},[])}(j))},g.rawSplit=function(ae){return g.fromArray(Ie(ae,b.isKanjiModeEnabled()))}},9089(Xe,g){let L;const B=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];g.getSymbolSize=function(_){if(!_)throw new Error('"version" cannot be null or undefined');if(_<1||_>40)throw new Error('"version" should be in range from 1 to 40');return 4*_+17},g.getSymbolTotalCodewords=function(_){return B[_]},g.getBCHDigit=function(S){let _=0;for(;0!==S;)_++,S>>>=1;return _},g.setToSJISFunction=function(_){if("function"!=typeof _)throw new Error('"toSJISFunc" is not a valid function.');L=_},g.isKanjiModeEnabled=function(){return typeof L<"u"},g.toSJIS=function(_){return L(_)}},377(Xe,g){g.isValid=function(B){return!isNaN(B)&&B>=1&&B<=40}},1252(Xe,g,L){const B=L(9089),S=L(3677),_=L(7424),I=L(1677),T=L(377),b=B.getBCHDigit(7973);function ne(Ae,z){return I.getCharCountIndicator(Ae,z)+4}function ee(Ae,z){let W=0;return Ae.forEach(function(oe){const me=ne(oe.mode,z);W+=me+oe.getBitsLength()}),W}g.from=function(z,W){return T.isValid(z)?parseInt(z,10):W},g.getCapacity=function(z,W,oe){if(!T.isValid(z))throw new Error("Invalid QR Code version");typeof oe>"u"&&(oe=I.BYTE);const ae=8*(B.getSymbolTotalCodewords(z)-S.getTotalCodewordsCount(z,W));if(oe===I.MIXED)return ae;const X=ae-ne(oe,z);switch(oe){case I.NUMERIC:return Math.floor(X/10*3);case I.ALPHANUMERIC:return Math.floor(X/11*2);case I.KANJI:return Math.floor(X/13);default:return Math.floor(X/8)}},g.getBestVersionForData=function(z,W){let oe;const me=_.from(W,_.M);if(Array.isArray(z)){if(z.length>1)return function Ie(Ae,z){for(let W=1;W<=40;W++)if(ee(Ae,W)<=g.getCapacity(W,z,I.MIXED))return W}(z,me);if(0===z.length)return 1;oe=z[0]}else oe=z;return function Z(Ae,z,W){for(let oe=1;oe<=40;oe++)if(z<=g.getCapacity(oe,W,Ae))return oe}(oe.mode,oe.getLength(),me)},g.getEncodedBits=function(z){if(!T.isValid(z)||z<7)throw new Error("Invalid QR Code version");let W=z<<12;for(;B.getBCHDigit(W)-b>=0;)W^=7973<<B.getBCHDigit(W)-b;return z<<12|W}},7030(Xe,g,L){const B=L(7077);g.render=function(T,O,b){let Z=b,ne=O;typeof Z>"u"&&(!O||!O.getContext)&&(Z=O,O=void 0),O||(ne=function _(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}()),Z=B.getOptions(Z);const ee=B.getImageWidth(T.modules.size,Z),Ie=ne.getContext("2d"),Ae=Ie.createImageData(ee,ee);return B.qrToImageData(Ae.data,T,Z),function S(I,T,O){I.clearRect(0,0,T.width,T.height),T.style||(T.style={}),T.height=O,T.width=O,T.style.height=O+"px",T.style.width=O+"px"}(Ie,ne,ee),Ie.putImageData(Ae,0,0),ne},g.renderToDataURL=function(T,O,b){let Z=b;return typeof Z>"u"&&(!O||!O.getContext)&&(Z=O,O=void 0),Z||(Z={}),g.render(T,O,Z).toDataURL(Z.type||"image/png",(Z.rendererOpts||{}).quality)}},6511(Xe,g,L){const B=L(7077);function S(T,O){const b=T.a/255,Z=O+'="'+T.hex+'"';return b<1?Z+" "+O+'-opacity="'+b.toFixed(2).slice(1)+'"':Z}function _(T,O,b){let Z=T+O;return typeof b<"u"&&(Z+=" "+b),Z}g.render=function(O,b,Z){const ne=B.getOptions(b),ee=O.modules.size,Ie=O.modules.data,Ae=ee+2*ne.margin,z=ne.color.light.a?"<path "+S(ne.color.light,"fill")+' d="M0 0h'+Ae+"v"+Ae+'H0z"/>':"",W="<path "+S(ne.color.dark,"stroke")+' d="'+function I(T,O,b){let Z="",ne=0,ee=!1,Ie=0;for(let Ae=0;Ae<T.length;Ae++){const z=Math.floor(Ae%O),W=Math.floor(Ae/O);!z&&!ee&&(ee=!0),T[Ae]?(Ie++,Ae>0&&z>0&&T[Ae-1]||(Z+=ee?_("M",z+b,.5+W+b):_("m",ne,0),ne=0,ee=!1),z+1<O&&T[Ae+1]||(Z+=_("h",Ie),Ie=0)):ne++}return Z}(Ie,ee,ne.margin)+'"/>',fe='<svg xmlns="http://www.w3.org/2000/svg" '+(ne.width?'width="'+ne.width+'" height="'+ne.width+'" ':"")+'viewBox="0 0 '+Ae+" "+Ae+'" shape-rendering="crispEdges">'+z+W+"</svg>\n";return"function"==typeof Z&&Z(null,fe),fe}},7077(Xe,g){function L(B){if("number"==typeof B&&(B=B.toString()),"string"!=typeof B)throw new Error("Color should be defined as hex string");let S=B.slice().replace("#","").split("");if(S.length<3||5===S.length||S.length>8)throw new Error("Invalid hex color: "+B);(3===S.length||4===S.length)&&(S=Array.prototype.concat.apply([],S.map(function(I){return[I,I]}))),6===S.length&&S.push("F","F");const _=parseInt(S.join(""),16);return{r:_>>24&255,g:_>>16&255,b:_>>8&255,a:255&_,hex:"#"+S.slice(0,6).join("")}}g.getOptions=function(S){S||(S={}),S.color||(S.color={});const I=S.width&&S.width>=21?S.width:void 0;return{width:I,scale:I?4:S.scale||4,margin:typeof S.margin>"u"||null===S.margin||S.margin<0?4:S.margin,color:{dark:L(S.color.dark||"#000000ff"),light:L(S.color.light||"#ffffffff")},type:S.type,rendererOpts:S.rendererOpts||{}}},g.getScale=function(S,_){return _.width&&_.width>=S+2*_.margin?_.width/(S+2*_.margin):_.scale},g.getImageWidth=function(S,_){const I=g.getScale(S,_);return Math.floor((S+2*_.margin)*I)},g.qrToImageData=function(S,_,I){const T=_.modules.size,O=_.modules.data,b=g.getScale(T,I),Z=Math.floor((T+2*I.margin)*b),ne=I.margin*b,ee=[I.color.light,I.color.dark];for(let Ie=0;Ie<Z;Ie++)for(let Ae=0;Ae<Z;Ae++){let z=4*(Ie*Z+Ae),W=I.color.light;Ie>=ne&&Ae>=ne&&Ie<Z-ne&&Ae<Z-ne&&(W=ee[O[Math.floor((Ie-ne)/b)*T+Math.floor((Ae-ne)/b)]?1:0]),S[z++]=W.r,S[z++]=W.g,S[z++]=W.b,S[z]=W.a}}},8244(Xe,g){var L,S;typeof globalThis<"u"?globalThis:typeof self<"u"&&self,void 0!==(S="function"==typeof(L=function(_){"use strict";if(!(globalThis.chrome&&globalThis.chrome.runtime&&globalThis.chrome.runtime.id))throw new Error("This script should only be loaded in a browser extension.");if(globalThis.browser&&globalThis.browser.runtime&&globalThis.browser.runtime.id)_.exports=globalThis.browser;else{const I="The message port closed before a response was received.";_.exports=(O=>{const b={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(0===Object.keys(b).length)throw new Error("api-metadata.json has not been included in browser-polyfill");class Z extends WeakMap{constructor(j,H=void 0){super(H),this.createItem=j}get(j){return this.has(j)||this.set(j,this.createItem(j)),super.get(j)}}const ee=(q,j)=>(...H)=>{O.runtime.lastError?q.reject(new Error(O.runtime.lastError.message)):q.resolve(j.singleCallbackArg||H.length<=1&&!1!==j.singleCallbackArg?H[0]:H)},Ie=q=>1==q?"argument":"arguments",z=(q,j,H)=>new Proxy(j,{apply:(U,$,ce)=>H.call($,q,...ce)});let W=Function.call.bind(Object.prototype.hasOwnProperty);const oe=(q,j={},H={})=>{let U=Object.create(null),$={has:(te,K)=>K in q||K in U,get(te,K,D){if(K in U)return U[K];if(!(K in q))return;let re=q[K];if("function"==typeof re)if("function"==typeof j[K])re=z(q,q[K],j[K]);else if(W(H,K)){let P=((q,j)=>function(U,...$){if($.length<j.minArgs)throw new Error(`Expected at least ${j.minArgs} ${Ie(j.minArgs)} for ${q}(), got ${$.length}`);if($.length>j.maxArgs)throw new Error(`Expected at most ${j.maxArgs} ${Ie(j.maxArgs)} for ${q}(), got ${$.length}`);return new Promise((ce,te)=>{if(j.fallbackToNoCallback)try{U[q](...$,ee({resolve:ce,reject:te},j))}catch(K){console.warn(`${q} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,K),U[q](...$),j.fallbackToNoCallback=!1,j.noCallback=!0,ce()}else j.noCallback?(U[q](...$),ce()):U[q](...$,ee({resolve:ce,reject:te},j))})})(K,H[K]);re=z(q,q[K],P)}else re=re.bind(q);else if("object"==typeof re&&null!==re&&(W(j,K)||W(H,K)))re=oe(re,j[K],H[K]);else{if(!W(H,"*"))return Object.defineProperty(U,K,{configurable:!0,enumerable:!0,get:()=>q[K],set(P){q[K]=P}}),re;re=oe(re,j[K],H["*"])}return U[K]=re,re},set:(te,K,D,re)=>(K in U?U[K]=D:q[K]=D,!0),defineProperty:(te,K,D)=>Reflect.defineProperty(U,K,D),deleteProperty:(te,K)=>Reflect.deleteProperty(U,K)},ce=Object.create(q);return new Proxy(ce,$)},me=q=>({addListener(j,H,...U){j.addListener(q.get(H),...U)},hasListener:(j,H)=>j.hasListener(q.get(H)),removeListener(j,H){j.removeListener(q.get(H))}}),fe=new Z(q=>"function"!=typeof q?q:function(H){const U=oe(H,{},{getContent:{minArgs:0,maxArgs:0}});q(U)}),ae=new Z(q=>"function"!=typeof q?q:function(H,U,$){let te,D,ce=!1,K=new Promise(k=>{te=function(pe){ce=!0,k(pe)}});try{D=q(H,U,te)}catch(k){D=Promise.reject(k)}const re=!0!==D&&(q=>q&&"object"==typeof q&&"function"==typeof q.then)(D);return!(!0!==D&&!re&&!ce||((re?D:K).then(pe=>{$(pe)},pe=>{let Me;Me=pe&&(pe instanceof Error||"string"==typeof pe.message)?pe.message:"An unexpected error occurred",$({__mozWebExtensionPolyfillReject__:!0,message:Me})}).catch(pe=>{console.error("Failed to send onMessage rejected reply",pe)}),0))}),X=({reject:q,resolve:j},H)=>{O.runtime.lastError?O.runtime.lastError.message===I?j():q(new Error(O.runtime.lastError.message)):H&&H.__mozWebExtensionPolyfillReject__?q(new Error(H.message)):j(H)},ge=(q,j,H,...U)=>{if(U.length<j.minArgs)throw new Error(`Expected at least ${j.minArgs} ${Ie(j.minArgs)} for ${q}(), got ${U.length}`);if(U.length>j.maxArgs)throw new Error(`Expected at most ${j.maxArgs} ${Ie(j.maxArgs)} for ${q}(), got ${U.length}`);return new Promise(($,ce)=>{const te=X.bind(null,{resolve:$,reject:ce});U.push(te),H.sendMessage(...U)})},Se={devtools:{network:{onRequestFinished:me(fe)}},runtime:{onMessage:me(ae),onMessageExternal:me(ae),sendMessage:ge.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:ge.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},Te={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return b.privacy={network:{"*":Te},services:{"*":Te},websites:{"*":Te}},oe(O,Se,b)})(chrome)}})?L.apply(g,[Xe]):L)&&(Xe.exports=S)},9293(Xe){function g(B,S,_,I,T,O,b){try{var Z=B[O](b),ne=Z.value}catch(ee){return void _(ee)}Z.done?S(ne):Promise.resolve(ne).then(I,T)}Xe.exports=function L(B){return function(){var S=this,_=arguments;return new Promise(function(I,T){var O=B.apply(S,_);function b(ne){g(O,I,T,b,Z,"next",ne)}function Z(ne){g(O,I,T,b,Z,"throw",ne)}b(void 0)})}},Xe.exports.__esModule=!0,Xe.exports.default=Xe.exports}},Xe=>{Xe(Xe.s=6819)}]);