diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..3bc5055 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +nottingham.dragonfly.xyz diff --git a/Condiment-Regular.ttf b/Condiment-Regular.ttf new file mode 100644 index 0000000..2768bab Binary files /dev/null and b/Condiment-Regular.ttf differ diff --git a/Fondamento-Italic.ttf b/Fondamento-Italic.ttf new file mode 100644 index 0000000..491be72 Binary files /dev/null and b/Fondamento-Italic.ttf differ diff --git a/Fondamento-Regular.ttf b/Fondamento-Regular.ttf new file mode 100644 index 0000000..9aa7394 Binary files /dev/null and b/Fondamento-Regular.ttf differ diff --git a/GothicLeaf.ttf b/GothicLeaf.ttf new file mode 100644 index 0000000..9dee5bc Binary files /dev/null and b/GothicLeaf.ttf differ diff --git a/JimNightshade-Regular.ttf b/JimNightshade-Regular.ttf new file mode 100644 index 0000000..69d6148 Binary files /dev/null and b/JimNightshade-Regular.ttf differ diff --git a/Kings-Regular.ttf b/Kings-Regular.ttf new file mode 100644 index 0000000..28e7eda Binary files /dev/null and b/Kings-Regular.ttf differ diff --git a/UnifrakturMaguntia-Regular.ttf b/UnifrakturMaguntia-Regular.ttf new file mode 100644 index 0000000..3ae4d69 Binary files /dev/null and b/UnifrakturMaguntia-Regular.ttf differ diff --git a/_app/env.js b/_app/env.js new file mode 100644 index 0000000..1cbca09 --- /dev/null +++ b/_app/env.js @@ -0,0 +1 @@ +export const env={"PUBLIC_REGISTRAR_URL":"https://us-central1-nottingham-420415.cloudfunctions.net/registrar","PUBLIC_CONTEST_DEPLOYED_BLOCK":"36624378","PUBLIC_SCHEDULED_PRIZES":"1142,2285,4573","PUBLIC_MAINTENANCE_MODE":"","PUBLIC_RPC_URL":"https://mainnet.era.zksync.io","PUBLIC_INVITE_ONLY":"","PUBLIC_LAUNCH_TIME":"2024-06-15T13:00:00-04:00","PUBLIC_GH_CLIENT_ID":"Ov23limY2NSRpoMnVolm","PUBLIC_CONTEST_ADDRESS":"0xE8582331D79948887B52A8092a5983288275F60E","PUBLIC_PROJECT_ID":"4bd7b24c55f8dc771ec3120f569f3e9c","PUBLIC_DATA_URL":"https://us-central1-nottingham-420415.cloudfunctions.net/data","PUBLIC_SCHEDULE":"2024-06-20T13:00:00-04:00,2024-06-25T13:00:00-04:00,2024-06-30T13:00:00-04:00","PUBLIC_CHAIN_ID":"324","PUBLIC_ANNOUNCEMENT":"Game contracts have been updated for season 3!"} \ No newline at end of file diff --git a/_app/immutable/assets/10.Bng8cVAW.css b/_app/immutable/assets/10.Bng8cVAW.css new file mode 100644 index 0000000..3256fb0 --- /dev/null +++ b/_app/immutable/assets/10.Bng8cVAW.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-1jmkil1.svelte-1jmkil1:not(:first-of-type){margin-top:2em}h1.svelte-1jmkil1.svelte-1jmkil1:first-of-type,h2.svelte-1jmkil1.svelte-1jmkil1:first-of-type{margin-top:0}h1.svelte-1jmkil1.svelte-1jmkil1,h2.svelte-1jmkil1.svelte-1jmkil1{margin-bottom:.5em;color:#b08a28}h1.svelte-1jmkil1.svelte-1jmkil1,h2.svelte-1jmkil1.svelte-1jmkil1,h3.svelte-1jmkil1.svelte-1jmkil1{text-indent:1ex}h2.svelte-1jmkil1.svelte-1jmkil1{color:#b06e28}a[href].svelte-1jmkil1.svelte-1jmkil1{text-decoration:none;color:#892d38}a[href].svelte-1jmkil1.svelte-1jmkil1:hover{text-decoration:underline}a[href].svelte-1jmkil1.svelte-1jmkil1:visited{color:#892d38}.grid.svelte-1jmkil1.svelte-1jmkil1{display:flex;flex-direction:row;flex-wrap:wrap;gap:6ex}.grid.svelte-1jmkil1 h3.svelte-1jmkil1{margin-bottom:.25em;border-bottom:1px solid #777} diff --git a/_app/immutable/assets/2.BD708D1f.css b/_app/immutable/assets/2.BD708D1f.css new file mode 100644 index 0000000..f9f1ce6 --- /dev/null +++ b/_app/immutable/assets/2.BD708D1f.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}button.svelte-oeolkk{transition:transform .05s ease-out;cursor:pointer}button.svelte-oeolkk:hover{transform:translate(.25em)}button.svelte-oeolkk:not(.custom){transition:transform .05s ease-out;border-image:url(../../../button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00}button.custom.svelte-oeolkk{margin:.5em 0;padding:0;background:none;border:none;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit}button.icon.svelte-oeolkk{--size:2.25em;--sheet-url:none;--row:0;--col:0;--rows:1;--cols:1;--bg-size:calc(var(--cols) * var(--size)) calc(var(--rows) * var(--size));--bg-pos:calc(-1 * var(--col) * var(--size)) calc(-1 * var(--row) * var(--size));--sheet-url-hover:var(--sheet-url);--row-hover:var(--row);--col-hover:var(--col);--rows-hover:var(--rows);--cols-hover:var(--cols);--bg-size-hover:calc(var(--cols-hover) * var(--size)) calc(var(--rows-hover) * var(--size));--bg-pos-hover:calc(-1 * var(--col-hover) * var(--size)) calc(-1 * var(--row-hover) * var(--size));background:none;border:none;cursor:pointer;background-repeat:no-repeat;width:var(--size);height:var(--size);background-image:var(--sheet-url);background-size:var(--bg-size);background-position:var(--bg-pos)}button.icon.svelte-oeolkk:hover{background-image:var(--sheet-url-hover);background-size:var(--bg-size-hover);background-position:var(--bg-pos-hover);transform:scale(1.05) rotate(10deg)}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}.tome.svelte-ui5oza>.content.svelte-ui5oza.svelte-ui5oza{font-family:Fondamento;font-weight:bolder}header.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{font-family:Nightshade;font-weight:700;font-size:1.2em;letter-spacing:.1ex}a[href].svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{text-decoration:none;color:#892d38}a[href].svelte-ui5oza.svelte-ui5oza.svelte-ui5oza:hover{text-decoration:underline}a[href].svelte-ui5oza.svelte-ui5oza.svelte-ui5oza:visited{color:#892d38}.announcement.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{border-image:url(../../../attention-border.png) 50% 12%/.75em 2ex round;padding:.2em 2ex;margin:1em auto;text-align:center;width:fit-content}header.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{margin:0 2ex 1rem 2ex;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}@media (max-width: 768px){header.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{flex-direction:column;gap:1em}}header.svelte-ui5oza>.left.svelte-ui5oza.svelte-ui5oza{display:flex;align-self:start;justify-content:center;flex-wrap:wrap}@media (max-width: 768px){header.svelte-ui5oza>.left.svelte-ui5oza.svelte-ui5oza{flex-direction:row;align-self:center}}header.svelte-ui5oza>.left.svelte-ui5oza>.svelte-ui5oza:not(:last-child):after{content:"|";margin:0 .5ex}header.svelte-ui5oza>.right.svelte-ui5oza.svelte-ui5oza{align-self:end;display:flex;justify-content:right;flex-wrap:wrap;flex:1 0 auto}@media (max-width: 768px){header.svelte-ui5oza>.right.svelte-ui5oza.svelte-ui5oza{align-self:center}}header.svelte-ui5oza>.right.svelte-ui5oza>.svelte-ui5oza:not(:last-child):after{content:"|";margin:0 .5ex}header.svelte-ui5oza .wallet-status.svelte-ui5oza.svelte-ui5oza{vertical-align:top;display:flex;flex-direction:row;align-items:center;gap:2ex}header.svelte-ui5oza .wallet-status .wallet-address.svelte-ui5oza.svelte-ui5oza{display:inline-block;overflow:hidden;max-width:128px;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}header.svelte-ui5oza .wallet-status .player-name.svelte-ui5oza.svelte-ui5oza{text-decoration:underline}.tome.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{--border-width:4rem;--border-padding:1.5rem;position:relative;min-height:calc(100vh - 2 * (var(--border-width) + var(--border-padding)));padding:calc(var(--border-width) + var(--border-padding));border-image:url(../../../page-border.png) 15.5% 16%/var(--border-width) round;font-size:1.25rem}@media (max-width: 768px){.tome.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{font-size:1.1rem;padding:calc(var(--border-width) + var(--border-padding)) 0;border-image:url(../../../page-border.png) 15.5% 15%/var(--border-width) 0 round}}.tome.svelte-ui5oza>.bg.svelte-ui5oza.svelte-ui5oza{pointer-events:none;position:absolute;z-index:-100;top:0;right:0;bottom:0;left:0;background:url(../../../aged-paper.png);background-size:100% auto;background-repeat:cover repeat;background-color:#8c5834;background-blend-mode:hard-light;mix-blend-mode:multiply}.tome.svelte-ui5oza>.ghost.svelte-ui5oza.svelte-ui5oza{overflow-y:hidden;position:absolute;z-index:-100;bottom:10vh;left:-10ex;mix-blend-mode:color-burn;opacity:.75;width:90%}@media (max-width: 768px){.tome.svelte-ui5oza>.ghost.svelte-ui5oza.svelte-ui5oza{width:100%;left:0}}.tome.svelte-ui5oza>.music-toggle.svelte-ui5oza.svelte-ui5oza{cursor:pointer;position:fixed;right:0;top:0;width:var(--border-width);height:var(--border-width)}.tome.svelte-ui5oza>.content.svelte-ui5oza.svelte-ui5oza{max-width:1024px;margin:0 auto;overflow:visible}@media (max-width: 768px){.tome.svelte-ui5oza>.content.svelte-ui5oza.svelte-ui5oza{padding:0 1ex}}.announcement.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{padding:1.5em 4ex;min-width:16ex;margin-top:0;color:#b08217;font-size:1.05em} diff --git a/_app/immutable/assets/3.CFmUWSZw.css b/_app/immutable/assets/3.CFmUWSZw.css new file mode 100644 index 0000000..9827756 --- /dev/null +++ b/_app/immutable/assets/3.CFmUWSZw.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}h3.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{text-indent:1ex}a[href].svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{text-decoration:none;color:#892d38}a[href].svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju:hover{text-decoration:underline}a[href].svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju:visited{color:#892d38}.smaller.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{font-size:.66em}.season.svelte-a2bvju>h3.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{margin-bottom:.25em}.season.svelte-a2bvju>h3 .leaf.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{height:1.25em;margin-bottom:-.25em}.season.svelte-a2bvju>.tournaments.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{margin-left:5ex}.season.svelte-a2bvju>.tournaments.svelte-a2bvju>.entry.svelte-a2bvju.svelte-a2bvju{display:flex;flex-wrap:wrap;gap:0 2ex;margin-bottom:.25em}.season.svelte-a2bvju>.tournaments.svelte-a2bvju>.entry.svelte-a2bvju>h3.svelte-a2bvju{margin:0}.season.current.svelte-a2bvju .prize.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{font-size:.85em;color:green;text-decoration:underline}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:not(:first-of-type){margin-top:2em}h1.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:first-of-type,h2.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:first-of-type{margin-top:0}h1.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak,h2.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{margin-bottom:.5em;color:#b08a28}h1.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak,h2.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak,h3.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{text-indent:1ex}h2.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{color:#b06e28}h1.svelte-xkivak+p.svelte-xkivak.svelte-xkivak.svelte-xkivak,h2.svelte-xkivak+p.svelte-xkivak.svelte-xkivak.svelte-xkivak{margin-top:.25em}a[href].svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{text-decoration:none;color:#892d38}a[href].svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:hover{text-decoration:underline}a[href].svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:visited{color:#892d38}a.inherit.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak,a.inherit.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:visited{color:inherit;text-decoration:inherit;font-style:inherit;font-weight:inherit}.illustration.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{float:right;height:8em}@media (max-width: 768px){.illustration.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{float:none;margin:0 auto;width:fit-content}}.illustration.svelte-xkivak>img.svelte-xkivak.svelte-xkivak.svelte-xkivak{height:100%}.illustration.svelte-xkivak>img.svelte-xkivak.svelte-xkivak.svelte-xkivak:nth-child(1){transform:scaleX(-1)}section.svelte-xkivak>ul.svelte-xkivak>li.svelte-xkivak.svelte-xkivak{margin-bottom:.5em}#timeline.svelte-xkivak>.events.svelte-xkivak.svelte-xkivak.svelte-xkivak{display:flex;flex-direction:column}@media (max-width: 768px){#timeline.svelte-xkivak>.events.svelte-xkivak.svelte-xkivak.svelte-xkivak{gap:.5em}}#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak.svelte-xkivak.svelte-xkivak{display:flex;flex-direction:row;justify-content:space-between}@media (max-width: 768px){#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak.svelte-xkivak.svelte-xkivak{flex-direction:column;justify-content:center;align-items:center}}#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak>.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak>.svelte-xkivak.svelte-xkivak{flex:1 0 fit-content}#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak>.spacer.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak>.spacer.svelte-xkivak.svelte-xkivak{display:contents}@media (max-width: 768px){#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak>.spacer.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak>.spacer.svelte-xkivak.svelte-xkivak{display:none}}#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak>.spacer.svelte-xkivak:after,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak>.spacer.svelte-xkivak.svelte-xkivak:after{content:"..................................................................................................................................................................................................................................";overflow:hidden;text-overflow:clip;display:block;flex:0 1 auto;opacity:.25}#timeline.svelte-xkivak>.disclaimer.svelte-xkivak.svelte-xkivak.svelte-xkivak{text-align:right;font-size:.75em}@media (max-width: 768px){#timeline.svelte-xkivak>.disclaimer.svelte-xkivak.svelte-xkivak.svelte-xkivak{margin-top:.5em;text-align:center}}.u.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{text-decoration:underline} diff --git a/_app/immutable/assets/4.y4NXrGVz.css b/_app/immutable/assets/4.y4NXrGVz.css new file mode 100644 index 0000000..bd8ff74 --- /dev/null +++ b/_app/immutable/assets/4.y4NXrGVz.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-agtccm.svelte-agtccm:not(:first-of-type){margin-top:2em}h1.svelte-agtccm.svelte-agtccm:first-of-type,h2.svelte-agtccm.svelte-agtccm:first-of-type{margin-top:0}h1.svelte-agtccm.svelte-agtccm,h2.svelte-agtccm.svelte-agtccm{margin-bottom:.5em;color:#b08a28}h1.svelte-agtccm.svelte-agtccm,h2.svelte-agtccm.svelte-agtccm,h3.svelte-agtccm.svelte-agtccm{text-indent:1ex}h2.svelte-agtccm.svelte-agtccm{color:#b06e28}a[href].svelte-agtccm.svelte-agtccm{text-decoration:none;color:#892d38}a[href].svelte-agtccm.svelte-agtccm:hover{text-decoration:underline}a[href].svelte-agtccm.svelte-agtccm:visited{color:#892d38}input.svelte-agtccm.svelte-agtccm:not([type]),input[type=text].svelte-agtccm.svelte-agtccm{background:none;border:none;border-image:url(../../../text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}input.svelte-agtccm.svelte-agtccm:not([type]):focus,input[type=text].svelte-agtccm.svelte-agtccm:focus{outline:none}.matches.svelte-agtccm .summary.svelte-agtccm{display:flex;flex-direction:row;justify-content:space-between;align-items:center;flex-wrap:wrap}.matches.svelte-agtccm .matches-grid.svelte-agtccm{display:flex;flex-wrap:wrap;gap:0 6ex}.matches.svelte-agtccm .matches-grid .match.svelte-agtccm{width:fit-content}.matches.svelte-agtccm .matches-grid .match h3.svelte-agtccm{margin-bottom:.25em;border-bottom:1px solid #777}.matches.svelte-agtccm .matches-grid .match ol.svelte-agtccm{margin-top:0}.smaller.svelte-agtccm.svelte-agtccm{font-size:.8em} diff --git a/_app/immutable/assets/5.CfogKFzx.css b/_app/immutable/assets/5.CfogKFzx.css new file mode 100644 index 0000000..7fe9a5e --- /dev/null +++ b/_app/immutable/assets/5.CfogKFzx.css @@ -0,0 +1 @@ +@charset "UTF-8";.pancake-chart.svelte-1gzh5rp{position:relative;display:block;width:100%;height:100%}.clip.svelte-1gzh5rp{overflow:hidden}.pancake-grid-item.svelte-1wq9bba{position:absolute;left:0;top:0}.pancake-point.svelte-11ba04d{position:absolute;width:0;height:0}.pancake-box.svelte-38xupb{position:absolute}svg.svelte-4s4ihd{position:absolute;width:100%;height:100%;overflow:visible}.clip.svelte-4s4ihd{overflow:hidden}svg.svelte-4s4ihd *{vector-effect:non-scaling-stroke}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(:first-of-type){margin-top:2em}h1.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:first-of-type,h2.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:first-of-type{margin-top:0}h1.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,h2.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin-bottom:.5em;color:#b08a28}h1.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,h2.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,h3.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{text-indent:1ex}h2.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:#b06e28}a[href].svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{text-decoration:none;color:#892d38}a[href].svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:hover{text-decoration:underline}a[href].svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:visited{color:#892d38}button.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{transition:transform .05s ease-out;cursor:pointer}button.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:hover{transform:translate(.25em)}button.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(.custom){transition:transform .05s ease-out;border-image:url(../../../button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00}.round-header.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:flex;flex-direction:row;width:100%;align-items:baseline;gap:1ex}.round-header.svelte-u0942d>.left.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.round-header.svelte-u0942d>.right.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{background:url(../../../charcoal-hl.png) repeat-x;background-size:18ex 120%;height:1em}.round-header.svelte-u0942d>.left.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{flex:0 1 2ex}.round-header.svelte-u0942d>.right.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{flex:1 1 1ex}.round-header.svelte-u0942d>.title.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{flex:0 0 fit-content;margin:0;text-indent:0}.builder.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:before{content:"🤠 ";font-size:.75em}@media (max-width: 768px){.summary.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:flex;flex-direction:column}}.summary.svelte-u0942d>.market.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{float:right;text-align:right;display:flex;flex-direction:column;flex-wrap:wrap}@media (max-width: 768px){.summary.svelte-u0942d>.market.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{float:none;flex-direction:row;justify-content:center;margin:.5em 0;order:1}}.summary.svelte-u0942d>.market h3.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin:0}@media (max-width: 768px){.summary.svelte-u0942d>.market h3.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin:0 1ex;font-size:1em}.summary.svelte-u0942d>.market h3.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:after{content:":"}}.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:flex;flex-direction:column;align-items:end}@media (max-width: 768px){.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d.svelte-u0942d.svelte-u0942d{flex-direction:row;gap:1ex;flex-wrap:wrap;justify-content:center}}.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d>.asset.svelte-u0942d.svelte-u0942d{display:flex;gap:1ex}@media (max-width: 768px){.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d>.asset.svelte-u0942d.svelte-u0942d:after{content:", ";margin-left:-.75ex}}.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d>.asset.svelte-u0942d>.emoji.svelte-u0942d{order:1}@media (max-width: 768px){.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d>.asset.svelte-u0942d>.emoji.svelte-u0942d{order:0}}.summary.svelte-u0942d>.player.svelte-u0942d>.balance.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin-left:2ex}.summary.svelte-u0942d>.player.svelte-u0942d>.balance.svelte-u0942d>.delta.svelte-u0942d.svelte-u0942d{font-size:.9em;margin-left:1ex;color:#570}.summary.svelte-u0942d>.player.svelte-u0942d>.balance.svelte-u0942d>.delta.decreased.svelte-u0942d.svelte-u0942d{color:#c30}.round.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin-bottom:1em}.round.svelte-u0942d>.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(:last-child){margin-bottom:1em}.player.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(:last-child){margin-bottom:.5em}.block.svelte-u0942d>.steps.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:none;margin-left:2ex;counter-reset:block-activity}.block.svelte-u0942d>.steps.svelte-u0942d>.step.svelte-u0942d.svelte-u0942d.svelte-u0942d{counter-increment:block-activity}.block.svelte-u0942d>.steps.svelte-u0942d>.step.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(:last-child){margin-bottom:.5em}.block.svelte-u0942d>.steps.svelte-u0942d>.step.svelte-u0942d.svelte-u0942d.svelte-u0942d:before{content:counter(block-activity) ")";font-style:italic;margin-right:1.5ex;font-size:.9em;opacity:.9;vertical-align:super}.block.svelte-u0942d>.steps .swaps.svelte-u0942d>.swap.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin-left:6ex}.block.svelte-u0942d>.expand button.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin:0 0 .5em;padding:0;background:none;border:none;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit}.block.svelte-u0942d>.expand.svelte-u0942d>button.svelte-u0942d>.prefix.svelte-u0942d.svelte-u0942d:after{content:"[+] Show"}.block.expanded.svelte-u0942d>.steps.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:block}.block.expanded.svelte-u0942d>.expand.svelte-u0942d>button.svelte-u0942d>.prefix.svelte-u0942d.svelte-u0942d:after{content:"[-] Hide"}h1.svelte-u0942d+.date.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{float:right}@media (max-width: 768px){h1.svelte-u0942d+.date.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:none}}@media (min-width: 768px){section.date.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:none}}.date.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{text-align:center}.deployment-failures.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin:1.5em 0ex}.deployment-failures.svelte-u0942d .failure.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:before{content:"🪦";margin-right:1ex}.chart.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{height:10em;margin:2em 0 3em;--player-1-color:rgb(87, 134, 17);--player-2-color:rgb(212, 23, 23);--player-3-color:rgb(32, 173, 220);--player-4-color:rgb(202, 48, 202)}.chart.svelte-u0942d .player-scores .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{fill:none;stroke:gray;stroke-width:.125em;stroke-linecap:round;stroke-linejoin:round}.chart.svelte-u0942d .player-scores:nth-of-type(1) .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.chart.svelte-u0942d .player-scores:nth-of-type(1) .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke:var(--player-1-color)}.chart.svelte-u0942d .player-scores:nth-of-type(2) .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.chart.svelte-u0942d .player-scores:nth-of-type(2) .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke:var(--player-2-color)}.chart.svelte-u0942d .player-scores:nth-of-type(3) .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.chart.svelte-u0942d .player-scores:nth-of-type(3) .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke:var(--player-3-color)}.chart.svelte-u0942d .player-scores:nth-of-type(4) .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.chart.svelte-u0942d .player-scores:nth-of-type(4) .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke:var(--player-4-color)}.chart.svelte-u0942d .player-scores .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke-width:.33em;stroke-linecap:round;stroke-linejoin:round;box-sizing:border-box}.chart.svelte-u0942d .player-scores .player-pt.final.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke-width:.66em}.chart.svelte-u0942d .legend .trophy.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{opacity:0}.chart.svelte-u0942d .legend .trophy.show.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{opacity:1}.chart.svelte-u0942d .legend .player-label.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{position:relative}.chart.svelte-u0942d .legend .player-label.svelte-u0942d:nth-of-type(1)>.score.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:var(--player-1-color)}.chart.svelte-u0942d .legend .player-label.svelte-u0942d:nth-of-type(2)>.score.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:var(--player-2-color)}.chart.svelte-u0942d .legend .player-label.svelte-u0942d:nth-of-type(3)>.score.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:var(--player-3-color)}.chart.svelte-u0942d .legend .player-label.svelte-u0942d:nth-of-type(4)>.score.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:var(--player-4-color)}.chart.svelte-u0942d .rounds-count.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{text-align:center;margin-top:1em} diff --git a/_app/immutable/assets/6.DurNQoRk.css b/_app/immutable/assets/6.DurNQoRk.css new file mode 100644 index 0000000..8b60d22 --- /dev/null +++ b/_app/immutable/assets/6.DurNQoRk.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-1j7wjax.svelte-1j7wjax:not(:first-of-type){margin-top:2em}h1.svelte-1j7wjax.svelte-1j7wjax:first-of-type,h2.svelte-1j7wjax.svelte-1j7wjax:first-of-type{margin-top:0}h1.svelte-1j7wjax.svelte-1j7wjax,h2.svelte-1j7wjax.svelte-1j7wjax{margin-bottom:.5em;color:#b08a28}h1.svelte-1j7wjax.svelte-1j7wjax,h2.svelte-1j7wjax.svelte-1j7wjax,h3.svelte-1j7wjax.svelte-1j7wjax{text-indent:1ex}h2.svelte-1j7wjax.svelte-1j7wjax{color:#b06e28}h2.svelte-1j7wjax+p.svelte-1j7wjax{margin-top:.25em}a[href].svelte-1j7wjax.svelte-1j7wjax{text-decoration:none;color:#892d38}a[href].svelte-1j7wjax.svelte-1j7wjax:hover{text-decoration:underline}a[href].svelte-1j7wjax.svelte-1j7wjax:visited{color:#892d38}button.svelte-1j7wjax.svelte-1j7wjax{transition:transform .05s ease-out;cursor:pointer}button.svelte-1j7wjax.svelte-1j7wjax:hover{transform:translate(.25em)}button[disabled].svelte-1j7wjax.svelte-1j7wjax{opacity:.5;pointer-events:none}button.svelte-1j7wjax.svelte-1j7wjax:not(.custom){transition:transform .05s ease-out;border-image:url(../../../button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00}button.custom.svelte-1j7wjax.svelte-1j7wjax{margin:.5em 0;padding:0;background:none;border:none;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit}input.svelte-1j7wjax.svelte-1j7wjax:not([type]),textarea.svelte-1j7wjax.svelte-1j7wjax{background:none;border:none;border-image:url(../../../text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}input.svelte-1j7wjax.svelte-1j7wjax:not([type]):focus,textarea.svelte-1j7wjax.svelte-1j7wjax:focus{outline:none}.alert.svelte-1j7wjax.svelte-1j7wjax{border-image:url(../../../attention-border.png) 50% 12%/.75em 2ex round;padding:.2em 2ex;margin:1em auto;text-align:center;width:fit-content}.season.svelte-1j7wjax .tournament-result.svelte-1j7wjax{display:grid;grid:auto/repeat(5,1fr);flex-direction:row;gap:1ex}.season.svelte-1j7wjax .tournament-result.header.svelte-1j7wjax{text-decoration:underline;margin-bottom:.5em}.season.svelte-1j7wjax .tournament-result.optional.svelte-1j7wjax{display:none}.season.svelte-1j7wjax button.expand.svelte-1j7wjax{margin-left:3ex}.season.expanded.svelte-1j7wjax button.expand.svelte-1j7wjax{display:none}.season.expanded.svelte-1j7wjax .optional.svelte-1j7wjax{display:grid}.submit-bytecode.svelte-1j7wjax.svelte-1j7wjax{display:flex;flex-direction:column}.submit-bytecode.svelte-1j7wjax .bytecode.svelte-1j7wjax{font-family:monospace;font-size:1.1em;letter-spacing:-.33ex;display:block;width:0 auto}.submit-bytecode.svelte-1j7wjax .buttons.svelte-1j7wjax{display:flex;justify-content:space-between;flex-wrap:wrap}.name.svelte-1j7wjax.svelte-1j7wjax{font-size:1.25em;color:#2549b5!important}.error.svelte-1j7wjax.svelte-1j7wjax{text-align:center;margin:1em 0;color:red}.address.svelte-1j7wjax.svelte-1j7wjax{text-overflow:ellipsis;overflow:hidden}input[type=file].svelte-1j7wjax.svelte-1j7wjax{display:none} diff --git a/_app/immutable/assets/7.SRjcVSip.css b/_app/immutable/assets/7.SRjcVSip.css new file mode 100644 index 0000000..64ad7a1 --- /dev/null +++ b/_app/immutable/assets/7.SRjcVSip.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob:not(:first-of-type){margin-top:2em}h1.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob:first-of-type{margin-top:0}h1.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{margin-bottom:.5em;color:#b08a28}h1.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{text-indent:1ex}a[href].svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{text-decoration:none;color:#892d38}a[href].svelte-6b93ob.svelte-6b93ob.svelte-6b93ob:hover{text-decoration:underline}a[href].svelte-6b93ob.svelte-6b93ob.svelte-6b93ob:visited{color:#892d38}ol.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{max-width:min-content;padding-inline-start:0;display:table}@media (max-width: 768px){ol.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{display:block;max-width:none}}ol.svelte-6b93ob li.svelte-6b93ob.svelte-6b93ob{display:table-row}ol.svelte-6b93ob li.svelte-6b93ob>.joined.svelte-6b93ob{opacity:.85}@media (min-width: 768px){ol.svelte-6b93ob li.svelte-6b93ob>.svelte-6b93ob{display:table-cell;width:fit-content;white-space:nowrap;padding:.1em 1ex}}@media (max-width: 768px){ol.svelte-6b93ob li.svelte-6b93ob.svelte-6b93ob{display:flex;flex-direction:row;flex-wrap:wrap;gap:1ex}ol.svelte-6b93ob li.svelte-6b93ob>.svelte-6b93ob{padding:0!important}ol.svelte-6b93ob li.svelte-6b93ob>.name.svelte-6b93ob{text-align:left}ol.svelte-6b93ob li.svelte-6b93ob>.joined.svelte-6b93ob{margin-left:4ex;flex:1 0 100%}ol.svelte-6b93ob li.svelte-6b93ob.svelte-6b93ob:not(:last-child){margin-bottom:1em}}.sort-options.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{display:flex;gap:1ex}.sort-options.svelte-6b93ob>.opt.svelte-6b93ob.svelte-6b93ob:not(:last-child):after{content:", "}.sort-options.svelte-6b93ob>.opt.svelte-6b93ob.svelte-6b93ob:last-child:after{content:"."}.delta.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{font-size:.8em}.delta.svelte-6b93ob .increased.svelte-6b93ob.svelte-6b93ob{color:green}.delta.svelte-6b93ob .increased.svelte-6b93ob.svelte-6b93ob:before{content:"+"}.delta.svelte-6b93ob .decreased.svelte-6b93ob.svelte-6b93ob{color:red}.delta.svelte-6b93ob .decreased.svelte-6b93ob.svelte-6b93ob:before{content:"-"}.disclaimer.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{font-size:.9em;margin-top:2em} diff --git a/_app/immutable/assets/8.RY5G_MoP.css b/_app/immutable/assets/8.RY5G_MoP.css new file mode 100644 index 0000000..0acbb47 --- /dev/null +++ b/_app/immutable/assets/8.RY5G_MoP.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}section.svelte-weh7pk.svelte-weh7pk:not(:first-of-type){margin-top:2em}h1.svelte-weh7pk.svelte-weh7pk:first-of-type{margin-top:0}h1.svelte-weh7pk.svelte-weh7pk{margin-bottom:.5em;color:#b08a28}h1.svelte-weh7pk.svelte-weh7pk{text-indent:1ex}a[href].svelte-weh7pk.svelte-weh7pk{text-decoration:none;color:#892d38}a[href].svelte-weh7pk.svelte-weh7pk:hover{text-decoration:underline}a[href].svelte-weh7pk.svelte-weh7pk:visited{color:#892d38}button.svelte-weh7pk.svelte-weh7pk{transition:transform .05s ease-out;cursor:pointer}button.svelte-weh7pk.svelte-weh7pk:hover{transform:translate(.25em)}button[disabled].svelte-weh7pk.svelte-weh7pk{opacity:.5;pointer-events:none}button.svelte-weh7pk.svelte-weh7pk:not(.custom){transition:transform .05s ease-out;border-image:url(../../../button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00}input.svelte-weh7pk.svelte-weh7pk:not([type]),input[type=email].svelte-weh7pk.svelte-weh7pk{background:none;border:none;border-image:url(../../../text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}input.svelte-weh7pk.svelte-weh7pk:not([type]):focus,input[type=email].svelte-weh7pk.svelte-weh7pk:focus{outline:none}.error.svelte-weh7pk.svelte-weh7pk{margin:1em auto;color:red}.auth-form.svelte-weh7pk.svelte-weh7pk{display:flex;flex-direction:column;align-items:center}.auth-form.svelte-weh7pk iframe.svelte-weh7pk{display:block;width:90%;height:16em;margin:0 auto;background-color:transparent}.auth-form.svelte-weh7pk .checkboxes.svelte-weh7pk{margin-top:1em}.auth-form.svelte-weh7pk button.svelte-weh7pk{display:block;margin:0 auto}.register-form.svelte-weh7pk.svelte-weh7pk{margin:0 auto;width:fit-content;display:flex;flex-direction:column;flex-wrap:wrap;align-items:center}.register-form.svelte-weh7pk .inputs.svelte-weh7pk{display:flex;align-items:center;flex-wrap:wrap;gap:2ex}@media (max-width: 768px){.register-form.svelte-weh7pk .inputs.svelte-weh7pk{flex-direction:column}}.register-form.svelte-weh7pk .inputs .field.svelte-weh7pk{display:flex;flex-direction:column} diff --git a/_app/immutable/assets/9.BlIaaKWA.css b/_app/immutable/assets/9.BlIaaKWA.css new file mode 100644 index 0000000..b35c5c3 --- /dev/null +++ b/_app/immutable/assets/9.BlIaaKWA.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}h1.svelte-j2bsx1.svelte-j2bsx1:first-of-type,h2.svelte-j2bsx1.svelte-j2bsx1:first-of-type{margin-top:0}h1.svelte-j2bsx1.svelte-j2bsx1,h2.svelte-j2bsx1.svelte-j2bsx1{margin-bottom:.5em;color:#b08a28}h1.svelte-j2bsx1.svelte-j2bsx1,h2.svelte-j2bsx1.svelte-j2bsx1,h3.svelte-j2bsx1.svelte-j2bsx1{text-indent:1ex}h2.svelte-j2bsx1.svelte-j2bsx1{color:#b06e28}a[href].svelte-j2bsx1.svelte-j2bsx1{text-decoration:none;color:#892d38}a[href].svelte-j2bsx1.svelte-j2bsx1:hover{text-decoration:underline}a[href].svelte-j2bsx1.svelte-j2bsx1:visited{color:#892d38}.grid.svelte-j2bsx1.svelte-j2bsx1{display:flex;flex-direction:row;flex-wrap:wrap;gap:0 6ex}.grid.svelte-j2bsx1 h3.svelte-j2bsx1{margin-bottom:.25em;border-bottom:1px solid #777} diff --git a/_app/immutable/assets/_layout.B0UhIsPD.css b/_app/immutable/assets/_layout.B0UhIsPD.css new file mode 100644 index 0000000..6d26a3f --- /dev/null +++ b/_app/immutable/assets/_layout.B0UhIsPD.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}button.svelte-oeolkk{transition:transform .05s ease-out;cursor:pointer}button.svelte-oeolkk:hover{transform:translate(.25em)}button.svelte-oeolkk:not(.custom){transition:transform .05s ease-out;border-image:url(/nottingham-frontend/button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00}button.custom.svelte-oeolkk{margin:.5em 0;padding:0;background:none;border:none;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit}button.icon.svelte-oeolkk{--size:2.25em;--sheet-url:none;--row:0;--col:0;--rows:1;--cols:1;--bg-size:calc(var(--cols) * var(--size)) calc(var(--rows) * var(--size));--bg-pos:calc(-1 * var(--col) * var(--size)) calc(-1 * var(--row) * var(--size));--sheet-url-hover:var(--sheet-url);--row-hover:var(--row);--col-hover:var(--col);--rows-hover:var(--rows);--cols-hover:var(--cols);--bg-size-hover:calc(var(--cols-hover) * var(--size)) calc(var(--rows-hover) * var(--size));--bg-pos-hover:calc(-1 * var(--col-hover) * var(--size)) calc(-1 * var(--row-hover) * var(--size));background:none;border:none;cursor:pointer;background-repeat:no-repeat;width:var(--size);height:var(--size);background-image:var(--sheet-url);background-size:var(--bg-size);background-position:var(--bg-pos)}button.icon.svelte-oeolkk:hover{background-image:var(--sheet-url-hover);background-size:var(--bg-size-hover);background-position:var(--bg-pos-hover);transform:scale(1.05) rotate(10deg)}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}.tome.svelte-ui5oza>.content.svelte-ui5oza.svelte-ui5oza{font-family:Fondamento;font-weight:bolder}header.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{font-family:Nightshade;font-weight:700;font-size:1.2em;letter-spacing:.1ex}a[href].svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{text-decoration:none;color:#892d38}a[href].svelte-ui5oza.svelte-ui5oza.svelte-ui5oza:hover{text-decoration:underline}a[href].svelte-ui5oza.svelte-ui5oza.svelte-ui5oza:visited{color:#892d38}.announcement.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{border-image:url(/nottingham-frontend/attention-border.png) 50% 12%/.75em 2ex round;padding:.2em 2ex;margin:1em auto;text-align:center;width:fit-content}header.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{margin:0 2ex 1rem 2ex;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}@media (max-width: 768px){header.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{flex-direction:column;gap:1em}}header.svelte-ui5oza>.left.svelte-ui5oza.svelte-ui5oza{display:flex;align-self:start;justify-content:center;flex-wrap:wrap}@media (max-width: 768px){header.svelte-ui5oza>.left.svelte-ui5oza.svelte-ui5oza{flex-direction:row;align-self:center}}header.svelte-ui5oza>.left.svelte-ui5oza>.svelte-ui5oza:not(:last-child):after{content:"|";margin:0 .5ex}header.svelte-ui5oza>.right.svelte-ui5oza.svelte-ui5oza{align-self:end;display:flex;justify-content:right;flex-wrap:wrap;flex:1 0 auto}@media (max-width: 768px){header.svelte-ui5oza>.right.svelte-ui5oza.svelte-ui5oza{align-self:center}}header.svelte-ui5oza>.right.svelte-ui5oza>.svelte-ui5oza:not(:last-child):after{content:"|";margin:0 .5ex}header.svelte-ui5oza .wallet-status.svelte-ui5oza.svelte-ui5oza{vertical-align:top;display:flex;flex-direction:row;align-items:center;gap:2ex}header.svelte-ui5oza .wallet-status .wallet-address.svelte-ui5oza.svelte-ui5oza{display:inline-block;overflow:hidden;max-width:128px;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}header.svelte-ui5oza .wallet-status .player-name.svelte-ui5oza.svelte-ui5oza{text-decoration:underline}.tome.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{--border-width:4rem;--border-padding:1.5rem;position:relative;min-height:calc(100vh - 2 * (var(--border-width) + var(--border-padding)));padding:calc(var(--border-width) + var(--border-padding));border-image:url(/nottingham-frontend/page-border.png) 15.5% 16%/var(--border-width) round;font-size:1.25rem}@media (max-width: 768px){.tome.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{font-size:1.1rem;padding:calc(var(--border-width) + var(--border-padding)) 0;border-image:url(/nottingham-frontend/page-border.png) 15.5% 15%/var(--border-width) 0 round}}.tome.svelte-ui5oza>.bg.svelte-ui5oza.svelte-ui5oza{pointer-events:none;position:absolute;z-index:-100;inset:0;background:url(/nottingham-frontend/aged-paper.png);background-size:100% auto;background-repeat:cover repeat;background-color:#8c5834;background-blend-mode:hard-light;mix-blend-mode:multiply}.tome.svelte-ui5oza>.ghost.svelte-ui5oza.svelte-ui5oza{overflow-y:hidden;position:absolute;z-index:-100;bottom:10vh;left:-10ex;mix-blend-mode:color-burn;opacity:.75;width:90%}@media (max-width: 768px){.tome.svelte-ui5oza>.ghost.svelte-ui5oza.svelte-ui5oza{width:100%;left:0}}.tome.svelte-ui5oza>.music-toggle.svelte-ui5oza.svelte-ui5oza{cursor:pointer;position:fixed;right:0;top:0;width:var(--border-width);height:var(--border-width)}.tome.svelte-ui5oza>.content.svelte-ui5oza.svelte-ui5oza{max-width:1024px;margin:0 auto;overflow:visible}@media (max-width: 768px){.tome.svelte-ui5oza>.content.svelte-ui5oza.svelte-ui5oza{padding:0 1ex}}.announcement.svelte-ui5oza.svelte-ui5oza.svelte-ui5oza{padding:1.5em 4ex;min-width:16ex;margin-top:0;color:#b08217;font-size:1.05em} diff --git a/_app/immutable/assets/_page.BVHX--vi.css b/_app/immutable/assets/_page.BVHX--vi.css new file mode 100644 index 0000000..533c44c --- /dev/null +++ b/_app/immutable/assets/_page.BVHX--vi.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob:not(:first-of-type){margin-top:2em}h1.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob:first-of-type{margin-top:0}h1.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{margin-bottom:.5em;color:#b08a28}h1.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{text-indent:1ex}a[href].svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{text-decoration:none;color:#892d38}a[href].svelte-6b93ob.svelte-6b93ob.svelte-6b93ob:hover{text-decoration:underline}a[href].svelte-6b93ob.svelte-6b93ob.svelte-6b93ob:visited{color:#892d38}ol.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{max-width:min-content;padding-inline-start:0;display:table}@media (max-width: 768px){ol.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{display:block;max-width:none}}ol.svelte-6b93ob li.svelte-6b93ob.svelte-6b93ob{display:table-row}ol.svelte-6b93ob li.svelte-6b93ob>.joined.svelte-6b93ob{opacity:.85}@media (min-width: 768px){ol.svelte-6b93ob li.svelte-6b93ob>.svelte-6b93ob{display:table-cell;width:fit-content;white-space:nowrap;padding:.1em 1ex}}@media (max-width: 768px){ol.svelte-6b93ob li.svelte-6b93ob.svelte-6b93ob{display:flex;flex-direction:row;flex-wrap:wrap;gap:1ex}ol.svelte-6b93ob li.svelte-6b93ob>.svelte-6b93ob{padding:0!important}ol.svelte-6b93ob li.svelte-6b93ob>.name.svelte-6b93ob{text-align:left}ol.svelte-6b93ob li.svelte-6b93ob>.joined.svelte-6b93ob{margin-left:4ex;flex:1 0 100%}ol.svelte-6b93ob li.svelte-6b93ob.svelte-6b93ob:not(:last-child){margin-bottom:1em}}.sort-options.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{display:flex;gap:1ex}.sort-options.svelte-6b93ob>.opt.svelte-6b93ob.svelte-6b93ob:not(:last-child):after{content:", "}.sort-options.svelte-6b93ob>.opt.svelte-6b93ob.svelte-6b93ob:last-child:after{content:"."}.delta.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{font-size:.8em}.delta.svelte-6b93ob .increased.svelte-6b93ob.svelte-6b93ob{color:green}.delta.svelte-6b93ob .increased.svelte-6b93ob.svelte-6b93ob:before{content:"+"}.delta.svelte-6b93ob .decreased.svelte-6b93ob.svelte-6b93ob{color:red}.delta.svelte-6b93ob .decreased.svelte-6b93ob.svelte-6b93ob:before{content:"-"}.disclaimer.svelte-6b93ob.svelte-6b93ob.svelte-6b93ob{font-size:.9em;margin-top:2em} diff --git a/_app/immutable/assets/_page.Bd5N-jCi.css b/_app/immutable/assets/_page.Bd5N-jCi.css new file mode 100644 index 0000000..1fc1a27 --- /dev/null +++ b/_app/immutable/assets/_page.Bd5N-jCi.css @@ -0,0 +1 @@ +@charset "UTF-8";.pancake-chart.svelte-1gzh5rp{position:relative;display:block;width:100%;height:100%}.clip.svelte-1gzh5rp{overflow:hidden}.pancake-grid-item.svelte-1wq9bba{position:absolute;left:0;top:0}.pancake-point.svelte-11ba04d{position:absolute;width:0;height:0}.pancake-box.svelte-38xupb{position:absolute}svg.svelte-4s4ihd{position:absolute;width:100%;height:100%;overflow:visible}.clip.svelte-4s4ihd{overflow:hidden}svg.svelte-4s4ihd *{vector-effect:non-scaling-stroke}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(:first-of-type){margin-top:2em}h1.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:first-of-type,h2.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:first-of-type{margin-top:0}h1.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,h2.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin-bottom:.5em;color:#b08a28}h1.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,h2.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,h3.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{text-indent:1ex}h2.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:#b06e28}a[href].svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{text-decoration:none;color:#892d38}a[href].svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:hover{text-decoration:underline}a[href].svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:visited{color:#892d38}button.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{transition:transform .05s ease-out;cursor:pointer}button.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:hover{transform:translate(.25em)}button.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(.custom){transition:transform .05s ease-out;border-image:url(/nottingham-frontend/button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00}.round-header.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:flex;flex-direction:row;width:100%;align-items:baseline;gap:1ex}.round-header.svelte-u0942d>.left.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.round-header.svelte-u0942d>.right.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{background:url(/nottingham-frontend/charcoal-hl.png) repeat-x;background-size:18ex 120%;height:1em}.round-header.svelte-u0942d>.left.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{flex:0 1 2ex}.round-header.svelte-u0942d>.right.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{flex:1 1 1ex}.round-header.svelte-u0942d>.title.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{flex:0 0 fit-content;margin:0;text-indent:0}.builder.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:before{content:"🤠 ";font-size:.75em}@media (max-width: 768px){.summary.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:flex;flex-direction:column}}.summary.svelte-u0942d>.market.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{float:right;text-align:right;display:flex;flex-direction:column;flex-wrap:wrap}@media (max-width: 768px){.summary.svelte-u0942d>.market.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{float:none;flex-direction:row;justify-content:center;margin:.5em 0;order:1}}.summary.svelte-u0942d>.market h3.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin:0}@media (max-width: 768px){.summary.svelte-u0942d>.market h3.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin:0 1ex;font-size:1em}.summary.svelte-u0942d>.market h3.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:after{content:":"}}.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:flex;flex-direction:column;align-items:end}@media (max-width: 768px){.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d.svelte-u0942d.svelte-u0942d{flex-direction:row;gap:1ex;flex-wrap:wrap;justify-content:center}}.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d>.asset.svelte-u0942d.svelte-u0942d{display:flex;gap:1ex}@media (max-width: 768px){.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d>.asset.svelte-u0942d.svelte-u0942d:after{content:", ";margin-left:-.75ex}}.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d>.asset.svelte-u0942d>.emoji.svelte-u0942d{order:1}@media (max-width: 768px){.summary.svelte-u0942d>.market.svelte-u0942d>.balances.svelte-u0942d>.asset.svelte-u0942d>.emoji.svelte-u0942d{order:0}}.summary.svelte-u0942d>.player.svelte-u0942d>.balance.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin-left:2ex}.summary.svelte-u0942d>.player.svelte-u0942d>.balance.svelte-u0942d>.delta.svelte-u0942d.svelte-u0942d{font-size:.9em;margin-left:1ex;color:#570}.summary.svelte-u0942d>.player.svelte-u0942d>.balance.svelte-u0942d>.delta.decreased.svelte-u0942d.svelte-u0942d{color:#c30}.round.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin-bottom:1em}.round.svelte-u0942d>.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(:last-child){margin-bottom:1em}.player.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(:last-child){margin-bottom:.5em}.block.svelte-u0942d>.steps.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:none;margin-left:2ex;counter-reset:block-activity}.block.svelte-u0942d>.steps.svelte-u0942d>.step.svelte-u0942d.svelte-u0942d.svelte-u0942d{counter-increment:block-activity}.block.svelte-u0942d>.steps.svelte-u0942d>.step.svelte-u0942d.svelte-u0942d.svelte-u0942d:not(:last-child){margin-bottom:.5em}.block.svelte-u0942d>.steps.svelte-u0942d>.step.svelte-u0942d.svelte-u0942d.svelte-u0942d:before{content:counter(block-activity) ")";font-style:italic;margin-right:1.5ex;font-size:.9em;opacity:.9;vertical-align:super}.block.svelte-u0942d>.steps .swaps.svelte-u0942d>.swap.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin-left:6ex}.block.svelte-u0942d>.expand button.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin:0 0 .5em;padding:0;background:none;border:none;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit}.block.svelte-u0942d>.expand.svelte-u0942d>button.svelte-u0942d>.prefix.svelte-u0942d.svelte-u0942d:after{content:"[+] Show"}.block.expanded.svelte-u0942d>.steps.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:block}.block.expanded.svelte-u0942d>.expand.svelte-u0942d>button.svelte-u0942d>.prefix.svelte-u0942d.svelte-u0942d:after{content:"[-] Hide"}h1.svelte-u0942d+.date.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{float:right}@media (max-width: 768px){h1.svelte-u0942d+.date.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:none}}@media (min-width: 768px){section.date.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{display:none}}.date.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{text-align:center}.deployment-failures.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{margin:1.5em 0ex}.deployment-failures.svelte-u0942d .failure.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d:before{content:"🪦";margin-right:1ex}.chart.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{height:10em;margin:2em 0 3em;--player-1-color:rgb(87, 134, 17);--player-2-color:rgb(212, 23, 23);--player-3-color:rgb(32, 173, 220);--player-4-color:rgb(202, 48, 202)}.chart.svelte-u0942d .player-scores .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{fill:none;stroke:gray;stroke-width:.125em;stroke-linecap:round;stroke-linejoin:round}.chart.svelte-u0942d .player-scores:nth-of-type(1) .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.chart.svelte-u0942d .player-scores:nth-of-type(1) .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke:var(--player-1-color)}.chart.svelte-u0942d .player-scores:nth-of-type(2) .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.chart.svelte-u0942d .player-scores:nth-of-type(2) .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke:var(--player-2-color)}.chart.svelte-u0942d .player-scores:nth-of-type(3) .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.chart.svelte-u0942d .player-scores:nth-of-type(3) .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke:var(--player-3-color)}.chart.svelte-u0942d .player-scores:nth-of-type(4) .line.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d,.chart.svelte-u0942d .player-scores:nth-of-type(4) .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke:var(--player-4-color)}.chart.svelte-u0942d .player-scores .player-pt.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke-width:.33em;stroke-linecap:round;stroke-linejoin:round;box-sizing:border-box}.chart.svelte-u0942d .player-scores .player-pt.final.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{stroke-width:.66em}.chart.svelte-u0942d .legend .trophy.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{opacity:0}.chart.svelte-u0942d .legend .trophy.show.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{opacity:1}.chart.svelte-u0942d .legend .player-label.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{position:relative}.chart.svelte-u0942d .legend .player-label.svelte-u0942d:nth-of-type(1)>.score.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:var(--player-1-color)}.chart.svelte-u0942d .legend .player-label.svelte-u0942d:nth-of-type(2)>.score.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:var(--player-2-color)}.chart.svelte-u0942d .legend .player-label.svelte-u0942d:nth-of-type(3)>.score.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:var(--player-3-color)}.chart.svelte-u0942d .legend .player-label.svelte-u0942d:nth-of-type(4)>.score.svelte-u0942d.svelte-u0942d.svelte-u0942d{color:var(--player-4-color)}.chart.svelte-u0942d .rounds-count.svelte-u0942d.svelte-u0942d.svelte-u0942d.svelte-u0942d{text-align:center;margin-top:1em} diff --git a/_app/immutable/assets/_page.BqVCeSSd.css b/_app/immutable/assets/_page.BqVCeSSd.css new file mode 100644 index 0000000..bc1346f --- /dev/null +++ b/_app/immutable/assets/_page.BqVCeSSd.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}h3.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{text-indent:1ex}a[href].svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{text-decoration:none;color:#892d38}a[href].svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju:hover{text-decoration:underline}a[href].svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju:visited{color:#892d38}.smaller.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{font-size:.66em}.season.svelte-a2bvju>h3.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{margin-bottom:.25em}.season.svelte-a2bvju>h3 .leaf.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{height:1.25em;margin-bottom:-.25em}.season.svelte-a2bvju>.tournaments.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{margin-left:5ex}.season.svelte-a2bvju>.tournaments.svelte-a2bvju>.entry.svelte-a2bvju.svelte-a2bvju{display:flex;flex-wrap:wrap;gap:0 2ex;margin-bottom:.25em}.season.svelte-a2bvju>.tournaments.svelte-a2bvju>.entry.svelte-a2bvju>h3.svelte-a2bvju{margin:0}.season.current.svelte-a2bvju .prize.svelte-a2bvju.svelte-a2bvju.svelte-a2bvju{font-size:.85em;color:green;text-decoration:underline}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:not(:first-of-type){margin-top:2em}h1.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:first-of-type,h2.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:first-of-type{margin-top:0}h1.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak,h2.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{margin-bottom:.5em;color:#b08a28}h1.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak,h2.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak,h3.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{text-indent:1ex}h2.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{color:#b06e28}h1.svelte-xkivak+p.svelte-xkivak.svelte-xkivak.svelte-xkivak,h2.svelte-xkivak+p.svelte-xkivak.svelte-xkivak.svelte-xkivak{margin-top:.25em}a[href].svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{text-decoration:none;color:#892d38}a[href].svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:hover{text-decoration:underline}a[href].svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:visited{color:#892d38}a.inherit.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak,a.inherit.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak:visited{color:inherit;text-decoration:inherit;font-style:inherit;font-weight:inherit}.illustration.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{float:right;height:8em}@media (max-width: 768px){.illustration.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{float:none;margin:0 auto;width:fit-content}}.illustration.svelte-xkivak>img.svelte-xkivak.svelte-xkivak.svelte-xkivak{height:100%}.illustration.svelte-xkivak>img.svelte-xkivak.svelte-xkivak.svelte-xkivak:nth-child(1){transform:scaleX(-1)}section.svelte-xkivak>ul.svelte-xkivak>li.svelte-xkivak.svelte-xkivak{margin-bottom:.5em}#timeline.svelte-xkivak>.events.svelte-xkivak.svelte-xkivak.svelte-xkivak{display:flex;flex-direction:column}@media (max-width: 768px){#timeline.svelte-xkivak>.events.svelte-xkivak.svelte-xkivak.svelte-xkivak{gap:.5em}}#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak.svelte-xkivak.svelte-xkivak{display:flex;flex-direction:row;justify-content:space-between}@media (max-width: 768px){#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak.svelte-xkivak.svelte-xkivak{flex-direction:column;justify-content:center;align-items:center}}#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak>.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak>.svelte-xkivak.svelte-xkivak{flex:1 0 fit-content}#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak>.spacer.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak>.spacer.svelte-xkivak.svelte-xkivak{display:contents}@media (max-width: 768px){#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak>.spacer.svelte-xkivak,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak>.spacer.svelte-xkivak.svelte-xkivak{display:none}}#timeline.svelte-xkivak>.events.svelte-xkivak>.event.svelte-xkivak>.spacer.svelte-xkivak:after,#timeline.svelte-xkivak>.events .prize-event.svelte-xkivak>.spacer.svelte-xkivak.svelte-xkivak:after{content:"..................................................................................................................................................................................................................................";overflow:hidden;text-overflow:clip;display:block;flex:0 1 auto;opacity:.25}#timeline.svelte-xkivak>.disclaimer.svelte-xkivak.svelte-xkivak.svelte-xkivak{text-align:right;font-size:.75em}@media (max-width: 768px){#timeline.svelte-xkivak>.disclaimer.svelte-xkivak.svelte-xkivak.svelte-xkivak{margin-top:.5em;text-align:center}}.u.svelte-xkivak.svelte-xkivak.svelte-xkivak.svelte-xkivak{text-decoration:underline} diff --git a/_app/immutable/assets/_page.CsXr3xRy.css b/_app/immutable/assets/_page.CsXr3xRy.css new file mode 100644 index 0000000..a94ef85 --- /dev/null +++ b/_app/immutable/assets/_page.CsXr3xRy.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-1jmkil1.svelte-1jmkil1:not(:first-of-type){margin-top:2em}h1.svelte-1jmkil1.svelte-1jmkil1:first-of-type,h2.svelte-1jmkil1.svelte-1jmkil1:first-of-type{margin-top:0}h1.svelte-1jmkil1.svelte-1jmkil1,h2.svelte-1jmkil1.svelte-1jmkil1{margin-bottom:.5em;color:#b08a28}h1.svelte-1jmkil1.svelte-1jmkil1,h2.svelte-1jmkil1.svelte-1jmkil1,h3.svelte-1jmkil1.svelte-1jmkil1{text-indent:1ex}h2.svelte-1jmkil1.svelte-1jmkil1{color:#b06e28}a[href].svelte-1jmkil1.svelte-1jmkil1{text-decoration:none;color:#892d38}a[href].svelte-1jmkil1.svelte-1jmkil1:hover{text-decoration:underline}a[href].svelte-1jmkil1.svelte-1jmkil1:visited{color:#892d38}.grid.svelte-1jmkil1.svelte-1jmkil1{display:flex;flex-direction:row;flex-wrap:wrap;gap:6ex}.grid.svelte-1jmkil1 h3.svelte-1jmkil1{margin-bottom:.25em;border-bottom:1px solid #777} diff --git a/_app/immutable/assets/_page.Da9TCI9w.css b/_app/immutable/assets/_page.Da9TCI9w.css new file mode 100644 index 0000000..389264a --- /dev/null +++ b/_app/immutable/assets/_page.Da9TCI9w.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-weh7pk.svelte-weh7pk:not(:first-of-type){margin-top:2em}h1.svelte-weh7pk.svelte-weh7pk:first-of-type{margin-top:0}h1.svelte-weh7pk.svelte-weh7pk{margin-bottom:.5em;color:#b08a28}h1.svelte-weh7pk.svelte-weh7pk{text-indent:1ex}a[href].svelte-weh7pk.svelte-weh7pk{text-decoration:none;color:#892d38}a[href].svelte-weh7pk.svelte-weh7pk:hover{text-decoration:underline}a[href].svelte-weh7pk.svelte-weh7pk:visited{color:#892d38}button.svelte-weh7pk.svelte-weh7pk{transition:transform .05s ease-out;cursor:pointer}button.svelte-weh7pk.svelte-weh7pk:hover{transform:translate(.25em)}button[disabled].svelte-weh7pk.svelte-weh7pk{opacity:.5;pointer-events:none}button.svelte-weh7pk.svelte-weh7pk:not(.custom){transition:transform .05s ease-out;border-image:url(/nottingham-frontend/button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00}input.svelte-weh7pk.svelte-weh7pk:not([type]),input[type=email].svelte-weh7pk.svelte-weh7pk{background:none;border:none;border-image:url(/nottingham-frontend/text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}input.svelte-weh7pk.svelte-weh7pk:not([type]):focus,input[type=email].svelte-weh7pk.svelte-weh7pk:focus{outline:none}.error.svelte-weh7pk.svelte-weh7pk{margin:1em auto;color:red}.auth-form.svelte-weh7pk.svelte-weh7pk{display:flex;flex-direction:column;align-items:center}.auth-form.svelte-weh7pk iframe.svelte-weh7pk{display:block;width:90%;height:16em;margin:0 auto;background-color:transparent}.auth-form.svelte-weh7pk .checkboxes.svelte-weh7pk{margin-top:1em}.auth-form.svelte-weh7pk button.svelte-weh7pk{display:block;margin:0 auto}.register-form.svelte-weh7pk.svelte-weh7pk{margin:0 auto;width:fit-content;display:flex;flex-direction:column;flex-wrap:wrap;align-items:center}.register-form.svelte-weh7pk .inputs.svelte-weh7pk{display:flex;align-items:center;flex-wrap:wrap;gap:2ex}@media (max-width: 768px){.register-form.svelte-weh7pk .inputs.svelte-weh7pk{flex-direction:column}}.register-form.svelte-weh7pk .inputs .field.svelte-weh7pk{display:flex;flex-direction:column} diff --git a/_app/immutable/assets/_page.DdBfvmPi.css b/_app/immutable/assets/_page.DdBfvmPi.css new file mode 100644 index 0000000..ecba598 --- /dev/null +++ b/_app/immutable/assets/_page.DdBfvmPi.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-agtccm.svelte-agtccm:not(:first-of-type){margin-top:2em}h1.svelte-agtccm.svelte-agtccm:first-of-type,h2.svelte-agtccm.svelte-agtccm:first-of-type{margin-top:0}h1.svelte-agtccm.svelte-agtccm,h2.svelte-agtccm.svelte-agtccm{margin-bottom:.5em;color:#b08a28}h1.svelte-agtccm.svelte-agtccm,h2.svelte-agtccm.svelte-agtccm,h3.svelte-agtccm.svelte-agtccm{text-indent:1ex}h2.svelte-agtccm.svelte-agtccm{color:#b06e28}a[href].svelte-agtccm.svelte-agtccm{text-decoration:none;color:#892d38}a[href].svelte-agtccm.svelte-agtccm:hover{text-decoration:underline}a[href].svelte-agtccm.svelte-agtccm:visited{color:#892d38}input.svelte-agtccm.svelte-agtccm:not([type]),input[type=text].svelte-agtccm.svelte-agtccm{background:none;border:none;border-image:url(/nottingham-frontend/text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}input.svelte-agtccm.svelte-agtccm:not([type]):focus,input[type=text].svelte-agtccm.svelte-agtccm:focus{outline:none}.matches.svelte-agtccm .summary.svelte-agtccm{display:flex;flex-direction:row;justify-content:space-between;align-items:center;flex-wrap:wrap}.matches.svelte-agtccm .matches-grid.svelte-agtccm{display:flex;flex-wrap:wrap;gap:0 6ex}.matches.svelte-agtccm .matches-grid .match.svelte-agtccm{width:fit-content}.matches.svelte-agtccm .matches-grid .match h3.svelte-agtccm{margin-bottom:.25em;border-bottom:1px solid #777}.matches.svelte-agtccm .matches-grid .match ol.svelte-agtccm{margin-top:0}.smaller.svelte-agtccm.svelte-agtccm{font-size:.8em} diff --git a/_app/immutable/assets/_page.DvlMo88E.css b/_app/immutable/assets/_page.DvlMo88E.css new file mode 100644 index 0000000..ae5faa9 --- /dev/null +++ b/_app/immutable/assets/_page.DvlMo88E.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}section.svelte-1j7wjax.svelte-1j7wjax:not(:first-of-type){margin-top:2em}h1.svelte-1j7wjax.svelte-1j7wjax:first-of-type,h2.svelte-1j7wjax.svelte-1j7wjax:first-of-type{margin-top:0}h1.svelte-1j7wjax.svelte-1j7wjax,h2.svelte-1j7wjax.svelte-1j7wjax{margin-bottom:.5em;color:#b08a28}h1.svelte-1j7wjax.svelte-1j7wjax,h2.svelte-1j7wjax.svelte-1j7wjax,h3.svelte-1j7wjax.svelte-1j7wjax{text-indent:1ex}h2.svelte-1j7wjax.svelte-1j7wjax{color:#b06e28}h2.svelte-1j7wjax+p.svelte-1j7wjax{margin-top:.25em}a[href].svelte-1j7wjax.svelte-1j7wjax{text-decoration:none;color:#892d38}a[href].svelte-1j7wjax.svelte-1j7wjax:hover{text-decoration:underline}a[href].svelte-1j7wjax.svelte-1j7wjax:visited{color:#892d38}button.svelte-1j7wjax.svelte-1j7wjax{transition:transform .05s ease-out;cursor:pointer}button.svelte-1j7wjax.svelte-1j7wjax:hover{transform:translate(.25em)}button[disabled].svelte-1j7wjax.svelte-1j7wjax{opacity:.5;pointer-events:none}button.svelte-1j7wjax.svelte-1j7wjax:not(.custom){transition:transform .05s ease-out;border-image:url(/nottingham-frontend/button-border.png) 14% 12%/.66em 2ex round;background:none;padding:.33em 2ex;font-weight:700;font-family:Fondamento;font-style:italic;font-size:1.05em;color:#b11b00}button.custom.svelte-1j7wjax.svelte-1j7wjax{margin:.5em 0;padding:0;background:none;border:none;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit}input.svelte-1j7wjax.svelte-1j7wjax:not([type]),textarea.svelte-1j7wjax.svelte-1j7wjax{background:none;border:none;border-image:url(/nottingham-frontend/text-input-border.png) 15% 22.5%/.5em 1.75ex round;padding:.5em 1.5ex .33em;font-family:Nightshade;font-size:1.2em;font-style:italic;font-weight:400}input.svelte-1j7wjax.svelte-1j7wjax:not([type]):focus,textarea.svelte-1j7wjax.svelte-1j7wjax:focus{outline:none}.alert.svelte-1j7wjax.svelte-1j7wjax{border-image:url(/nottingham-frontend/attention-border.png) 50% 12%/.75em 2ex round;padding:.2em 2ex;margin:1em auto;text-align:center;width:fit-content}.season.svelte-1j7wjax .tournament-result.svelte-1j7wjax{display:grid;grid:auto/repeat(5,1fr);flex-direction:row;gap:1ex}.season.svelte-1j7wjax .tournament-result.header.svelte-1j7wjax{text-decoration:underline;margin-bottom:.5em}.season.svelte-1j7wjax .tournament-result.optional.svelte-1j7wjax{display:none}.season.svelte-1j7wjax button.expand.svelte-1j7wjax{margin-left:3ex}.season.expanded.svelte-1j7wjax button.expand.svelte-1j7wjax{display:none}.season.expanded.svelte-1j7wjax .optional.svelte-1j7wjax{display:grid}.submit-bytecode.svelte-1j7wjax.svelte-1j7wjax{display:flex;flex-direction:column}.submit-bytecode.svelte-1j7wjax .bytecode.svelte-1j7wjax{font-family:monospace;font-size:1.1em;letter-spacing:-.33ex;display:block;width:0 auto}.submit-bytecode.svelte-1j7wjax .buttons.svelte-1j7wjax{display:flex;justify-content:space-between;flex-wrap:wrap}.name.svelte-1j7wjax.svelte-1j7wjax{font-size:1.25em;color:#2549b5!important}.error.svelte-1j7wjax.svelte-1j7wjax{text-align:center;margin:1em 0;color:red}.address.svelte-1j7wjax.svelte-1j7wjax{text-overflow:ellipsis;overflow:hidden}input[type=file].svelte-1j7wjax.svelte-1j7wjax{display:none} diff --git a/_app/immutable/assets/_page.DxWoO6ym.css b/_app/immutable/assets/_page.DxWoO6ym.css new file mode 100644 index 0000000..006c4d3 --- /dev/null +++ b/_app/immutable/assets/_page.DxWoO6ym.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}h1.svelte-j2bsx1.svelte-j2bsx1:first-of-type,h2.svelte-j2bsx1.svelte-j2bsx1:first-of-type{margin-top:0}h1.svelte-j2bsx1.svelte-j2bsx1,h2.svelte-j2bsx1.svelte-j2bsx1{margin-bottom:.5em;color:#b08a28}h1.svelte-j2bsx1.svelte-j2bsx1,h2.svelte-j2bsx1.svelte-j2bsx1,h3.svelte-j2bsx1.svelte-j2bsx1{text-indent:1ex}h2.svelte-j2bsx1.svelte-j2bsx1{color:#b06e28}a[href].svelte-j2bsx1.svelte-j2bsx1{text-decoration:none;color:#892d38}a[href].svelte-j2bsx1.svelte-j2bsx1:hover{text-decoration:underline}a[href].svelte-j2bsx1.svelte-j2bsx1:visited{color:#892d38}.grid.svelte-j2bsx1.svelte-j2bsx1{display:flex;flex-direction:row;flex-wrap:wrap;gap:0 6ex}.grid.svelte-j2bsx1 h3.svelte-j2bsx1{margin-bottom:.25em;border-bottom:1px solid #777} diff --git a/_app/immutable/assets/page.BWNIR0BY.css b/_app/immutable/assets/page.BWNIR0BY.css new file mode 100644 index 0000000..4f8fdd5 --- /dev/null +++ b/_app/immutable/assets/page.BWNIR0BY.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}:root{--size:5em}.spinner.svelte-a8ekfe{display:inline-block;background-image:url(/nottingham-frontend/cat-spinner.png);width:var(--size);height:var(--size);background-repeat:no-repeat;background-size:calc(3 * var(--size));animation:svelte-a8ekfe-spin .33s steps(1,end) infinite;transform:scaleX(-1);filter:sepia(.5);display:flex;align-items:center}.spinner.failed.svelte-a8ekfe{animation:none;transform:scale(-1) rotate(12deg);background-position:calc(var(--size) * -2) 0}@keyframes svelte-a8ekfe-spin{0%{background-position:calc(var(--size) * -2) 0}33%{background-position:calc(var(--size) * -1) 0}66%{background-position:0 0}}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}.lede.svelte-qse11b>h1:first-letter{font-family:"Initial"}.lede.svelte-qse11b>h1:first-letter{font-style:normal;font-weight:100;font-size:3em;float:left;text-transform:capitalize;line-height:.95em;letter-spacing:.05ex;background:url(/nottingham-frontend/gold-leaf-texture.jpg);background-size:100%;background-clip:text;color:#0000;padding-bottom:.05em}.lede.svelte-qse11b.svelte-qse11b{margin-bottom:1em}.lede.svelte-qse11b>h1{margin:0!important;color:#b08a28;text-indent:0!important}.lede.svelte-qse11b>p{margin-top:0}.lede.svelte-qse11b>p:nth-last-child(2){margin-bottom:0}.lede.svelte-qse11b>.svelte-qse11b:last-child{clear:both}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}.page.svelte-18qstv3.svelte-18qstv3{font-family:Fondamento;font-weight:bolder}.page.svelte-18qstv3.svelte-18qstv3{position:relative}.page.svelte-18qstv3 .content.svelte-18qstv3{overflow:hidden} diff --git a/_app/immutable/assets/page.CLNrBPMz.css b/_app/immutable/assets/page.CLNrBPMz.css new file mode 100644 index 0000000..3556a49 --- /dev/null +++ b/_app/immutable/assets/page.CLNrBPMz.css @@ -0,0 +1 @@ +body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}:root{--size:5em}.spinner.svelte-a8ekfe{display:inline-block;background-image:url(../../../cat-spinner.png);width:var(--size);height:var(--size);background-repeat:no-repeat;background-size:calc(3 * var(--size));animation:svelte-a8ekfe-spin .33s steps(1,end) infinite;transform:scaleX(-1);filter:sepia(.5);display:flex;align-items:center}.spinner.failed.svelte-a8ekfe{animation:none;transform:scale(-1) rotate(12deg);background-position:calc(var(--size) * -2) 0}@keyframes svelte-a8ekfe-spin{0%{background-position:calc(var(--size) * -2) 0}33%{background-position:calc(var(--size) * -1) 0}66%{background-position:0 0}}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}.lede.svelte-qse11b>h1:first-letter{font-family:"Initial"}.lede.svelte-qse11b>h1:first-letter{font-style:normal;font-weight:100;font-size:3em;float:left;text-transform:capitalize;line-height:.95em;letter-spacing:.05ex;background:url(../../../gold-leaf-texture.jpg);background-size:100%;-webkit-background-clip:text;background-clip:text;color:#0000;padding-bottom:.05em}.lede.svelte-qse11b.svelte-qse11b{margin-bottom:1em}.lede.svelte-qse11b>h1{margin:0!important;color:#b08a28;text-indent:0!important}.lede.svelte-qse11b>p{margin-top:0}.lede.svelte-qse11b>p:nth-last-child(2){margin-bottom:0}.lede.svelte-qse11b>.svelte-qse11b:last-child{clear:both}:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}.page.svelte-18qstv3.svelte-18qstv3{font-family:Fondamento;font-weight:bolder}.page.svelte-18qstv3.svelte-18qstv3{position:relative}.page.svelte-18qstv3 .content.svelte-18qstv3{overflow:hidden} diff --git a/_app/immutable/assets/player.BGZDgu9l.css b/_app/immutable/assets/player.BGZDgu9l.css new file mode 100644 index 0000000..f3feb6e --- /dev/null +++ b/_app/immutable/assets/player.BGZDgu9l.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(../../../pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(../../../Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(../../../Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(../../../Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(../../../UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(../../../GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(../../../Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(../../../JimNightshade-Regular.ttf) format("truetype")}a[href].svelte-amw2kc{text-decoration:none;color:#892d38}a[href].svelte-amw2kc:hover{text-decoration:underline}a[href].svelte-amw2kc:visited{color:#892d38} diff --git a/_app/immutable/assets/player.Dm-KDun2.css b/_app/immutable/assets/player.Dm-KDun2.css new file mode 100644 index 0000000..5d561d8 --- /dev/null +++ b/_app/immutable/assets/player.Dm-KDun2.css @@ -0,0 +1 @@ +:root{--bg-color:rgb(255, 245, 218)}body{background-color:var(--bg-color);color:#4a352c;margin:0;min-height:100vh;cursor:url(/nottingham-frontend/pointer.png) 5 5,pointer}@media (max-width: 768px){body{cursor:auto}}@font-face{font-family:Fondamento;src:url(/nottingham-frontend/Fondamento-Regular.ttf) format("truetype")}@font-face{font-family:Fondamento Italic;src:url(/nottingham-frontend/Fondamento-Italic.ttf) format("truetype")}@font-face{font-family:Kings;src:url(/nottingham-frontend/Kings-Regular.ttf) format("truetype")}@font-face{font-family:Unifraktur;src:url(/nottingham-frontend/UnifrakturMaguntia-Regular.ttf) format("truetype")}@font-face{font-family:"Initial";src:url(/nottingham-frontend/GothicLeaf.ttf) format("truetype")}@font-face{font-family:Condiment;src:url(/nottingham-frontend/Condiment-Regular.ttf) format("truetype")}@font-face{font-family:Nightshade;src:url(/nottingham-frontend/JimNightshade-Regular.ttf) format("truetype")}a[href].svelte-amw2kc{text-decoration:none;color:#892d38}a[href].svelte-amw2kc:hover{text-decoration:underline}a[href].svelte-amw2kc:visited{color:#892d38} diff --git a/_app/immutable/chunks/2.CpRWH4-H.js b/_app/immutable/chunks/2.CpRWH4-H.js new file mode 100644 index 0000000..cc92f25 --- /dev/null +++ b/_app/immutable/chunks/2.CpRWH4-H.js @@ -0,0 +1,9930 @@ +const __vite__fileDeps=["./index.hW7Iu6gF.js","./preload-helper.D6kgxu3v.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{s as S3,c as X_,e as Sr,d as Ir,f as vi,i as tr,k as yi,u as ex,g as tx,a as rx,o as Qd,a4 as hO,y as ix,N as nx,v as ar,x as I3,n as kc,L as dO,b as On,j as Pn,q as Bs,z as fO,l as mr,A as ox,a0 as pO,I as gO,t as jl,h as Fl,m as sx}from"./scheduler.C1FoT2GD.js";import{S as T3,i as R3,t as Da,a as Na,c as k3,b as O3,m as P3,d as D3,g as mO,e as wO}from"./index.DFmxPlw4.js";import{a4 as $a,a5 as vO,a6 as yO,a7 as bO,a8 as Zn,a9 as _O,w as xO,W as Lg,I as AO,J as EO,K as ax,R as CO,aa as SO,ab as IO,ac as TO,M as cx,Q as RO,ad as N3,ae as cn,af as Hw,ag as kO,ah as OO,ai as zl,aj as lx,ak as PO,al as DO,Z as NO,am as ux,an as hx,ao as $O,ap as $3,aq as MO,ar as BO,as as UO,at as LO,au as jO,$ as FO,av as zO,p as WO,aw as i4,ax as h1,ay as n4,az as HO,aA as qO,aB as VO,aC as KO,aD as GO,aE as qw,aF as ZO,L as i2,P as QO,aG as o4}from"./kit.CACir_b1.js";import{_ as Bo}from"./preload-helper.D6kgxu3v.js";import{s as M3,A as B3,c as YO,d as dx,e as JO,f as s4}from"./contest.LM7IXEuc.js";import{p as XO}from"./stores.uos4ky2n.js";import{b as Uo}from"./paths.2ZvcQRjx.js";async function eP(r,{chain:e}){const{id:t,name:i,nativeCurrency:n,rpcUrls:o,blockExplorers:s}=e;await r.request({method:"wallet_addEthereumChain",params:[{chainId:$a(t),chainName:i,nativeCurrency:n,rpcUrls:o.default.http,blockExplorerUrls:s?Object.values(s).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}function fx(r,e={}){const{key:t="custom",name:i="Custom Provider",retryDelay:n}=e;return({retryCount:o})=>vO({key:t,name:i,request:r.request.bind(r),retryCount:e.retryCount??o,retryDelay:n,type:"custom"})}function tP(r,e){let[t,i="0"]=r.split(".");const n=t.startsWith("-");if(n&&(t=t.slice(1)),i=i.replace(/(0+)$/,""),e===0)Math.round(+`.${i}`)===1&&(t=`${BigInt(t)+1n}`),i="";else if(i.length>e){const[o,s,a]=[i.slice(0,e-1),i.slice(e-1,e),i.slice(e)],u=Math.round(+`${s}.${a}`);u>9?i=`${BigInt(o)+BigInt(1)}0`.padStart(o.length+1,"0"):i=`${o}${u}`,i.length>e&&(i=i.slice(1),t=`${BigInt(t)+1n}`),i=i.slice(0,e)}else i=i.padEnd(e,"0");return BigInt(`${n?"-":""}${t}${i}`)}function rP(r,e){const{abi:t,args:i,bytecode:n,...o}=e,s=yO({abi:t,args:i,bytecode:n});return M3(r,{...o,data:s})}async function iP(r){var t;return((t=r.account)==null?void 0:t.type)==="local"?[r.account.address]:(await r.request({method:"eth_accounts"},{dedupe:!0})).map(i=>bO(i))}async function nP(r){return await r.request({method:"wallet_getPermissions"},{dedupe:!0})}async function oP(r){return(await r.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(t=>Zn(t))}async function sP(r,e){return r.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function px(r,{account:e=r.account,message:t}){if(!e)throw new B3({docsPath:"/docs/actions/wallet/signMessage"});const i=Lg(e);if(i.type==="local")return i.signMessage({message:t});const n=typeof t=="string"?_O(t):t.raw instanceof Uint8Array?xO(t.raw):t.raw;return r.request({method:"personal_sign",params:[n,i.address]},{retryCount:0})}async function aP(r,e){var h,d,p,v;const{account:t=r.account,chain:i=r.chain,...n}=e;if(!t)throw new B3({docsPath:"/docs/actions/wallet/signTransaction"});const o=Lg(t);AO({account:o,...e});const s=await EO(r,ax,"getChainId")({});i!==null&&YO({currentChainId:s,chain:i});const a=(i==null?void 0:i.formatters)||((h=r.chain)==null?void 0:h.formatters),u=((d=a==null?void 0:a.transactionRequest)==null?void 0:d.format)||CO;return o.type==="local"?o.signTransaction({...n,chainId:s},{serializer:(v=(p=r.chain)==null?void 0:p.serializers)==null?void 0:v.transaction}):await r.request({method:"eth_signTransaction",params:[{...u(n),chainId:$a(s),from:o.address}]},{retryCount:0})}async function cP(r,e){const{account:t=r.account,domain:i,message:n,primaryType:o}=e;if(!t)throw new B3({docsPath:"/docs/actions/wallet/signTypedData"});const s=Lg(t),a={EIP712Domain:SO({domain:i}),...e.types};if(IO({domain:i,message:n,primaryType:o,types:a}),s.type==="local")return s.signTypedData({domain:i,message:n,primaryType:o,types:a});const u=TO({domain:i,message:n,primaryType:o,types:a});return r.request({method:"eth_signTypedData_v4",params:[s.address,u]},{retryCount:0})}async function lP(r,{id:e}){await r.request({method:"wallet_switchEthereumChain",params:[{chainId:$a(e)}]},{retryCount:0})}async function uP(r,e){return await r.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function hP(r){return{addChain:e=>eP(r,e),deployContract:e=>rP(r,e),getAddresses:()=>iP(r),getChainId:()=>ax(r),getPermissions:()=>nP(r),prepareTransactionRequest:e=>cx(r,e),requestAddresses:()=>oP(r),requestPermissions:e=>sP(r,e),sendRawTransaction:e=>RO(r,e),sendTransaction:e=>M3(r,e),signMessage:e=>px(r,e),signTransaction:e=>aP(r,e),signTypedData:e=>cP(r,e),switchChain:e=>lP(r,e),watchAsset:e=>uP(r,e),writeContract:e=>dx(r,e)}}function dP(r){const{key:e="wallet",name:t="Wallet Client",transport:i}=r;return N3({...r,key:e,name:t,transport:i,type:"walletClient"}).extend(hP)}var ln=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ea(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function jg(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}var U3={exports:{}},ch=typeof Reflect=="object"?Reflect:null,a4=ch&&typeof ch.apply=="function"?ch.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)},d1;ch&&typeof ch.ownKeys=="function"?d1=ch.ownKeys:Object.getOwnPropertySymbols?d1=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:d1=function(e){return Object.getOwnPropertyNames(e)};function fP(r){console&&console.warn&&console.warn(r)}var gx=Number.isNaN||function(e){return e!==e};function Mr(){Mr.init.call(this)}U3.exports=Mr;U3.exports.once=wP;Mr.EventEmitter=Mr;Mr.prototype._events=void 0;Mr.prototype._eventsCount=0;Mr.prototype._maxListeners=void 0;var c4=10;function Fg(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Mr,"defaultMaxListeners",{enumerable:!0,get:function(){return c4},set:function(r){if(typeof r!="number"||r<0||gx(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");c4=r}});Mr.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Mr.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||gx(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function mx(r){return r._maxListeners===void 0?Mr.defaultMaxListeners:r._maxListeners}Mr.prototype.getMaxListeners=function(){return mx(this)};Mr.prototype.emit=function(e){for(var t=[],i=1;i0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(u===void 0)return!1;if(typeof u=="function")a4(u,this,t);else for(var h=u.length,d=_x(u,h),i=0;i0&&s.length>n&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=r,a.type=e,a.count=s.length,fP(a)}return r}Mr.prototype.addListener=function(e,t){return wx(this,e,t,!1)};Mr.prototype.on=Mr.prototype.addListener;Mr.prototype.prependListener=function(e,t){return wx(this,e,t,!0)};function pP(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function vx(r,e,t){var i={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},n=pP.bind(i);return n.listener=t,i.wrapFn=n,n}Mr.prototype.once=function(e,t){return Fg(t),this.on(e,vx(this,e,t)),this};Mr.prototype.prependOnceListener=function(e,t){return Fg(t),this.prependListener(e,vx(this,e,t)),this};Mr.prototype.removeListener=function(e,t){var i,n,o,s,a;if(Fg(t),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if(typeof i!="function"){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,o=s;break}if(o<0)return this;o===0?i.shift():gP(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,a||t)}return this};Mr.prototype.off=Mr.prototype.removeListener;Mr.prototype.removeAllListeners=function(e){var t,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),s;for(n=0;n=0;n--)this.removeListener(e,t[n]);return this};function yx(r,e,t){var i=r._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?t?[n.listener||n]:[n]:t?mP(n):_x(n,n.length)}Mr.prototype.listeners=function(e){return yx(this,e,!0)};Mr.prototype.rawListeners=function(e){return yx(this,e,!1)};Mr.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):bx.call(r,e)};Mr.prototype.listenerCount=bx;function bx(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Mr.prototype.eventNames=function(){return this._eventsCount>0?d1(this._events):[]};function _x(r,e){for(var t=new Array(e),i=0;i"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new AP:typeof navigator<"u"?RP(navigator.userAgent):OP()}function TP(r){return r!==""&&SP.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var o=n.exec(r);return!!o&&[i,o]},!1)}function RP(r){var e=TP(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new xP;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.length=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o}function MP(r,e){return function(t,i){e(t,i,r)}}function BP(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function UP(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{h(i.next(d))}catch(p){s(p)}}function u(d){try{h(i.throw(d))}catch(p){s(p)}}function h(d){d.done?o(d.value):n(d.value).then(a,u)}h((i=i.apply(r,e||[])).next())})}function LP(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(h){return function(d){return u([h,d])}}function u(h){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(o=h[0]&2?n.return:h[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,h[1])).done)return o;switch(n=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,n=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ax(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,o=[],s;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(s)throw s.error}}return o}function zP(){for(var r=[],e=0;e1||a(v,b)})})}function a(v,b){try{u(i[v](b))}catch(I){p(o[0][3],I)}}function u(v){v.value instanceof hf?Promise.resolve(v.value.v).then(h,d):p(o[0][2],v)}function h(v){a("next",v)}function d(v){a("throw",v)}function p(v,b){v(b),o.shift(),o.length&&a(o[0][0],o[0][1])}}function qP(r){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=r[n]?function(s){return(t=!t)?{value:hf(r[n](s)),done:n==="return"}:o?o(s):s}:o}}function VP(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof s2=="function"?s2(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=r[o]&&function(s){return new Promise(function(a,u){s=r[o](s),n(a,u,s.done,s.value)})}}function n(o,s,a,u){Promise.resolve(u).then(function(h){o({value:h,done:a})},s)}}function KP(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function GP(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function ZP(r){return r&&r.__esModule?r:{default:r}}function QP(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function YP(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const JP=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return o2},__asyncDelegator:qP,__asyncGenerator:HP,__asyncValues:VP,__await:hf,__awaiter:UP,__classPrivateFieldGet:QP,__classPrivateFieldSet:YP,__createBinding:jP,__decorate:$P,__exportStar:FP,__extends:DP,__generator:LP,__importDefault:ZP,__importStar:GP,__makeTemplateObject:KP,__metadata:BP,__param:MP,__read:Ax,__rest:NP,__spread:zP,__spreadArrays:WP,__values:s2},Symbol.toStringTag,{value:"Module"})),zg=jg(JP);var Vw={},Od={},d4;function XP(){if(d4)return Od;d4=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return Od.delay=r,Od}var xl={},Kw={},Al={},f4;function eD(){return f4||(f4=1,Object.defineProperty(Al,"__esModule",{value:!0}),Al.ONE_THOUSAND=Al.ONE_HUNDRED=void 0,Al.ONE_HUNDRED=100,Al.ONE_THOUSAND=1e3),Al}var Gw={},p4;function tD(){return p4||(p4=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(Gw)),Gw}var g4;function Ex(){return g4||(g4=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=zg;e.__exportStar(eD(),r),e.__exportStar(tD(),r)}(Kw)),Kw}var m4;function rD(){if(m4)return xl;m4=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.fromMiliseconds=xl.toMiliseconds=void 0;const r=Ex();function e(i){return i*r.ONE_THOUSAND}xl.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return xl.fromMiliseconds=t,xl}var w4;function iD(){return w4||(w4=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=zg;e.__exportStar(XP(),r),e.__exportStar(rD(),r)}(Vw)),Vw}var Vu={},v4;function nD(){if(v4)return Vu;v4=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const n=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:n})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return Vu.Watch=r,Vu.default=r,Vu}var Zw={},Pd={},y4;function oD(){if(y4)return Pd;y4=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.IWatch=void 0;class r{}return Pd.IWatch=r,Pd}var b4;function sD(){return b4||(b4=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),zg.__exportStar(oD(),r)}(Zw)),Zw}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=zg;e.__exportStar(iD(),r),e.__exportStar(nD(),r),e.__exportStar(sD(),r),e.__exportStar(Ex(),r)})(Ye);var zr={};Object.defineProperty(zr,"__esModule",{value:!0});zr.getLocalStorage=zr.getLocalStorageOrThrow=zr.getCrypto=zr.getCryptoOrThrow=Cx=zr.getLocation=zr.getLocationOrThrow=F3=zr.getNavigator=zr.getNavigatorOrThrow=j3=zr.getDocument=zr.getDocumentOrThrow=zr.getFromWindowOrThrow=zr.getFromWindow=void 0;function du(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}zr.getFromWindow=du;function Qh(r){const e=du(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}zr.getFromWindowOrThrow=Qh;function aD(){return Qh("document")}zr.getDocumentOrThrow=aD;function cD(){return du("document")}var j3=zr.getDocument=cD;function lD(){return Qh("navigator")}zr.getNavigatorOrThrow=lD;function uD(){return du("navigator")}var F3=zr.getNavigator=uD;function hD(){return Qh("location")}zr.getLocationOrThrow=hD;function dD(){return du("location")}var Cx=zr.getLocation=dD;function fD(){return Qh("crypto")}zr.getCryptoOrThrow=fD;function pD(){return du("crypto")}zr.getCrypto=pD;function gD(){return Qh("localStorage")}zr.getLocalStorageOrThrow=gD;function mD(){return du("localStorage")}zr.getLocalStorage=mD;var z3={};Object.defineProperty(z3,"__esModule",{value:!0});var Sx=z3.getWindowMetadata=void 0;const _4=zr;function wD(){let r,e;try{r=_4.getDocumentOrThrow(),e=_4.getLocationOrThrow()}catch{return null}function t(){const p=r.getElementsByTagName("link"),v=[];for(let b=0;b-1){const $=I.getAttribute("href");if($)if($.toLowerCase().indexOf("https:")===-1&&$.toLowerCase().indexOf("http:")===-1&&$.indexOf("//")!==0){let K=e.protocol+"//"+e.host;if($.indexOf("/")===0)K+=$;else{const P=e.pathname.split("/");P.pop();const q=P.join("/");K+=q+"/"+$}v.push(K)}else if($.indexOf("//")===0){const K=e.protocol+$;v.push(K)}else v.push($)}}return v}function i(...p){const v=r.getElementsByTagName("meta");for(let b=0;bI.getAttribute($)).filter($=>$?p.includes($):!1);if(L.length&&L){const $=I.getAttribute("content");if($)return $}}return""}function n(){let p=i("name","og:site_name","og:title","twitter:title");return p||(p=r.title),p}function o(){return i("description","og:description","twitter:description","keywords")}const s=n(),a=o(),u=e.origin,h=t();return{description:a,url:u,icons:h,name:s}}Sx=z3.getWindowMetadata=wD;var df={},vD=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Ix="%[a-f0-9]{2}",x4=new RegExp("("+Ix+")|([^%]+?)","gi"),A4=new RegExp("("+Ix+")+","gi");function a2(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),i=r.slice(e);return Array.prototype.concat.call([],a2(t),a2(i))}function yD(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(x4)||[],t=1;t{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},AD=function(r,e){for(var t={},i=Object.keys(r),n=Array.isArray(e),o=0;oP==null,s=Symbol("encodeFragmentIdentifier");function a(P){switch(P.arrayFormat){case"index":return q=>(D,U)=>{const F=D.length;return U===void 0||P.skipNull&&U===null||P.skipEmptyString&&U===""?D:U===null?[...D,[d(q,P),"[",F,"]"].join("")]:[...D,[d(q,P),"[",d(F,P),"]=",d(U,P)].join("")]};case"bracket":return q=>(D,U)=>U===void 0||P.skipNull&&U===null||P.skipEmptyString&&U===""?D:U===null?[...D,[d(q,P),"[]"].join("")]:[...D,[d(q,P),"[]=",d(U,P)].join("")];case"colon-list-separator":return q=>(D,U)=>U===void 0||P.skipNull&&U===null||P.skipEmptyString&&U===""?D:U===null?[...D,[d(q,P),":list="].join("")]:[...D,[d(q,P),":list=",d(U,P)].join("")];case"comma":case"separator":case"bracket-separator":{const q=P.arrayFormat==="bracket-separator"?"[]=":"=";return D=>(U,F)=>F===void 0||P.skipNull&&F===null||P.skipEmptyString&&F===""?U:(F=F===null?"":F,U.length===0?[[d(D,P),q,d(F,P)].join("")]:[[U,d(F,P)].join(P.arrayFormatSeparator)])}default:return q=>(D,U)=>U===void 0||P.skipNull&&U===null||P.skipEmptyString&&U===""?D:U===null?[...D,d(q,P)]:[...D,[d(q,P),"=",d(U,P)].join("")]}}function u(P){let q;switch(P.arrayFormat){case"index":return(D,U,F)=>{if(q=/\[(\d*)\]$/.exec(D),D=D.replace(/\[\d*\]$/,""),!q){F[D]=U;return}F[D]===void 0&&(F[D]={}),F[D][q[1]]=U};case"bracket":return(D,U,F)=>{if(q=/(\[\])$/.exec(D),D=D.replace(/\[\]$/,""),!q){F[D]=U;return}if(F[D]===void 0){F[D]=[U];return}F[D]=[].concat(F[D],U)};case"colon-list-separator":return(D,U,F)=>{if(q=/(:list)$/.exec(D),D=D.replace(/:list$/,""),!q){F[D]=U;return}if(F[D]===void 0){F[D]=[U];return}F[D]=[].concat(F[D],U)};case"comma":case"separator":return(D,U,F)=>{const _=typeof U=="string"&&U.includes(P.arrayFormatSeparator),x=typeof U=="string"&&!_&&p(U,P).includes(P.arrayFormatSeparator);U=x?p(U,P):U;const M=_||x?U.split(P.arrayFormatSeparator).map(j=>p(j,P)):U===null?U:p(U,P);F[D]=M};case"bracket-separator":return(D,U,F)=>{const _=/(\[\])$/.test(D);if(D=D.replace(/\[\]$/,""),!_){F[D]=U&&p(U,P);return}const x=U===null?[]:U.split(P.arrayFormatSeparator).map(M=>p(M,P));if(F[D]===void 0){F[D]=x;return}F[D]=[].concat(F[D],x)};default:return(D,U,F)=>{if(F[D]===void 0){F[D]=U;return}F[D]=[].concat(F[D],U)}}}function h(P){if(typeof P!="string"||P.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function d(P,q){return q.encode?q.strict?e(P):encodeURIComponent(P):P}function p(P,q){return q.decode?t(P):P}function v(P){return Array.isArray(P)?P.sort():typeof P=="object"?v(Object.keys(P)).sort((q,D)=>Number(q)-Number(D)).map(q=>P[q]):P}function b(P){const q=P.indexOf("#");return q!==-1&&(P=P.slice(0,q)),P}function I(P){let q="";const D=P.indexOf("#");return D!==-1&&(q=P.slice(D)),q}function L(P){P=b(P);const q=P.indexOf("?");return q===-1?"":P.slice(q+1)}function $(P,q){return q.parseNumbers&&!Number.isNaN(Number(P))&&typeof P=="string"&&P.trim()!==""?P=Number(P):q.parseBooleans&&P!==null&&(P.toLowerCase()==="true"||P.toLowerCase()==="false")&&(P=P.toLowerCase()==="true"),P}function K(P,q){q=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},q),h(q.arrayFormatSeparator);const D=u(q),U=Object.create(null);if(typeof P!="string"||(P=P.trim().replace(/^[?#&]/,""),!P))return U;for(const F of P.split("&")){if(F==="")continue;let[_,x]=i(q.decode?F.replace(/\+/g," "):F,"=");x=x===void 0?null:["comma","separator","bracket-separator"].includes(q.arrayFormat)?x:p(x,q),D(p(_,q),x,U)}for(const F of Object.keys(U)){const _=U[F];if(typeof _=="object"&&_!==null)for(const x of Object.keys(_))_[x]=$(_[x],q);else U[F]=$(_,q)}return q.sort===!1?U:(q.sort===!0?Object.keys(U).sort():Object.keys(U).sort(q.sort)).reduce((F,_)=>{const x=U[_];return x&&typeof x=="object"&&!Array.isArray(x)?F[_]=v(x):F[_]=x,F},Object.create(null))}r.extract=L,r.parse=K,r.stringify=(P,q)=>{if(!P)return"";q=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},q),h(q.arrayFormatSeparator);const D=x=>q.skipNull&&o(P[x])||q.skipEmptyString&&P[x]==="",U=a(q),F={};for(const x of Object.keys(P))D(x)||(F[x]=P[x]);const _=Object.keys(F);return q.sort!==!1&&_.sort(q.sort),_.map(x=>{const M=P[x];return M===void 0?"":M===null?d(x,q):Array.isArray(M)?M.length===0&&q.arrayFormat==="bracket-separator"?d(x,q)+"[]":M.reduce(U(x),[]).join("&"):d(x,q)+"="+d(M,q)}).filter(x=>x.length>0).join("&")},r.parseUrl=(P,q)=>{q=Object.assign({decode:!0},q);const[D,U]=i(P,"#");return Object.assign({url:D.split("?")[0]||"",query:K(L(P),q)},q&&q.parseFragmentIdentifier&&U?{fragmentIdentifier:p(U,q)}:{})},r.stringifyUrl=(P,q)=>{q=Object.assign({encode:!0,strict:!0,[s]:!0},q);const D=b(P.url).split("?")[0]||"",U=r.extract(P.url),F=r.parse(U,{sort:!1}),_=Object.assign(F,P.query);let x=r.stringify(_,q);x&&(x=`?${x}`);let M=I(P.url);return P.fragmentIdentifier&&(M=`#${q[s]?d(P.fragmentIdentifier,q):P.fragmentIdentifier}`),`${D}${x}${M}`},r.pick=(P,q,D)=>{D=Object.assign({parseFragmentIdentifier:!0,[s]:!1},D);const{url:U,query:F,fragmentIdentifier:_}=r.parseUrl(P,D);return r.stringifyUrl({url:U,query:n(F,q),fragmentIdentifier:_},D)},r.exclude=(P,q,D)=>{const U=Array.isArray(q)?F=>!q.includes(F):(F,_)=>!q(F,_);return r.pick(P,U,D)}})(df);var W3={},Wg={},Gt={},Tx={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(a,u){var h=a>>>16&65535,d=a&65535,p=u>>>16&65535,v=u&65535;return d*v+(h*v+d*p<<16>>>0)|0}r.mul=Math.imul||e;function t(a,u){return a+u|0}r.add=t;function i(a,u){return a-u|0}r.sub=i;function n(a,u){return a<>>32-u}r.rotl=n;function o(a,u){return a<<32-u|a>>>u}r.rotr=o;function s(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}r.isInteger=Number.isInteger||s,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(a){return r.isInteger(a)&&a>=-r.MAX_SAFE_INTEGER&&a<=r.MAX_SAFE_INTEGER}})(Tx);Object.defineProperty(Gt,"__esModule",{value:!0});var Rx=Tx;function ED(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}Gt.readInt16BE=ED;function CD(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}Gt.readUint16BE=CD;function SD(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}Gt.readInt16LE=SD;function ID(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}Gt.readUint16LE=ID;function kx(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}Gt.writeUint16BE=kx;Gt.writeInt16BE=kx;function Ox(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}Gt.writeUint16LE=Ox;Gt.writeInt16LE=Ox;function c2(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}Gt.readInt32BE=c2;function l2(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}Gt.readUint32BE=l2;function u2(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}Gt.readInt32LE=u2;function h2(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}Gt.readUint32LE=h2;function R1(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}Gt.writeUint32BE=R1;Gt.writeInt32BE=R1;function k1(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}Gt.writeUint32LE=k1;Gt.writeInt32LE=k1;function TD(r,e){e===void 0&&(e=0);var t=c2(r,e),i=c2(r,e+4);return t*4294967296+i-(i>>31)*4294967296}Gt.readInt64BE=TD;function RD(r,e){e===void 0&&(e=0);var t=l2(r,e),i=l2(r,e+4);return t*4294967296+i}Gt.readUint64BE=RD;function kD(r,e){e===void 0&&(e=0);var t=u2(r,e),i=u2(r,e+4);return i*4294967296+t-(t>>31)*4294967296}Gt.readInt64LE=kD;function OD(r,e){e===void 0&&(e=0);var t=h2(r,e),i=h2(r,e+4);return i*4294967296+t}Gt.readUint64LE=OD;function Px(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),R1(r/4294967296>>>0,e,t),R1(r>>>0,e,t+4),e}Gt.writeUint64BE=Px;Gt.writeInt64BE=Px;function Dx(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),k1(r>>>0,e,t),k1(r/4294967296>>>0,e,t+4),e}Gt.writeUint64LE=Dx;Gt.writeInt64LE=Dx;function PD(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,o=r/8+t-1;o>=t;o--)i+=e[o]*n,n*=256;return i}Gt.readUintBE=PD;function DD(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,o=t;o=i;o--)t[o]=e/n&255,n*=256;return t}Gt.writeUintBE=ND;function $D(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Rx.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,o=i;o>>16|w<<16,V=V+w|0,_^=V,_=_>>>20|_<<12,D=D+x|0,C^=D,C=C>>>16|C<<16,Z=Z+C|0,x^=Z,x=x>>>20|x<<12,U=U+M|0,R^=U,R=R>>>16|R<<16,m=m+R|0,M^=m,M=M>>>20|M<<12,F=F+j|0,k^=F,k=k>>>16|k<<16,g=g+k|0,j^=g,j=j>>>20|j<<12,U=U+M|0,R^=U,R=R>>>24|R<<8,m=m+R|0,M^=m,M=M>>>25|M<<7,F=F+j|0,k^=F,k=k>>>24|k<<8,g=g+k|0,j^=g,j=j>>>25|j<<7,D=D+x|0,C^=D,C=C>>>24|C<<8,Z=Z+C|0,x^=Z,x=x>>>25|x<<7,q=q+_|0,w^=q,w=w>>>24|w<<8,V=V+w|0,_^=V,_=_>>>25|_<<7,q=q+x|0,k^=q,k=k>>>16|k<<16,m=m+k|0,x^=m,x=x>>>20|x<<12,D=D+M|0,w^=D,w=w>>>16|w<<16,g=g+w|0,M^=g,M=M>>>20|M<<12,U=U+j|0,C^=U,C=C>>>16|C<<16,V=V+C|0,j^=V,j=j>>>20|j<<12,F=F+_|0,R^=F,R=R>>>16|R<<16,Z=Z+R|0,_^=Z,_=_>>>20|_<<12,U=U+j|0,C^=U,C=C>>>24|C<<8,V=V+C|0,j^=V,j=j>>>25|j<<7,F=F+_|0,R^=F,R=R>>>24|R<<8,Z=Z+R|0,_^=Z,_=_>>>25|_<<7,D=D+M|0,w^=D,w=w>>>24|w<<8,g=g+w|0,M^=g,M=M>>>25|M<<7,q=q+x|0,k^=q,k=k>>>24|k<<8,m=m+k|0,x^=m,x=x>>>25|x<<7;Ki.writeUint32LE(q+i|0,r,0),Ki.writeUint32LE(D+n|0,r,4),Ki.writeUint32LE(U+o|0,r,8),Ki.writeUint32LE(F+s|0,r,12),Ki.writeUint32LE(_+a|0,r,16),Ki.writeUint32LE(x+u|0,r,20),Ki.writeUint32LE(M+h|0,r,24),Ki.writeUint32LE(j+d|0,r,28),Ki.writeUint32LE(V+p|0,r,32),Ki.writeUint32LE(Z+v|0,r,36),Ki.writeUint32LE(m+b|0,r,40),Ki.writeUint32LE(g+I|0,r,44),Ki.writeUint32LE(w+L|0,r,48),Ki.writeUint32LE(C+$|0,r,52),Ki.writeUint32LE(R+K|0,r,56),Ki.writeUint32LE(k+P|0,r,60)}function Nx(r,e,t,i,n){if(n===void 0&&(n=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var $x={},Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});function ZD(r,e,t){return~(r-1)&e|r-1&t}Vc.select=ZD;function QD(r,e){return(r|0)-(e|0)-1>>>31&1}Vc.lessOrEqual=QD;function Mx(r,e){if(r.length!==e.length)return 0;for(var t=0,i=0;i>>8}Vc.compare=Mx;function YD(r,e){return r.length===0||e.length===0?!1:Mx(r,e)!==0}Vc.equal=YD;(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Vc,t=oo;r.DIGEST_LENGTH=16;var i=function(){function s(a){this.digestLength=r.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var u=a[0]|a[1]<<8;this._r[0]=u&8191;var h=a[2]|a[3]<<8;this._r[1]=(u>>>13|h<<3)&8191;var d=a[4]|a[5]<<8;this._r[2]=(h>>>10|d<<6)&7939;var p=a[6]|a[7]<<8;this._r[3]=(d>>>7|p<<9)&8191;var v=a[8]|a[9]<<8;this._r[4]=(p>>>4|v<<12)&255,this._r[5]=v>>>1&8190;var b=a[10]|a[11]<<8;this._r[6]=(v>>>14|b<<2)&8191;var I=a[12]|a[13]<<8;this._r[7]=(b>>>11|I<<5)&8065;var L=a[14]|a[15]<<8;this._r[8]=(I>>>8|L<<8)&8191,this._r[9]=L>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return s.prototype._blocks=function(a,u,h){for(var d=this._fin?0:2048,p=this._h[0],v=this._h[1],b=this._h[2],I=this._h[3],L=this._h[4],$=this._h[5],K=this._h[6],P=this._h[7],q=this._h[8],D=this._h[9],U=this._r[0],F=this._r[1],_=this._r[2],x=this._r[3],M=this._r[4],j=this._r[5],V=this._r[6],Z=this._r[7],m=this._r[8],g=this._r[9];h>=16;){var w=a[u+0]|a[u+1]<<8;p+=w&8191;var C=a[u+2]|a[u+3]<<8;v+=(w>>>13|C<<3)&8191;var R=a[u+4]|a[u+5]<<8;b+=(C>>>10|R<<6)&8191;var k=a[u+6]|a[u+7]<<8;I+=(R>>>7|k<<9)&8191;var B=a[u+8]|a[u+9]<<8;L+=(k>>>4|B<<12)&8191,$+=B>>>1&8191;var N=a[u+10]|a[u+11]<<8;K+=(B>>>14|N<<2)&8191;var y=a[u+12]|a[u+13]<<8;P+=(N>>>11|y<<5)&8191;var H=a[u+14]|a[u+15]<<8;q+=(y>>>8|H<<8)&8191,D+=H>>>5|d;var de=0,xe=de;xe+=p*U,xe+=v*(5*g),xe+=b*(5*m),xe+=I*(5*Z),xe+=L*(5*V),de=xe>>>13,xe&=8191,xe+=$*(5*j),xe+=K*(5*M),xe+=P*(5*x),xe+=q*(5*_),xe+=D*(5*F),de+=xe>>>13,xe&=8191;var O=de;O+=p*F,O+=v*U,O+=b*(5*g),O+=I*(5*m),O+=L*(5*Z),de=O>>>13,O&=8191,O+=$*(5*V),O+=K*(5*j),O+=P*(5*M),O+=q*(5*x),O+=D*(5*_),de+=O>>>13,O&=8191;var he=de;he+=p*_,he+=v*F,he+=b*U,he+=I*(5*g),he+=L*(5*m),de=he>>>13,he&=8191,he+=$*(5*Z),he+=K*(5*V),he+=P*(5*j),he+=q*(5*M),he+=D*(5*x),de+=he>>>13,he&=8191;var J=de;J+=p*x,J+=v*_,J+=b*F,J+=I*U,J+=L*(5*g),de=J>>>13,J&=8191,J+=$*(5*m),J+=K*(5*Z),J+=P*(5*V),J+=q*(5*j),J+=D*(5*M),de+=J>>>13,J&=8191;var re=de;re+=p*M,re+=v*x,re+=b*_,re+=I*F,re+=L*U,de=re>>>13,re&=8191,re+=$*(5*g),re+=K*(5*m),re+=P*(5*Z),re+=q*(5*V),re+=D*(5*j),de+=re>>>13,re&=8191;var oe=de;oe+=p*j,oe+=v*M,oe+=b*x,oe+=I*_,oe+=L*F,de=oe>>>13,oe&=8191,oe+=$*U,oe+=K*(5*g),oe+=P*(5*m),oe+=q*(5*Z),oe+=D*(5*V),de+=oe>>>13,oe&=8191;var E=de;E+=p*V,E+=v*j,E+=b*M,E+=I*x,E+=L*_,de=E>>>13,E&=8191,E+=$*F,E+=K*U,E+=P*(5*g),E+=q*(5*m),E+=D*(5*Z),de+=E>>>13,E&=8191;var X=de;X+=p*Z,X+=v*V,X+=b*j,X+=I*M,X+=L*x,de=X>>>13,X&=8191,X+=$*_,X+=K*F,X+=P*U,X+=q*(5*g),X+=D*(5*m),de+=X>>>13,X&=8191;var ve=de;ve+=p*m,ve+=v*Z,ve+=b*V,ve+=I*j,ve+=L*M,de=ve>>>13,ve&=8191,ve+=$*x,ve+=K*_,ve+=P*F,ve+=q*U,ve+=D*(5*g),de+=ve>>>13,ve&=8191;var Ee=de;Ee+=p*g,Ee+=v*m,Ee+=b*Z,Ee+=I*V,Ee+=L*j,de=Ee>>>13,Ee&=8191,Ee+=$*M,Ee+=K*x,Ee+=P*_,Ee+=q*F,Ee+=D*U,de+=Ee>>>13,Ee&=8191,de=(de<<2)+de|0,de=de+xe|0,xe=de&8191,de=de>>>13,O+=de,p=xe,v=O,b=he,I=J,L=re,$=oe,K=E,P=X,q=ve,D=Ee,u+=16,h-=16}this._h[0]=p,this._h[1]=v,this._h[2]=b,this._h[3]=I,this._h[4]=L,this._h[5]=$,this._h[6]=K,this._h[7]=P,this._h[8]=q,this._h[9]=D},s.prototype.finish=function(a,u){u===void 0&&(u=0);var h=new Uint16Array(10),d,p,v,b;if(this._leftover){for(b=this._leftover,this._buffer[b++]=1;b<16;b++)this._buffer[b]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(d=this._h[1]>>>13,this._h[1]&=8191,b=2;b<10;b++)this._h[b]+=d,d=this._h[b]>>>13,this._h[b]&=8191;for(this._h[0]+=d*5,d=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=d,d=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=d,h[0]=this._h[0]+5,d=h[0]>>>13,h[0]&=8191,b=1;b<10;b++)h[b]=this._h[b]+d,d=h[b]>>>13,h[b]&=8191;for(h[9]-=8192,p=(d^1)-1,b=0;b<10;b++)h[b]&=p;for(p=~p,b=0;b<10;b++)this._h[b]=this._h[b]&p|h[b];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,v=this._h[0]+this._pad[0],this._h[0]=v&65535,b=1;b<8;b++)v=(this._h[b]+this._pad[b]|0)+(v>>>16)|0,this._h[b]=v&65535;return a[u+0]=this._h[0]>>>0,a[u+1]=this._h[0]>>>8,a[u+2]=this._h[1]>>>0,a[u+3]=this._h[1]>>>8,a[u+4]=this._h[2]>>>0,a[u+5]=this._h[2]>>>8,a[u+6]=this._h[3]>>>0,a[u+7]=this._h[3]>>>8,a[u+8]=this._h[4]>>>0,a[u+9]=this._h[4]>>>8,a[u+10]=this._h[5]>>>0,a[u+11]=this._h[5]>>>8,a[u+12]=this._h[6]>>>0,a[u+13]=this._h[6]>>>8,a[u+14]=this._h[7]>>>0,a[u+15]=this._h[7]>>>8,this._finished=!0,this},s.prototype.update=function(a){var u=0,h=a.length,d;if(this._leftover){d=16-this._leftover,d>h&&(d=h);for(var p=0;p=16&&(d=h-h%16,this._blocks(a,u,d),u+=d,h-=d),h){for(var p=0;p16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var b=new Uint8Array(16);b.set(h,b.length-h.length);var I=new Uint8Array(32);e.stream(this._key,b,I,4);var L=d.length+this.tagLength,$;if(v){if(v.length!==L)throw new Error("ChaCha20Poly1305: incorrect destination length");$=v}else $=new Uint8Array(L);return e.streamXOR(this._key,b,d,$,4),this._authenticate($.subarray($.length-this.tagLength,$.length),I,$.subarray(0,$.length-this.tagLength),p),i.wipe(b),$},u.prototype.open=function(h,d,p,v){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(d.length0&&b.update(s.subarray(v.length%16))),b.update(p),p.length%16>0&&b.update(s.subarray(p.length%16));var I=new Uint8Array(8);v&&n.writeUint64LE(v.length,I),b.update(I),n.writeUint64LE(p.length,I),b.update(I);for(var L=b.digest(),$=0;$this.blockSize?this._inner.update(t).finish(i).clean():i.set(t);for(var n=0;n1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},r.prototype.expand=function(e){for(var t=new Uint8Array(e),i=0;i256)throw new Error("randomString charset is too long");let v="";const b=d.length,I=256-256%b;for(;h>0;){const L=n(Math.ceil(h*256/I),p);for(let $=0;$0;$++){const K=L[$];K0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=u[d++],h--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(d=o(this._temp,this._state,u,d,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=u[d++],h--;return this},a.prototype.finish=function(u){if(!this._finished){var h=this._bytesHashed,d=this._bufferLength,p=h/536870912|0,v=h<<3,b=h%64<56?64:128;this._buffer[d]=128;for(var I=d+1;I0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(u){return this._state.set(u.state),this._bufferLength=u.bufferLength,u.buffer&&this._buffer.set(u.buffer),this._bytesHashed=u.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(u){t.wipe(u.state),u.buffer&&t.wipe(u.buffer),u.bufferLength=0,u.bytesHashed=0},a}();r.SHA256=i;var n=new Int32Array([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]);function o(a,u,h,d,p){for(;p>=64;){for(var v=u[0],b=u[1],I=u[2],L=u[3],$=u[4],K=u[5],P=u[6],q=u[7],D=0;D<16;D++){var U=d+D*4;a[D]=e.readUint32BE(h,U)}for(var D=16;D<64;D++){var F=a[D-2],_=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10;F=a[D-15];var x=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3;a[D]=(_+a[D-7]|0)+(x+a[D-16]|0)}for(var D=0;D<64;D++){var _=((($>>>6|$<<26)^($>>>11|$<<21)^($>>>25|$<<7))+($&K^~$&P)|0)+(q+(n[D]+a[D]|0)|0)|0,x=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&b^v&I^b&I)|0;q=P,P=K,K=$,$=L+_|0,L=I,I=b,b=v,v=_+x|0}u[0]+=v,u[1]+=b,u[2]+=I,u[3]+=L,u[4]+=$,u[5]+=K,u[6]+=P,u[7]+=q,d+=64,p-=64}return d}function s(a){var u=new i;u.update(a);var h=u.digest();return u.clean(),h}r.hash=s})(Kg);var q3={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=Yh,t=oo;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function i(D){const U=new Float64Array(16);if(D)for(let F=0;F>16&1),F[j-1]&=65535;F[15]=_[15]-32767-(F[14]>>16&1);const M=F[15]>>16&1;F[14]&=65535,a(_,F,1-M)}for(let x=0;x<16;x++)D[2*x]=_[x]&255,D[2*x+1]=_[x]>>8}function h(D,U){for(let F=0;F<16;F++)D[F]=U[2*F]+(U[2*F+1]<<8);D[15]&=32767}function d(D,U,F){for(let _=0;_<16;_++)D[_]=U[_]+F[_]}function p(D,U,F){for(let _=0;_<16;_++)D[_]=U[_]-F[_]}function v(D,U,F){let _,x,M=0,j=0,V=0,Z=0,m=0,g=0,w=0,C=0,R=0,k=0,B=0,N=0,y=0,H=0,de=0,xe=0,O=0,he=0,J=0,re=0,oe=0,E=0,X=0,ve=0,Ee=0,Ce=0,Be=0,ot=0,Ge=0,dr=0,mt=0,Qe=F[0],lt=F[1],ze=F[2],Ke=F[3],xt=F[4],Fe=F[5],Ze=F[6],W=F[7],A=F[8],T=F[9],Q=F[10],se=F[11],ue=F[12],ye=F[13],Oe=F[14],Le=F[15];_=U[0],M+=_*Qe,j+=_*lt,V+=_*ze,Z+=_*Ke,m+=_*xt,g+=_*Fe,w+=_*Ze,C+=_*W,R+=_*A,k+=_*T,B+=_*Q,N+=_*se,y+=_*ue,H+=_*ye,de+=_*Oe,xe+=_*Le,_=U[1],j+=_*Qe,V+=_*lt,Z+=_*ze,m+=_*Ke,g+=_*xt,w+=_*Fe,C+=_*Ze,R+=_*W,k+=_*A,B+=_*T,N+=_*Q,y+=_*se,H+=_*ue,de+=_*ye,xe+=_*Oe,O+=_*Le,_=U[2],V+=_*Qe,Z+=_*lt,m+=_*ze,g+=_*Ke,w+=_*xt,C+=_*Fe,R+=_*Ze,k+=_*W,B+=_*A,N+=_*T,y+=_*Q,H+=_*se,de+=_*ue,xe+=_*ye,O+=_*Oe,he+=_*Le,_=U[3],Z+=_*Qe,m+=_*lt,g+=_*ze,w+=_*Ke,C+=_*xt,R+=_*Fe,k+=_*Ze,B+=_*W,N+=_*A,y+=_*T,H+=_*Q,de+=_*se,xe+=_*ue,O+=_*ye,he+=_*Oe,J+=_*Le,_=U[4],m+=_*Qe,g+=_*lt,w+=_*ze,C+=_*Ke,R+=_*xt,k+=_*Fe,B+=_*Ze,N+=_*W,y+=_*A,H+=_*T,de+=_*Q,xe+=_*se,O+=_*ue,he+=_*ye,J+=_*Oe,re+=_*Le,_=U[5],g+=_*Qe,w+=_*lt,C+=_*ze,R+=_*Ke,k+=_*xt,B+=_*Fe,N+=_*Ze,y+=_*W,H+=_*A,de+=_*T,xe+=_*Q,O+=_*se,he+=_*ue,J+=_*ye,re+=_*Oe,oe+=_*Le,_=U[6],w+=_*Qe,C+=_*lt,R+=_*ze,k+=_*Ke,B+=_*xt,N+=_*Fe,y+=_*Ze,H+=_*W,de+=_*A,xe+=_*T,O+=_*Q,he+=_*se,J+=_*ue,re+=_*ye,oe+=_*Oe,E+=_*Le,_=U[7],C+=_*Qe,R+=_*lt,k+=_*ze,B+=_*Ke,N+=_*xt,y+=_*Fe,H+=_*Ze,de+=_*W,xe+=_*A,O+=_*T,he+=_*Q,J+=_*se,re+=_*ue,oe+=_*ye,E+=_*Oe,X+=_*Le,_=U[8],R+=_*Qe,k+=_*lt,B+=_*ze,N+=_*Ke,y+=_*xt,H+=_*Fe,de+=_*Ze,xe+=_*W,O+=_*A,he+=_*T,J+=_*Q,re+=_*se,oe+=_*ue,E+=_*ye,X+=_*Oe,ve+=_*Le,_=U[9],k+=_*Qe,B+=_*lt,N+=_*ze,y+=_*Ke,H+=_*xt,de+=_*Fe,xe+=_*Ze,O+=_*W,he+=_*A,J+=_*T,re+=_*Q,oe+=_*se,E+=_*ue,X+=_*ye,ve+=_*Oe,Ee+=_*Le,_=U[10],B+=_*Qe,N+=_*lt,y+=_*ze,H+=_*Ke,de+=_*xt,xe+=_*Fe,O+=_*Ze,he+=_*W,J+=_*A,re+=_*T,oe+=_*Q,E+=_*se,X+=_*ue,ve+=_*ye,Ee+=_*Oe,Ce+=_*Le,_=U[11],N+=_*Qe,y+=_*lt,H+=_*ze,de+=_*Ke,xe+=_*xt,O+=_*Fe,he+=_*Ze,J+=_*W,re+=_*A,oe+=_*T,E+=_*Q,X+=_*se,ve+=_*ue,Ee+=_*ye,Ce+=_*Oe,Be+=_*Le,_=U[12],y+=_*Qe,H+=_*lt,de+=_*ze,xe+=_*Ke,O+=_*xt,he+=_*Fe,J+=_*Ze,re+=_*W,oe+=_*A,E+=_*T,X+=_*Q,ve+=_*se,Ee+=_*ue,Ce+=_*ye,Be+=_*Oe,ot+=_*Le,_=U[13],H+=_*Qe,de+=_*lt,xe+=_*ze,O+=_*Ke,he+=_*xt,J+=_*Fe,re+=_*Ze,oe+=_*W,E+=_*A,X+=_*T,ve+=_*Q,Ee+=_*se,Ce+=_*ue,Be+=_*ye,ot+=_*Oe,Ge+=_*Le,_=U[14],de+=_*Qe,xe+=_*lt,O+=_*ze,he+=_*Ke,J+=_*xt,re+=_*Fe,oe+=_*Ze,E+=_*W,X+=_*A,ve+=_*T,Ee+=_*Q,Ce+=_*se,Be+=_*ue,ot+=_*ye,Ge+=_*Oe,dr+=_*Le,_=U[15],xe+=_*Qe,O+=_*lt,he+=_*ze,J+=_*Ke,re+=_*xt,oe+=_*Fe,E+=_*Ze,X+=_*W,ve+=_*A,Ee+=_*T,Ce+=_*Q,Be+=_*se,ot+=_*ue,Ge+=_*ye,dr+=_*Oe,mt+=_*Le,M+=38*O,j+=38*he,V+=38*J,Z+=38*re,m+=38*oe,g+=38*E,w+=38*X,C+=38*ve,R+=38*Ee,k+=38*Ce,B+=38*Be,N+=38*ot,y+=38*Ge,H+=38*dr,de+=38*mt,x=1,_=M+x+65535,x=Math.floor(_/65536),M=_-x*65536,_=j+x+65535,x=Math.floor(_/65536),j=_-x*65536,_=V+x+65535,x=Math.floor(_/65536),V=_-x*65536,_=Z+x+65535,x=Math.floor(_/65536),Z=_-x*65536,_=m+x+65535,x=Math.floor(_/65536),m=_-x*65536,_=g+x+65535,x=Math.floor(_/65536),g=_-x*65536,_=w+x+65535,x=Math.floor(_/65536),w=_-x*65536,_=C+x+65535,x=Math.floor(_/65536),C=_-x*65536,_=R+x+65535,x=Math.floor(_/65536),R=_-x*65536,_=k+x+65535,x=Math.floor(_/65536),k=_-x*65536,_=B+x+65535,x=Math.floor(_/65536),B=_-x*65536,_=N+x+65535,x=Math.floor(_/65536),N=_-x*65536,_=y+x+65535,x=Math.floor(_/65536),y=_-x*65536,_=H+x+65535,x=Math.floor(_/65536),H=_-x*65536,_=de+x+65535,x=Math.floor(_/65536),de=_-x*65536,_=xe+x+65535,x=Math.floor(_/65536),xe=_-x*65536,M+=x-1+37*(x-1),x=1,_=M+x+65535,x=Math.floor(_/65536),M=_-x*65536,_=j+x+65535,x=Math.floor(_/65536),j=_-x*65536,_=V+x+65535,x=Math.floor(_/65536),V=_-x*65536,_=Z+x+65535,x=Math.floor(_/65536),Z=_-x*65536,_=m+x+65535,x=Math.floor(_/65536),m=_-x*65536,_=g+x+65535,x=Math.floor(_/65536),g=_-x*65536,_=w+x+65535,x=Math.floor(_/65536),w=_-x*65536,_=C+x+65535,x=Math.floor(_/65536),C=_-x*65536,_=R+x+65535,x=Math.floor(_/65536),R=_-x*65536,_=k+x+65535,x=Math.floor(_/65536),k=_-x*65536,_=B+x+65535,x=Math.floor(_/65536),B=_-x*65536,_=N+x+65535,x=Math.floor(_/65536),N=_-x*65536,_=y+x+65535,x=Math.floor(_/65536),y=_-x*65536,_=H+x+65535,x=Math.floor(_/65536),H=_-x*65536,_=de+x+65535,x=Math.floor(_/65536),de=_-x*65536,_=xe+x+65535,x=Math.floor(_/65536),xe=_-x*65536,M+=x-1+37*(x-1),D[0]=M,D[1]=j,D[2]=V,D[3]=Z,D[4]=m,D[5]=g,D[6]=w,D[7]=C,D[8]=R,D[9]=k,D[10]=B,D[11]=N,D[12]=y,D[13]=H,D[14]=de,D[15]=xe}function b(D,U){v(D,U,U)}function I(D,U){const F=i();for(let _=0;_<16;_++)F[_]=U[_];for(let _=253;_>=0;_--)b(F,F),_!==2&&_!==4&&v(F,F,U);for(let _=0;_<16;_++)D[_]=F[_]}function L(D,U){const F=new Uint8Array(32),_=new Float64Array(80),x=i(),M=i(),j=i(),V=i(),Z=i(),m=i();for(let R=0;R<31;R++)F[R]=D[R];F[31]=D[31]&127|64,F[0]&=248,h(_,U);for(let R=0;R<16;R++)M[R]=_[R];x[0]=V[0]=1;for(let R=254;R>=0;--R){const k=F[R>>>3]>>>(R&7)&1;a(x,M,k),a(j,V,k),d(Z,x,j),p(x,x,j),d(j,M,V),p(M,M,V),b(V,Z),b(m,x),v(x,j,x),v(j,M,Z),d(Z,x,j),p(x,x,j),b(M,x),p(j,V,m),v(x,j,o),d(x,x,V),v(j,j,x),v(x,V,m),v(V,M,_),b(M,Z),a(x,M,k),a(j,V,k)}for(let R=0;R<16;R++)_[R+16]=x[R],_[R+32]=j[R],_[R+48]=M[R],_[R+64]=V[R];const g=_.subarray(32),w=_.subarray(16);I(g,g),v(w,w,g);const C=new Uint8Array(32);return u(C,w),C}r.scalarMult=L;function $(D){return L(D,n)}r.scalarMultBase=$;function K(D){if(D.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const U=new Uint8Array(D);return{publicKey:$(U),secretKey:U}}r.generateKeyPairFromSeed=K;function P(D){const U=(0,e.randomBytes)(32,D),F=K(U);return(0,t.wipe)(U),F}r.generateKeyPair=P;function q(D,U,F=!1){if(D.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(U.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=L(D,U);if(F){let x=0;for(let M=0;M<_.length;M++)x|=_[M];if(x===0)throw new Error("X25519: invalid shared key")}return _}r.sharedKey=q})(q3);function Lx(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function f2(r,e){e||(e=r.reduce((n,o)=>n+o.length,0));const t=Lx(e);let i=0;for(const n of r)t.set(n,i),i+=n.length;return t}function pN(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i>>0,D=new Uint8Array(q);K!==P;){for(var U=I[K],F=0,_=q-1;(U!==0||F<$)&&_!==-1;_--,F++)U+=256*D[_]>>>0,D[_]=U%a>>>0,U=U/a>>>0;if(U!==0)throw new Error("Non-zero carry");$=F,K++}for(var x=q-$;x!==q&&D[x]===0;)x++;for(var M=u.repeat(L);x>>0,q=new Uint8Array(P);I[L];){var D=t[I.charCodeAt(L)];if(D===255)return;for(var U=0,F=P-1;(D!==0||U>>0,q[F]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");K=U,L++}if(I[L]!==" "){for(var _=P-K;_!==P&&q[_]===0;)_++;for(var x=new Uint8Array($+(P-_)),M=$;_!==P;)x[M++]=q[_++];return x}}}function b(I){var L=v(I);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:v,decode:b}}var gN=pN,mN=gN;const wN=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},vN=r=>new TextEncoder().encode(r),yN=r=>new TextDecoder().decode(r);class bN{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class _N{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return jx(this,e)}}class xN{constructor(e){this.decoders=e}or(e){return jx(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const jx=(r,e)=>new xN({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class AN{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new bN(e,t,i),this.decoder=new _N(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Gg=({name:r,prefix:e,encode:t,decode:i})=>new AN(r,e,t,i),h0=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=mN(t,e);return Gg({prefix:r,name:e,encode:i,decode:o=>wN(n(o))})},EN=(r,e,t,i)=>{const n={};for(let d=0;d=8&&(a-=8,s[h++]=255&u>>a)}if(a>=t||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},CN=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<t;)s-=t,o+=e[n&a>>s];if(s&&(o+=e[n&a<Gg({prefix:e,name:r,encode(n){return CN(n,i,t)},decode(n){return EN(n,i,t,r)}}),SN=Gg({prefix:"\0",name:"identity",encode:r=>yN(r),decode:r=>vN(r)}),IN=Object.freeze(Object.defineProperty({__proto__:null,identity:SN},Symbol.toStringTag,{value:"Module"})),TN=Fi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),RN=Object.freeze(Object.defineProperty({__proto__:null,base2:TN},Symbol.toStringTag,{value:"Module"})),kN=Fi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),ON=Object.freeze(Object.defineProperty({__proto__:null,base8:kN},Symbol.toStringTag,{value:"Module"})),PN=h0({prefix:"9",name:"base10",alphabet:"0123456789"}),DN=Object.freeze(Object.defineProperty({__proto__:null,base10:PN},Symbol.toStringTag,{value:"Module"})),NN=Fi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$N=Fi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),MN=Object.freeze(Object.defineProperty({__proto__:null,base16:NN,base16upper:$N},Symbol.toStringTag,{value:"Module"})),BN=Fi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),UN=Fi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),LN=Fi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),jN=Fi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),FN=Fi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zN=Fi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),WN=Fi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),HN=Fi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),qN=Fi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),VN=Object.freeze(Object.defineProperty({__proto__:null,base32:BN,base32hex:FN,base32hexpad:WN,base32hexpadupper:HN,base32hexupper:zN,base32pad:LN,base32padupper:jN,base32upper:UN,base32z:qN},Symbol.toStringTag,{value:"Module"})),KN=h0({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),GN=h0({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),ZN=Object.freeze(Object.defineProperty({__proto__:null,base36:KN,base36upper:GN},Symbol.toStringTag,{value:"Module"})),QN=h0({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),YN=h0({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),JN=Object.freeze(Object.defineProperty({__proto__:null,base58btc:QN,base58flickr:YN},Symbol.toStringTag,{value:"Module"})),XN=Fi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),e$=Fi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),t$=Fi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),r$=Fi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),i$=Object.freeze(Object.defineProperty({__proto__:null,base64:XN,base64pad:e$,base64url:t$,base64urlpad:r$},Symbol.toStringTag,{value:"Module"})),Fx=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),n$=Fx.reduce((r,e,t)=>(r[t]=e,r),[]),o$=Fx.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function s$(r){return r.reduce((e,t)=>(e+=n$[t],e),"")}function a$(r){const e=[];for(const t of r){const i=o$[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const c$=Gg({prefix:"🚀",name:"base256emoji",encode:s$,decode:a$}),l$=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:c$},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const I4={...IN,...RN,...ON,...DN,...MN,...VN,...ZN,...JN,...i$,...l$};function zx(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const T4=zx("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Qw=zx("ascii","a",r=>{let e="a";for(let t=0;t{r=r.substring(1);const e=Lx(r.length);for(let t=0;t{if(e.length&&!e.includes(i))return;const n=r[i];t.push(...n.accounts)}),t}function Hx(r,e){return r.includes(":")?[r]:e.chains||[]}var d$=Object.defineProperty,k4=Object.getOwnPropertySymbols,f$=Object.prototype.hasOwnProperty,p$=Object.prototype.propertyIsEnumerable,O4=(r,e,t)=>e in r?d$(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,P4=(r,e)=>{for(var t in e||(e={}))f$.call(e,t)&&O4(r,t,e[t]);if(k4)for(var t of k4(e))p$.call(e,t)&&O4(r,t,e[t]);return r};const g$="ReactNative",Qn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},m$="js";function ff(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Jh(){return!j3()&&!!F3()&&navigator.product===g$}function Xh(){return!ff()&&!!F3()&&!!j3()}function d0(){return Jh()?Qn.reactNative:ff()?Qn.node:Xh()?Qn.browser:Qn.unknown}function w$(){var r;try{return Jh()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(r=global.Application)==null?void 0:r.applicationId:void 0}catch{return}}function v$(r,e){let t=df.parse(r);return t=P4(P4({},t),e),r=df.stringify(t),r}function y$(){return Sx()||{name:"",description:"",url:"",icons:[""]}}function b$(){if(d0()===Qn.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:i}=global.Platform;return[t,i].join("-")}const r=IP();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function _$(){var r;const e=d0();return e===Qn.browser?[e,((r=Cx())==null?void 0:r.host)||"unknown"].join(":"):e}function x$(r,e,t){const i=b$(),n=_$();return[[r,e].join("-"),[m$,t].join("-"),i,n].join("/")}function A$({protocol:r,version:e,relayUrl:t,sdkVersion:i,auth:n,projectId:o,useOnCloseEvent:s,bundleId:a}){const u=t.split("?"),h=x$(r,e,i),d={auth:n,ua:h,projectId:o,useOnCloseEvent:s||void 0,origin:a||void 0},p=v$(u[1]||"",d);return u[0]+"?"+p}function kl(r,e){return r.filter(t=>e.includes(t)).length===r.length}function qx(r){return Object.fromEntries(r.entries())}function Vx(r){return new Map(Object.entries(r))}function Rl(r=Ye.FIVE_MINUTES,e){const t=Ye.toMiliseconds(r||Ye.FIVE_MINUTES);let i,n,o;return{resolve:s=>{o&&i&&(clearTimeout(o),i(s))},reject:s=>{o&&n&&(clearTimeout(o),n(s))},done:()=>new Promise((s,a)=>{o=setTimeout(()=>{a(new Error(e))},t),i=s,n=a})}}function lh(r,e,t){return new Promise(async(i,n)=>{const o=setTimeout(()=>n(new Error(t)),e);try{const s=await r;i(s)}catch(s){n(s)}clearTimeout(o)})}function Kx(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${r}`)}function E$(r){return Kx("topic",r)}function C$(r){return Kx("id",r)}function Gx(r){const[e,t]=r.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")i.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))i.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return i}function Li(r,e){return Ye.fromMiliseconds(Date.now()+Ye.toMiliseconds(r))}function wc(r){return Date.now()>=Ye.toMiliseconds(r)}function ir(r,e){return`${r}${e?`:${e}`:""}`}function p1(r=[],e=[]){return[...new Set([...r,...e])]}async function S$({id:r,topic:e,wcDeepLink:t}){try{if(!t)return;const i=typeof t=="string"?JSON.parse(t):t;let n=i==null?void 0:i.href;if(typeof n!="string")return;n.endsWith("/")&&(n=n.slice(0,-1));const o=`${n}/wc?requestId=${r}&sessionTopic=${e}`,s=d0();s===Qn.browser?o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):s===Qn.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}async function I$(r,e){try{return await r.getItem(e)||(Xh()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}var Zx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function T$(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}var Qx={exports:{}};/** +* [js-sha3]{@link https://github.com/emn178/js-sha3} +* +* @version 0.8.0 +* @author Chen, Yi-Cyuan [emn178@gmail.com] +* @copyright Chen, Yi-Cyuan 2015-2018 +* @license MIT +*/(function(r){(function(){var e="input is invalid type",t="finalize already called",i=typeof window=="object",n=i?window:{};n.JS_SHA3_NO_WINDOW&&(i=!1);var o=!i&&typeof self=="object",s=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?n=Zx:o&&(n=self);var a=!n.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,u=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",h="0123456789abcdef".split(""),d=[31,7936,2031616,520093696],p=[4,1024,262144,67108864],v=[1,256,65536,16777216],b=[6,1536,393216,100663296],I=[0,8,16,24],L=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],$=[224,256,384,512],K=[128,256],P=["hex","buffer","arrayBuffer","array","digest"],q={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),u&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(O){return typeof O=="object"&&O.buffer&&O.buffer.constructor===ArrayBuffer});for(var D=function(O,he,J){return function(re){return new H(O,he,O).update(re)[J]()}},U=function(O,he,J){return function(re,oe){return new H(O,he,oe).update(re)[J]()}},F=function(O,he,J){return function(re,oe,E,X){return g["cshake"+O].update(re,oe,E,X)[J]()}},_=function(O,he,J){return function(re,oe,E,X){return g["kmac"+O].update(re,oe,E,X)[J]()}},x=function(O,he,J,re){for(var oe=0;oe>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var re=0;re<50;++re)this.s[re]=0}H.prototype.update=function(O){if(this.finalized)throw new Error(t);var he,J=typeof O;if(J!=="string"){if(J==="object"){if(O===null)throw new Error(e);if(u&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!u||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);he=!0}for(var re=this.blocks,oe=this.byteCount,E=O.length,X=this.blockCount,ve=0,Ee=this.s,Ce,Be;ve>2]|=O[ve]<>2]|=Be<>2]|=(192|Be>>6)<>2]|=(128|Be&63)<=57344?(re[Ce>>2]|=(224|Be>>12)<>2]|=(128|Be>>6&63)<>2]|=(128|Be&63)<>2]|=(240|Be>>18)<>2]|=(128|Be>>12&63)<>2]|=(128|Be>>6&63)<>2]|=(128|Be&63)<=oe){for(this.start=Ce-oe,this.block=re[X],Ce=0;Ce>8,J=O&255;J>0;)oe.unshift(J),O=O>>8,J=O&255,++re;return he?oe.push(re):oe.unshift(re),this.update(oe),oe.length},H.prototype.encodeString=function(O){var he,J=typeof O;if(J!=="string"){if(J==="object"){if(O===null)throw new Error(e);if(u&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!u||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);he=!0}var re=0,oe=O.length;if(he)re=oe;else for(var E=0;E=57344?re+=3:(X=65536+((X&1023)<<10|O.charCodeAt(++E)&1023),re+=4)}return re+=this.encode(re*8),this.update(O),re},H.prototype.bytepad=function(O,he){for(var J=this.encode(he),re=0;re>2]|=this.padding[he&3],this.lastByteIndex===this.byteCount)for(O[0]=O[J],he=1;he>4&15]+h[ve&15]+h[ve>>12&15]+h[ve>>8&15]+h[ve>>20&15]+h[ve>>16&15]+h[ve>>28&15]+h[ve>>24&15];E%O===0&&(xe(he),oe=0)}return re&&(ve=he[oe],X+=h[ve>>4&15]+h[ve&15],re>1&&(X+=h[ve>>12&15]+h[ve>>8&15]),re>2&&(X+=h[ve>>20&15]+h[ve>>16&15])),X},H.prototype.arrayBuffer=function(){this.finalize();var O=this.blockCount,he=this.s,J=this.outputBlocks,re=this.extraBytes,oe=0,E=0,X=this.outputBits>>3,ve;re?ve=new ArrayBuffer(J+1<<2):ve=new ArrayBuffer(X);for(var Ee=new Uint32Array(ve);E>8&255,X[ve+2]=Ee>>16&255,X[ve+3]=Ee>>24&255;E%O===0&&xe(he)}return re&&(ve=E<<2,Ee=he[oe],X[ve]=Ee&255,re>1&&(X[ve+1]=Ee>>8&255),re>2&&(X[ve+2]=Ee>>16&255)),X};function de(O,he,J){H.call(this,O,he,J)}de.prototype=new H,de.prototype.finalize=function(){return this.encode(this.outputBits,!0),H.prototype.finalize.call(this)};var xe=function(O){var he,J,re,oe,E,X,ve,Ee,Ce,Be,ot,Ge,dr,mt,Qe,lt,ze,Ke,xt,Fe,Ze,W,A,T,Q,se,ue,ye,Oe,Le,kt,at,st,Zr,lr,fr,Xi,Ot,At,Ar,Pt,It,gr,Mt,Bt,Er,Ut,Dt,Tr,Nt,wt,Dr,Lt,Rr,Go,kr,er,uo,ho,fo,po,go,Ai;for(re=0;re<48;re+=2)oe=O[0]^O[10]^O[20]^O[30]^O[40],E=O[1]^O[11]^O[21]^O[31]^O[41],X=O[2]^O[12]^O[22]^O[32]^O[42],ve=O[3]^O[13]^O[23]^O[33]^O[43],Ee=O[4]^O[14]^O[24]^O[34]^O[44],Ce=O[5]^O[15]^O[25]^O[35]^O[45],Be=O[6]^O[16]^O[26]^O[36]^O[46],ot=O[7]^O[17]^O[27]^O[37]^O[47],Ge=O[8]^O[18]^O[28]^O[38]^O[48],dr=O[9]^O[19]^O[29]^O[39]^O[49],he=Ge^(X<<1|ve>>>31),J=dr^(ve<<1|X>>>31),O[0]^=he,O[1]^=J,O[10]^=he,O[11]^=J,O[20]^=he,O[21]^=J,O[30]^=he,O[31]^=J,O[40]^=he,O[41]^=J,he=oe^(Ee<<1|Ce>>>31),J=E^(Ce<<1|Ee>>>31),O[2]^=he,O[3]^=J,O[12]^=he,O[13]^=J,O[22]^=he,O[23]^=J,O[32]^=he,O[33]^=J,O[42]^=he,O[43]^=J,he=X^(Be<<1|ot>>>31),J=ve^(ot<<1|Be>>>31),O[4]^=he,O[5]^=J,O[14]^=he,O[15]^=J,O[24]^=he,O[25]^=J,O[34]^=he,O[35]^=J,O[44]^=he,O[45]^=J,he=Ee^(Ge<<1|dr>>>31),J=Ce^(dr<<1|Ge>>>31),O[6]^=he,O[7]^=J,O[16]^=he,O[17]^=J,O[26]^=he,O[27]^=J,O[36]^=he,O[37]^=J,O[46]^=he,O[47]^=J,he=Be^(oe<<1|E>>>31),J=ot^(E<<1|oe>>>31),O[8]^=he,O[9]^=J,O[18]^=he,O[19]^=J,O[28]^=he,O[29]^=J,O[38]^=he,O[39]^=J,O[48]^=he,O[49]^=J,mt=O[0],Qe=O[1],Er=O[11]<<4|O[10]>>>28,Ut=O[10]<<4|O[11]>>>28,ye=O[20]<<3|O[21]>>>29,Oe=O[21]<<3|O[20]>>>29,fo=O[31]<<9|O[30]>>>23,po=O[30]<<9|O[31]>>>23,It=O[40]<<18|O[41]>>>14,gr=O[41]<<18|O[40]>>>14,Zr=O[2]<<1|O[3]>>>31,lr=O[3]<<1|O[2]>>>31,lt=O[13]<<12|O[12]>>>20,ze=O[12]<<12|O[13]>>>20,Dt=O[22]<<10|O[23]>>>22,Tr=O[23]<<10|O[22]>>>22,Le=O[33]<<13|O[32]>>>19,kt=O[32]<<13|O[33]>>>19,go=O[42]<<2|O[43]>>>30,Ai=O[43]<<2|O[42]>>>30,Rr=O[5]<<30|O[4]>>>2,Go=O[4]<<30|O[5]>>>2,fr=O[14]<<6|O[15]>>>26,Xi=O[15]<<6|O[14]>>>26,Ke=O[25]<<11|O[24]>>>21,xt=O[24]<<11|O[25]>>>21,Nt=O[34]<<15|O[35]>>>17,wt=O[35]<<15|O[34]>>>17,at=O[45]<<29|O[44]>>>3,st=O[44]<<29|O[45]>>>3,T=O[6]<<28|O[7]>>>4,Q=O[7]<<28|O[6]>>>4,kr=O[17]<<23|O[16]>>>9,er=O[16]<<23|O[17]>>>9,Ot=O[26]<<25|O[27]>>>7,At=O[27]<<25|O[26]>>>7,Fe=O[36]<<21|O[37]>>>11,Ze=O[37]<<21|O[36]>>>11,Dr=O[47]<<24|O[46]>>>8,Lt=O[46]<<24|O[47]>>>8,Mt=O[8]<<27|O[9]>>>5,Bt=O[9]<<27|O[8]>>>5,se=O[18]<<20|O[19]>>>12,ue=O[19]<<20|O[18]>>>12,uo=O[29]<<7|O[28]>>>25,ho=O[28]<<7|O[29]>>>25,Ar=O[38]<<8|O[39]>>>24,Pt=O[39]<<8|O[38]>>>24,W=O[48]<<14|O[49]>>>18,A=O[49]<<14|O[48]>>>18,O[0]=mt^~lt&Ke,O[1]=Qe^~ze&xt,O[10]=T^~se&ye,O[11]=Q^~ue&Oe,O[20]=Zr^~fr&Ot,O[21]=lr^~Xi&At,O[30]=Mt^~Er&Dt,O[31]=Bt^~Ut&Tr,O[40]=Rr^~kr&uo,O[41]=Go^~er&ho,O[2]=lt^~Ke&Fe,O[3]=ze^~xt&Ze,O[12]=se^~ye&Le,O[13]=ue^~Oe&kt,O[22]=fr^~Ot&Ar,O[23]=Xi^~At&Pt,O[32]=Er^~Dt&Nt,O[33]=Ut^~Tr&wt,O[42]=kr^~uo&fo,O[43]=er^~ho&po,O[4]=Ke^~Fe&W,O[5]=xt^~Ze&A,O[14]=ye^~Le&at,O[15]=Oe^~kt&st,O[24]=Ot^~Ar&It,O[25]=At^~Pt&gr,O[34]=Dt^~Nt&Dr,O[35]=Tr^~wt&Lt,O[44]=uo^~fo&go,O[45]=ho^~po&Ai,O[6]=Fe^~W&mt,O[7]=Ze^~A&Qe,O[16]=Le^~at&T,O[17]=kt^~st&Q,O[26]=Ar^~It&Zr,O[27]=Pt^~gr&lr,O[36]=Nt^~Dr&Mt,O[37]=wt^~Lt&Bt,O[46]=fo^~go&Rr,O[47]=po^~Ai&Go,O[8]=W^~mt<,O[9]=A^~Qe&ze,O[18]=at^~T&se,O[19]=st^~Q&ue,O[28]=It^~Zr&fr,O[29]=gr^~lr&Xi,O[38]=Dr^~Mt&Er,O[39]=Lt^~Bt&Ut,O[48]=go^~Rr&kr,O[49]=Ai^~Go&er,O[0]^=L[re],O[1]^=L[re+1]};if(a)r.exports=g;else for(C=0;C{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const M4=O$();var p2;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(p2||(p2={}));var as;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(as||(as={}));const B4="0123456789abcdef";let ji=class wi{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const i=e.toLowerCase();g1[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!($4>g1[i])&&console.log.apply(console,t)}debug(...e){this._log(wi.levels.DEBUG,e)}info(...e){this._log(wi.levels.INFO,e)}warn(...e){this._log(wi.levels.WARNING,e)}makeError(e,t,i){if(N4)return this.makeError("censored error",t,{});t||(t=wi.errors.UNKNOWN_ERROR),i||(i={});const n=[];Object.keys(i).forEach(u=>{const h=i[u];try{if(h instanceof Uint8Array){let d="";for(let p=0;p>4],d+=B4[h[p]&15];n.push(u+"=Uint8Array(0x"+d+")")}else n.push(u+"="+JSON.stringify(h))}catch{n.push(u+"="+JSON.stringify(i[u].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);const o=e;let s="";switch(t){case as.NUMERIC_FAULT:{s="NUMERIC_FAULT";const u=e;switch(u){case"overflow":case"underflow":case"division-by-zero":s+="-"+u;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case as.CALL_EXCEPTION:case as.INSUFFICIENT_FUNDS:case as.MISSING_NEW:case as.NONCE_EXPIRED:case as.REPLACEMENT_UNDERPRICED:case as.TRANSACTION_REPLACED:case as.UNPREDICTABLE_GAS_LIMIT:s=t;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=t,Object.keys(i).forEach(function(u){a[u]=i[u]}),a}throwError(e,t,i){throw this.makeError(e,t,i)}throwArgumentError(e,t,i){return this.throwError(e,wi.errors.INVALID_ARGUMENT,{argument:t,value:i})}assert(e,t,i,n){e||this.throwError(t,i,n)}assertArgument(e,t,i,n){e||this.throwArgumentError(t,i,n)}checkNormalize(e){M4&&this.throwError("platform missing String.prototype.normalize",wi.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:M4})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,wi.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,wi.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,i){i?i=": "+i:i="",et&&this.throwError("too many arguments"+i,wi.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",wi.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",wi.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",wi.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Yw||(Yw=new wi(k$)),Yw}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",wi.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),D4){if(!e)return;this.globalLogger().throwError("error censorship permanent",wi.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}N4=!!e,D4=!!t}static setLogLevel(e){const t=g1[e.toLowerCase()];if(t==null){wi.globalLogger().warn("invalid log level - "+e);return}$4=t}static from(e){return new wi(e)}};ji.errors=as,ji.levels=p2;const P$="bytes/5.7.0",ni=new ji(P$);function Yx(r){return!!r.toHexString}function uh(r){return r.slice||(r.slice=function(){const e=Array.prototype.slice.call(arguments);return uh(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}function D$(r){return Yn(r)&&!(r.length%2)||ed(r)}function U4(r){return typeof r=="number"&&r==r&&r%1===0}function ed(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!U4(r.length)||r.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ei(r,e){if(e||(e={}),typeof r=="number"){ni.checkSafeUint53(r,"invalid arrayify value");const t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),uh(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Yx(r)&&(r=r.toHexString()),Yn(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":ni.throwArgumentError("hex data is odd-length","value",r));const i=[];for(let n=0;nei(n)),t=e.reduce((n,o)=>n+o.length,0),i=new Uint8Array(t);return e.reduce((n,o)=>(i.set(o,n),n+o.length),0),uh(i)}function $$(r,e){r=ei(r),r.length>e&&ni.throwArgumentError("value out of range","value",arguments[0]);const t=new Uint8Array(e);return t.set(r,e-r.length),uh(t)}function Yn(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}const Jw="0123456789abcdef";function kn(r,e){if(e||(e={}),typeof r=="number"){ni.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=Jw[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Yx(r))return r.toHexString();if(Yn(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":ni.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(ed(r)){let t="0x";for(let i=0;i>4]+Jw[n&15]}return t}return ni.throwArgumentError("invalid hexlify value","value",r)}function M$(r){if(typeof r!="string")r=kn(r);else if(!Yn(r)||r.length%2)return null;return(r.length-2)/2}function L4(r,e,t){return typeof r!="string"?r=kn(r):(!Yn(r)||r.length%2)&&ni.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}function Ls(r,e){for(typeof r!="string"?r=kn(r):Yn(r)||ni.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&ni.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}function Jx(r){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(D$(r)){let t=ei(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=kn(t.slice(0,32)),e.s=kn(t.slice(32,64))):t.length===65?(e.r=kn(t.slice(0,32)),e.s=kn(t.slice(32,64)),e.v=t[64]):ni.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:ni.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=kn(t.slice(32,64))}else{if(e.r=r.r,e.s=r.s,e.v=r.v,e.recoveryParam=r.recoveryParam,e._vs=r._vs,e._vs!=null){const n=$$(ei(e._vs),32);e._vs=kn(n);const o=n[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=o:e.recoveryParam!==o&&ni.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),n[0]&=127;const s=kn(n);e.s==null?e.s=s:e.s!==s&&ni.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?ni.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const n=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==n&&ni.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Yn(e.r)?ni.throwArgumentError("signature missing or invalid r","signature",r):e.r=Ls(e.r,32),e.s==null||!Yn(e.s)?ni.throwArgumentError("signature missing or invalid s","signature",r):e.s=Ls(e.s,32);const t=ei(e.s);t[0]>=128&&ni.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);const i=kn(t);e._vs&&(Yn(e._vs)||ni.throwArgumentError("signature invalid _vs","signature",r),e._vs=Ls(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&ni.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function V3(r){return"0x"+R$.keccak_256(ei(r))}var Xx={exports:{}},B$={},U$=Object.freeze({__proto__:null,default:B$}),L$=T$(U$);(function(r){(function(e,t){function i(m,g){if(!m)throw new Error(g||"Assertion failed")}function n(m,g){m.super_=g;var w=function(){};w.prototype=g.prototype,m.prototype=new w,m.prototype.constructor=m}function o(m,g,w){if(o.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((g==="le"||g==="be")&&(w=g,g=10),this._init(m||0,g||10,w||"be"))}typeof e=="object"?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=L$.Buffer}catch{}o.isBN=function(m){return m instanceof o?!0:m!==null&&typeof m=="object"&&m.constructor.wordSize===o.wordSize&&Array.isArray(m.words)},o.max=function(m,g){return m.cmp(g)>0?m:g},o.min=function(m,g){return m.cmp(g)<0?m:g},o.prototype._init=function(m,g,w){if(typeof m=="number")return this._initNumber(m,g,w);if(typeof m=="object")return this._initArray(m,g,w);g==="hex"&&(g=16),i(g===(g|0)&&g>=2&&g<=36),m=m.toString().replace(/\s+/g,"");var C=0;m[0]==="-"&&(C++,this.negative=1),C=0;C-=3)k=m[C]|m[C-1]<<8|m[C-2]<<16,this.words[R]|=k<>>26-B&67108863,B+=24,B>=26&&(B-=26,R++);else if(w==="le")for(C=0,R=0;C>>26-B&67108863,B+=24,B>=26&&(B-=26,R++);return this._strip()};function a(m,g){var w=m.charCodeAt(g);if(w>=48&&w<=57)return w-48;if(w>=65&&w<=70)return w-55;if(w>=97&&w<=102)return w-87;i(!1,"Invalid character in "+m)}function u(m,g,w){var C=a(m,w);return w-1>=g&&(C|=a(m,w-1)<<4),C}o.prototype._parseHex=function(m,g,w){this.length=Math.ceil((m.length-g)/6),this.words=new Array(this.length);for(var C=0;C=g;C-=2)B=u(m,g,C)<=18?(R-=18,k+=1,this.words[k]|=B>>>26):R+=8;else{var N=m.length-g;for(C=N%2===0?g+1:g;C=18?(R-=18,k+=1,this.words[k]|=B>>>26):R+=8}this._strip()};function h(m,g,w,C){for(var R=0,k=0,B=Math.min(m.length,w),N=g;N=49?k=y-49+10:y>=17?k=y-17+10:k=y,i(y>=0&&k1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=p}catch{o.prototype.inspect=p}else o.prototype.inspect=p;function p(){return(this.red?""}var v=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],b=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(m,g){m=m||10,g=g|0||1;var w;if(m===16||m==="hex"){w="";for(var C=0,R=0,k=0;k>>24-C&16777215,C+=2,C>=26&&(C-=26,k--),R!==0||k!==this.length-1?w=v[6-N.length]+N+w:w=N+w}for(R!==0&&(w=R.toString(16)+w);w.length%g!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(m===(m|0)&&m>=2&&m<=36){var y=b[m],H=I[m];w="";var de=this.clone();for(de.negative=0;!de.isZero();){var xe=de.modrn(H).toString(m);de=de.idivn(H),de.isZero()?w=xe+w:w=v[y-xe.length]+xe+w}for(this.isZero()&&(w="0"+w);w.length%g!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(m,g){return this.toArrayLike(s,m,g)}),o.prototype.toArray=function(m,g){return this.toArrayLike(Array,m,g)};var L=function(m,g){return m.allocUnsafe?m.allocUnsafe(g):new m(g)};o.prototype.toArrayLike=function(m,g,w){this._strip();var C=this.byteLength(),R=w||Math.max(1,C);i(C<=R,"byte array longer than desired length"),i(R>0,"Requested array length <= 0");var k=L(m,R),B=g==="le"?"LE":"BE";return this["_toArrayLike"+B](k,C),k},o.prototype._toArrayLikeLE=function(m,g){for(var w=0,C=0,R=0,k=0;R>8&255),w>16&255),k===6?(w>24&255),C=0,k=0):(C=B>>>24,k+=2)}if(w=0&&(m[w--]=B>>8&255),w>=0&&(m[w--]=B>>16&255),k===6?(w>=0&&(m[w--]=B>>24&255),C=0,k=0):(C=B>>>24,k+=2)}if(w>=0)for(m[w--]=C;w>=0;)m[w--]=0},Math.clz32?o.prototype._countBits=function(m){return 32-Math.clz32(m)}:o.prototype._countBits=function(m){var g=m,w=0;return g>=4096&&(w+=13,g>>>=13),g>=64&&(w+=7,g>>>=7),g>=8&&(w+=4,g>>>=4),g>=2&&(w+=2,g>>>=2),w+g},o.prototype._zeroBits=function(m){if(m===0)return 26;var g=m,w=0;return g&8191||(w+=13,g>>>=13),g&127||(w+=7,g>>>=7),g&15||(w+=4,g>>>=4),g&3||(w+=2,g>>>=2),g&1||w++,w},o.prototype.bitLength=function(){var m=this.words[this.length-1],g=this._countBits(m);return(this.length-1)*26+g};function $(m){for(var g=new Array(m.bitLength()),w=0;w>>R&1}return g}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,g=0;gm.length?this.clone().ior(m):m.clone().ior(this)},o.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},o.prototype.iuand=function(m){var g;this.length>m.length?g=m:g=this;for(var w=0;wm.length?this.clone().iand(m):m.clone().iand(this)},o.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},o.prototype.iuxor=function(m){var g,w;this.length>m.length?(g=this,w=m):(g=m,w=this);for(var C=0;Cm.length?this.clone().ixor(m):m.clone().ixor(this)},o.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},o.prototype.inotn=function(m){i(typeof m=="number"&&m>=0);var g=Math.ceil(m/26)|0,w=m%26;this._expand(g),w>0&&g--;for(var C=0;C0&&(this.words[C]=~this.words[C]&67108863>>26-w),this._strip()},o.prototype.notn=function(m){return this.clone().inotn(m)},o.prototype.setn=function(m,g){i(typeof m=="number"&&m>=0);var w=m/26|0,C=m%26;return this._expand(w+1),g?this.words[w]=this.words[w]|1<m.length?(w=this,C=m):(w=m,C=this);for(var R=0,k=0;k>>26;for(;R!==0&&k>>26;if(this.length=w.length,R!==0)this.words[this.length]=R,this.length++;else if(w!==this)for(;km.length?this.clone().iadd(m):m.clone().iadd(this)},o.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var g=this.iadd(m);return m.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var w=this.cmp(m);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,R;w>0?(C=this,R=m):(C=m,R=this);for(var k=0,B=0;B>26,this.words[B]=g&67108863;for(;k!==0&&B>26,this.words[B]=g&67108863;if(k===0&&B>>26,xe=y&67108863,O=Math.min(H,g.length-1),he=Math.max(0,H-m.length+1);he<=O;he++){var J=H-he|0;R=m.words[J]|0,k=g.words[he]|0,B=R*k+xe,de+=B/67108864|0,xe=B&67108863}w.words[H]=xe|0,y=de|0}return y!==0?w.words[H]=y|0:w.length--,w._strip()}var P=function(m,g,w){var C=m.words,R=g.words,k=w.words,B=0,N,y,H,de=C[0]|0,xe=de&8191,O=de>>>13,he=C[1]|0,J=he&8191,re=he>>>13,oe=C[2]|0,E=oe&8191,X=oe>>>13,ve=C[3]|0,Ee=ve&8191,Ce=ve>>>13,Be=C[4]|0,ot=Be&8191,Ge=Be>>>13,dr=C[5]|0,mt=dr&8191,Qe=dr>>>13,lt=C[6]|0,ze=lt&8191,Ke=lt>>>13,xt=C[7]|0,Fe=xt&8191,Ze=xt>>>13,W=C[8]|0,A=W&8191,T=W>>>13,Q=C[9]|0,se=Q&8191,ue=Q>>>13,ye=R[0]|0,Oe=ye&8191,Le=ye>>>13,kt=R[1]|0,at=kt&8191,st=kt>>>13,Zr=R[2]|0,lr=Zr&8191,fr=Zr>>>13,Xi=R[3]|0,Ot=Xi&8191,At=Xi>>>13,Ar=R[4]|0,Pt=Ar&8191,It=Ar>>>13,gr=R[5]|0,Mt=gr&8191,Bt=gr>>>13,Er=R[6]|0,Ut=Er&8191,Dt=Er>>>13,Tr=R[7]|0,Nt=Tr&8191,wt=Tr>>>13,Dr=R[8]|0,Lt=Dr&8191,Rr=Dr>>>13,Go=R[9]|0,kr=Go&8191,er=Go>>>13;w.negative=m.negative^g.negative,w.length=19,N=Math.imul(xe,Oe),y=Math.imul(xe,Le),y=y+Math.imul(O,Oe)|0,H=Math.imul(O,Le);var uo=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(uo>>>26)|0,uo&=67108863,N=Math.imul(J,Oe),y=Math.imul(J,Le),y=y+Math.imul(re,Oe)|0,H=Math.imul(re,Le),N=N+Math.imul(xe,at)|0,y=y+Math.imul(xe,st)|0,y=y+Math.imul(O,at)|0,H=H+Math.imul(O,st)|0;var ho=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(ho>>>26)|0,ho&=67108863,N=Math.imul(E,Oe),y=Math.imul(E,Le),y=y+Math.imul(X,Oe)|0,H=Math.imul(X,Le),N=N+Math.imul(J,at)|0,y=y+Math.imul(J,st)|0,y=y+Math.imul(re,at)|0,H=H+Math.imul(re,st)|0,N=N+Math.imul(xe,lr)|0,y=y+Math.imul(xe,fr)|0,y=y+Math.imul(O,lr)|0,H=H+Math.imul(O,fr)|0;var fo=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(fo>>>26)|0,fo&=67108863,N=Math.imul(Ee,Oe),y=Math.imul(Ee,Le),y=y+Math.imul(Ce,Oe)|0,H=Math.imul(Ce,Le),N=N+Math.imul(E,at)|0,y=y+Math.imul(E,st)|0,y=y+Math.imul(X,at)|0,H=H+Math.imul(X,st)|0,N=N+Math.imul(J,lr)|0,y=y+Math.imul(J,fr)|0,y=y+Math.imul(re,lr)|0,H=H+Math.imul(re,fr)|0,N=N+Math.imul(xe,Ot)|0,y=y+Math.imul(xe,At)|0,y=y+Math.imul(O,Ot)|0,H=H+Math.imul(O,At)|0;var po=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(po>>>26)|0,po&=67108863,N=Math.imul(ot,Oe),y=Math.imul(ot,Le),y=y+Math.imul(Ge,Oe)|0,H=Math.imul(Ge,Le),N=N+Math.imul(Ee,at)|0,y=y+Math.imul(Ee,st)|0,y=y+Math.imul(Ce,at)|0,H=H+Math.imul(Ce,st)|0,N=N+Math.imul(E,lr)|0,y=y+Math.imul(E,fr)|0,y=y+Math.imul(X,lr)|0,H=H+Math.imul(X,fr)|0,N=N+Math.imul(J,Ot)|0,y=y+Math.imul(J,At)|0,y=y+Math.imul(re,Ot)|0,H=H+Math.imul(re,At)|0,N=N+Math.imul(xe,Pt)|0,y=y+Math.imul(xe,It)|0,y=y+Math.imul(O,Pt)|0,H=H+Math.imul(O,It)|0;var go=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(go>>>26)|0,go&=67108863,N=Math.imul(mt,Oe),y=Math.imul(mt,Le),y=y+Math.imul(Qe,Oe)|0,H=Math.imul(Qe,Le),N=N+Math.imul(ot,at)|0,y=y+Math.imul(ot,st)|0,y=y+Math.imul(Ge,at)|0,H=H+Math.imul(Ge,st)|0,N=N+Math.imul(Ee,lr)|0,y=y+Math.imul(Ee,fr)|0,y=y+Math.imul(Ce,lr)|0,H=H+Math.imul(Ce,fr)|0,N=N+Math.imul(E,Ot)|0,y=y+Math.imul(E,At)|0,y=y+Math.imul(X,Ot)|0,H=H+Math.imul(X,At)|0,N=N+Math.imul(J,Pt)|0,y=y+Math.imul(J,It)|0,y=y+Math.imul(re,Pt)|0,H=H+Math.imul(re,It)|0,N=N+Math.imul(xe,Mt)|0,y=y+Math.imul(xe,Bt)|0,y=y+Math.imul(O,Mt)|0,H=H+Math.imul(O,Bt)|0;var Ai=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(Ai>>>26)|0,Ai&=67108863,N=Math.imul(ze,Oe),y=Math.imul(ze,Le),y=y+Math.imul(Ke,Oe)|0,H=Math.imul(Ke,Le),N=N+Math.imul(mt,at)|0,y=y+Math.imul(mt,st)|0,y=y+Math.imul(Qe,at)|0,H=H+Math.imul(Qe,st)|0,N=N+Math.imul(ot,lr)|0,y=y+Math.imul(ot,fr)|0,y=y+Math.imul(Ge,lr)|0,H=H+Math.imul(Ge,fr)|0,N=N+Math.imul(Ee,Ot)|0,y=y+Math.imul(Ee,At)|0,y=y+Math.imul(Ce,Ot)|0,H=H+Math.imul(Ce,At)|0,N=N+Math.imul(E,Pt)|0,y=y+Math.imul(E,It)|0,y=y+Math.imul(X,Pt)|0,H=H+Math.imul(X,It)|0,N=N+Math.imul(J,Mt)|0,y=y+Math.imul(J,Bt)|0,y=y+Math.imul(re,Mt)|0,H=H+Math.imul(re,Bt)|0,N=N+Math.imul(xe,Ut)|0,y=y+Math.imul(xe,Dt)|0,y=y+Math.imul(O,Ut)|0,H=H+Math.imul(O,Dt)|0;var xs=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(xs>>>26)|0,xs&=67108863,N=Math.imul(Fe,Oe),y=Math.imul(Fe,Le),y=y+Math.imul(Ze,Oe)|0,H=Math.imul(Ze,Le),N=N+Math.imul(ze,at)|0,y=y+Math.imul(ze,st)|0,y=y+Math.imul(Ke,at)|0,H=H+Math.imul(Ke,st)|0,N=N+Math.imul(mt,lr)|0,y=y+Math.imul(mt,fr)|0,y=y+Math.imul(Qe,lr)|0,H=H+Math.imul(Qe,fr)|0,N=N+Math.imul(ot,Ot)|0,y=y+Math.imul(ot,At)|0,y=y+Math.imul(Ge,Ot)|0,H=H+Math.imul(Ge,At)|0,N=N+Math.imul(Ee,Pt)|0,y=y+Math.imul(Ee,It)|0,y=y+Math.imul(Ce,Pt)|0,H=H+Math.imul(Ce,It)|0,N=N+Math.imul(E,Mt)|0,y=y+Math.imul(E,Bt)|0,y=y+Math.imul(X,Mt)|0,H=H+Math.imul(X,Bt)|0,N=N+Math.imul(J,Ut)|0,y=y+Math.imul(J,Dt)|0,y=y+Math.imul(re,Ut)|0,H=H+Math.imul(re,Dt)|0,N=N+Math.imul(xe,Nt)|0,y=y+Math.imul(xe,wt)|0,y=y+Math.imul(O,Nt)|0,H=H+Math.imul(O,wt)|0;var rl=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(rl>>>26)|0,rl&=67108863,N=Math.imul(A,Oe),y=Math.imul(A,Le),y=y+Math.imul(T,Oe)|0,H=Math.imul(T,Le),N=N+Math.imul(Fe,at)|0,y=y+Math.imul(Fe,st)|0,y=y+Math.imul(Ze,at)|0,H=H+Math.imul(Ze,st)|0,N=N+Math.imul(ze,lr)|0,y=y+Math.imul(ze,fr)|0,y=y+Math.imul(Ke,lr)|0,H=H+Math.imul(Ke,fr)|0,N=N+Math.imul(mt,Ot)|0,y=y+Math.imul(mt,At)|0,y=y+Math.imul(Qe,Ot)|0,H=H+Math.imul(Qe,At)|0,N=N+Math.imul(ot,Pt)|0,y=y+Math.imul(ot,It)|0,y=y+Math.imul(Ge,Pt)|0,H=H+Math.imul(Ge,It)|0,N=N+Math.imul(Ee,Mt)|0,y=y+Math.imul(Ee,Bt)|0,y=y+Math.imul(Ce,Mt)|0,H=H+Math.imul(Ce,Bt)|0,N=N+Math.imul(E,Ut)|0,y=y+Math.imul(E,Dt)|0,y=y+Math.imul(X,Ut)|0,H=H+Math.imul(X,Dt)|0,N=N+Math.imul(J,Nt)|0,y=y+Math.imul(J,wt)|0,y=y+Math.imul(re,Nt)|0,H=H+Math.imul(re,wt)|0,N=N+Math.imul(xe,Lt)|0,y=y+Math.imul(xe,Rr)|0,y=y+Math.imul(O,Lt)|0,H=H+Math.imul(O,Rr)|0;var As=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(As>>>26)|0,As&=67108863,N=Math.imul(se,Oe),y=Math.imul(se,Le),y=y+Math.imul(ue,Oe)|0,H=Math.imul(ue,Le),N=N+Math.imul(A,at)|0,y=y+Math.imul(A,st)|0,y=y+Math.imul(T,at)|0,H=H+Math.imul(T,st)|0,N=N+Math.imul(Fe,lr)|0,y=y+Math.imul(Fe,fr)|0,y=y+Math.imul(Ze,lr)|0,H=H+Math.imul(Ze,fr)|0,N=N+Math.imul(ze,Ot)|0,y=y+Math.imul(ze,At)|0,y=y+Math.imul(Ke,Ot)|0,H=H+Math.imul(Ke,At)|0,N=N+Math.imul(mt,Pt)|0,y=y+Math.imul(mt,It)|0,y=y+Math.imul(Qe,Pt)|0,H=H+Math.imul(Qe,It)|0,N=N+Math.imul(ot,Mt)|0,y=y+Math.imul(ot,Bt)|0,y=y+Math.imul(Ge,Mt)|0,H=H+Math.imul(Ge,Bt)|0,N=N+Math.imul(Ee,Ut)|0,y=y+Math.imul(Ee,Dt)|0,y=y+Math.imul(Ce,Ut)|0,H=H+Math.imul(Ce,Dt)|0,N=N+Math.imul(E,Nt)|0,y=y+Math.imul(E,wt)|0,y=y+Math.imul(X,Nt)|0,H=H+Math.imul(X,wt)|0,N=N+Math.imul(J,Lt)|0,y=y+Math.imul(J,Rr)|0,y=y+Math.imul(re,Lt)|0,H=H+Math.imul(re,Rr)|0,N=N+Math.imul(xe,kr)|0,y=y+Math.imul(xe,er)|0,y=y+Math.imul(O,kr)|0,H=H+Math.imul(O,er)|0;var il=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(il>>>26)|0,il&=67108863,N=Math.imul(se,at),y=Math.imul(se,st),y=y+Math.imul(ue,at)|0,H=Math.imul(ue,st),N=N+Math.imul(A,lr)|0,y=y+Math.imul(A,fr)|0,y=y+Math.imul(T,lr)|0,H=H+Math.imul(T,fr)|0,N=N+Math.imul(Fe,Ot)|0,y=y+Math.imul(Fe,At)|0,y=y+Math.imul(Ze,Ot)|0,H=H+Math.imul(Ze,At)|0,N=N+Math.imul(ze,Pt)|0,y=y+Math.imul(ze,It)|0,y=y+Math.imul(Ke,Pt)|0,H=H+Math.imul(Ke,It)|0,N=N+Math.imul(mt,Mt)|0,y=y+Math.imul(mt,Bt)|0,y=y+Math.imul(Qe,Mt)|0,H=H+Math.imul(Qe,Bt)|0,N=N+Math.imul(ot,Ut)|0,y=y+Math.imul(ot,Dt)|0,y=y+Math.imul(Ge,Ut)|0,H=H+Math.imul(Ge,Dt)|0,N=N+Math.imul(Ee,Nt)|0,y=y+Math.imul(Ee,wt)|0,y=y+Math.imul(Ce,Nt)|0,H=H+Math.imul(Ce,wt)|0,N=N+Math.imul(E,Lt)|0,y=y+Math.imul(E,Rr)|0,y=y+Math.imul(X,Lt)|0,H=H+Math.imul(X,Rr)|0,N=N+Math.imul(J,kr)|0,y=y+Math.imul(J,er)|0,y=y+Math.imul(re,kr)|0,H=H+Math.imul(re,er)|0;var nl=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(nl>>>26)|0,nl&=67108863,N=Math.imul(se,lr),y=Math.imul(se,fr),y=y+Math.imul(ue,lr)|0,H=Math.imul(ue,fr),N=N+Math.imul(A,Ot)|0,y=y+Math.imul(A,At)|0,y=y+Math.imul(T,Ot)|0,H=H+Math.imul(T,At)|0,N=N+Math.imul(Fe,Pt)|0,y=y+Math.imul(Fe,It)|0,y=y+Math.imul(Ze,Pt)|0,H=H+Math.imul(Ze,It)|0,N=N+Math.imul(ze,Mt)|0,y=y+Math.imul(ze,Bt)|0,y=y+Math.imul(Ke,Mt)|0,H=H+Math.imul(Ke,Bt)|0,N=N+Math.imul(mt,Ut)|0,y=y+Math.imul(mt,Dt)|0,y=y+Math.imul(Qe,Ut)|0,H=H+Math.imul(Qe,Dt)|0,N=N+Math.imul(ot,Nt)|0,y=y+Math.imul(ot,wt)|0,y=y+Math.imul(Ge,Nt)|0,H=H+Math.imul(Ge,wt)|0,N=N+Math.imul(Ee,Lt)|0,y=y+Math.imul(Ee,Rr)|0,y=y+Math.imul(Ce,Lt)|0,H=H+Math.imul(Ce,Rr)|0,N=N+Math.imul(E,kr)|0,y=y+Math.imul(E,er)|0,y=y+Math.imul(X,kr)|0,H=H+Math.imul(X,er)|0;var Es=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(Es>>>26)|0,Es&=67108863,N=Math.imul(se,Ot),y=Math.imul(se,At),y=y+Math.imul(ue,Ot)|0,H=Math.imul(ue,At),N=N+Math.imul(A,Pt)|0,y=y+Math.imul(A,It)|0,y=y+Math.imul(T,Pt)|0,H=H+Math.imul(T,It)|0,N=N+Math.imul(Fe,Mt)|0,y=y+Math.imul(Fe,Bt)|0,y=y+Math.imul(Ze,Mt)|0,H=H+Math.imul(Ze,Bt)|0,N=N+Math.imul(ze,Ut)|0,y=y+Math.imul(ze,Dt)|0,y=y+Math.imul(Ke,Ut)|0,H=H+Math.imul(Ke,Dt)|0,N=N+Math.imul(mt,Nt)|0,y=y+Math.imul(mt,wt)|0,y=y+Math.imul(Qe,Nt)|0,H=H+Math.imul(Qe,wt)|0,N=N+Math.imul(ot,Lt)|0,y=y+Math.imul(ot,Rr)|0,y=y+Math.imul(Ge,Lt)|0,H=H+Math.imul(Ge,Rr)|0,N=N+Math.imul(Ee,kr)|0,y=y+Math.imul(Ee,er)|0,y=y+Math.imul(Ce,kr)|0,H=H+Math.imul(Ce,er)|0;var rc=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(rc>>>26)|0,rc&=67108863,N=Math.imul(se,Pt),y=Math.imul(se,It),y=y+Math.imul(ue,Pt)|0,H=Math.imul(ue,It),N=N+Math.imul(A,Mt)|0,y=y+Math.imul(A,Bt)|0,y=y+Math.imul(T,Mt)|0,H=H+Math.imul(T,Bt)|0,N=N+Math.imul(Fe,Ut)|0,y=y+Math.imul(Fe,Dt)|0,y=y+Math.imul(Ze,Ut)|0,H=H+Math.imul(Ze,Dt)|0,N=N+Math.imul(ze,Nt)|0,y=y+Math.imul(ze,wt)|0,y=y+Math.imul(Ke,Nt)|0,H=H+Math.imul(Ke,wt)|0,N=N+Math.imul(mt,Lt)|0,y=y+Math.imul(mt,Rr)|0,y=y+Math.imul(Qe,Lt)|0,H=H+Math.imul(Qe,Rr)|0,N=N+Math.imul(ot,kr)|0,y=y+Math.imul(ot,er)|0,y=y+Math.imul(Ge,kr)|0,H=H+Math.imul(Ge,er)|0;var ic=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(ic>>>26)|0,ic&=67108863,N=Math.imul(se,Mt),y=Math.imul(se,Bt),y=y+Math.imul(ue,Mt)|0,H=Math.imul(ue,Bt),N=N+Math.imul(A,Ut)|0,y=y+Math.imul(A,Dt)|0,y=y+Math.imul(T,Ut)|0,H=H+Math.imul(T,Dt)|0,N=N+Math.imul(Fe,Nt)|0,y=y+Math.imul(Fe,wt)|0,y=y+Math.imul(Ze,Nt)|0,H=H+Math.imul(Ze,wt)|0,N=N+Math.imul(ze,Lt)|0,y=y+Math.imul(ze,Rr)|0,y=y+Math.imul(Ke,Lt)|0,H=H+Math.imul(Ke,Rr)|0,N=N+Math.imul(mt,kr)|0,y=y+Math.imul(mt,er)|0,y=y+Math.imul(Qe,kr)|0,H=H+Math.imul(Qe,er)|0;var en=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(en>>>26)|0,en&=67108863,N=Math.imul(se,Ut),y=Math.imul(se,Dt),y=y+Math.imul(ue,Ut)|0,H=Math.imul(ue,Dt),N=N+Math.imul(A,Nt)|0,y=y+Math.imul(A,wt)|0,y=y+Math.imul(T,Nt)|0,H=H+Math.imul(T,wt)|0,N=N+Math.imul(Fe,Lt)|0,y=y+Math.imul(Fe,Rr)|0,y=y+Math.imul(Ze,Lt)|0,H=H+Math.imul(Ze,Rr)|0,N=N+Math.imul(ze,kr)|0,y=y+Math.imul(ze,er)|0,y=y+Math.imul(Ke,kr)|0,H=H+Math.imul(Ke,er)|0;var ol=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(ol>>>26)|0,ol&=67108863,N=Math.imul(se,Nt),y=Math.imul(se,wt),y=y+Math.imul(ue,Nt)|0,H=Math.imul(ue,wt),N=N+Math.imul(A,Lt)|0,y=y+Math.imul(A,Rr)|0,y=y+Math.imul(T,Lt)|0,H=H+Math.imul(T,Rr)|0,N=N+Math.imul(Fe,kr)|0,y=y+Math.imul(Fe,er)|0,y=y+Math.imul(Ze,kr)|0,H=H+Math.imul(Ze,er)|0;var sl=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(sl>>>26)|0,sl&=67108863,N=Math.imul(se,Lt),y=Math.imul(se,Rr),y=y+Math.imul(ue,Lt)|0,H=Math.imul(ue,Rr),N=N+Math.imul(A,kr)|0,y=y+Math.imul(A,er)|0,y=y+Math.imul(T,kr)|0,H=H+Math.imul(T,er)|0;var al=(B+N|0)+((y&8191)<<13)|0;B=(H+(y>>>13)|0)+(al>>>26)|0,al&=67108863,N=Math.imul(se,kr),y=Math.imul(se,er),y=y+Math.imul(ue,kr)|0,H=Math.imul(ue,er);var cl=(B+N|0)+((y&8191)<<13)|0;return B=(H+(y>>>13)|0)+(cl>>>26)|0,cl&=67108863,k[0]=uo,k[1]=ho,k[2]=fo,k[3]=po,k[4]=go,k[5]=Ai,k[6]=xs,k[7]=rl,k[8]=As,k[9]=il,k[10]=nl,k[11]=Es,k[12]=rc,k[13]=ic,k[14]=en,k[15]=ol,k[16]=sl,k[17]=al,k[18]=cl,B!==0&&(k[19]=B,w.length++),w};Math.imul||(P=K);function q(m,g,w){w.negative=g.negative^m.negative,w.length=m.length+g.length;for(var C=0,R=0,k=0;k>>26)|0,R+=B>>>26,B&=67108863}w.words[k]=N,C=B,B=R}return C!==0?w.words[k]=C:w.length--,w._strip()}function D(m,g,w){return q(m,g,w)}o.prototype.mulTo=function(m,g){var w,C=this.length+m.length;return this.length===10&&m.length===10?w=P(this,m,g):C<63?w=K(this,m,g):C<1024?w=q(this,m,g):w=D(this,m,g),w},o.prototype.mul=function(m){var g=new o(null);return g.words=new Array(this.length+m.length),this.mulTo(m,g)},o.prototype.mulf=function(m){var g=new o(null);return g.words=new Array(this.length+m.length),D(this,m,g)},o.prototype.imul=function(m){return this.clone().mulTo(m,this)},o.prototype.imuln=function(m){var g=m<0;g&&(m=-m),i(typeof m=="number"),i(m<67108864);for(var w=0,C=0;C>=26,w+=R/67108864|0,w+=k>>>26,this.words[C]=k&67108863}return w!==0&&(this.words[C]=w,this.length++),g?this.ineg():this},o.prototype.muln=function(m){return this.clone().imuln(m)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(m){var g=$(m);if(g.length===0)return new o(1);for(var w=this,C=0;C=0);var g=m%26,w=(m-g)/26,C=67108863>>>26-g<<26-g,R;if(g!==0){var k=0;for(R=0;R>>26-g}k&&(this.words[R]=k,this.length++)}if(w!==0){for(R=this.length-1;R>=0;R--)this.words[R+w]=this.words[R];for(R=0;R=0);var C;g?C=(g-g%26)/26:C=0;var R=m%26,k=Math.min((m-R)/26,this.length),B=67108863^67108863>>>R<k)for(this.length-=k,y=0;y=0&&(H!==0||y>=C);y--){var de=this.words[y]|0;this.words[y]=H<<26-R|de>>>R,H=de&B}return N&&H!==0&&(N.words[N.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(m,g,w){return i(this.negative===0),this.iushrn(m,g,w)},o.prototype.shln=function(m){return this.clone().ishln(m)},o.prototype.ushln=function(m){return this.clone().iushln(m)},o.prototype.shrn=function(m){return this.clone().ishrn(m)},o.prototype.ushrn=function(m){return this.clone().iushrn(m)},o.prototype.testn=function(m){i(typeof m=="number"&&m>=0);var g=m%26,w=(m-g)/26,C=1<=0);var g=m%26,w=(m-g)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(g!==0&&w++,this.length=Math.min(w,this.length),g!==0){var C=67108863^67108863>>>g<=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},o.prototype.isubn=function(m){if(i(typeof m=="number"),i(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g>26)-(N/67108864|0),this.words[R+w]=k&67108863}for(;R>26,this.words[R+w]=k&67108863;if(B===0)return this._strip();for(i(B===-1),B=0,R=0;R>26,this.words[R]=k&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(m,g){var w=this.length-m.length,C=this.clone(),R=m,k=R.words[R.length-1]|0,B=this._countBits(k);w=26-B,w!==0&&(R=R.ushln(w),C.iushln(w),k=R.words[R.length-1]|0);var N=C.length-R.length,y;if(g!=="mod"){y=new o(null),y.length=N+1,y.words=new Array(y.length);for(var H=0;H=0;xe--){var O=(C.words[R.length+xe]|0)*67108864+(C.words[R.length+xe-1]|0);for(O=Math.min(O/k|0,67108863),C._ishlnsubmul(R,O,xe);C.negative!==0;)O--,C.negative=0,C._ishlnsubmul(R,1,xe),C.isZero()||(C.negative^=1);y&&(y.words[xe]=O)}return y&&y._strip(),C._strip(),g!=="div"&&w!==0&&C.iushrn(w),{div:y||null,mod:C}},o.prototype.divmod=function(m,g,w){if(i(!m.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var C,R,k;return this.negative!==0&&m.negative===0?(k=this.neg().divmod(m,g),g!=="mod"&&(C=k.div.neg()),g!=="div"&&(R=k.mod.neg(),w&&R.negative!==0&&R.iadd(m)),{div:C,mod:R}):this.negative===0&&m.negative!==0?(k=this.divmod(m.neg(),g),g!=="mod"&&(C=k.div.neg()),{div:C,mod:k.mod}):this.negative&m.negative?(k=this.neg().divmod(m.neg(),g),g!=="div"&&(R=k.mod.neg(),w&&R.negative!==0&&R.isub(m)),{div:k.div,mod:R}):m.length>this.length||this.cmp(m)<0?{div:new o(0),mod:this}:m.length===1?g==="div"?{div:this.divn(m.words[0]),mod:null}:g==="mod"?{div:null,mod:new o(this.modrn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new o(this.modrn(m.words[0]))}:this._wordDiv(m,g)},o.prototype.div=function(m){return this.divmod(m,"div",!1).div},o.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},o.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},o.prototype.divRound=function(m){var g=this.divmod(m);if(g.mod.isZero())return g.div;var w=g.div.negative!==0?g.mod.isub(m):g.mod,C=m.ushrn(1),R=m.andln(1),k=w.cmp(C);return k<0||R===1&&k===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},o.prototype.modrn=function(m){var g=m<0;g&&(m=-m),i(m<=67108863);for(var w=(1<<26)%m,C=0,R=this.length-1;R>=0;R--)C=(w*C+(this.words[R]|0))%m;return g?-C:C},o.prototype.modn=function(m){return this.modrn(m)},o.prototype.idivn=function(m){var g=m<0;g&&(m=-m),i(m<=67108863);for(var w=0,C=this.length-1;C>=0;C--){var R=(this.words[C]|0)+w*67108864;this.words[C]=R/m|0,w=R%m}return this._strip(),g?this.ineg():this},o.prototype.divn=function(m){return this.clone().idivn(m)},o.prototype.egcd=function(m){i(m.negative===0),i(!m.isZero());var g=this,w=m.clone();g.negative!==0?g=g.umod(m):g=g.clone();for(var C=new o(1),R=new o(0),k=new o(0),B=new o(1),N=0;g.isEven()&&w.isEven();)g.iushrn(1),w.iushrn(1),++N;for(var y=w.clone(),H=g.clone();!g.isZero();){for(var de=0,xe=1;!(g.words[0]&xe)&&de<26;++de,xe<<=1);if(de>0)for(g.iushrn(de);de-- >0;)(C.isOdd()||R.isOdd())&&(C.iadd(y),R.isub(H)),C.iushrn(1),R.iushrn(1);for(var O=0,he=1;!(w.words[0]&he)&&O<26;++O,he<<=1);if(O>0)for(w.iushrn(O);O-- >0;)(k.isOdd()||B.isOdd())&&(k.iadd(y),B.isub(H)),k.iushrn(1),B.iushrn(1);g.cmp(w)>=0?(g.isub(w),C.isub(k),R.isub(B)):(w.isub(g),k.isub(C),B.isub(R))}return{a:k,b:B,gcd:w.iushln(N)}},o.prototype._invmp=function(m){i(m.negative===0),i(!m.isZero());var g=this,w=m.clone();g.negative!==0?g=g.umod(m):g=g.clone();for(var C=new o(1),R=new o(0),k=w.clone();g.cmpn(1)>0&&w.cmpn(1)>0;){for(var B=0,N=1;!(g.words[0]&N)&&B<26;++B,N<<=1);if(B>0)for(g.iushrn(B);B-- >0;)C.isOdd()&&C.iadd(k),C.iushrn(1);for(var y=0,H=1;!(w.words[0]&H)&&y<26;++y,H<<=1);if(y>0)for(w.iushrn(y);y-- >0;)R.isOdd()&&R.iadd(k),R.iushrn(1);g.cmp(w)>=0?(g.isub(w),C.isub(R)):(w.isub(g),R.isub(C))}var de;return g.cmpn(1)===0?de=C:de=R,de.cmpn(0)<0&&de.iadd(m),de},o.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var g=this.clone(),w=m.clone();g.negative=0,w.negative=0;for(var C=0;g.isEven()&&w.isEven();C++)g.iushrn(1),w.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;w.isEven();)w.iushrn(1);var R=g.cmp(w);if(R<0){var k=g;g=w,w=k}else if(R===0||w.cmpn(1)===0)break;g.isub(w)}while(!0);return w.iushln(C)},o.prototype.invm=function(m){return this.egcd(m).a.umod(m)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(m){return this.words[0]&m},o.prototype.bincn=function(m){i(typeof m=="number");var g=m%26,w=(m-g)/26,C=1<>>26,B&=67108863,this.words[k]=B}return R!==0&&(this.words[k]=R,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(m){var g=m<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this._strip();var w;if(this.length>1)w=1;else{g&&(m=-m),i(m<=67108863,"Number is too big");var C=this.words[0]|0;w=C===m?0:Cm.length)return 1;if(this.length=0;w--){var C=this.words[w]|0,R=m.words[w]|0;if(C!==R){CR&&(g=1);break}}return g},o.prototype.gtn=function(m){return this.cmpn(m)===1},o.prototype.gt=function(m){return this.cmp(m)===1},o.prototype.gten=function(m){return this.cmpn(m)>=0},o.prototype.gte=function(m){return this.cmp(m)>=0},o.prototype.ltn=function(m){return this.cmpn(m)===-1},o.prototype.lt=function(m){return this.cmp(m)===-1},o.prototype.lten=function(m){return this.cmpn(m)<=0},o.prototype.lte=function(m){return this.cmp(m)<=0},o.prototype.eqn=function(m){return this.cmpn(m)===0},o.prototype.eq=function(m){return this.cmp(m)===0},o.red=function(m){return new V(m)},o.prototype.toRed=function(m){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(m){return this.red=m,this},o.prototype.forceRed=function(m){return i(!this.red,"Already a number in reduction context"),this._forceRed(m)},o.prototype.redAdd=function(m){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},o.prototype.redIAdd=function(m){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},o.prototype.redSub=function(m){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},o.prototype.redISub=function(m){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},o.prototype.redShl=function(m){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},o.prototype.redMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},o.prototype.redIMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(m){return i(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var U={k256:null,p224:null,p192:null,p25519:null};function F(m,g){this.name=m,this.p=new o(g,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var m=new o(null);return m.words=new Array(Math.ceil(this.n/13)),m},F.prototype.ireduce=function(m){var g=m,w;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),w=g.bitLength();while(w>this.n);var C=w0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},F.prototype.split=function(m,g){m.iushrn(this.n,0,g)},F.prototype.imulK=function(m){return m.imul(this.k)};function _(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(_,F),_.prototype.split=function(m,g){for(var w=4194303,C=Math.min(m.length,9),R=0;R>>22,k=B}k>>>=22,m.words[R-10]=k,k===0&&m.length>10?m.length-=10:m.length-=9},_.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var g=0,w=0;w>>=26,m.words[w]=R,g=C}return g!==0&&(m.words[m.length++]=g),m},o._prime=function(m){if(U[m])return U[m];var g;if(m==="k256")g=new _;else if(m==="p224")g=new x;else if(m==="p192")g=new M;else if(m==="p25519")g=new j;else throw new Error("Unknown prime "+m);return U[m]=g,g};function V(m){if(typeof m=="string"){var g=o._prime(m);this.m=g.p,this.prime=g}else i(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}V.prototype._verify1=function(m){i(m.negative===0,"red works only with positives"),i(m.red,"red works only with red numbers")},V.prototype._verify2=function(m,g){i((m.negative|g.negative)===0,"red works only with positives"),i(m.red&&m.red===g.red,"red works only with red numbers")},V.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):(d(m,m.umod(this.m)._forceRed(this)),m)},V.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},V.prototype.add=function(m,g){this._verify2(m,g);var w=m.add(g);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},V.prototype.iadd=function(m,g){this._verify2(m,g);var w=m.iadd(g);return w.cmp(this.m)>=0&&w.isub(this.m),w},V.prototype.sub=function(m,g){this._verify2(m,g);var w=m.sub(g);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},V.prototype.isub=function(m,g){this._verify2(m,g);var w=m.isub(g);return w.cmpn(0)<0&&w.iadd(this.m),w},V.prototype.shl=function(m,g){return this._verify1(m),this.imod(m.ushln(g))},V.prototype.imul=function(m,g){return this._verify2(m,g),this.imod(m.imul(g))},V.prototype.mul=function(m,g){return this._verify2(m,g),this.imod(m.mul(g))},V.prototype.isqr=function(m){return this.imul(m,m.clone())},V.prototype.sqr=function(m){return this.mul(m,m)},V.prototype.sqrt=function(m){if(m.isZero())return m.clone();var g=this.m.andln(3);if(i(g%2===1),g===3){var w=this.m.add(new o(1)).iushrn(2);return this.pow(m,w)}for(var C=this.m.subn(1),R=0;!C.isZero()&&C.andln(1)===0;)R++,C.iushrn(1);i(!C.isZero());var k=new o(1).toRed(this),B=k.redNeg(),N=this.m.subn(1).iushrn(1),y=this.m.bitLength();for(y=new o(2*y*y).toRed(this);this.pow(y,N).cmp(B)!==0;)y.redIAdd(B);for(var H=this.pow(y,C),de=this.pow(m,C.addn(1).iushrn(1)),xe=this.pow(m,C),O=R;xe.cmp(k)!==0;){for(var he=xe,J=0;he.cmp(k)!==0;J++)he=he.redSqr();i(J=0;R--){for(var H=g.words[R],de=y-1;de>=0;de--){var xe=H>>de&1;if(k!==C[0]&&(k=this.sqr(k)),xe===0&&B===0){N=0;continue}B<<=1,B|=xe,N++,!(N!==w&&(R!==0||de!==0))&&(k=this.mul(k,C[B]),N=0,B=0)}y=26}return k},V.prototype.convertTo=function(m){var g=m.umod(this.m);return g===m?g.clone():g},V.prototype.convertFrom=function(m){var g=m.clone();return g.red=null,g},o.mont=function(m){return new Z(m)};function Z(m){V.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(Z,V),Z.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},Z.prototype.convertFrom=function(m){var g=this.imod(m.mul(this.rinv));return g.red=null,g},Z.prototype.imul=function(m,g){if(m.isZero()||g.isZero())return m.words[0]=0,m.length=1,m;var w=m.imul(g),C=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=w.isub(C).iushrn(this.shift),k=R;return R.cmp(this.m)>=0?k=R.isub(this.m):R.cmpn(0)<0&&(k=R.iadd(this.m)),k._forceRed(this)},Z.prototype.mul=function(m,g){if(m.isZero()||g.isZero())return new o(0)._forceRed(this);var w=m.mul(g),C=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=w.isub(C).iushrn(this.shift),k=R;return R.cmp(this.m)>=0?k=R.isub(this.m):R.cmpn(0)<0&&(k=R.iadd(this.m)),k._forceRed(this)},Z.prototype.invm=function(m){var g=this.imod(m._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(r,Zx)})(Xx);var Vt=Xx.exports;const eA="bignumber/5.7.0";var O1=Vt.BN;const Ta=new ji(eA),Xw={},j4=9007199254740991;function j$(r){return r!=null&&(fn.isBigNumber(r)||typeof r=="number"&&r%1===0||typeof r=="string"&&!!r.match(/^-?[0-9]+$/)||Yn(r)||typeof r=="bigint"||ed(r))}let F4=!1,fn=class os{constructor(e,t){e!==Xw&&Ta.throwError("cannot call constructor directly; use BigNumber.from",ji.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Cn(or(this).fromTwos(e))}toTwos(e){return Cn(or(this).toTwos(e))}abs(){return this._hex[0]==="-"?os.from(this._hex.substring(1)):this}add(e){return Cn(or(this).add(or(e)))}sub(e){return Cn(or(this).sub(or(e)))}div(e){return os.from(e).isZero()&&Eo("division-by-zero","div"),Cn(or(this).div(or(e)))}mul(e){return Cn(or(this).mul(or(e)))}mod(e){const t=or(e);return t.isNeg()&&Eo("division-by-zero","mod"),Cn(or(this).umod(t))}pow(e){const t=or(e);return t.isNeg()&&Eo("negative-power","pow"),Cn(or(this).pow(t))}and(e){const t=or(e);return(this.isNegative()||t.isNeg())&&Eo("unbound-bitwise-result","and"),Cn(or(this).and(t))}or(e){const t=or(e);return(this.isNegative()||t.isNeg())&&Eo("unbound-bitwise-result","or"),Cn(or(this).or(t))}xor(e){const t=or(e);return(this.isNegative()||t.isNeg())&&Eo("unbound-bitwise-result","xor"),Cn(or(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Eo("negative-width","mask"),Cn(or(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Eo("negative-width","shl"),Cn(or(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Eo("negative-width","shr"),Cn(or(this).shrn(e))}eq(e){return or(this).eq(or(e))}lt(e){return or(this).lt(or(e))}lte(e){return or(this).lte(or(e))}gt(e){return or(this).gt(or(e))}gte(e){return or(this).gte(or(e))}isNegative(){return this._hex[0]==="-"}isZero(){return or(this).isZero()}toNumber(){try{return or(this).toNumber()}catch{Eo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ta.throwError("this platform does not support BigInt",ji.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?F4||(F4=!0,Ta.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ta.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ji.errors.UNEXPECTED_ARGUMENT,{}):Ta.throwError("BigNumber.toString does not accept parameters",ji.errors.UNEXPECTED_ARGUMENT,{})),or(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof os)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new os(Xw,pf(e)):e.match(/^-?[0-9]+$/)?new os(Xw,pf(new O1(e))):Ta.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Eo("underflow","BigNumber.from",e),(e>=j4||e<=-j4)&&Eo("overflow","BigNumber.from",e),os.from(String(e));const t=e;if(typeof t=="bigint")return os.from(t.toString());if(ed(t))return os.from(kn(t));if(t)if(t.toHexString){const i=t.toHexString();if(typeof i=="string")return os.from(i)}else{let i=t._hex;if(i==null&&t.type==="BigNumber"&&(i=t.hex),typeof i=="string"&&(Yn(i)||i[0]==="-"&&Yn(i.substring(1))))return os.from(i)}return Ta.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function pf(r){if(typeof r!="string")return pf(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&Ta.throwArgumentError("invalid hex","value",r),r=pf(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Cn(r){return fn.from(pf(r))}function or(r){const e=fn.from(r).toHexString();return e[0]==="-"?new O1("-"+e.substring(3),16):new O1(e.substring(2),16)}function Eo(r,e,t){const i={fault:r,operation:e};return t!=null&&(i.value=t),Ta.throwError(r,ji.errors.NUMERIC_FAULT,i)}function F$(r){return new O1(r,36).toString(16)}const un=new ji(eA),Yd={},tA=fn.from(0),rA=fn.from(-1);function iA(r,e,t,i){const n={fault:e,operation:t};return i!==void 0&&(n.value=i),un.throwError(r,ji.errors.NUMERIC_FAULT,n)}let Jd="0";for(;Jd.length<256;)Jd+=Jd;function K3(r){if(typeof r!="number")try{r=fn.from(r).toNumber()}catch{}return typeof r=="number"&&r>=0&&r<=256&&!(r%1)?"1"+Jd.substring(0,r):un.throwArgumentError("invalid decimal size","decimals",r)}function ev(r,e){e==null&&(e=0);const t=K3(e);r=fn.from(r);const i=r.lt(tA);i&&(r=r.mul(rA));let n=r.mod(t).toString();for(;n.length2&&un.throwArgumentError("too many decimal points","value",r);let o=n[0],s=n[1];for(o||(o="0"),s||(s="0");s[s.length-1]==="0";)s=s.substring(0,s.length-1);for(s.length>t.length-1&&iA("fractional component exceeds decimals","underflow","parseFixed"),s===""&&(s="0");s.lengthe[s]==null?u:(typeof e[s]!==a&&un.throwArgumentError("invalid fixed format ("+s+" not "+a+")","format."+s,e[s]),e[s]);t=o("signed","boolean",t),i=o("width","number",i),n=o("decimals","number",n)}return i%8&&un.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),n>80&&un.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new g2(Yd,t,i,n)}},nA=class an{constructor(e,t,i,n){e!==Yd&&un.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ji.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&un.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=ya(this._value,this.format.decimals),i=ya(e._value,e.format.decimals);return an.fromValue(t.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=ya(this._value,this.format.decimals),i=ya(e._value,e.format.decimals);return an.fromValue(t.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=ya(this._value,this.format.decimals),i=ya(e._value,e.format.decimals);return an.fromValue(t.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=ya(this._value,this.format.decimals),i=ya(e._value,e.format.decimals);return an.fromValue(t.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=an.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(t=t.subUnsafe(z4.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=an.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(t=t.addUnsafe(z4.toFormat(t.format))),t}round(e){e==null&&(e=0);const t=this.toString().split(".");if(t.length===1&&t.push("0"),(e<0||e>80||e%1)&&un.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const i=an.from("1"+Jd.substring(0,e),this.format),n=z$.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&un.throwArgumentError("invalid byte width","width",e);const t=fn.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Ls(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return an.fromString(this._value,e)}static fromValue(e,t,i){return i==null&&t!=null&&!j$(t)&&(i=t,t=null),t==null&&(t=0),i==null&&(i="fixed"),an.fromString(ev(e,t),tv.from(i))}static fromString(e,t){t==null&&(t="fixed");const i=tv.from(t),n=ya(e,i.decimals);!i.signed&&n.lt(tA)&&iA("unsigned value cannot be negative","overflow","value",e);let o=null;i.signed?o=n.toTwos(i.width).toHexString():(o=n.toHexString(),o=Ls(o,i.width/8));const s=ev(n,i.decimals);return new an(Yd,o,s,i)}static fromBytes(e,t){t==null&&(t="fixed");const i=tv.from(t);if(ei(e).length>i.width/8)throw new Error("overflow");let n=fn.from(e);i.signed&&(n=n.fromTwos(i.width));const o=n.toTwos((i.signed?0:1)+i.width).toHexString(),s=ev(n,i.decimals);return new an(Yd,o,s,i)}static from(e,t){if(typeof e=="string")return an.fromString(e,t);if(ed(e))return an.fromBytes(e,t);try{return an.fromValue(e,0,t)}catch(i){if(i.code!==ji.errors.INVALID_ARGUMENT)throw i}return un.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}};const z4=nA.from(1),z$=nA.from("0.5"),W$="strings/5.7.0",H$=new ji(W$);var P1;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(P1||(P1={}));var W4;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(W4||(W4={}));function rv(r,e=P1.current){e!=P1.current&&(H$.checkNormalize(),r=r.normalize(e));let t=[];for(let i=0;i>6|192),t.push(n&63|128);else if((n&64512)==55296){i++;const o=r.charCodeAt(i);if(i>=r.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const s=65536+((n&1023)<<10)+(o&1023);t.push(s>>18|240),t.push(s>>12&63|128),t.push(s>>6&63|128),t.push(s&63|128)}else t.push(n>>12|224),t.push(n>>6&63|128),t.push(n&63|128)}return ei(t)}function q$(r){if(r.length%4!==0)throw new Error("bad data");let e=[];for(let t=0;t{let o=n.split(":");t+=parseInt(o[0],16),i[t]=e(o[1])}),i}function H4(r){let e=0;return r.split(",").map(t=>{let i=t.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let n=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:n,h:e}})}H4("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(r=>parseInt(r,16)),iv("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),iv("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),iv("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",q$),H4("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function V$(r){r=atob(r);const e=[];for(let t=0;t0&&Array.isArray(a)?n(a,s-1):t.push(a)})};return n(r,e),t}function K$(r){const e={};for(let t=0;t>--u&1}const p=31,v=Math.pow(2,p),b=v>>>1,I=b>>1,L=v-1;let $=0;for(let U=0;U1;){let j=F+_>>>1;U>>1|d(),x=x<<1^b,M=(M^b)<<1|b|1;P=x,q=1+M-x}let D=i-4;return K.map(U=>{switch(U-D){case 3:return D+65792+(r[a++]<<16|r[a++]<<8|r[a++]);case 2:return D+256+(r[a++]<<8|r[a++]);case 1:return D+r[a++];default:return U-1}})}function Z$(r){let e=0;return()=>r[e++]}function Q$(r){return Z$(G$(r))}function Y$(r){return r&1?~r>>1:r>>1}function J$(r,e){let t=Array(r);for(let i=0;ie[s]):t}function eM(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(rM(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(iM(t,r))}return K$(oA(e))}function tM(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(t)}return e}function sA(r,e,t){let i=Array(r).fill(void 0).map(()=>[]);for(let n=0;ni[s].push(o));return i}function rM(r,e){let t=1+e(),i=e(),n=tM(e),o=sA(n.length,1+r,e);return oA(o.map((s,a)=>{const u=s[0],h=s.slice(1);return Array(n[a]).fill(void 0).map((d,p)=>{let v=p*i;return[u+p*t,h.map(b=>b+v)]})}))}function iM(r,e){let t=1+e();return sA(t,1+r,e).map(i=>[i[0],i.slice(1)])}function nM(r){let e=D1(r).sort((i,n)=>i-n);return t();function t(){let i=[];for(;;){let h=D1(r,e);if(h.length==0)break;i.push({set:new Set(h),node:t()})}i.sort((h,d)=>d.set.size-h.set.size);let n=r(),o=n%3;n=n/3|0;let s=!!(n&1);n>>=1;let a=n==1,u=n==2;return{branches:i,valid:o,fe0f:s,save:a,check:u}}}function oM(){return Q$(V$("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Wp=oM();new Set(D1(Wp)),new Set(D1(Wp)),eM(Wp),nM(Wp);const sM=new Uint8Array(32);sM.fill(0);const aM=`Ethereum Signed Message: +`;function aA(r){return typeof r=="string"&&(r=rv(r)),V3(N$([rv(aM),rv(String(r.length)),r]))}const cM="address/5.7.0",Hd=new ji(cM);function V4(r){Yn(r,20)||Hd.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const e=r.substring(2).split(""),t=new Uint8Array(40);for(let n=0;n<40;n++)t[n]=e[n].charCodeAt(0);const i=ei(V3(t));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(i[n>>1]&15)>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}const lM=9007199254740991;function uM(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const G3={};for(let r=0;r<10;r++)G3[String(r)]=String(r);for(let r=0;r<26;r++)G3[String.fromCharCode(65+r)]=String(10+r);const K4=Math.floor(uM(lM));function hM(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(i=>G3[i]).join("");for(;e.length>=K4;){let i=e.substring(0,K4);e=parseInt(i,10)%97+e.substring(i.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}function dM(r){let e=null;if(typeof r!="string"&&Hd.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=V4(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&Hd.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==hM(r)&&Hd.throwArgumentError("bad icap checksum","address",r),e=F$(r.substring(4));e.length<40;)e="0"+e;e=V4("0x"+e)}else Hd.throwArgumentError("invalid address","address",r);return e}function Dd(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}const fM=new Uint8Array(32);fM.fill(0),fn.from(-1);const pM=fn.from(0),gM=fn.from(1);fn.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ls(gM.toHexString(),32),Ls(pM.toHexString(),32);var Os={},cr={},f0=cA;function cA(r,e){if(!r)throw new Error(e||"Assertion failed")}cA.equal=function(r,e,t){if(r!=e)throw new Error(t||"Assertion failed: "+r+" != "+e)};var m2={exports:{}};typeof Object.create=="function"?m2.exports=function(r,e){e&&(r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:m2.exports=function(r,e){if(e){r.super_=e;var t=function(){};t.prototype=e.prototype,r.prototype=new t,r.prototype.constructor=r}};var mM=f0,wM=m2.exports;cr.inherits=wM;function vM(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function yM(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),n=0;n>6|192,t[i++]=o&63|128):vM(r,n)?(o=65536+((o&1023)<<10)+(r.charCodeAt(++n)&1023),t[i++]=o>>18|240,t[i++]=o>>12&63|128,t[i++]=o>>6&63|128,t[i++]=o&63|128):(t[i++]=o>>12|224,t[i++]=o>>6&63|128,t[i++]=o&63|128)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}cr.htonl=lA;function _M(r,e){for(var t="",i=0;i>>0}return o}cr.join32=xM;function AM(r,e){for(var t=new Array(r.length*4),i=0,n=0;i>>24,t[n+1]=o>>>16&255,t[n+2]=o>>>8&255,t[n+3]=o&255):(t[n+3]=o>>>24,t[n+2]=o>>>16&255,t[n+1]=o>>>8&255,t[n]=o&255)}return t}cr.split32=AM;function EM(r,e){return r>>>e|r<<32-e}cr.rotr32=EM;function CM(r,e){return r<>>32-e}cr.rotl32=CM;function SM(r,e){return r+e>>>0}cr.sum32=SM;function IM(r,e,t){return r+e+t>>>0}cr.sum32_3=IM;function TM(r,e,t,i){return r+e+t+i>>>0}cr.sum32_4=TM;function RM(r,e,t,i,n){return r+e+t+i+n>>>0}cr.sum32_5=RM;function kM(r,e,t,i){var n=r[e],o=r[e+1],s=i+o>>>0,a=(s>>0,r[e+1]=s}cr.sum64=kM;function OM(r,e,t,i){var n=e+i>>>0,o=(n>>0}cr.sum64_hi=OM;function PM(r,e,t,i){var n=e+i;return n>>>0}cr.sum64_lo=PM;function DM(r,e,t,i,n,o,s,a){var u=0,h=e;h=h+i>>>0,u+=h>>0,u+=h>>0,u+=h>>0}cr.sum64_4_hi=DM;function NM(r,e,t,i,n,o,s,a){var u=e+i+o+a;return u>>>0}cr.sum64_4_lo=NM;function $M(r,e,t,i,n,o,s,a,u,h){var d=0,p=e;p=p+i>>>0,d+=p>>0,d+=p>>0,d+=p>>0,d+=p>>0}cr.sum64_5_hi=$M;function MM(r,e,t,i,n,o,s,a,u,h){var d=e+i+o+a+h;return d>>>0}cr.sum64_5_lo=MM;function BM(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}cr.rotr64_hi=BM;function UM(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}cr.rotr64_lo=UM;function LM(r,e,t){return r>>>t}cr.shr64_hi=LM;function jM(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}cr.shr64_lo=jM;var td={},G4=cr,FM=f0;function Hp(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}td.BlockHash=Hp,Hp.prototype.update=function(r,e){if(r=G4.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){r=this.pending;var t=r.length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=G4.join32(r,0,r.length-t,this.endian);for(var i=0;i>>24&255,i[n++]=r>>>16&255,i[n++]=r>>>8&255,i[n++]=r&255}else for(i[n++]=r&255,i[n++]=r>>>8&255,i[n++]=r>>>16&255,i[n++]=r>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o>>3}ta.g0_256=VM;function KM(r){return js(r,17)^js(r,19)^r>>>10}ta.g1_256=KM;var wh=cr,GM=td,ZM=ta,nv=wh.rotl32,Nd=wh.sum32,QM=wh.sum32_5,YM=ZM.ft_1,gA=GM.BlockHash,JM=[1518500249,1859775393,2400959708,3395469782];function $s(){if(!(this instanceof $s))return new $s;gA.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}wh.inherits($s,gA);var XM=$s;$s.blockSize=512,$s.outSize=160,$s.hmacStrength=80,$s.padLength=64,$s.prototype._update=function(r,e){for(var t=this.W,i=0;i<16;i++)t[i]=r[e+i];for(;ithis.blockSize&&(r=new this.Hash().update(r).digest()),jB(r.length<=this.blockSize);for(var e=r.length;e>8,v=d&255;p?u.push(p,v):u.push(v)}return u}t.toArray=i;function n(s){return s.length===1?"0"+s:s}t.zero2=n;function o(s){for(var a="",u=0;u(v>>1)-1?L=(v>>1)-$:L=$,b.isubn(L)):L=0,p[I]=L,b.iushrn(1)}return p}t.getNAF=i;function n(u,h){var d=[[],[]];u=u.clone(),h=h.clone();for(var p=0,v=0,b;u.cmpn(-p)>0||h.cmpn(-v)>0;){var I=u.andln(3)+p&3,L=h.andln(3)+v&3;I===3&&(I=-1),L===3&&(L=-1);var $;I&1?(b=u.andln(7)+p&7,(b===3||b===5)&&L===2?$=-I:$=I):$=0,d[0].push($);var K;L&1?(b=h.andln(7)+v&7,(b===3||b===5)&&I===2?K=-L:K=L):K=0,d[1].push(K),2*p===$+1&&(p=1-p),2*v===K+1&&(v=1-v),u.iushrn(1),h.iushrn(1)}return d}t.getJSF=n;function o(u,h,d){var p="_"+h;u.prototype[h]=function(){return this[p]!==void 0?this[p]:this[p]=d.call(this)}}t.cachedProperty=o;function s(u){return typeof u=="string"?t.toArray(u,"hex"):u}t.parseBytes=s;function a(u){return new Vt(u,"hex","le")}t.intFromLE=a}),Vp=Jn.getNAF,WB=Jn.getJSF,N1=Jn.assert;function xc(r,e){this.type=r,this.p=new Vt(e.p,16),this.red=e.prime?Vt.red(e.prime):Vt.mont(this.p),this.zero=new Vt(0).toRed(this.red),this.one=new Vt(1).toRed(this.red),this.two=new Vt(2).toRed(this.red),this.n=e.n&&new Vt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var fu=xc;xc.prototype.point=function(){throw new Error("Not implemented")},xc.prototype.validate=function(){throw new Error("Not implemented")},xc.prototype._fixedNafMul=function(r,e){N1(r.precomputed);var t=r._getDoubles(),i=Vp(e,1,this._bitLength),n=(1<=s;u--)a=(a<<1)+i[u];o.push(a)}for(var h=this.jpoint(null,null,null),d=this.jpoint(null,null,null),p=n;p>0;p--){for(s=0;s=0;a--){for(var u=0;a>=0&&o[a]===0;a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var h=o[a];N1(h!==0),r.type==="affine"?h>0?s=s.mixedAdd(n[h-1>>1]):s=s.mixedAdd(n[-h-1>>1].neg()):h>0?s=s.add(n[h-1>>1]):s=s.add(n[-h-1>>1].neg())}return r.type==="affine"?s.toP():s},xc.prototype._wnafMulAdd=function(r,e,t,i,n){var o=this._wnafT1,s=this._wnafT2,a=this._wnafT3,u=0,h,d,p;for(h=0;h=1;h-=2){var b=h-1,I=h;if(o[b]!==1||o[I]!==1){a[b]=Vp(t[b],o[b],this._bitLength),a[I]=Vp(t[I],o[I],this._bitLength),u=Math.max(a[b].length,u),u=Math.max(a[I].length,u);continue}var L=[e[b],null,null,e[I]];e[b].y.cmp(e[I].y)===0?(L[1]=e[b].add(e[I]),L[2]=e[b].toJ().mixedAdd(e[I].neg())):e[b].y.cmp(e[I].y.redNeg())===0?(L[1]=e[b].toJ().mixedAdd(e[I]),L[2]=e[b].add(e[I].neg())):(L[1]=e[b].toJ().mixedAdd(e[I]),L[2]=e[b].toJ().mixedAdd(e[I].neg()));var $=[-3,-1,-5,-7,0,7,5,1,3],K=WB(t[b],t[I]);for(u=Math.max(K[0].length,u),a[b]=new Array(u),a[I]=new Array(u),d=0;d=0;h--){for(var F=0;h>=0;){var _=!0;for(d=0;d=0&&F++,D=D.dblp(F),h<0)break;for(d=0;d0?p=s[d][x-1>>1]:x<0&&(p=s[d][-x-1>>1].neg()),p.type==="affine"?D=D.mixedAdd(p):D=D.add(p))}}for(h=0;h=Math.ceil((r.bitLength()+1)/e.step):!1},Co.prototype._getDoubles=function(r,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],i=this,n=0;n=0&&(v=u,b=h),d.negative&&(d=d.neg(),p=p.neg()),v.negative&&(v=v.neg(),b=b.neg()),[{a:d,b:p},{a:v,b}]},Mo.prototype._endoSplit=function(r){var e=this.endo.basis,t=e[0],i=e[1],n=i.b.mul(r).divRound(this.n),o=t.b.neg().mul(r).divRound(this.n),s=n.mul(t.a),a=o.mul(i.a),u=n.mul(t.b),h=o.mul(i.b),d=r.sub(s).sub(a),p=u.add(h).neg();return{k1:d,k2:p}},Mo.prototype.pointFromX=function(r,e){r=new Vt(r,16),r.red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),i=t.redSqrt();if(i.redSqr().redSub(t).cmp(this.zero)!==0)throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(r,i)},Mo.prototype.validate=function(r){if(r.inf)return!0;var e=r.x,t=r.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return t.redSqr().redISub(n).cmpn(0)===0},Mo.prototype._endoWnafMulAdd=function(r,e,t){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},Si.prototype.isInfinity=function(){return this.inf},Si.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(this.x.cmp(r.x)===0)return this.curve.point(null,null);var e=this.y.redSub(r.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),i=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,i)},Si.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(r.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),i=r.redInvm(),n=t.redAdd(t).redIAdd(t).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},Si.prototype.getX=function(){return this.x.fromRed()},Si.prototype.getY=function(){return this.y.fromRed()},Si.prototype.mul=function(r){return r=new Vt(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},Si.prototype.mulAdd=function(r,e,t){var i=[this,e],n=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},Si.prototype.jmulAdd=function(r,e,t){var i=[this,e],n=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},Si.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||this.x.cmp(r.x)===0&&this.y.cmp(r.y)===0)},Si.prototype.neg=function(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var t=this.precomputed,i=function(n){return n.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e},Si.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r};function $i(r,e,t,i){fu.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Vt(0)):(this.x=new Vt(e,16),this.y=new Vt(t,16),this.z=new Vt(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Q3($i,fu.BasePoint),Mo.prototype.jpoint=function(r,e,t){return new $i(this,r,e,t)},$i.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),i=this.y.redMul(e).redMul(r);return this.curve.point(t,i)},$i.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},$i.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),i=this.x.redMul(e),n=r.x.redMul(t),o=this.y.redMul(e.redMul(r.z)),s=r.y.redMul(t.redMul(this.z)),a=i.redSub(n),u=o.redSub(s);if(a.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),d=h.redMul(a),p=i.redMul(h),v=u.redSqr().redIAdd(d).redISub(p).redISub(p),b=u.redMul(p.redISub(v)).redISub(o.redMul(d)),I=this.z.redMul(r.z).redMul(a);return this.curve.jpoint(v,b,I)},$i.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,i=r.x.redMul(e),n=this.y,o=r.y.redMul(e).redMul(this.z),s=t.redSub(i),a=n.redSub(o);if(s.cmpn(0)===0)return a.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),d=t.redMul(u),p=a.redSqr().redIAdd(h).redISub(d).redISub(d),v=a.redMul(d.redISub(p)).redISub(n.redMul(h)),b=this.z.redMul(s);return this.curve.jpoint(p,v,b)},$i.prototype.dblp=function(r){if(r===0)return this;if(this.isInfinity())return this;if(!r)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var t=this;for(e=0;e=0)return!1;if(t.redIAdd(n),this.x.cmp(t)===0)return!0}},$i.prototype.inspect=function(){return this.isInfinity()?"":""},$i.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var m1=id(function(r,e){var t=e;t.base=fu,t.short=qB,t.mont=null,t.edwards=null}),w1=id(function(r,e){var t=e,i=Jn.assert;function n(a){a.type==="short"?this.curve=new m1.short(a):a.type==="edwards"?this.curve=new m1.edwards(a):this.curve=new m1.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=n;function o(a,u){Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){var h=new n(u);return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,value:h}),h}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Os.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Os.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Os.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Os.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Os.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Os.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Os.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=null.crash()}catch{s=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Os.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})});function Ac(r){if(!(this instanceof Ac))return new Ac(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=us.toArray(r.entropy,r.entropyEnc||"hex"),t=us.toArray(r.nonce,r.nonceEnc||"hex"),i=us.toArray(r.pers,r.persEnc||"hex");Z3(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}var J4=Ac;Ac.prototype._init=function(r,e,t){var i=r.concat(e).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(t||[])),this._reseed=1},Ac.prototype.generate=function(r,e,t,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(i=t,t=e,e=null),t&&(t=us.toArray(t,i||"hex"),this._update(t));for(var n=[];n.length"};var VB=Jn.assert;function Zg(r,e){if(r instanceof Zg)return r;this._importDER(r,e)||(VB(r.r&&r.s,"Signature without r or s"),this.r=new Vt(r.r,16),this.s=new Vt(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var Kp=Zg;function KB(){this.place=0}function lv(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4)return!1;for(var n=0,o=0,s=e.place;o>>=0;return n<=127?!1:(e.place=s,n)}function X4(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Zg.prototype.toDER=function(r){var e=this.r.toArray(),t=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t)),e=X4(e),t=X4(t);!t[0]&&!(t[1]&128);)t=t.slice(1);var i=[2];uv(i,e.length),i=i.concat(e),i.push(2),uv(i,t.length);var n=i.concat(t),o=[48];return uv(o,n.length),o=o.concat(n),Jn.encode(o,r)};var GB=function(){throw new Error("unsupported")},IA=Jn.assert;function Do(r){if(!(this instanceof Do))return new Do(r);typeof r=="string"&&(IA(Object.prototype.hasOwnProperty.call(w1,r),"Unknown curve "+r),r=w1[r]),r instanceof w1.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var ZB=Do;Do.prototype.keyPair=function(r){return new cv(this,r)},Do.prototype.keyFromPrivate=function(r,e){return cv.fromPrivate(this,r,e)},Do.prototype.keyFromPublic=function(r,e){return cv.fromPublic(this,r,e)},Do.prototype.genKeyPair=function(r){r||(r={});for(var e=new J4({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||GB(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),i=this.n.sub(new Vt(2));;){var n=new Vt(e.generate(t));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Do.prototype._truncateToN=function(r,e){var t=r.byteLength()*8-this.n.bitLength();return t>0&&(r=r.ushrn(t)),!e&&r.cmp(this.n)>=0?r.sub(this.n):r},Do.prototype.sign=function(r,e,t,i){typeof t=="object"&&(i=t,t=null),i||(i={}),e=this.keyFromPrivate(e,t),r=this._truncateToN(new Vt(r,16));for(var n=this.n.byteLength(),o=e.getPrivate().toArray("be",n),s=r.toArray("be",n),a=new J4({hash:this.hash,entropy:o,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new Vt(1)),h=0;;h++){var d=i.k?i.k(h):new Vt(a.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(u)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var v=p.getX(),b=v.umod(this.n);if(b.cmpn(0)!==0){var I=d.invm(this.n).mul(b.mul(e.getPrivate()).iadd(r));if(I=I.umod(this.n),I.cmpn(0)!==0){var L=(p.getY().isOdd()?1:0)|(v.cmp(b)!==0?2:0);return i.canonical&&I.cmp(this.nh)>0&&(I=this.n.sub(I),L^=1),new Kp({r:b,s:I,recoveryParam:L})}}}}}},Do.prototype.verify=function(r,e,t,i){r=this._truncateToN(new Vt(r,16)),t=this.keyFromPublic(t,i),e=new Kp(e,"hex");var n=e.r,o=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),a=s.mul(r).umod(this.n),u=s.mul(n).umod(this.n),h;return this.curve._maxwellTrick?(h=this.g.jmulAdd(a,t.getPublic(),u),h.isInfinity()?!1:h.eqXToP(n)):(h=this.g.mulAdd(a,t.getPublic(),u),h.isInfinity()?!1:h.getX().umod(this.n).cmp(n)===0)},Do.prototype.recoverPubKey=function(r,e,t,i){IA((3&t)===t,"The recovery param is more than two bits"),e=new Kp(e,i);var n=this.n,o=new Vt(r),s=e.r,a=e.s,u=t&1,h=t>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?s=this.curve.pointFromX(s.add(this.curve.n),u):s=this.curve.pointFromX(s,u);var d=e.r.invm(n),p=n.sub(o).mul(d).umod(n),v=a.mul(d).umod(n);return this.g.mulAdd(p,s,v)},Do.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new Kp(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(r,e,n)}catch{continue}if(o.eq(t))return n}throw new Error("Unable to find valid recovery factor")};var QB=id(function(r,e){var t=e;t.version="6.5.4",t.utils=Jn,t.rand=function(){throw new Error("unsupported")},t.curve=m1,t.curves=w1,t.ec=ZB,t.eddsa=null}),YB=QB.ec;const JB="signing-key/5.7.0",y2=new ji(JB);let hv=null;function vc(){return hv||(hv=new YB("secp256k1")),hv}class XB{constructor(e){Dd(this,"curve","secp256k1"),Dd(this,"privateKey",kn(e)),M$(this.privateKey)!==32&&y2.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=vc().keyFromPrivate(ei(this.privateKey));Dd(this,"publicKey","0x"+t.getPublic(!1,"hex")),Dd(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Dd(this,"_isSigningKey",!0)}_addPoint(e){const t=vc().keyFromPublic(ei(this.publicKey)),i=vc().keyFromPublic(ei(e));return"0x"+t.pub.add(i.pub).encodeCompressed("hex")}signDigest(e){const t=vc().keyFromPrivate(ei(this.privateKey)),i=ei(e);i.length!==32&&y2.throwArgumentError("bad digest length","digest",e);const n=t.sign(i,{canonical:!0});return Jx({recoveryParam:n.recoveryParam,r:Ls("0x"+n.r.toString(16),32),s:Ls("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=vc().keyFromPrivate(ei(this.privateKey)),i=vc().keyFromPublic(ei(TA(e)));return Ls("0x"+t.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function eU(r,e){const t=Jx(e),i={r:ei(t.r),s:ei(t.s)};return"0x"+vc().recoverPubKey(ei(r),i,t.recoveryParam).encode("hex",!1)}function TA(r,e){const t=ei(r);return t.length===32?new XB(t).publicKey:t.length===33?"0x"+vc().keyFromPublic(t).getPublic(!1,"hex"):t.length===65?kn(t):y2.throwArgumentError("invalid public or private key","key","[REDACTED]")}var e6;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(e6||(e6={}));function tU(r){const e=TA(r);return dM(L4(V3(L4(e,1)),12))}function rU(r,e){return tU(eU(ei(r),e))}const iU="https://rpc.walletconnect.com/v1";async function nU(r,e,t,i,n,o){switch(t.t){case"eip191":return oU(r,e,t.s);case"eip1271":return await sU(r,e,t.s,i,n,o);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${t.t}`)}}function oU(r,e,t){return rU(aA(e),t).toLowerCase()===r.toLowerCase()}async function sU(r,e,t,i,n,o){try{const s="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",u="0000000000000000000000000000000000000000000000000000000000000041",h=t.substring(2),d=aA(e).substring(2),p=s+d+a+u+h,v=await fetch(`${o||iU}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:aU(),jsonrpc:"2.0",method:"eth_call",params:[{to:r,data:p},"latest"]})}),{result:b}=await v.json();return b?b.slice(0,s.length).toLowerCase()===s.toLowerCase():!1}catch(s){return console.error("isValidEip1271Signature: ",s),!1}}function aU(){return Date.now()+Math.floor(Math.random()*1e3)}var cU=Object.defineProperty,lU=Object.defineProperties,uU=Object.getOwnPropertyDescriptors,t6=Object.getOwnPropertySymbols,hU=Object.prototype.hasOwnProperty,dU=Object.prototype.propertyIsEnumerable,r6=(r,e,t)=>e in r?cU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,fU=(r,e)=>{for(var t in e||(e={}))hU.call(e,t)&&r6(r,t,e[t]);if(t6)for(var t of t6(e))dU.call(e,t)&&r6(r,t,e[t]);return r},pU=(r,e)=>lU(r,uU(e));const gU="did:pkh:",Y3=r=>r==null?void 0:r.split(":"),RA=r=>{const e=r&&Y3(r);if(e)return r.includes(gU)?e[3]:e[1]},i6=r=>{const e=r&&Y3(r);if(e)return e[2]+":"+e[3]},$1=r=>{const e=r&&Y3(r);if(e)return e.pop()};async function n6(r){const{cacao:e,projectId:t}=r,{s:i,p:n}=e,o=kA(n,n.iss),s=$1(n.iss);return await nU(s,o,i,RA(n.iss),t)}const kA=(r,e)=>{const t=`${r.domain} wants you to sign in with your Ethereum account:`,i=$1(e);if(!r.aud&&!r.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=r.statement||void 0;const o=`URI: ${r.aud||r.uri}`,s=`Version: ${r.version}`,a=`Chain ID: ${RA(e)}`,u=`Nonce: ${r.nonce}`,h=`Issued At: ${r.iat}`,d=r.resources?`Resources:${r.resources.map(v=>` +- ${v}`).join("")}`:void 0,p=v1(r.resources);if(p){const v=gf(p);n=EU(n,v)}return[t,i,"",n,"",o,s,a,u,h,d].filter(v=>v!=null).join(` +`)};function mU(r){return Buffer.from(JSON.stringify(r)).toString("base64")}function wU(r){return JSON.parse(Buffer.from(r,"base64").toString("utf-8"))}function Wl(r){if(!r)throw new Error("No recap provided, value is undefined");if(!r.att)throw new Error("No `att` property found");const e=Object.keys(r.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(t=>{const i=r.att[t];if(Array.isArray(i))throw new Error(`Resource must be an object: ${t}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(i).forEach(n=>{const o=i[n];if(!Array.isArray(o))throw new Error(`Ability limits ${n} must be an array of objects, found: ${o}`);if(!o.length)throw new Error(`Value of ${n} is empty array, must be an array with objects`);o.forEach(s=>{if(typeof s!="object")throw new Error(`Ability limits (${n}) must be an array of objects, found: ${s}`)})})})}function vU(r,e,t,i={}){return t==null||t.sort((n,o)=>n.localeCompare(o)),{att:{[r]:yU(e,t,i)}}}function yU(r,e,t={}){e=e==null?void 0:e.sort((n,o)=>n.localeCompare(o));const i=e.map(n=>({[`${r}/${n}`]:[t]}));return Object.assign({},...i)}function OA(r){return Wl(r),`urn:recap:${mU(r).replace(/=/g,"")}`}function gf(r){const e=wU(r.replace("urn:recap:",""));return Wl(e),e}function bU(r,e,t){const i=vU(r,e,t);return OA(i)}function _U(r){return r&&r.includes("urn:recap:")}function xU(r,e){const t=gf(r),i=gf(e),n=AU(t,i);return OA(n)}function AU(r,e){Wl(r),Wl(e);const t=Object.keys(r.att).concat(Object.keys(e.att)).sort((n,o)=>n.localeCompare(o)),i={att:{}};return t.forEach(n=>{var o,s;Object.keys(((o=r.att)==null?void 0:o[n])||{}).concat(Object.keys(((s=e.att)==null?void 0:s[n])||{})).sort((a,u)=>a.localeCompare(u)).forEach(a=>{var u,h;i.att[n]=pU(fU({},i.att[n]),{[a]:((u=r.att[n])==null?void 0:u[a])||((h=e.att[n])==null?void 0:h[a])})})}),i}function EU(r="",e){Wl(e);const t="I further authorize the stated URI to perform the following actions on my behalf: ";if(r.includes(t))return r;const i=[];let n=0;Object.keys(e.att).forEach(a=>{const u=Object.keys(e.att[a]).map(p=>({ability:p.split("/")[0],action:p.split("/")[1]}));u.sort((p,v)=>p.action.localeCompare(v.action));const h={};u.forEach(p=>{h[p.ability]||(h[p.ability]=[]),h[p.ability].push(p.action)});const d=Object.keys(h).map(p=>(n++,`(${n}) '${p}': '${h[p].join("', '")}' for '${a}'.`));i.push(d.join(", ").replace(".,","."))});const o=i.join(" "),s=`${t}${o}`;return`${r?r+" ":""}${s}`}function o6(r){var e;const t=gf(r);Wl(t);const i=(e=t.att)==null?void 0:e.eip155;return i?Object.keys(i).map(n=>n.split("/")[1]):[]}function s6(r){const e=gf(r);Wl(e);const t=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(n=>{var o;(o=n==null?void 0:n[0])!=null&&o.chains&&t.push(n[0].chains)})}),[...new Set(t.flat())]}function v1(r){if(!r)return;const e=r==null?void 0:r[r.length-1];return _U(e)?e:void 0}const PA="base10",hn="base16",b2="base64pad",J3="utf8",DA=0,$c=1,CU=0,a6=1,_2=12,X3=32;function SU(){const r=q3.generateKeyPair();return{privateKey:dn(r.secretKey,hn),publicKey:dn(r.publicKey,hn)}}function x2(){const r=Yh.randomBytes(X3);return dn(r,hn)}function IU(r,e){const t=q3.sharedKey($n(r,hn),$n(e,hn),!0),i=new iN(Kg.SHA256,t).expand(X3);return dn(i,hn)}function y1(r){const e=Kg.hash($n(r,hn));return dn(e,hn)}function Ol(r){const e=Kg.hash($n(r,J3));return dn(e,hn)}function TU(r){return $n(`${r}`,PA)}function p0(r){return Number(dn(r,PA))}function RU(r){const e=TU(typeof r.type<"u"?r.type:DA);if(p0(e)===$c&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?$n(r.senderPublicKey,hn):void 0,i=typeof r.iv<"u"?$n(r.iv,hn):Yh.randomBytes(_2),n=new W3.ChaCha20Poly1305($n(r.symKey,hn)).seal(i,$n(r.message,J3));return OU({type:e,sealed:n,iv:i,senderPublicKey:t})}function kU(r){const e=new W3.ChaCha20Poly1305($n(r.symKey,hn)),{sealed:t,iv:i}=M1(r.encoded),n=e.open(i,t);if(n===null)throw new Error("Failed to decrypt");return dn(n,J3)}function OU(r){if(p0(r.type)===$c){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return dn(f2([r.type,r.senderPublicKey,r.iv,r.sealed]),b2)}return dn(f2([r.type,r.iv,r.sealed]),b2)}function M1(r){const e=$n(r,b2),t=e.slice(CU,a6),i=a6;if(p0(t)===$c){const a=i+X3,u=a+_2,h=e.slice(i,a),d=e.slice(a,u),p=e.slice(u);return{type:t,sealed:p,iv:d,senderPublicKey:h}}const n=i+_2,o=e.slice(i,n),s=e.slice(n);return{type:t,sealed:s,iv:o}}function PU(r,e){const t=M1(r);return NA({type:p0(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?dn(t.senderPublicKey,hn):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function NA(r){const e=(r==null?void 0:r.type)||DA;if(e===$c){if(typeof(r==null?void 0:r.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(r==null?void 0:r.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r==null?void 0:r.senderPublicKey,receiverPublicKey:r==null?void 0:r.receiverPublicKey}}function c6(r){return r.type===$c&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}const DU="irn";function A2(r){return(r==null?void 0:r.relay)||{protocol:DU}}function qd(r){const e=u$[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var NU=Object.defineProperty,$U=Object.defineProperties,MU=Object.getOwnPropertyDescriptors,l6=Object.getOwnPropertySymbols,BU=Object.prototype.hasOwnProperty,UU=Object.prototype.propertyIsEnumerable,u6=(r,e,t)=>e in r?NU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,h6=(r,e)=>{for(var t in e||(e={}))BU.call(e,t)&&u6(r,t,e[t]);if(l6)for(var t of l6(e))UU.call(e,t)&&u6(r,t,e[t]);return r},LU=(r,e)=>$U(r,MU(e));function jU(r,e="-"){const t={},i="relay"+e;return Object.keys(r).forEach(n=>{if(n.startsWith(i)){const o=n.replace(i,""),s=r[n];t[o]=s}}),t}function d6(r){r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,i=r.substring(0,e),n=r.substring(e+1,t).split("@"),o=typeof t<"u"?r.substring(t):"",s=df.parse(o),a=typeof s.methods=="string"?s.methods.split(","):void 0;return{protocol:i,topic:FU(n[0]),version:parseInt(n[1],10),symKey:s.symKey,relay:jU(s),methods:a,expiryTimestamp:s.expiryTimestamp?parseInt(s.expiryTimestamp,10):void 0}}function FU(r){return r.startsWith("//")?r.substring(2):r}function zU(r,e="-"){const t="relay",i={};return Object.keys(r).forEach(n=>{const o=t+e+n;r[n]&&(i[o]=r[n])}),i}function WU(r){return`${r.protocol}:${r.topic}@${r.version}?`+df.stringify(h6(LU(h6({symKey:r.symKey},zU(r.relay)),{expiryTimestamp:r.expiryTimestamp}),r.methods?{methods:r.methods.join(",")}:{}))}function nd(r){const e=[];return r.forEach(t=>{const[i,n]=t.split(":");e.push(`${i}:${n}`)}),e}function HU(r){const e=[];return Object.values(r).forEach(t=>{e.push(...nd(t.accounts))}),e}function qU(r,e){const t=[];return Object.values(r).forEach(i=>{nd(i.accounts).includes(e)&&t.push(...i.methods)}),t}function VU(r,e){const t=[];return Object.values(r).forEach(i=>{nd(i.accounts).includes(e)&&t.push(...i.events)}),t}function ey(r){return r.includes(":")}function Vd(r){return ey(r)?r.split(":")[0]:r}function KU(r){const e={};return r==null||r.forEach(t=>{const[i,n]=t.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(t),e[i].chains.push(`${i}:${n}`)}),e}function f6(r,e){e=e.map(i=>i.replace("did:pkh:",""));const t=KU(e);for(const[i,n]of Object.entries(t))n.methods?n.methods=p1(n.methods,r):n.methods=r,n.events=["chainChanged","accountsChanged"];return t}const GU={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},ZU={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function je(r,e){const{message:t,code:i}=ZU[r];return{message:e?`${t} ${e}`:t,code:i}}function Pr(r,e){const{message:t,code:i}=GU[r];return{message:e?`${t} ${e}`:t,code:i}}function Hs(r,e){return!!Array.isArray(r)}function mf(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function Dn(r){return typeof r>"u"}function si(r,e){return e&&Dn(r)?!0:typeof r=="string"&&!!r.trim().length}function ty(r,e){return typeof r=="number"&&!isNaN(r)}function QU(r,e){const{requiredNamespaces:t}=e,i=Object.keys(r.namespaces),n=Object.keys(t);let o=!0;return kl(n,i)?(i.forEach(s=>{const{accounts:a,methods:u,events:h}=r.namespaces[s],d=nd(a),p=t[s];(!kl(Hx(s,p),d)||!kl(p.methods,u)||!kl(p.events,h))&&(o=!1)}),o):!1}function B1(r){return si(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function YU(r){if(si(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&B1(t)}}return!1}function JU(r){if(si(r,!1))try{return typeof new URL(r)<"u"}catch{return!1}return!1}function XU(r){var e;return(e=r==null?void 0:r.proposer)==null?void 0:e.publicKey}function eL(r){return r==null?void 0:r.topic}function tL(r,e){let t=null;return si(r==null?void 0:r.publicKey,!1)||(t=je("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function p6(r){let e=!0;return Hs(r)?r.length&&(e=r.every(t=>si(t,!1))):e=!1,e}function rL(r,e,t){let i=null;return Hs(e)&&e.length?e.forEach(n=>{i||B1(n)||(i=Pr("UNSUPPORTED_CHAINS",`${t}, chain ${n} should be a string and conform to "namespace:chainId" format`))}):B1(r)||(i=Pr("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function iL(r,e,t){let i=null;return Object.entries(r).forEach(([n,o])=>{if(i)return;const s=rL(n,Hx(n,o),`${e} ${t}`);s&&(i=s)}),i}function nL(r,e){let t=null;return Hs(r)?r.forEach(i=>{t||YU(i)||(t=Pr("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):t=Pr("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function oL(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const n=nL(i==null?void 0:i.accounts,`${e} namespace`);n&&(t=n)}),t}function sL(r,e){let t=null;return p6(r==null?void 0:r.methods)?p6(r==null?void 0:r.events)||(t=Pr("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=Pr("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function $A(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const n=sL(i,`${e}, namespace`);n&&(t=n)}),t}function aL(r,e,t){let i=null;if(r&&mf(r)){const n=$A(r,e);n&&(i=n);const o=iL(r,e,t);o&&(i=o)}else i=je("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return i}function dv(r,e){let t=null;if(r&&mf(r)){const i=$A(r,e);i&&(t=i);const n=oL(r,e);n&&(t=n)}else t=je("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function MA(r){return si(r.protocol,!0)}function cL(r,e){let t=!1;return r?r&&Hs(r)&&r.length&&r.forEach(i=>{t=MA(i)}):t=!0,t}function lL(r){return typeof r=="number"}function Rn(r){return typeof r<"u"&&typeof r!==null}function uL(r){return!(!r||typeof r!="object"||!r.code||!ty(r.code)||!r.message||!si(r.message,!1))}function hL(r){return!(Dn(r)||!si(r.method,!1))}function dL(r){return!(Dn(r)||Dn(r.result)&&Dn(r.error)||!ty(r.id)||!si(r.jsonrpc,!1))}function fL(r){return!(Dn(r)||!si(r.name,!1))}function g6(r,e){return!(!B1(e)||!HU(r).includes(e))}function pL(r,e,t){return si(t,!1)?qU(r,e).includes(t):!1}function gL(r,e,t){return si(t,!1)?VU(r,e).includes(t):!1}function m6(r,e,t){let i=null;const n=mL(r),o=wL(e),s=Object.keys(n),a=Object.keys(o),u=w6(Object.keys(r)),h=w6(Object.keys(e)),d=u.filter(p=>!h.includes(p));return d.length&&(i=je("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces. + Required: ${d.toString()} + Received: ${Object.keys(e).toString()}`)),kl(s,a)||(i=je("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces. + Required: ${s.toString()} + Approved: ${a.toString()}`)),Object.keys(e).forEach(p=>{if(!p.includes(":")||i)return;const v=nd(e[p].accounts);v.includes(p)||(i=je("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${p} + Required: ${p} + Approved: ${v.toString()}`))}),s.forEach(p=>{i||(kl(n[p].methods,o[p].methods)?kl(n[p].events,o[p].events)||(i=je("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${p}`)):i=je("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${p}`))}),i}function mL(r){const e={};return Object.keys(r).forEach(t=>{var i;t.includes(":")?e[t]=r[t]:(i=r[t].chains)==null||i.forEach(n=>{e[n]={methods:r[t].methods,events:r[t].events}})}),e}function w6(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function wL(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const i=nd(r[t].accounts);i==null||i.forEach(n=>{e[n]={accounts:r[t].accounts.filter(o=>o.includes(`${n}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function vL(r,e){return ty(r)&&r<=e.max&&r>=e.min}function v6(){const r=d0();return new Promise(e=>{switch(r){case Qn.browser:e(yL());break;case Qn.reactNative:e(bL());break;case Qn.node:e(_L());break;default:e(!0)}})}function yL(){return Xh()&&(navigator==null?void 0:navigator.onLine)}async function bL(){if(Jh()&&typeof global<"u"&&global!=null&&global.NetInfo){const r=await(global==null?void 0:global.NetInfo.fetch());return r==null?void 0:r.isConnected}return!0}function _L(){return!0}function xL(r){switch(d0()){case Qn.browser:AL(r);break;case Qn.reactNative:EL(r);break}}function AL(r){!Jh()&&Xh()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function EL(r){Jh()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>r(e==null?void 0:e.isConnected)))}const fv={};class Md{static get(e){return fv[e]}static set(e,t){fv[e]=t}static delete(e){delete fv[e]}}const CL=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,SL=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,IL=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function TL(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){RL(r);return}return e}function RL(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function Gp(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.endsWith('"')&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const i=t.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!IL.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(CL.test(r)||SL.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,TL)}return JSON.parse(r)}catch(i){if(e.strict)throw i;return r}}function kL(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function Oi(r,...e){try{return kL(r(...e))}catch(t){return Promise.reject(t)}}function OL(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function PL(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function b1(r){if(OL(r))return String(r);if(PL(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return b1(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function BA(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const E2="base64:";function DL(r){if(typeof r=="string")return r;BA();const e=Buffer.from(r).toString("base64");return E2+e}function NL(r){return typeof r!="string"||!r.startsWith(E2)?r:(BA(),Buffer.from(r.slice(E2.length),"base64"))}function In(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function $L(...r){return In(r.join(":"))}function Zp(r){return r=In(r),r?r+":":""}const ML="memory",BL=()=>{const r=new Map;return{name:ML,options:{},hasItem(e){return r.has(e)},getItem(e){return r.get(e)??null},getItemRaw(e){return r.get(e)??null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return Array.from(r.keys())},clear(){r.clear()},dispose(){r.clear()}}};function UL(r={}){const e={mounts:{"":r.driver||BL()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=h=>{for(const d of e.mountpoints)if(h.startsWith(d))return{base:d,relativeKey:h.slice(d.length),driver:e.mounts[d]};return{base:"",relativeKey:h,driver:e.mounts[""]}},i=(h,d)=>e.mountpoints.filter(p=>p.startsWith(h)||d&&h.startsWith(p)).map(p=>({relativeBase:h.length>p.length?h.slice(p.length):void 0,mountpoint:p,driver:e.mounts[p]})),n=(h,d)=>{if(e.watching){d=In(d);for(const p of e.watchListeners)p(h,d)}},o=async()=>{if(!e.watching){e.watching=!0;for(const h in e.mounts)e.unwatch[h]=await y6(e.mounts[h],n,h)}},s=async()=>{if(e.watching){for(const h in e.unwatch)await e.unwatch[h]();e.unwatch={},e.watching=!1}},a=(h,d,p)=>{const v=new Map,b=I=>{let L=v.get(I.base);return L||(L={driver:I.driver,base:I.base,items:[]},v.set(I.base,L)),L};for(const I of h){const L=typeof I=="string",$=In(L?I:I.key),K=L?void 0:I.value,P=L||!I.options?d:{...d,...I.options},q=t($);b(q).items.push({key:$,value:K,relativeKey:q.relativeKey,options:P})}return Promise.all([...v.values()].map(I=>p(I))).then(I=>I.flat())},u={hasItem(h,d={}){h=In(h);const{relativeKey:p,driver:v}=t(h);return Oi(v.hasItem,p,d)},getItem(h,d={}){h=In(h);const{relativeKey:p,driver:v}=t(h);return Oi(v.getItem,p,d).then(b=>Gp(b))},getItems(h,d){return a(h,d,p=>p.driver.getItems?Oi(p.driver.getItems,p.items.map(v=>({key:v.relativeKey,options:v.options})),d).then(v=>v.map(b=>({key:$L(p.base,b.key),value:Gp(b.value)}))):Promise.all(p.items.map(v=>Oi(p.driver.getItem,v.relativeKey,v.options).then(b=>({key:v.key,value:Gp(b)})))))},getItemRaw(h,d={}){h=In(h);const{relativeKey:p,driver:v}=t(h);return v.getItemRaw?Oi(v.getItemRaw,p,d):Oi(v.getItem,p,d).then(b=>NL(b))},async setItem(h,d,p={}){if(d===void 0)return u.removeItem(h);h=In(h);const{relativeKey:v,driver:b}=t(h);b.setItem&&(await Oi(b.setItem,v,b1(d),p),b.watch||n("update",h))},async setItems(h,d){await a(h,d,async p=>{if(p.driver.setItems)return Oi(p.driver.setItems,p.items.map(v=>({key:v.relativeKey,value:b1(v.value),options:v.options})),d);p.driver.setItem&&await Promise.all(p.items.map(v=>Oi(p.driver.setItem,v.relativeKey,b1(v.value),v.options)))})},async setItemRaw(h,d,p={}){if(d===void 0)return u.removeItem(h,p);h=In(h);const{relativeKey:v,driver:b}=t(h);if(b.setItemRaw)await Oi(b.setItemRaw,v,d,p);else if(b.setItem)await Oi(b.setItem,v,DL(d),p);else return;b.watch||n("update",h)},async removeItem(h,d={}){typeof d=="boolean"&&(d={removeMeta:d}),h=In(h);const{relativeKey:p,driver:v}=t(h);v.removeItem&&(await Oi(v.removeItem,p,d),(d.removeMeta||d.removeMata)&&await Oi(v.removeItem,p+"$",d),v.watch||n("remove",h))},async getMeta(h,d={}){typeof d=="boolean"&&(d={nativeOnly:d}),h=In(h);const{relativeKey:p,driver:v}=t(h),b=Object.create(null);if(v.getMeta&&Object.assign(b,await Oi(v.getMeta,p,d)),!d.nativeOnly){const I=await Oi(v.getItem,p+"$",d).then(L=>Gp(L));I&&typeof I=="object"&&(typeof I.atime=="string"&&(I.atime=new Date(I.atime)),typeof I.mtime=="string"&&(I.mtime=new Date(I.mtime)),Object.assign(b,I))}return b},setMeta(h,d,p={}){return this.setItem(h+"$",d,p)},removeMeta(h,d={}){return this.removeItem(h+"$",d)},async getKeys(h,d={}){h=Zp(h);const p=i(h,!0);let v=[];const b=[];for(const I of p){const $=(await Oi(I.driver.getKeys,I.relativeBase,d)).map(K=>I.mountpoint+In(K)).filter(K=>!v.some(P=>K.startsWith(P)));b.push(...$),v=[I.mountpoint,...v.filter(K=>!K.startsWith(I.mountpoint))]}return h?b.filter(I=>I.startsWith(h)&&!I.endsWith("$")):b.filter(I=>!I.endsWith("$"))},async clear(h,d={}){h=Zp(h),await Promise.all(i(h,!1).map(async p=>{if(p.driver.clear)return Oi(p.driver.clear,p.relativeBase,d);if(p.driver.removeItem){const v=await p.driver.getKeys(p.relativeBase||"",d);return Promise.all(v.map(b=>p.driver.removeItem(b,d)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(h=>b6(h)))},async watch(h){return await o(),e.watchListeners.push(h),async()=>{e.watchListeners=e.watchListeners.filter(d=>d!==h),e.watchListeners.length===0&&await s()}},async unwatch(){e.watchListeners=[],await s()},mount(h,d){if(h=Zp(h),h&&e.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(e.mountpoints.push(h),e.mountpoints.sort((p,v)=>v.length-p.length)),e.mounts[h]=d,e.watching&&Promise.resolve(y6(d,n,h)).then(p=>{e.unwatch[h]=p}).catch(console.error),u},async unmount(h,d=!0){h=Zp(h),!(!h||!e.mounts[h])&&(e.watching&&h in e.unwatch&&(e.unwatch[h](),delete e.unwatch[h]),d&&await b6(e.mounts[h]),e.mountpoints=e.mountpoints.filter(p=>p!==h),delete e.mounts[h])},getMount(h=""){h=In(h)+":";const d=t(h);return{driver:d.driver,base:d.base}},getMounts(h="",d={}){return h=In(h),i(h,d.parents).map(v=>({driver:v.driver,base:v.mountpoint}))}};return u}function y6(r,e,t){return r.watch?r.watch((i,n)=>e(i,t+n)):()=>{}}async function b6(r){typeof r.dispose=="function"&&await Oi(r.dispose)}function pu(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function UA(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const i=pu(t);return(n,o)=>i.then(s=>o(s.transaction(e,n).objectStore(e)))}let pv;function g0(){return pv||(pv=UA("keyval-store","keyval")),pv}function _6(r,e=g0()){return e("readonly",t=>pu(t.get(r)))}function LL(r,e,t=g0()){return t("readwrite",i=>(i.put(e,r),pu(i.transaction)))}function jL(r,e=g0()){return e("readwrite",t=>(t.delete(r),pu(t.transaction)))}function FL(r=g0()){return r("readwrite",e=>(e.clear(),pu(e.transaction)))}function zL(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},pu(r.transaction)}function WL(r=g0()){return r("readonly",e=>{if(e.getAllKeys)return pu(e.getAllKeys());const t=[];return zL(e,i=>t.push(i.key)).then(()=>t)})}const HL=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),qL=r=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,n)=>typeof n=="string"&&n.match(/^\d+n$/)?BigInt(n.substring(0,n.length-1)):n)};function m0(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return qL(r)}catch{return r}}function Ma(r){return typeof r=="string"?r:HL(r)||""}const VL="idb-keyval";var KL=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=n=>e+n;let i;return r.dbName&&r.storeName&&(i=UA(r.dbName,r.storeName)),{name:VL,options:r,async hasItem(n){return!(typeof await _6(t(n),i)>"u")},async getItem(n){return await _6(t(n),i)??null},setItem(n,o){return LL(t(n),o,i)},removeItem(n){return jL(t(n),i)},getKeys(){return WL(i)},clear(){return FL(i)}}};const GL="WALLET_CONNECT_V2_INDEXED_DB",ZL="keyvaluestorage";let QL=class{constructor(){this.indexedDb=UL({driver:KL({dbName:GL,storeName:ZL})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,Ma(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var gv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_1={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,i){this[t]=String(i)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(i){t[i]=void 0,delete t[i]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof gv<"u"&&gv.localStorage?_1.exports=gv.localStorage:typeof window<"u"&&window.localStorage?_1.exports=window.localStorage:_1.exports=new e})();function YL(r){var e;return[r[0],m0((e=r[1])!=null?e:"")]}class JL{constructor(){this.localStorage=_1.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(YL)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return m0(t)}async setItem(e,t){this.localStorage.setItem(e,Ma(t))}async removeItem(e){this.localStorage.removeItem(e)}}const XL="wc_storage_version",x6=1,ej=async(r,e,t)=>{const i=XL,n=await e.getItem(i);if(n&&n>=x6){t(e);return}const o=await r.getKeys();if(!o.length){t(e);return}const s=[];for(;o.length;){const a=o.shift();if(!a)continue;const u=a.toLowerCase();if(u.includes("wc@")||u.includes("walletconnect")||u.includes("wc_")||u.includes("wallet_connect")){const h=await r.getItem(a);await e.setItem(a,h),s.push(a)}}await e.setItem(i,x6),t(e),tj(r,s)},tj=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};let rj=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new JL;this.storage=e;try{const t=new QL;ej(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};class gu{}let ij=class extends gu{constructor(e){super()}};const A6=Ye.FIVE_SECONDS,w0={pulse:"heartbeat_pulse"};let nj=class LA extends ij{constructor(e){super(e),this.events=new no.EventEmitter,this.interval=A6,this.interval=(e==null?void 0:e.interval)||A6}static async init(e){const t=new LA(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Ye.toMiliseconds(this.interval))}pulse(){this.events.emit(w0.pulse)}};function oj(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}var sj=aj;function aj(r,e,t){var i=t&&t.stringify||oj,n=1;if(typeof r=="object"&&r!==null){var o=e.length+n;if(o===1)return r;var s=new Array(o);s[0]=i(r);for(var a=1;a-1?p:0,r.charCodeAt(b+1)){case 100:case 102:if(d>=u||e[d]==null)break;p=u||e[d]==null)break;p=u||e[d]===void 0)break;p",p=b+2,b++;break}h+=i(e[d]),p=b+2,b++;break;case 115:if(d>=u)break;p-1&&(o=!1);const s=["error","fatal","warn","info","debug","trace"];typeof t=="function"&&(t.error=t.fatal=t.warn=t.info=t.debug=t.trace=t),r.enabled===!1&&(r.level="silent");const a=r.level||"info",u=Object.create(t);u.log||(u.log=vf),Object.defineProperty(u,"levelVal",{get:d}),Object.defineProperty(u,"level",{get:p,set:v});const h={transmit:e,serialize:n,asObject:r.browser.asObject,levels:s,timestamp:pj(r)};u.levels=Ws.levels,u.level=a,u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=vf,u.serializers=i,u._serialize=n,u._stdErrSerialize=o,u.child=b,e&&(u._logEvent=C2());function d(){return this.level==="silent"?1/0:this.levels.values[this.level]}function p(){return this._level}function v(I){if(I!=="silent"&&!this.levels.values[I])throw Error("unknown level "+I);this._level=I,Ku(h,u,"error","log"),Ku(h,u,"fatal","error"),Ku(h,u,"warn","error"),Ku(h,u,"info","log"),Ku(h,u,"debug","log"),Ku(h,u,"trace","log")}function b(I,L){if(!I)throw new Error("missing bindings for child Pino");L=L||{},n&&I.serializers&&(L.serializers=I.serializers);const $=L.serializers;if(n&&$){var K=Object.assign({},i,$),P=r.browser.serialize===!0?Object.keys(K):n;delete I.serializers,Qg([I],P,K,this._stdErrSerialize)}function q(D){this._childLevel=(D._childLevel|0)+1,this.error=Gu(D,I,"error"),this.fatal=Gu(D,I,"fatal"),this.warn=Gu(D,I,"warn"),this.info=Gu(D,I,"info"),this.debug=Gu(D,I,"debug"),this.trace=Gu(D,I,"trace"),K&&(this.serializers=K,this._serialize=P),e&&(this._logEvent=C2([].concat(D._logEvent.bindings,I)))}return q.prototype=this,new q(this)}return u}Ws.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Ws.stdSerializers=cj;Ws.stdTimeFunctions=Object.assign({},{nullTime:jA,epochTime:FA,unixTime:gj,isoTime:mj});function Ku(r,e,t,i){const n=Object.getPrototypeOf(e);e[t]=e.levelVal>e.levels.values[t]?vf:n[t]?n[t]:wf[t]||wf[i]||vf,uj(r,e,t)}function uj(r,e,t){!r.transmit&&e[t]===vf||(e[t]=function(i){return function(){const o=r.timestamp(),s=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===wf?wf:this;for(var u=0;u-1&&o in t&&(r[n][o]=t[o](r[n][o]))}function Gu(r,e,t){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;nthis.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;t!==null;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}},zA=class{constructor(e,t=ry){this.level=e??"error",this.levelValue=Xu.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new C6(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===Xu.levels.values.error?console.error(e):t===Xu.levels.values.warn?console.warn(e):t===Xu.levels.values.debug?console.debug(e):t===Xu.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Ma({timestamp:new Date().toISOString(),log:e}));const t=typeof e=="string"?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new C6(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(Ma({extraMetadata:e})),new Blob(t,{type:"application/json"})}},bj=class{constructor(e,t=ry){this.baseChunkLogger=new zA(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=t,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}},_j=class{constructor(e,t=ry){this.baseChunkLogger=new zA(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var xj=Object.defineProperty,Aj=Object.defineProperties,Ej=Object.getOwnPropertyDescriptors,S6=Object.getOwnPropertySymbols,Cj=Object.prototype.hasOwnProperty,Sj=Object.prototype.propertyIsEnumerable,I6=(r,e,t)=>e in r?xj(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,U1=(r,e)=>{for(var t in e||(e={}))Cj.call(e,t)&&I6(r,t,e[t]);if(S6)for(var t of S6(e))Sj.call(e,t)&&I6(r,t,e[t]);return r},L1=(r,e)=>Aj(r,Ej(e));function Yg(r){return L1(U1({},r),{level:(r==null?void 0:r.level)||vj.level})}function Ij(r,e=y0){return r[e]||""}function Tj(r,e,t=y0){return r[t]=e,r}function Un(r,e=y0){let t="";return typeof r.bindings>"u"?t=Ij(r,e):t=r.bindings().context||"",t}function Rj(r,e,t=y0){const i=Un(r,t);return i.trim()?`${i}/${e}`:e}function Ln(r,e,t=y0){const i=Rj(r,e,t),n=r.child({context:i});return Tj(n,i,t)}function kj(r){var e,t;const i=new bj((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:v0(L1(U1({},r.opts),{level:"trace",browser:L1(U1({},(t=r.opts)==null?void 0:t.browser),{write:n=>i.write(n)})})),chunkLoggerController:i}}function Oj(r){var e;const t=new _j((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:v0(L1(U1({},r.opts),{level:"trace"}),t),chunkLoggerController:t}}function Pj(r){return typeof r.loggerOverride<"u"&&typeof r.loggerOverride!="string"?{logger:r.loggerOverride,chunkLoggerController:null}:typeof window<"u"?kj(r):Oj(r)}let Dj=class extends gu{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},Nj=class extends gu{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},$j=class{constructor(e,t){this.logger=e,this.core=t}},Mj=class extends gu{constructor(e,t){super(),this.relayer=e,this.logger=t}},Bj=class extends gu{constructor(e){super()}},Uj=class{constructor(e,t,i,n){this.core=e,this.logger=t,this.name=i}},Lj=class extends gu{constructor(e,t){super(),this.relayer=e,this.logger=t}},jj=class extends gu{constructor(e,t){super(),this.core=e,this.logger=t}},Fj=class{constructor(e,t){this.projectId=e,this.logger=t}},zj=class{constructor(e,t){this.projectId=e,this.logger=t}},Wj=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},Hj=class{constructor(e){this.client=e}};var iy={},WA={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Gt,t=oo;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var i=function(){function a(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return a.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},a.prototype.update=function(u,h){if(h===void 0&&(h=u.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var d=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=u[d++],h--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(d=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,u,d,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=u[d++],h--;return this},a.prototype.finish=function(u){if(!this._finished){var h=this._bytesHashed,d=this._bufferLength,p=h/536870912|0,v=h<<3,b=h%128<112?128:256;this._buffer[d]=128;for(var I=d+1;I0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(u){return this._stateHi.set(u.stateHi),this._stateLo.set(u.stateLo),this._bufferLength=u.bufferLength,u.buffer&&this._buffer.set(u.buffer),this._bytesHashed=u.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(u){t.wipe(u.stateHi),t.wipe(u.stateLo),u.buffer&&t.wipe(u.buffer),u.bufferLength=0,u.bytesHashed=0},a}();r.SHA512=i;var n=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(a,u,h,d,p,v,b){for(var I=h[0],L=h[1],$=h[2],K=h[3],P=h[4],q=h[5],D=h[6],U=h[7],F=d[0],_=d[1],x=d[2],M=d[3],j=d[4],V=d[5],Z=d[6],m=d[7],g,w,C,R,k,B,N,y;b>=128;){for(var H=0;H<16;H++){var de=8*H+v;a[H]=e.readUint32BE(p,de),u[H]=e.readUint32BE(p,de+4)}for(var H=0;H<80;H++){var xe=I,O=L,he=$,J=K,re=P,oe=q,E=D,X=U,ve=F,Ee=_,Ce=x,Be=M,ot=j,Ge=V,dr=Z,mt=m;if(g=U,w=m,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=(P>>>14|j<<18)^(P>>>18|j<<14)^(j>>>9|P<<23),w=(j>>>14|P<<18)^(j>>>18|P<<14)^(P>>>9|j<<23),k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,g=P&q^~P&D,w=j&V^~j&Z,k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,g=n[H*2],w=n[H*2+1],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,g=a[H%16],w=u[H%16],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,C=N&65535|y<<16,R=k&65535|B<<16,g=C,w=R,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=(I>>>28|F<<4)^(F>>>2|I<<30)^(F>>>7|I<<25),w=(F>>>28|I<<4)^(I>>>2|F<<30)^(I>>>7|F<<25),k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,g=I&L^I&$^L&$,w=F&_^F&x^_&x,k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,X=N&65535|y<<16,mt=k&65535|B<<16,g=J,w=Be,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=C,w=R,k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,J=N&65535|y<<16,Be=k&65535|B<<16,L=xe,$=O,K=he,P=J,q=re,D=oe,U=E,I=X,_=ve,x=Ee,M=Ce,j=Be,V=ot,Z=Ge,m=dr,F=mt,H%16===15)for(var de=0;de<16;de++)g=a[de],w=u[de],k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=a[(de+9)%16],w=u[(de+9)%16],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,C=a[(de+1)%16],R=u[(de+1)%16],g=(C>>>1|R<<31)^(C>>>8|R<<24)^C>>>7,w=(R>>>1|C<<31)^(R>>>8|C<<24)^(R>>>7|C<<25),k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,C=a[(de+14)%16],R=u[(de+14)%16],g=(C>>>19|R<<13)^(R>>>29|C<<3)^C>>>6,w=(R>>>19|C<<13)^(C>>>29|R<<3)^(R>>>6|C<<26),k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,a[de]=N&65535|y<<16,u[de]=k&65535|B<<16}g=I,w=F,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=h[0],w=d[0],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,h[0]=I=N&65535|y<<16,d[0]=F=k&65535|B<<16,g=L,w=_,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=h[1],w=d[1],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,h[1]=L=N&65535|y<<16,d[1]=_=k&65535|B<<16,g=$,w=x,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=h[2],w=d[2],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,h[2]=$=N&65535|y<<16,d[2]=x=k&65535|B<<16,g=K,w=M,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=h[3],w=d[3],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,h[3]=K=N&65535|y<<16,d[3]=M=k&65535|B<<16,g=P,w=j,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=h[4],w=d[4],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,h[4]=P=N&65535|y<<16,d[4]=j=k&65535|B<<16,g=q,w=V,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=h[5],w=d[5],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,h[5]=q=N&65535|y<<16,d[5]=V=k&65535|B<<16,g=D,w=Z,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=h[6],w=d[6],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,h[6]=D=N&65535|y<<16,d[6]=Z=k&65535|B<<16,g=U,w=m,k=w&65535,B=w>>>16,N=g&65535,y=g>>>16,g=h[7],w=d[7],k+=w&65535,B+=w>>>16,N+=g&65535,y+=g>>>16,B+=k>>>16,N+=B>>>16,y+=N>>>16,h[7]=U=N&65535|y<<16,d[7]=m=k&65535|B<<16,v+=128,b-=128}return v}function s(a){var u=new i;u.update(a);var h=u.digest();return u.clean(),h}r.hash=s})(WA);(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=Yh,t=WA,i=oo;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function n(J){const re=new Float64Array(16);if(J)for(let oe=0;oe>16&1),oe[Ee-1]&=65535;oe[15]=E[15]-32767-(oe[14]>>16&1);const ve=oe[15]>>16&1;oe[14]&=65535,L(E,oe,1-ve)}for(let X=0;X<16;X++)J[2*X]=E[X]&255,J[2*X+1]=E[X]>>8}function K(J,re){let oe=0;for(let E=0;E<32;E++)oe|=J[E]^re[E];return(1&oe-1>>>8)-1}function P(J,re){const oe=new Uint8Array(32),E=new Uint8Array(32);return $(oe,J),$(E,re),K(oe,E)}function q(J){const re=new Uint8Array(32);return $(re,J),re[0]&1}function D(J,re){for(let oe=0;oe<16;oe++)J[oe]=re[2*oe]+(re[2*oe+1]<<8);J[15]&=32767}function U(J,re,oe){for(let E=0;E<16;E++)J[E]=re[E]+oe[E]}function F(J,re,oe){for(let E=0;E<16;E++)J[E]=re[E]-oe[E]}function _(J,re,oe){let E,X,ve=0,Ee=0,Ce=0,Be=0,ot=0,Ge=0,dr=0,mt=0,Qe=0,lt=0,ze=0,Ke=0,xt=0,Fe=0,Ze=0,W=0,A=0,T=0,Q=0,se=0,ue=0,ye=0,Oe=0,Le=0,kt=0,at=0,st=0,Zr=0,lr=0,fr=0,Xi=0,Ot=oe[0],At=oe[1],Ar=oe[2],Pt=oe[3],It=oe[4],gr=oe[5],Mt=oe[6],Bt=oe[7],Er=oe[8],Ut=oe[9],Dt=oe[10],Tr=oe[11],Nt=oe[12],wt=oe[13],Dr=oe[14],Lt=oe[15];E=re[0],ve+=E*Ot,Ee+=E*At,Ce+=E*Ar,Be+=E*Pt,ot+=E*It,Ge+=E*gr,dr+=E*Mt,mt+=E*Bt,Qe+=E*Er,lt+=E*Ut,ze+=E*Dt,Ke+=E*Tr,xt+=E*Nt,Fe+=E*wt,Ze+=E*Dr,W+=E*Lt,E=re[1],Ee+=E*Ot,Ce+=E*At,Be+=E*Ar,ot+=E*Pt,Ge+=E*It,dr+=E*gr,mt+=E*Mt,Qe+=E*Bt,lt+=E*Er,ze+=E*Ut,Ke+=E*Dt,xt+=E*Tr,Fe+=E*Nt,Ze+=E*wt,W+=E*Dr,A+=E*Lt,E=re[2],Ce+=E*Ot,Be+=E*At,ot+=E*Ar,Ge+=E*Pt,dr+=E*It,mt+=E*gr,Qe+=E*Mt,lt+=E*Bt,ze+=E*Er,Ke+=E*Ut,xt+=E*Dt,Fe+=E*Tr,Ze+=E*Nt,W+=E*wt,A+=E*Dr,T+=E*Lt,E=re[3],Be+=E*Ot,ot+=E*At,Ge+=E*Ar,dr+=E*Pt,mt+=E*It,Qe+=E*gr,lt+=E*Mt,ze+=E*Bt,Ke+=E*Er,xt+=E*Ut,Fe+=E*Dt,Ze+=E*Tr,W+=E*Nt,A+=E*wt,T+=E*Dr,Q+=E*Lt,E=re[4],ot+=E*Ot,Ge+=E*At,dr+=E*Ar,mt+=E*Pt,Qe+=E*It,lt+=E*gr,ze+=E*Mt,Ke+=E*Bt,xt+=E*Er,Fe+=E*Ut,Ze+=E*Dt,W+=E*Tr,A+=E*Nt,T+=E*wt,Q+=E*Dr,se+=E*Lt,E=re[5],Ge+=E*Ot,dr+=E*At,mt+=E*Ar,Qe+=E*Pt,lt+=E*It,ze+=E*gr,Ke+=E*Mt,xt+=E*Bt,Fe+=E*Er,Ze+=E*Ut,W+=E*Dt,A+=E*Tr,T+=E*Nt,Q+=E*wt,se+=E*Dr,ue+=E*Lt,E=re[6],dr+=E*Ot,mt+=E*At,Qe+=E*Ar,lt+=E*Pt,ze+=E*It,Ke+=E*gr,xt+=E*Mt,Fe+=E*Bt,Ze+=E*Er,W+=E*Ut,A+=E*Dt,T+=E*Tr,Q+=E*Nt,se+=E*wt,ue+=E*Dr,ye+=E*Lt,E=re[7],mt+=E*Ot,Qe+=E*At,lt+=E*Ar,ze+=E*Pt,Ke+=E*It,xt+=E*gr,Fe+=E*Mt,Ze+=E*Bt,W+=E*Er,A+=E*Ut,T+=E*Dt,Q+=E*Tr,se+=E*Nt,ue+=E*wt,ye+=E*Dr,Oe+=E*Lt,E=re[8],Qe+=E*Ot,lt+=E*At,ze+=E*Ar,Ke+=E*Pt,xt+=E*It,Fe+=E*gr,Ze+=E*Mt,W+=E*Bt,A+=E*Er,T+=E*Ut,Q+=E*Dt,se+=E*Tr,ue+=E*Nt,ye+=E*wt,Oe+=E*Dr,Le+=E*Lt,E=re[9],lt+=E*Ot,ze+=E*At,Ke+=E*Ar,xt+=E*Pt,Fe+=E*It,Ze+=E*gr,W+=E*Mt,A+=E*Bt,T+=E*Er,Q+=E*Ut,se+=E*Dt,ue+=E*Tr,ye+=E*Nt,Oe+=E*wt,Le+=E*Dr,kt+=E*Lt,E=re[10],ze+=E*Ot,Ke+=E*At,xt+=E*Ar,Fe+=E*Pt,Ze+=E*It,W+=E*gr,A+=E*Mt,T+=E*Bt,Q+=E*Er,se+=E*Ut,ue+=E*Dt,ye+=E*Tr,Oe+=E*Nt,Le+=E*wt,kt+=E*Dr,at+=E*Lt,E=re[11],Ke+=E*Ot,xt+=E*At,Fe+=E*Ar,Ze+=E*Pt,W+=E*It,A+=E*gr,T+=E*Mt,Q+=E*Bt,se+=E*Er,ue+=E*Ut,ye+=E*Dt,Oe+=E*Tr,Le+=E*Nt,kt+=E*wt,at+=E*Dr,st+=E*Lt,E=re[12],xt+=E*Ot,Fe+=E*At,Ze+=E*Ar,W+=E*Pt,A+=E*It,T+=E*gr,Q+=E*Mt,se+=E*Bt,ue+=E*Er,ye+=E*Ut,Oe+=E*Dt,Le+=E*Tr,kt+=E*Nt,at+=E*wt,st+=E*Dr,Zr+=E*Lt,E=re[13],Fe+=E*Ot,Ze+=E*At,W+=E*Ar,A+=E*Pt,T+=E*It,Q+=E*gr,se+=E*Mt,ue+=E*Bt,ye+=E*Er,Oe+=E*Ut,Le+=E*Dt,kt+=E*Tr,at+=E*Nt,st+=E*wt,Zr+=E*Dr,lr+=E*Lt,E=re[14],Ze+=E*Ot,W+=E*At,A+=E*Ar,T+=E*Pt,Q+=E*It,se+=E*gr,ue+=E*Mt,ye+=E*Bt,Oe+=E*Er,Le+=E*Ut,kt+=E*Dt,at+=E*Tr,st+=E*Nt,Zr+=E*wt,lr+=E*Dr,fr+=E*Lt,E=re[15],W+=E*Ot,A+=E*At,T+=E*Ar,Q+=E*Pt,se+=E*It,ue+=E*gr,ye+=E*Mt,Oe+=E*Bt,Le+=E*Er,kt+=E*Ut,at+=E*Dt,st+=E*Tr,Zr+=E*Nt,lr+=E*wt,fr+=E*Dr,Xi+=E*Lt,ve+=38*A,Ee+=38*T,Ce+=38*Q,Be+=38*se,ot+=38*ue,Ge+=38*ye,dr+=38*Oe,mt+=38*Le,Qe+=38*kt,lt+=38*at,ze+=38*st,Ke+=38*Zr,xt+=38*lr,Fe+=38*fr,Ze+=38*Xi,X=1,E=ve+X+65535,X=Math.floor(E/65536),ve=E-X*65536,E=Ee+X+65535,X=Math.floor(E/65536),Ee=E-X*65536,E=Ce+X+65535,X=Math.floor(E/65536),Ce=E-X*65536,E=Be+X+65535,X=Math.floor(E/65536),Be=E-X*65536,E=ot+X+65535,X=Math.floor(E/65536),ot=E-X*65536,E=Ge+X+65535,X=Math.floor(E/65536),Ge=E-X*65536,E=dr+X+65535,X=Math.floor(E/65536),dr=E-X*65536,E=mt+X+65535,X=Math.floor(E/65536),mt=E-X*65536,E=Qe+X+65535,X=Math.floor(E/65536),Qe=E-X*65536,E=lt+X+65535,X=Math.floor(E/65536),lt=E-X*65536,E=ze+X+65535,X=Math.floor(E/65536),ze=E-X*65536,E=Ke+X+65535,X=Math.floor(E/65536),Ke=E-X*65536,E=xt+X+65535,X=Math.floor(E/65536),xt=E-X*65536,E=Fe+X+65535,X=Math.floor(E/65536),Fe=E-X*65536,E=Ze+X+65535,X=Math.floor(E/65536),Ze=E-X*65536,E=W+X+65535,X=Math.floor(E/65536),W=E-X*65536,ve+=X-1+37*(X-1),X=1,E=ve+X+65535,X=Math.floor(E/65536),ve=E-X*65536,E=Ee+X+65535,X=Math.floor(E/65536),Ee=E-X*65536,E=Ce+X+65535,X=Math.floor(E/65536),Ce=E-X*65536,E=Be+X+65535,X=Math.floor(E/65536),Be=E-X*65536,E=ot+X+65535,X=Math.floor(E/65536),ot=E-X*65536,E=Ge+X+65535,X=Math.floor(E/65536),Ge=E-X*65536,E=dr+X+65535,X=Math.floor(E/65536),dr=E-X*65536,E=mt+X+65535,X=Math.floor(E/65536),mt=E-X*65536,E=Qe+X+65535,X=Math.floor(E/65536),Qe=E-X*65536,E=lt+X+65535,X=Math.floor(E/65536),lt=E-X*65536,E=ze+X+65535,X=Math.floor(E/65536),ze=E-X*65536,E=Ke+X+65535,X=Math.floor(E/65536),Ke=E-X*65536,E=xt+X+65535,X=Math.floor(E/65536),xt=E-X*65536,E=Fe+X+65535,X=Math.floor(E/65536),Fe=E-X*65536,E=Ze+X+65535,X=Math.floor(E/65536),Ze=E-X*65536,E=W+X+65535,X=Math.floor(E/65536),W=E-X*65536,ve+=X-1+37*(X-1),J[0]=ve,J[1]=Ee,J[2]=Ce,J[3]=Be,J[4]=ot,J[5]=Ge,J[6]=dr,J[7]=mt,J[8]=Qe,J[9]=lt,J[10]=ze,J[11]=Ke,J[12]=xt,J[13]=Fe,J[14]=Ze,J[15]=W}function x(J,re){_(J,re,re)}function M(J,re){const oe=n();let E;for(E=0;E<16;E++)oe[E]=re[E];for(E=253;E>=0;E--)x(oe,oe),E!==2&&E!==4&&_(oe,oe,re);for(E=0;E<16;E++)J[E]=oe[E]}function j(J,re){const oe=n();let E;for(E=0;E<16;E++)oe[E]=re[E];for(E=250;E>=0;E--)x(oe,oe),E!==1&&_(oe,oe,re);for(E=0;E<16;E++)J[E]=oe[E]}function V(J,re){const oe=n(),E=n(),X=n(),ve=n(),Ee=n(),Ce=n(),Be=n(),ot=n(),Ge=n();F(oe,J[1],J[0]),F(Ge,re[1],re[0]),_(oe,oe,Ge),U(E,J[0],J[1]),U(Ge,re[0],re[1]),_(E,E,Ge),_(X,J[3],re[3]),_(X,X,h),_(ve,J[2],re[2]),U(ve,ve,ve),F(Ee,E,oe),F(Ce,ve,X),U(Be,ve,X),U(ot,E,oe),_(J[0],Ee,Ce),_(J[1],ot,Be),_(J[2],Be,Ce),_(J[3],Ee,ot)}function Z(J,re,oe){for(let E=0;E<4;E++)L(J[E],re[E],oe)}function m(J,re){const oe=n(),E=n(),X=n();M(X,re[2]),_(oe,re[0],X),_(E,re[1],X),$(J,E),J[31]^=q(oe)<<7}function g(J,re,oe){b(J[0],s),b(J[1],a),b(J[2],a),b(J[3],s);for(let E=255;E>=0;--E){const X=oe[E/8|0]>>(E&7)&1;Z(J,re,X),V(re,J),V(J,J),Z(J,re,X)}}function w(J,re){const oe=[n(),n(),n(),n()];b(oe[0],d),b(oe[1],p),b(oe[2],a),_(oe[3],d,p),g(J,oe,re)}function C(J){if(J.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const re=(0,t.hash)(J);re[0]&=248,re[31]&=127,re[31]|=64;const oe=new Uint8Array(32),E=[n(),n(),n(),n()];w(E,re),m(oe,E);const X=new Uint8Array(64);return X.set(J),X.set(oe,32),{publicKey:oe,secretKey:X}}r.generateKeyPairFromSeed=C;function R(J){const re=(0,e.randomBytes)(32,J),oe=C(re);return(0,i.wipe)(re),oe}r.generateKeyPair=R;function k(J){if(J.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(J.subarray(32))}r.extractPublicKeyFromSecretKey=k;const B=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function N(J,re){let oe,E,X,ve;for(E=63;E>=32;--E){for(oe=0,X=E-32,ve=E-12;X>4)*B[X],oe=re[X]>>8,re[X]&=255;for(X=0;X<32;X++)re[X]-=oe*B[X];for(E=0;E<32;E++)re[E+1]+=re[E]>>8,J[E]=re[E]&255}function y(J){const re=new Float64Array(64);for(let oe=0;oe<64;oe++)re[oe]=J[oe];for(let oe=0;oe<64;oe++)J[oe]=0;N(J,re)}function H(J,re){const oe=new Float64Array(64),E=[n(),n(),n(),n()],X=(0,t.hash)(J.subarray(0,32));X[0]&=248,X[31]&=127,X[31]|=64;const ve=new Uint8Array(64);ve.set(X.subarray(32),32);const Ee=new t.SHA512;Ee.update(ve.subarray(32)),Ee.update(re);const Ce=Ee.digest();Ee.clean(),y(Ce),w(E,Ce),m(ve,E),Ee.reset(),Ee.update(ve.subarray(0,32)),Ee.update(J.subarray(32)),Ee.update(re);const Be=Ee.digest();y(Be);for(let ot=0;ot<32;ot++)oe[ot]=Ce[ot];for(let ot=0;ot<32;ot++)for(let Ge=0;Ge<32;Ge++)oe[ot+Ge]+=Be[ot]*X[Ge];return N(ve.subarray(32),oe),ve}r.sign=H;function de(J,re){const oe=n(),E=n(),X=n(),ve=n(),Ee=n(),Ce=n(),Be=n();return b(J[2],a),D(J[1],re),x(X,J[1]),_(ve,X,u),F(X,X,J[2]),U(ve,J[2],ve),x(Ee,ve),x(Ce,Ee),_(Be,Ce,Ee),_(oe,Be,X),_(oe,oe,ve),j(oe,oe),_(oe,oe,X),_(oe,oe,ve),_(oe,oe,ve),_(J[0],oe,ve),x(E,J[0]),_(E,E,ve),P(E,X)&&_(J[0],J[0],v),x(E,J[0]),_(E,E,ve),P(E,X)?-1:(q(J[0])===re[31]>>7&&F(J[0],s,J[0]),_(J[3],J[0],J[1]),0)}function xe(J,re,oe){const E=new Uint8Array(32),X=[n(),n(),n(),n()],ve=[n(),n(),n(),n()];if(oe.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(de(ve,J))return!1;const Ee=new t.SHA512;Ee.update(oe.subarray(0,32)),Ee.update(J),Ee.update(re);const Ce=Ee.digest();return y(Ce),g(X,ve,Ce),w(ve,oe.subarray(32)),V(X,ve),m(E,X),!K(oe,E)}r.verify=xe;function O(J){let re=[n(),n(),n(),n()];if(de(re,J))throw new Error("Ed25519: invalid public key");let oe=n(),E=n(),X=re[1];U(oe,a,X),F(E,a,X),M(E,E),_(oe,oe,E);let ve=new Uint8Array(32);return $(ve,oe),ve}r.convertPublicKeyToX25519=O;function he(J){const re=(0,t.hash)(J.subarray(0,32));re[0]&=248,re[31]&=127,re[31]|=64;const oe=new Uint8Array(re.subarray(0,32));return(0,i.wipe)(re),oe}r.convertSecretKeyToX25519=he})(iy);const qj="EdDSA",Vj="JWT",HA=".",qA="base64url",Kj="utf8",Gj="utf8",Zj=":",Qj="did",Yj="key",T6="base58btc",Jj="z",Xj="K36",eF=32;function j1(r){return dn($n(Ma(r),Kj),qA)}function VA(r){const e=$n(Xj,T6),t=Jj+dn(f2([e,r]),T6);return[Qj,Yj,t].join(Zj)}function tF(r){return dn(r,qA)}function rF(r){return $n([j1(r.header),j1(r.payload)].join(HA),Gj)}function iF(r){return[j1(r.header),j1(r.payload),tF(r.signature)].join(HA)}function R6(r=Yh.randomBytes(eF)){return iy.generateKeyPairFromSeed(r)}async function nF(r,e,t,i,n=Ye.fromMiliseconds(Date.now())){const o={alg:qj,typ:Vj},s=VA(i.publicKey),a=n+t,u={iss:s,sub:r,aud:e,iat:n,exp:a},h=rF({header:o,payload:u}),d=iy.sign(i.secretKey,h);return iF({header:o,payload:u,signature:d})}const oF="PARSE_ERROR",sF="INVALID_REQUEST",aF="METHOD_NOT_FOUND",cF="INVALID_PARAMS",KA="INTERNAL_ERROR",ny="SERVER_ERROR",lF=[-32700,-32600,-32601,-32602,-32603],Xd={[oF]:{code:-32700,message:"Parse error"},[sF]:{code:-32600,message:"Invalid Request"},[aF]:{code:-32601,message:"Method not found"},[cF]:{code:-32602,message:"Invalid params"},[KA]:{code:-32603,message:"Internal error"},[ny]:{code:-32e3,message:"Server error"}},GA=ny;function uF(r){return lF.includes(r)}function k6(r){return Object.keys(Xd).includes(r)?Xd[r]:Xd[GA]}function hF(r){const e=Object.values(Xd).find(t=>t.code===r);return e||Xd[GA]}function ZA(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var QA={};/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var S2=function(r,e){return S2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},S2(r,e)};function dF(r,e){S2(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var I2=function(){return I2=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o}function gF(r,e){return function(t,i){e(t,i,r)}}function mF(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function wF(r,e,t,i){function n(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{h(i.next(d))}catch(p){s(p)}}function u(d){try{h(i.throw(d))}catch(p){s(p)}}function h(d){d.done?o(d.value):n(d.value).then(a,u)}h((i=i.apply(r,e||[])).next())})}function vF(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(h){return function(d){return u([h,d])}}function u(h){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(o=h[0]&2?n.return:h[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,h[1])).done)return o;switch(n=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,n=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function YA(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,o=[],s;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(s)throw s.error}}return o}function _F(){for(var r=[],e=0;e1||a(v,b)})})}function a(v,b){try{u(i[v](b))}catch(I){p(o[0][3],I)}}function u(v){v.value instanceof yf?Promise.resolve(v.value.v).then(h,d):p(o[0][2],v)}function h(v){a("next",v)}function d(v){a("throw",v)}function p(v,b){v(b),o.shift(),o.length&&a(o[0][0],o[0][1])}}function EF(r){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=r[n]?function(s){return(t=!t)?{value:yf(r[n](s)),done:n==="return"}:o?o(s):s}:o}}function CF(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof T2=="function"?T2(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=r[o]&&function(s){return new Promise(function(a,u){s=r[o](s),n(a,u,s.done,s.value)})}}function n(o,s,a,u){Promise.resolve(u).then(function(h){o({value:h,done:a})},s)}}function SF(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function IF(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function TF(r){return r&&r.__esModule?r:{default:r}}function RF(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function kF(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const OF=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return I2},__asyncDelegator:EF,__asyncGenerator:AF,__asyncValues:CF,__await:yf,__awaiter:wF,__classPrivateFieldGet:RF,__classPrivateFieldSet:kF,__createBinding:yF,__decorate:pF,__exportStar:bF,__extends:dF,__generator:vF,__importDefault:TF,__importStar:IF,__makeTemplateObject:SF,__metadata:mF,__param:gF,__read:YA,__rest:fF,__spread:_F,__spreadArrays:xF,__values:T2},Symbol.toStringTag,{value:"Module"})),PF=jg(OF);var ba={},O6;function DF(){if(O6)return ba;O6=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.isBrowserCryptoAvailable=ba.getSubtleCrypto=ba.getBrowerCrypto=void 0;function r(){return(ln==null?void 0:ln.crypto)||(ln==null?void 0:ln.msCrypto)||{}}ba.getBrowerCrypto=r;function e(){const i=r();return i.subtle||i.webkitSubtle}ba.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return ba.isBrowserCryptoAvailable=t,ba}var _a={},P6;function NF(){if(P6)return _a;P6=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.isBrowser=_a.isNode=_a.isReactNative=void 0;function r(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}_a.isReactNative=r;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}_a.isNode=e;function t(){return!r()&&!e()}return _a.isBrowser=t,_a}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=PF;e.__exportStar(DF(),r),e.__exportStar(NF(),r)})(QA);function yc(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function Pl(r=6){return BigInt(yc(r))}function dh(r,e,t){return{id:t||yc(),jsonrpc:"2.0",method:r,params:e}}function Jg(r,e){return{id:r,jsonrpc:"2.0",result:e}}function Xg(r,e,t){return{id:r,jsonrpc:"2.0",error:$F(e)}}function $F(r,e){return typeof r>"u"?k6(KA):(typeof r=="string"&&(r=Object.assign(Object.assign({},k6(ny)),{message:r})),uF(r.code)&&(r=hF(r.code)),r)}let MF=class{},BF=class extends MF{constructor(){super()}},UF=class extends BF{constructor(e){super()}};const LF="^https?:",jF="^wss?:";function FF(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function JA(r,e){const t=FF(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function D6(r){return JA(r,LF)}function N6(r){return JA(r,jF)}function zF(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function XA(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function oy(r){return XA(r)&&"method"in r}function em(r){return XA(r)&&(Ds(r)||$o(r))}function Ds(r){return"result"in r}function $o(r){return"error"in r}let Ya=class extends UF{constructor(e){super(e),this.events=new no.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(dh(e.method,e.params||[],e.id||Pl().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(o){n(o)}this.events.on(`${e.id}`,o=>{$o(o)?n(o.error):i(o.result)});try{await this.connection.send(e,t)}catch(o){n(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),em(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const WF=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),HF=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",$6=r=>r.split("?")[0],M6=10,qF=WF();let VF=class{constructor(e){if(this.url=e,this.events=new no.EventEmitter,this.registering=!1,!N6(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Ma(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!N6(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,n)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),n(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return n(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,i)=>{const n=new URLSearchParams(e).get("origin"),o=QA.isReactNative()?{headers:{origin:n}}:{rejectUnauthorized:!zF(e)},s=new qF(e,[],o);HF()?s.onerror=a=>{const u=a;i(this.emitError(u.error))}:s.on("error",a=>{i(this.emitError(a))}),s.onopen=()=>{this.onOpen(s),t(s)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?m0(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),n=i.message||i.toString(),o=Xg(e,n);this.events.emit("payload",o)}parseError(e,t=this.url){return ZA(e,$6(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>M6&&this.events.setMaxListeners(M6)}emitError(e){const t=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${$6(this.url)}`));return this.events.emit("register_error",t),t}};var F1={exports:{}};F1.exports;(function(r,e){var t=200,i="__lodash_hash_undefined__",n=1,o=2,s=9007199254740991,a="[object Arguments]",u="[object Array]",h="[object AsyncFunction]",d="[object Boolean]",p="[object Date]",v="[object Error]",b="[object Function]",I="[object GeneratorFunction]",L="[object Map]",$="[object Number]",K="[object Null]",P="[object Object]",q="[object Promise]",D="[object Proxy]",U="[object RegExp]",F="[object Set]",_="[object String]",x="[object Symbol]",M="[object Undefined]",j="[object WeakMap]",V="[object ArrayBuffer]",Z="[object DataView]",m="[object Float32Array]",g="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",R="[object Int32Array]",k="[object Uint8Array]",B="[object Uint8ClampedArray]",N="[object Uint16Array]",y="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,de=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,O={};O[m]=O[g]=O[w]=O[C]=O[R]=O[k]=O[B]=O[N]=O[y]=!0,O[a]=O[u]=O[V]=O[d]=O[Z]=O[p]=O[v]=O[b]=O[L]=O[$]=O[P]=O[U]=O[F]=O[_]=O[j]=!1;var he=typeof ln=="object"&&ln&&ln.Object===Object&&ln,J=typeof self=="object"&&self&&self.Object===Object&&self,re=he||J||Function("return this")(),oe=e&&!e.nodeType&&e,E=oe&&!0&&r&&!r.nodeType&&r,X=E&&E.exports===oe,ve=X&&he.process,Ee=function(){try{return ve&&ve.binding&&ve.binding("util")}catch{}}(),Ce=Ee&&Ee.isTypedArray;function Be(ne,fe){for(var Re=-1,tt=ne==null?0:ne.length,Ur=0,Wt=[];++Re-1}function go(ne,fe){var Re=this.__data__,tt=ll(Re,ne);return tt<0?(++this.size,Re.push([ne,fe])):Re[tt][1]=fe,this}er.prototype.clear=uo,er.prototype.delete=ho,er.prototype.get=fo,er.prototype.has=po,er.prototype.set=go;function Ai(ne){var fe=-1,Re=ne==null?0:ne.length;for(this.clear();++fehi))return!1;var Lr=Wt.get(ne);if(Lr&&Wt.get(fe))return Lr==fe;var ti=-1,bn=!0,di=Re&o?new Es:void 0;for(Wt.set(ne,fe),Wt.set(fe,ne);++ti-1&&ne%1==0&&ne-1&&ne%1==0&&ne<=s}function rp(ne){var fe=typeof ne;return ne!=null&&(fe=="object"||fe=="function")}function dl(ne){return ne!=null&&typeof ne=="object"}var ip=Ce?mt(Ce):H0;function jm(ne){return Um(ne)?z0(ne):q0(ne)}function Br(){return[]}function Nr(){return!1}r.exports=Lm})(F1,F1.exports);var KF=F1.exports;const GF=ea(KF);function ZF(r,e){return e=e||{},new Promise(function(t,i){var n=new XMLHttpRequest,o=[],s=[],a={},u=function(){return{ok:(n.status/100|0)==2,statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return s},get:function(d){return a[d.toLowerCase()]},has:function(d){return d.toLowerCase()in a}}}};for(var h in n.open(e.method||"get",r,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,p,v){o.push(p=p.toLowerCase()),s.push([p,v]),a[p]=a[p]?a[p]+","+v:v}),t(u())},n.onerror=i,n.withCredentials=e.credentials=="include",e.headers)n.setRequestHeader(h,e.headers[h]);n.send(e.body||null)})}const QF=Object.freeze(Object.defineProperty({__proto__:null,default:ZF},Symbol.toStringTag,{value:"Module"})),B6=jg(QF);var YF=self.fetch||(self.fetch=B6.default||B6);const JF=ea(YF);var XF={};function ez(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i>>0,D=new Uint8Array(q);K!==P;){for(var U=I[K],F=0,_=q-1;(U!==0||F<$)&&_!==-1;_--,F++)U+=256*D[_]>>>0,D[_]=U%a>>>0,U=U/a>>>0;if(U!==0)throw new Error("Non-zero carry");$=F,K++}for(var x=q-$;x!==q&&D[x]===0;)x++;for(var M=u.repeat(L);x>>0,q=new Uint8Array(P);I[L];){var D=t[I.charCodeAt(L)];if(D===255)return;for(var U=0,F=P-1;(D!==0||U>>0,q[F]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");K=U,L++}if(I[L]!==" "){for(var _=P-K;_!==P&&q[_]===0;)_++;for(var x=new Uint8Array($+(P-_)),M=$;_!==P;)x[M++]=q[_++];return x}}}function b(I){var L=v(I);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:v,decode:b}}var tz=ez,rz=tz;const eE=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},iz=r=>new TextEncoder().encode(r),nz=r=>new TextDecoder().decode(r);class oz{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}let sz=class{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return tE(this,e)}},az=class{constructor(e){this.decoders=e}or(e){return tE(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const tE=(r,e)=>new az({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});let cz=class{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new oz(e,t,i),this.decoder=new sz(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const tm=({name:r,prefix:e,encode:t,decode:i})=>new cz(r,e,t,i),b0=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=rz(t,e);return tm({prefix:r,name:e,encode:i,decode:o=>eE(n(o))})},lz=(r,e,t,i)=>{const n={};for(let d=0;d=8&&(a-=8,s[h++]=255&u>>a)}if(a>=t||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},uz=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<t;)s-=t,o+=e[n&a>>s];if(s&&(o+=e[n&a<tm({prefix:e,name:r,encode(n){return uz(n,i,t)},decode(n){return lz(n,i,t,r)}}),hz=tm({prefix:"\0",name:"identity",encode:r=>nz(r),decode:r=>iz(r)});var dz=Object.freeze({__proto__:null,identity:hz});const fz=zi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var pz=Object.freeze({__proto__:null,base2:fz});const gz=zi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var mz=Object.freeze({__proto__:null,base8:gz});const wz=b0({prefix:"9",name:"base10",alphabet:"0123456789"});var vz=Object.freeze({__proto__:null,base10:wz});const yz=zi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),bz=zi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var _z=Object.freeze({__proto__:null,base16:yz,base16upper:bz});const xz=zi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Az=zi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ez=zi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Cz=zi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Sz=zi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Iz=zi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Tz=zi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Rz=zi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kz=zi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Oz=Object.freeze({__proto__:null,base32:xz,base32upper:Az,base32pad:Ez,base32padupper:Cz,base32hex:Sz,base32hexupper:Iz,base32hexpad:Tz,base32hexpadupper:Rz,base32z:kz});const Pz=b0({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Dz=b0({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Nz=Object.freeze({__proto__:null,base36:Pz,base36upper:Dz});const $z=b0({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Mz=b0({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Bz=Object.freeze({__proto__:null,base58btc:$z,base58flickr:Mz});const Uz=zi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Lz=zi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),jz=zi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Fz=zi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var zz=Object.freeze({__proto__:null,base64:Uz,base64pad:Lz,base64url:jz,base64urlpad:Fz});const rE=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Wz=rE.reduce((r,e,t)=>(r[t]=e,r),[]),Hz=rE.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function qz(r){return r.reduce((e,t)=>(e+=Wz[t],e),"")}function Vz(r){const e=[];for(const t of r){const i=Hz[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const Kz=tm({prefix:"🚀",name:"base256emoji",encode:qz,decode:Vz});var Gz=Object.freeze({__proto__:null,base256emoji:Kz}),Zz=iE,U6=128,Qz=127,Yz=~Qz,Jz=Math.pow(2,31);function iE(r,e,t){e=e||[],t=t||0;for(var i=t;r>=Jz;)e[t++]=r&255|U6,r/=128;for(;r&Yz;)e[t++]=r&255|U6,r>>>=7;return e[t]=r|0,iE.bytes=t-i+1,e}var Xz=R2,eW=128,L6=127;function R2(r,i){var t=0,i=i||0,n=0,o=i,s,a=r.length;do{if(o>=a)throw R2.bytes=0,new RangeError("Could not decode varint");s=r[o++],t+=n<28?(s&L6)<=eW);return R2.bytes=o-i,t}var tW=Math.pow(2,7),rW=Math.pow(2,14),iW=Math.pow(2,21),nW=Math.pow(2,28),oW=Math.pow(2,35),sW=Math.pow(2,42),aW=Math.pow(2,49),cW=Math.pow(2,56),lW=Math.pow(2,63),uW=function(r){return r(nE.encode(r,e,t),e),F6=r=>nE.encodingLength(r),k2=(r,e)=>{const t=e.byteLength,i=F6(r),n=i+F6(t),o=new Uint8Array(n+t);return j6(r,o,0),j6(t,o,i),o.set(e,n),new dW(r,t,e,o)};class dW{constructor(e,t,i,n){this.code=e,this.size=t,this.digest=i,this.bytes=n}}const oE=({name:r,code:e,encode:t})=>new fW(r,e,t);class fW{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?k2(this.code,t):t.then(i=>k2(this.code,i))}else throw Error("Unknown type, must be binary type")}}const sE=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),pW=oE({name:"sha2-256",code:18,encode:sE("SHA-256")}),gW=oE({name:"sha2-512",code:19,encode:sE("SHA-512")});var mW=Object.freeze({__proto__:null,sha256:pW,sha512:gW});const aE=0,wW="identity",cE=eE,vW=r=>k2(aE,cE(r)),yW={code:aE,name:wW,encode:cE,digest:vW};var bW=Object.freeze({__proto__:null,identity:yW});new TextEncoder,new TextDecoder;const z6={...dz,...pz,...mz,...vz,..._z,...Oz,...Nz,...Bz,...zz,...Gz};({...mW,...bW});function _W(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function lE(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const W6=lE("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),wv=lE("ascii","a",r=>{let e="a";for(let t=0;t{r=r.substring(1);const e=_W(r.length);for(let t=0;t{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,n)=>{this.isInitialized(),this.keychain.set(i,n),await this.persist()},this.get=i=>{this.isInitialized();const n=this.keychain.get(i);if(typeof n>"u"){const{message:o}=je("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(o)}return n},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=Ln(t,this.name)}get context(){return Un(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,qx(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Vx(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}}class rH{constructor(e,t,i){this.core=e,this.logger=t,this.name=IW,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=n=>(this.isInitialized(),this.keychain.has(n)),this.getClientId=async()=>{this.isInitialized();const n=await this.getClientSeed(),o=R6(n);return VA(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const n=SU();return this.setPrivateKey(n.publicKey,n.privateKey)},this.signJWT=async n=>{this.isInitialized();const o=await this.getClientSeed(),s=R6(o),a=x2();return await nF(a,n,TW,s)},this.generateSharedKey=(n,o,s)=>{this.isInitialized();const a=this.getPrivateKey(n),u=IU(a,o);return this.setSymKey(u,s)},this.setSymKey=async(n,o)=>{this.isInitialized();const s=o||y1(n);return await this.keychain.set(s,n),s},this.deleteKeyPair=async n=>{this.isInitialized(),await this.keychain.del(n)},this.deleteSymKey=async n=>{this.isInitialized(),await this.keychain.del(n)},this.encode=async(n,o,s)=>{this.isInitialized();const a=NA(s),u=Ma(o);if(c6(a)){const v=a.senderPublicKey,b=a.receiverPublicKey;n=await this.generateSharedKey(v,b)}const h=this.getSymKey(n),{type:d,senderPublicKey:p}=a;return RU({type:d,symKey:h,message:u,senderPublicKey:p})},this.decode=async(n,o,s)=>{this.isInitialized();const a=PU(o,s);if(c6(a)){const u=a.receiverPublicKey,h=a.senderPublicKey;n=await this.generateSharedKey(u,h)}try{const u=this.getSymKey(n),h=kU({symKey:u,encoded:o});return m0(h)}catch(u){this.logger.error(`Failed to decode message from topic: '${n}', clientId: '${await this.getClientId()}'`),this.logger.error(u)}},this.getPayloadType=n=>{const o=M1(n);return p0(o.type)},this.getPayloadSenderPublicKey=n=>{const o=M1(n);return o.senderPublicKey?dn(o.senderPublicKey,hn):void 0},this.core=e,this.logger=Ln(t,this.name),this.keychain=i||new tH(this.core,this.logger)}get context(){return Un(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(H6)}catch{e=x2(),await this.keychain.set(H6,e)}return AW(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}}class iH extends $j{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=OW,this.version=PW,this.initialized=!1,this.storagePrefix=Mc,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,n)=>{this.isInitialized();const o=Ol(n);let s=this.messages.get(i);return typeof s>"u"&&(s={}),typeof s[o]<"u"||(s[o]=n,this.messages.set(i,s),await this.persist()),o},this.get=i=>{this.isInitialized();let n=this.messages.get(i);return typeof n>"u"&&(n={}),n},this.has=(i,n)=>{this.isInitialized();const o=this.get(i),s=Ol(n);return typeof o[s]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=Ln(e,this.name),this.core=t}get context(){return Un(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,qx(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Vx(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}}class nH extends Mj{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new no.EventEmitter,this.name=NW,this.queue=new Map,this.publishTimeout=Ye.toMiliseconds(Ye.ONE_MINUTE),this.failedPublishTimeout=Ye.toMiliseconds(Ye.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,n,o)=>{var s;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:n,opts:o}});const a=(o==null?void 0:o.ttl)||DW,u=A2(o),h=(o==null?void 0:o.prompt)||!1,d=(o==null?void 0:o.tag)||0,p=(o==null?void 0:o.id)||Pl().toString(),v={topic:i,message:n,opts:{ttl:a,relay:u,prompt:h,tag:d,id:p}},b=`Failed to publish payload, please try again. id:${p} tag:${d}`,I=Date.now();let L,$=1;try{for(;L===void 0;){if(Date.now()-I>this.publishTimeout)throw new Error(b);this.logger.trace({id:p,attempts:$},`publisher.publish - attempt ${$}`),L=await await lh(this.rpcPublish(i,n,a,u,h,d,p).catch(K=>this.logger.warn(K)),this.publishTimeout,b),$++,L||await new Promise(K=>setTimeout(K,this.failedPublishTimeout))}this.relayer.events.emit(Nn.publish,v),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:p,topic:i,message:n,opts:o}})}catch(K){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(K),(s=o==null?void 0:o.internal)!=null&&s.throwOnFailedPublish)throw K;this.queue.set(p,v)}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.relayer=e,this.logger=Ln(t,this.name),this.registerEventListeners()}get context(){return Un(this.logger)}rpcPublish(e,t,i,n,o,s,a){var u,h,d,p;const v={method:qd(n.protocol).publish,params:{topic:e,message:t,ttl:i,prompt:o,tag:s},id:a};return Dn((u=v.params)==null?void 0:u.prompt)&&((h=v.params)==null||delete h.prompt),Dn((d=v.params)==null?void 0:d.tag)&&((p=v.params)==null||delete p.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:v}),this.relayer.request(v)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:i,opts:n}=e;await this.publish(t,i,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(w0.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Nn.connection_stalled);return}this.checkQueue()}),this.relayer.on(Nn.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class oH{constructor(){this.map=new Map,this.set=(e,t)=>{const i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,t))return;const n=i.filter(o=>o!==t);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var sH=Object.defineProperty,aH=Object.defineProperties,cH=Object.getOwnPropertyDescriptors,V6=Object.getOwnPropertySymbols,lH=Object.prototype.hasOwnProperty,uH=Object.prototype.propertyIsEnumerable,K6=(r,e,t)=>e in r?sH(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ud=(r,e)=>{for(var t in e||(e={}))lH.call(e,t)&&K6(r,t,e[t]);if(V6)for(var t of V6(e))uH.call(e,t)&&K6(r,t,e[t]);return r},yv=(r,e)=>aH(r,cH(e));class hH extends Lj{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new oH,this.events=new no.EventEmitter,this.name=WW,this.version=HW,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Mc,this.subscribeTimeout=Ye.toMiliseconds(Ye.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}});try{const o=A2(n),s={topic:i,relay:o};this.pending.set(i,s);const a=await this.rpcSubscribe(i,o);return typeof a=="string"&&(this.onSubscribe(a,s),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}})),a}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},this.unsubscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),typeof(n==null?void 0:n.id)<"u"?await this.unsubscribeById(i,n.id,n):await this.unsubscribeByTopic(i,n)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const n=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((o,s)=>{const a=new Ye.Watch;a.start(n);const u=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(u),a.stop(n),o(!0)),a.elapsed(n)>=qW&&(clearInterval(u),a.stop(n),s(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Ln(t,this.name),this.clientId=""}get context(){return Un(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const i=this.topicMap.get(e);await Promise.all(i.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}});try{const n=A2(i);await this.rpcUnsubscribe(e,t,n);const o=Pr("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}})}catch(n){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(n),n}}async rpcSubscribe(e,t){const i={method:qd(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await lh(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)?Ol(e+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Nn.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,i={method:qd(t.protocol).batchSubscribe,params:{topics:e.map(n=>n.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await lh(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)}catch{this.relayer.events.emit(Nn.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t=e[0].relay,i={method:qd(t.protocol).batchFetchMessages,params:{topics:e.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let n;try{n=await await lh(this.relayer.request(i).catch(o=>this.logger.warn(o)),this.subscribeTimeout)}catch{this.relayer.events.emit(Nn.connection_stalled)}return n}rpcUnsubscribe(e,t,i){const n={method:qd(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,yv(Ud({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,Ud({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,Ud({},t)),this.topicMap.set(t.topic,e),this.events.emit(Ns.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:i}=je("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(Ns.deleted,yv(Ud({},i),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Ns.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=je("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);Hs(t)&&this.onBatchSubscribe(t.map((i,n)=>yv(Ud({},e[n]),{id:i})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(w0.pulse,async()=>{await this.checkPending()}),this.events.on(Ns.created,async e=>{const t=Ns.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(Ns.deleted,async e=>{const t=Ns.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var dH=Object.defineProperty,G6=Object.getOwnPropertySymbols,fH=Object.prototype.hasOwnProperty,pH=Object.prototype.propertyIsEnumerable,Z6=(r,e,t)=>e in r?dH(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,gH=(r,e)=>{for(var t in e||(e={}))fH.call(e,t)&&Z6(r,t,e[t]);if(G6)for(var t of G6(e))pH.call(e,t)&&Z6(r,t,e[t]);return r};class mH extends Bj{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new no.EventEmitter,this.name=MW,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=Ye.toMiliseconds(Ye.THIRTY_SECONDS+Ye.ONE_SECOND),this.request=async t=>{var i,n;this.logger.debug("Publishing Request Payload");const o=t.id||Pl().toString();await this.toEstablishConnection();try{const s=this.provider.request(t);this.requestsInFlight.set(o,{promise:s,request:t}),this.logger.trace({id:o,method:t.method,topic:(i=t.params)==null?void 0:i.topic},"relayer.request - attempt to publish...");const a=await new Promise(async(u,h)=>{const d=()=>{h(new Error(`relayer.request - publish interrupted, id: ${o}`))};this.provider.on(So.disconnect,d);const p=await s;this.provider.off(So.disconnect,d),u(p)});return this.logger.trace({id:o,method:t.method,topic:(n=t.params)==null?void 0:n.topic},"relayer.request - published"),a}catch(s){throw this.logger.debug(`Failed to Publish Request: ${o}`),s}finally{this.requestsInFlight.delete(o)}},this.resetPingTimeout=()=>{if(ff())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,i,n;(n=(i=(t=this.provider)==null?void 0:t.connection)==null?void 0:i.socket)==null||n.terminate()},this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.startPingTimeout(),this.events.emit(Nn.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(Nn.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(So.payload,this.onPayloadHandler),this.provider.on(So.connect,this.onConnectHandler),this.provider.on(So.disconnect,this.onDisconnectHandler),this.provider.on(So.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Ln(e.logger,this.name):v0(Yg({level:e.logger||$W})),this.messages=new iH(this.logger,e.core),this.subscriber=new hH(this,this.logger),this.publisher=new nH(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||dE,this.projectId=e.projectId,this.bundleId=w$(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${q6}...`),await this.restartTransport(q6)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},jW)}get context(){return Un(this.logger)}get connected(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===1}get connecting(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===0}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var i;this.isInitialized();let n=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"",o;const s=a=>{a.topic===e&&(this.subscriber.off(Ns.created,s),o())};return await Promise.all([new Promise(a=>{o=a,this.subscriber.on(Ns.created,s)}),new Promise(async a=>{n=await this.subscriber.subscribe(e,t)||n,a()})]),n}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await lh(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(t,i)=>{const n=()=>{this.provider.off(So.disconnect,n),i(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(So.disconnect,n),await lh(this.provider.connect(),Ye.toMiliseconds(Ye.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{i(o)}),await this.subscriber.start(),this.hasExperiencedNetworkDisruption=!1,t()})}catch(t){this.logger.error(t);const i=t;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(i.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await v6())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const t=e.sort((i,n)=>i.publishedAt-n.publishedAt);this.logger.trace(`Batch of ${t.length} message events sorted`);for(const i of t)try{await this.onMessageEvent(i)}catch(n){this.logger.warn(n)}this.logger.trace(`Batch of ${t.length} message events processed`)}startPingTimeout(){var e,t,i,n,o;if(ff())try{(t=(e=this.provider)==null?void 0:e.connection)!=null&&t.socket&&((o=(n=(i=this.provider)==null?void 0:i.connection)==null?void 0:n.socket)==null||o.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(s){this.logger.warn(s)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ya(new VF(A$({sdkVersion:LW,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:i}=e;await this.messages.set(t,i)}async shouldIgnoreMessageEvent(e){const{topic:t,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const n=this.messages.has(t,i);return n&&this.logger.debug(`Ignoring duplicate message: ${i}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),oy(e)){if(!e.method.endsWith(BW))return;const t=e.params,{topic:i,message:n,publishedAt:o}=t.data,s={topic:i,message:n,publishedAt:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(gH({type:"event",event:t.id},s)),this.events.emit(t.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else em(e)&&this.events.emit(Nn.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Nn.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Jg(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(So.payload,this.onPayloadHandler),this.provider.off(So.connect,this.onConnectHandler),this.provider.off(So.disconnect,this.onDisconnectHandler),this.provider.off(So.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await v6();xL(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Nn.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},Ye.toMiliseconds(UW))}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var wH=Object.defineProperty,Q6=Object.getOwnPropertySymbols,vH=Object.prototype.hasOwnProperty,yH=Object.prototype.propertyIsEnumerable,Y6=(r,e,t)=>e in r?wH(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,J6=(r,e)=>{for(var t in e||(e={}))vH.call(e,t)&&Y6(r,t,e[t]);if(Q6)for(var t of Q6(e))yH.call(e,t)&&Y6(r,t,e[t]);return r};class mu extends Uj{constructor(e,t,i,n=Mc,o=void 0){super(e,t,i,n),this.core=e,this.logger=t,this.name=i,this.map=new Map,this.version=FW,this.cached=[],this.initialized=!1,this.storagePrefix=Mc,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{this.getKey&&s!==null&&!Dn(s)?this.map.set(this.getKey(s),s):XU(s)?this.map.set(s.id,s):eL(s)&&this.map.set(s.topic,s)}),this.cached=[],this.initialized=!0)},this.set=async(s,a)=>{this.isInitialized(),this.map.has(s)?await this.update(s,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:a}),this.map.set(s,a),await this.persist())},this.get=s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s)),this.getAll=s=>(this.isInitialized(),s?this.values.filter(a=>Object.keys(s).every(u=>GF(a[u],s[u]))):this.values),this.update=async(s,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:a});const u=J6(J6({},this.getData(s)),a);this.map.set(s,u),await this.persist()},this.delete=async(s,a)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:a}),this.map.delete(s),this.addToRecentlyDeleted(s),await this.persist())},this.logger=Ln(t,this.name),this.storagePrefix=n,this.getKey=o}get context(){return Un(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:n}=je("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}const{message:i}=je("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=je("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}}class bH{constructor(e,t){this.core=e,this.logger=t,this.name=VW,this.version=KW,this.events=new L3,this.initialized=!1,this.storagePrefix=Mc,this.ignoredPayloadTypes=[$c],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const n=x2(),o=await this.core.crypto.setSymKey(n),s=Li(Ye.FIVE_MINUTES),a={protocol:hE},u={topic:o,expiry:s,relay:a,active:!1},h=WU({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:n,relay:a,expiryTimestamp:s,methods:i==null?void 0:i.methods});return this.core.expirer.set(o,s),await this.pairings.set(o,u),await this.core.relayer.subscribe(o),{topic:o,uri:h}},this.pair=async i=>{this.isInitialized(),this.isValidPair(i);const{topic:n,symKey:o,relay:s,expiryTimestamp:a,methods:u}=d6(i.uri);let h;if(this.pairings.keys.includes(n)&&(h=this.pairings.get(n),h.active))throw new Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);const d=a||Li(Ye.FIVE_MINUTES),p={topic:n,relay:s,expiry:d,active:!1,methods:u};return this.core.expirer.set(n,d),await this.pairings.set(n,p),i.activatePairing&&await this.activate({topic:n}),this.events.emit(oh.create,p),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(o,n),await this.core.relayer.subscribe(n,{relay:s}),p},this.activate=async({topic:i})=>{this.isInitialized();const n=Li(Ye.THIRTY_DAYS);this.core.expirer.set(i,n),await this.pairings.update(i,{active:!0,expiry:n})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.pairings.keys.includes(n)){const o=await this.sendRequest(n,"wc_pairingPing",{}),{done:s,resolve:a,reject:u}=Rl();this.events.once(ir("pairing_ping",o),({error:h})=>{h?u(h):a()}),await s()}},this.updateExpiry=async({topic:i,expiry:n})=>{this.isInitialized(),await this.pairings.update(i,{expiry:n})},this.updateMetadata=async({topic:i,metadata:n})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:n})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;this.pairings.keys.includes(n)&&(await this.sendRequest(n,"wc_pairingDelete",Pr("USER_DISCONNECTED")),await this.deletePairing(n))},this.sendRequest=async(i,n,o)=>{const s=dh(n,o),a=await this.core.crypto.encode(i,s),u=Bd[n].req;return this.core.history.set(i,s),this.core.relayer.publish(i,a,u),s.id},this.sendResult=async(i,n,o)=>{const s=Jg(i,o),a=await this.core.crypto.encode(n,s),u=await this.core.history.get(n,i),h=Bd[u.request.method].res;await this.core.relayer.publish(n,a,h),await this.core.history.resolve(s)},this.sendError=async(i,n,o)=>{const s=Xg(i,o),a=await this.core.crypto.encode(n,s),u=await this.core.history.get(n,i),h=Bd[u.request.method]?Bd[u.request.method].res:Bd.unregistered_method.res;await this.core.relayer.publish(n,a,h),await this.core.history.resolve(s)},this.deletePairing=async(i,n)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,Pr("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),n?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(n=>wc(n.expiry));await Promise.all(i.map(n=>this.deletePairing(n.topic)))},this.onRelayEventRequest=i=>{const{topic:n,payload:o}=i;switch(o.method){case"wc_pairingPing":return this.onPairingPingRequest(n,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(n,o);default:return this.onUnknownRpcMethodRequest(n,o)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:o}=i,s=(await this.core.history.get(n,o.id)).request.method;switch(s){case"wc_pairingPing":return this.onPairingPingResponse(n,o);default:return this.onUnknownRpcMethodResponse(s)}},this.onPairingPingRequest=async(i,n)=>{const{id:o}=n;try{this.isValidPing({topic:i}),await this.sendResult(o,i,!0),this.events.emit(oh.ping,{id:o,topic:i})}catch(s){await this.sendError(o,i,s),this.logger.error(s)}},this.onPairingPingResponse=(i,n)=>{const{id:o}=n;setTimeout(()=>{Ds(n)?this.events.emit(ir("pairing_ping",o),{}):$o(n)&&this.events.emit(ir("pairing_ping",o),{error:n.error})},500)},this.onPairingDeleteRequest=async(i,n)=>{const{id:o}=n;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(oh.delete,{id:o,topic:i})}catch(s){await this.sendError(o,i,s),this.logger.error(s)}},this.onUnknownRpcMethodRequest=async(i,n)=>{const{id:o,method:s}=n;try{if(this.registeredMethods.includes(s))return;const a=Pr("WC_METHOD_UNSUPPORTED",s);await this.sendError(o,i,a),this.logger.error(a)}catch(a){await this.sendError(o,i,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error(Pr("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=i=>{var n;if(!Rn(i)){const{message:s}=je("MISSING_OR_INVALID",`pair() params: ${i}`);throw new Error(s)}if(!JU(i.uri)){const{message:s}=je("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw new Error(s)}const o=d6(i.uri);if(!((n=o==null?void 0:o.relay)!=null&&n.protocol)){const{message:s}=je("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(s)}if(!(o!=null&&o.symKey)){const{message:s}=je("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(s)}if(o!=null&&o.expiryTimestamp&&Ye.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!Rn(i)){const{message:o}=je("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(o)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidDisconnect=async i=>{if(!Rn(i)){const{message:o}=je("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(o)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidPairingTopic=async i=>{if(!si(i,!1)){const{message:n}=je("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(n)}if(!this.pairings.keys.includes(i)){const{message:n}=je("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(n)}if(wc(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:n}=je("EXPIRED",`pairing topic: ${i}`);throw new Error(n)}},this.core=e,this.logger=Ln(t,this.name),this.pairings=new mu(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Un(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Nn.message,async e=>{const{topic:t,message:i}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const n=await this.core.crypto.decode(t,i);try{oy(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):em(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:t,payload:n}),this.core.history.delete(t,n.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(Po.expired,async e=>{const{topic:t}=Gx(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(oh.expire,{topic:t}))})}}class _H extends Nj{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new no.EventEmitter,this.name=GW,this.version=ZW,this.cached=[],this.initialized=!1,this.storagePrefix=Mc,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,n,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:n,chainId:o}),this.records.has(n.id))return;const s={id:n.id,topic:i,request:{method:n.method,params:n.params||null},chainId:o,expiry:Li(Ye.THIRTY_DAYS)};this.records.set(s.id,s),this.persist(),this.events.emit(ts.created,s)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const n=await this.getRecord(i.id);typeof n.response>"u"&&(n.response=$o(i)?{error:i.error}:{result:i.result},this.records.set(n.id,n),this.persist(),this.events.emit(ts.updated,n))},this.get=async(i,n)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:n}),await this.getRecord(n)),this.delete=(i,n)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:n}),this.values.forEach(o=>{if(o.topic===i){if(typeof n<"u"&&o.id!==n)return;this.records.delete(o.id),this.events.emit(ts.deleted,o)}}),this.persist()},this.exists=async(i,n)=>(this.isInitialized(),this.records.has(n)?(await this.getRecord(n)).topic===i:!1),this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=Ln(t,this.name)}get context(){return Un(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const i={topic:t.topic,request:dh(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:i}=je("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ts.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=je("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(ts.created,e=>{const t=ts.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(ts.updated,e=>{const t=ts.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(ts.deleted,e=>{const t=ts.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(w0.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{Ye.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(ts.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}}class xH extends jj{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new no.EventEmitter,this.name=QW,this.version=YW,this.cached=[],this.initialized=!1,this.storagePrefix=Mc,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const n=this.formatTarget(i);return typeof this.getExpiration(n)<"u"}catch{return!1}},this.set=(i,n)=>{this.isInitialized();const o=this.formatTarget(i),s={target:o,expiry:n};this.expirations.set(o,s),this.checkExpiry(o,s),this.events.emit(Po.created,{target:o,expiration:s})},this.get=i=>{this.isInitialized();const n=this.formatTarget(i);return this.getExpiration(n)},this.del=i=>{if(this.isInitialized(),this.has(i)){const n=this.formatTarget(i),o=this.getExpiration(n);this.expirations.delete(n),this.events.emit(Po.deleted,{target:n,expiration:o})}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=Ln(t,this.name)}get context(){return Un(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return E$(e);if(typeof e=="number")return C$(e);const{message:t}=je("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Po.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=je("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:i}=je("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return t}checkExpiry(e,t){const{expiry:i}=t;Ye.toMiliseconds(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Po.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(w0.pulse,()=>this.checkExpirations()),this.events.on(Po.created,e=>{const t=Po.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Po.expired,e=>{const t=Po.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Po.deleted,e=>{const t=Po.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}}}class AH extends Fj{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=vv,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async i=>{if(this.verifyDisabled||Jh()||!Xh())return;const n=this.getVerifyUrl(i==null?void 0:i.verifyUrl);this.verifyUrl!==n&&this.removeIframe(),this.verifyUrl=n;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o)}if(!this.initialized){this.removeIframe(),this.verifyUrl=O2;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o),this.verifyDisabled=!0}}},this.register=async i=>{this.initialized?this.sendPost(i.attestationId):(this.addToQueue(i.attestationId),await this.init())},this.resolve=async i=>{if(this.isDevEnv)return"";const n=this.getVerifyUrl(i==null?void 0:i.verifyUrl);let o;try{o=await this.fetchAttestation(i.attestationId,n)}catch(s){this.logger.info(`failed to resolve attestation: ${i.attestationId} from url: ${n}`),this.logger.info(s),o=await this.fetchAttestation(i.attestationId,O2)}return o},this.fetchAttestation=async(i,n)=>{this.logger.info(`resolving attestation: ${i} from url: ${n}`);const o=this.startAbortTimer(Ye.ONE_SECOND*2),s=await fetch(`${n}/attestation/${i}`,{signal:this.abortController.signal});return clearTimeout(o),s.status===200?await s.json():void 0},this.addToQueue=i=>{this.queue.push(i)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(i=>this.sendPost(i)),this.queue=[])},this.sendPost=i=>{var n;try{if(!this.iframe)return;(n=this.iframe.contentWindow)==null||n.postMessage(i,"*"),this.logger.info(`postMessage sent: ${i} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let i;const n=o=>{o.data==="verify_ready"&&(this.onInit(),window.removeEventListener("message",n),i())};await Promise.race([new Promise(o=>{const s=document.getElementById(vv);if(s)return this.iframe=s,this.onInit(),o();window.addEventListener("message",n);const a=document.createElement("iframe");a.id=vv,a.src=`${this.verifyUrl}/${this.projectId}`,a.style.display="none",document.body.append(a),this.iframe=a,i=o}),new Promise((o,s)=>setTimeout(()=>{window.removeEventListener("message",n),s("verify iframe load timeout")},Ye.toMiliseconds(Ye.FIVE_SECONDS)))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=i=>{let n=i||sh;return JW.includes(n)||(this.logger.info(`verify url: ${n}, not included in trusted list, assigning default: ${sh}`),n=sh),n},this.logger=Ln(t,this.name),this.verifyUrl=sh,this.abortController=new AbortController,this.isDevEnv=ff()&&XF.IS_VITEST}get context(){return Un(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Ye.toMiliseconds(e))}}let EH=class extends zj{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=XW,this.registerDeviceToken=async i=>{const{clientId:n,token:o,notificationType:s,enableEncrypted:a=!1}=i,u=`${eH}/${this.projectId}/clients`;await JF(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:n,type:s,token:o,always_raw:a})})},this.logger=Ln(t,this.context)}};var CH=Object.defineProperty,X6=Object.getOwnPropertySymbols,SH=Object.prototype.hasOwnProperty,IH=Object.prototype.propertyIsEnumerable,e8=(r,e,t)=>e in r?CH(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,t8=(r,e)=>{for(var t in e||(e={}))SH.call(e,t)&&e8(r,t,e[t]);if(X6)for(var t of X6(e))IH.call(e,t)&&e8(r,t,e[t]);return r};let TH=class fE extends Dj{constructor(e){var t;super(e),this.protocol=uE,this.version=EW,this.name=sy,this.events=new no.EventEmitter,this.initialized=!1,this.on=(s,a)=>this.events.on(s,a),this.once=(s,a)=>this.events.once(s,a),this.off=(s,a)=>this.events.off(s,a),this.removeListener=(s,a)=>this.events.removeListener(s,a),this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||dE,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=Yg({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:CW.logger}),{logger:n,chunkLoggerController:o}=Pj({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=o,(t=this.logChunkController)!=null&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var s,a;(s=this.logChunkController)!=null&&s.downloadLogsBlobInBrowser&&((a=this.logChunkController)==null||a.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=Ln(n,this.name),this.heartbeat=new nj,this.crypto=new rH(this,this.logger,e==null?void 0:e.keychain),this.history=new _H(this,this.logger),this.expirer=new xH(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new rj(t8(t8({},SW),e==null?void 0:e.storageOptions)),this.relayer=new mH({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new bH(this,this.logger),this.verify=new AH(this.projectId||"",this.logger),this.echoClient=new EH(this.projectId||"",this.logger)}static async init(e){const t=new fE(e);await t.initialize();const i=await t.crypto.getClientId();return await t.storage.setItem(zW,i),t}get context(){return Un(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const RH=TH,pE="wc",gE=2,mE="client",ay=`${pE}@${gE}:${mE}:`,bv={name:mE,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},r8="WALLETCONNECT_DEEPLINK_CHOICE",kH="proposal",wE="Proposal expired",OH="session",Zu=Ye.SEVEN_DAYS,PH="engine",Kn={wc_sessionPropose:{req:{ttl:Ye.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Ye.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Ye.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Ye.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Ye.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Ye.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Ye.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Ye.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Ye.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Ye.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Ye.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Ye.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Ye.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Ye.ONE_HOUR,prompt:!1,tag:1117}}},_v={min:Ye.FIVE_MINUTES,max:Ye.SEVEN_DAYS},xa={idle:"IDLE",active:"ACTIVE"},DH="request",NH=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"],$H="wc",MH="auth",BH="authKeys",UH="pairingTopics",LH="requests",rm=`${$H}@${1.5}:${MH}:`,x1=`${rm}:PUB_KEY`;var jH=Object.defineProperty,FH=Object.defineProperties,zH=Object.getOwnPropertyDescriptors,i8=Object.getOwnPropertySymbols,WH=Object.prototype.hasOwnProperty,HH=Object.prototype.propertyIsEnumerable,n8=(r,e,t)=>e in r?jH(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,gi=(r,e)=>{for(var t in e||(e={}))WH.call(e,t)&&n8(r,t,e[t]);if(i8)for(var t of i8(e))HH.call(e,t)&&n8(r,t,e[t]);return r},El=(r,e)=>FH(r,zH(e));class qH extends Hj{constructor(e){super(e),this.name=PH,this.events=new L3,this.initialized=!1,this.requestQueue={state:xa.idle,queue:[]},this.sessionRequestQueue={state:xa.idle,queue:[]},this.requestQueueDelay=Ye.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Kn)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Ye.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const i=El(gi({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:n,requiredNamespaces:o,optionalNamespaces:s,sessionProperties:a,relays:u}=i;let h=n,d,p=!1;try{h&&(p=this.client.core.pairing.pairings.get(h).active)}catch(D){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),D}if(!h||!p){const{topic:D,uri:U}=await this.client.core.pairing.create();h=D,d=U}if(!h){const{message:D}=je("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(D)}const v=await this.client.core.crypto.generateKeyPair(),b=Kn.wc_sessionPropose.req.ttl||Ye.FIVE_MINUTES,I=Li(b),L=gi({requiredNamespaces:o,optionalNamespaces:s,relays:u??[{protocol:hE}],proposer:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:I},a&&{sessionProperties:a}),{reject:$,resolve:K,done:P}=Rl(b,wE);this.events.once(ir("session_connect"),async({error:D,session:U})=>{if(D)$(D);else if(U){U.self.publicKey=v;const F=El(gi({},U),{requiredNamespaces:L.requiredNamespaces,optionalNamespaces:L.optionalNamespaces});await this.client.session.set(U.topic,F),await this.setExpiry(U.topic,U.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:U.peer.metadata}),K(F)}});const q=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:L,throwOnFailedPublish:!0});return await this.setProposal(q,gi({id:q},L)),{uri:d,approval:P}},this.pair=async t=>{await this.isInitialized();try{return await this.client.core.pairing.pair(t)}catch(i){throw this.client.logger.error("pair() failed"),i}},this.approve=async t=>{await this.isInitialized();try{await this.isValidApprove(t)}catch(P){throw this.client.logger.error("approve() -> isValidApprove() failed"),P}const{id:i,relayProtocol:n,namespaces:o,sessionProperties:s,sessionConfig:a}=t;let u;try{u=this.client.proposal.get(i)}catch(P){throw this.client.logger.error(`approve() -> proposal.get(${i}) failed`),P}let{pairingTopic:h,proposer:d,requiredNamespaces:p,optionalNamespaces:v}=u;h=h||"";const b=await this.client.core.crypto.generateKeyPair(),I=d.publicKey,L=await this.client.core.crypto.generateSharedKey(b,I),$=gi(gi({relay:{protocol:n??"irn"},namespaces:o,pairingTopic:h,controller:{publicKey:b,metadata:this.client.metadata},expiry:Li(Zu)},s&&{sessionProperties:s}),a&&{sessionConfig:a});await this.client.core.relayer.subscribe(L);const K=El(gi({},$),{topic:L,requiredNamespaces:p,optionalNamespaces:v,pairingTopic:h,acknowledged:!1,self:$.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:b});await this.client.session.set(L,K);try{await this.sendResult({id:i,topic:h,result:{relay:{protocol:n??"irn"},responderPublicKey:b},throwOnFailedPublish:!0}),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:$,throwOnFailedPublish:!0})}catch(P){throw this.client.logger.error(P),this.client.session.delete(L,Pr("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),P}return await this.client.core.pairing.updateMetadata({topic:h,metadata:d.metadata}),await this.client.proposal.delete(i,Pr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}),await this.setExpiry(L,Li(Zu)),{topic:L,acknowledged:()=>new Promise(P=>setTimeout(()=>P(this.client.session.get(L)),500))}},this.reject=async t=>{await this.isInitialized();try{await this.isValidReject(t)}catch(s){throw this.client.logger.error("reject() -> isValidReject() failed"),s}const{id:i,reason:n}=t;let o;try{o=this.client.proposal.get(i).pairingTopic}catch(s){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),s}o&&(await this.sendError({id:i,topic:o,error:n}),await this.client.proposal.delete(i,Pr("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized();try{await this.isValidUpdate(t)}catch(p){throw this.client.logger.error("update() -> isValidUpdate() failed"),p}const{topic:i,namespaces:n}=t,{done:o,resolve:s,reject:a}=Rl(),u=yc(),h=Pl().toString(),d=this.client.session.get(i).namespaces;return this.events.once(ir("session_update",u),({error:p})=>{p?a(p):s()}),await this.client.session.update(i,{namespaces:n}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:u,relayRpcId:h}).catch(p=>{this.client.logger.error(p),this.client.session.update(i,{namespaces:d}),a(p)}),{acknowledged:o}},this.extend=async t=>{await this.isInitialized();try{await this.isValidExtend(t)}catch(u){throw this.client.logger.error("extend() -> isValidExtend() failed"),u}const{topic:i}=t,n=yc(),{done:o,resolve:s,reject:a}=Rl();return this.events.once(ir("session_extend",n),({error:u})=>{u?a(u):s()}),await this.setExpiry(i,Li(Zu)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(u=>{a(u)}),{acknowledged:o}},this.request=async t=>{await this.isInitialized();try{await this.isValidRequest(t)}catch(b){throw this.client.logger.error("request() -> isValidRequest() failed"),b}const{chainId:i,request:n,topic:o,expiry:s=Kn.wc_sessionRequest.req.ttl}=t,a=this.client.session.get(o),u=yc(),h=Pl().toString(),{done:d,resolve:p,reject:v}=Rl(s,"Request expired. Please try again.");return this.events.once(ir("session_request",u),({error:b,result:I})=>{b?v(b):p(I)}),await Promise.all([new Promise(async b=>{await this.sendRequest({clientRpcId:u,relayRpcId:h,topic:o,method:"wc_sessionRequest",params:{request:El(gi({},n),{expiryTimestamp:Li(s)}),chainId:i},expiry:s,throwOnFailedPublish:!0}).catch(I=>v(I)),this.client.events.emit("session_request_sent",{topic:o,request:n,chainId:i,id:u}),b()}),new Promise(async b=>{var I;if(!((I=a.sessionConfig)!=null&&I.disableDeepLink)){const L=await I$(this.client.core.storage,r8);S$({id:u,topic:o,wcDeepLink:L})}b()}),d()]).then(b=>b[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:i,response:n}=t,{id:o}=n;Ds(n)?await this.sendResult({id:o,topic:i,result:n.result,throwOnFailedPublish:!0}):$o(n)&&await this.sendError({id:o,topic:i,error:n.error}),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized();try{await this.isValidPing(t)}catch(n){throw this.client.logger.error("ping() -> isValidPing() failed"),n}const{topic:i}=t;if(this.client.session.keys.includes(i)){const n=yc(),o=Pl().toString(),{done:s,resolve:a,reject:u}=Rl();this.events.once(ir("session_ping",n),({error:h})=>{h?u(h):a()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:n,relayRpcId:o}),s()])}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:i,event:n,chainId:o}=t,s=Pl().toString();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:n,chainId:o},throwOnFailedPublish:!0,relayRpcId:s})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:i}=t;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:Pr("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:n}=je("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(n)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(i=>QU(i,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async t=>{this.isInitialized(),this.isValidAuthenticate(t);const{chains:i,statement:n="",uri:o,domain:s,nonce:a,type:u,exp:h,nbf:d,methods:p=[],expiry:v}=t,b=[...t.resources||[]],{topic:I,uri:L}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:I,uri:L}});const $=await this.client.core.crypto.generateKeyPair(),K=y1($);if(await Promise.all([this.client.auth.authKeys.set(x1,{responseTopic:K,publicKey:$}),this.client.auth.pairingTopics.set(K,{topic:K,pairingTopic:I})]),await this.client.core.relayer.subscribe(K),this.client.logger.info(`sending request to new pairing topic: ${I}`),p.length>0){const{namespace:m}=f1(i[0]);let g=bU(m,"request",p);v1(b)&&(g=xU(g,b.pop())),b.push(g)}const P=v&&v>Kn.wc_sessionAuthenticate.req.ttl?v:Kn.wc_sessionAuthenticate.req.ttl,q={authPayload:{type:u??"caip122",chains:i,statement:n,aud:o,domain:s,version:"1",nonce:a,iat:new Date().toISOString(),exp:h,nbf:d,resources:b},requester:{publicKey:$,metadata:this.client.metadata},expiryTimestamp:Li(P)},D={eip155:{chains:i,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},U={requiredNamespaces:{},optionalNamespaces:D,relays:[{protocol:"irn"}],proposer:{publicKey:$,metadata:this.client.metadata},expiryTimestamp:Li(Kn.wc_sessionPropose.req.ttl)},{done:F,resolve:_,reject:x}=Rl(P,"Request expired"),M=async({error:m,session:g})=>{if(this.events.off(ir("session_request",V),j),m)x(m);else if(g){g.self.publicKey=$,await this.client.session.set(g.topic,g),await this.setExpiry(g.topic,g.expiry),I&&await this.client.core.pairing.updateMetadata({topic:I,metadata:g.peer.metadata});const w=this.client.session.get(g.topic);await this.deleteProposal(Z),_({session:w})}},j=async m=>{if(await this.deletePendingAuthRequest(V,{message:"fulfilled",code:0}),m.error){const N=Pr("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return m.error.code===N.code?void 0:(this.events.off(ir("session_connect"),M),x(m.error.message))}await this.deleteProposal(Z),this.events.off(ir("session_connect"),M);const{cacaos:g,responder:w}=m.result,C=[],R=[];for(const N of g){await n6({cacao:N,projectId:this.client.core.projectId})||(this.client.logger.error(N,"Signature verification failed"),x(Pr("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:y}=N,H=v1(y.resources),de=[i6(y.iss)],xe=$1(y.iss);if(H){const O=o6(H),he=s6(H);C.push(...O),de.push(...he)}for(const O of de)R.push(`${O}:${xe}`)}const k=await this.client.core.crypto.generateSharedKey($,w.publicKey);let B;C.length>0&&(B={topic:k,acknowledged:!0,self:{publicKey:$,metadata:this.client.metadata},peer:w,controller:w.publicKey,expiry:Li(Zu),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:I,namespaces:f6([...new Set(C)],[...new Set(R)])},await this.client.core.relayer.subscribe(k),await this.client.session.set(k,B),B=this.client.session.get(k)),_({auths:g,session:B})},V=yc(),Z=yc();this.events.once(ir("session_connect"),M),this.events.once(ir("session_request",V),j);try{await Promise.all([this.sendRequest({topic:I,method:"wc_sessionAuthenticate",params:q,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:V}),this.sendRequest({topic:I,method:"wc_sessionPropose",params:U,expiry:Kn.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:Z})])}catch(m){throw this.events.off(ir("session_connect"),M),this.events.off(ir("session_request",V),j),m}return await this.setProposal(Z,gi({id:Z},U)),await this.setAuthRequest(V,{request:El(gi({},q),{verifyContext:{}}),pairingTopic:I}),{uri:L,response:F}},this.approveSessionAuthenticate=async t=>{this.isInitialized();const{id:i,auths:n}=t,o=this.getPendingAuthRequest(i);if(!o)throw new Error(`Could not find pending auth request with id ${i}`);const s=o.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),u=y1(s),h={type:$c,receiverPublicKey:s,senderPublicKey:a},d=[],p=[];for(const I of n){if(!await n6({cacao:I,projectId:this.client.core.projectId})){const q=Pr("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:u,error:q,encodeOpts:h}),new Error(q.message)}const{p:L}=I,$=v1(L.resources),K=[i6(L.iss)],P=$1(L.iss);if($){const q=o6($),D=s6($);d.push(...q),K.push(...D)}for(const q of K)p.push(`${q}:${P}`)}const v=await this.client.core.crypto.generateSharedKey(a,s);let b;return(d==null?void 0:d.length)>0&&(b={topic:v,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:s,metadata:o.requester.metadata},controller:s,expiry:Li(Zu),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:"",namespaces:f6([...new Set(d)],[...new Set(p)])},await this.client.core.relayer.subscribe(v),await this.client.session.set(v,b)),await this.sendResult({topic:u,id:i,result:{cacaos:n,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:h,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(i,{message:"fullfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),{session:b}},this.rejectSessionAuthenticate=async t=>{await this.isInitialized();const{id:i,reason:n}=t,o=this.getPendingAuthRequest(i);if(!o)throw new Error(`Could not find pending auth request with id ${i}`);const s=o.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),u=y1(s),h={type:$c,receiverPublicKey:s,senderPublicKey:a};await this.sendError({id:i,topic:u,error:n,encodeOpts:h}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.client.proposal.delete(i,Pr("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:i,iss:n}=t;return kA(i,n)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const i=this.client.core.pairing.pairings.get(t.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(o=>{var s,a;return((s=o.peerMetadata)==null?void 0:s.url)&&((a=o.peerMetadata)==null?void 0:a.url)===t.peer.metadata.url&&o.topic&&o.topic!==i.topic});if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async t=>{const{topic:i,expirerHasDeleted:n=!1,emitEvent:o=!0,id:s=0}=t,{self:a}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,Pr("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),n||this.client.core.expirer.del(i),this.client.core.storage.removeItem(r8).catch(u=>this.client.logger.warn(u)),this.getPendingSessionRequests().forEach(u=>{u.topic===i&&this.deletePendingSessionRequest(u.id,Pr("USER_DISCONNECTED"))}),o&&this.client.events.emit("session_delete",{id:s,topic:i})},this.deleteProposal=async(t,i)=>{await Promise.all([this.client.proposal.delete(t,Pr("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,i,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,i),n?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(o=>o.id!==t),n&&(this.sessionRequestQueue.state=xa.idle,this.client.events.emit("session_request_expire",{id:t}))},this.deletePendingAuthRequest=async(t,i,n=!1)=>{await Promise.all([this.client.auth.requests.delete(t,i),n?Promise.resolve():this.client.core.expirer.del(t)])},this.setExpiry=async(t,i)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,i),await this.client.session.update(t,{expiry:i}))},this.setProposal=async(t,i)=>{this.client.core.expirer.set(t,Li(Kn.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,i)},this.setAuthRequest=async(t,i)=>{const{request:n,pairingTopic:o}=i;this.client.core.expirer.set(t,n.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:t,pairingTopic:o,verifyContext:n.verifyContext})},this.setPendingSessionRequest=async t=>{const{id:i,topic:n,params:o,verifyContext:s}=t,a=o.request.expiryTimestamp||Li(Kn.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,a),await this.client.pendingRequest.set(i,{id:i,topic:n,params:o,verifyContext:s})},this.sendRequest=async t=>{const{topic:i,method:n,params:o,expiry:s,relayRpcId:a,clientRpcId:u,throwOnFailedPublish:h}=t,d=dh(n,o,u);if(Xh()&&NH.includes(n)){const b=Ol(JSON.stringify(d));this.client.core.verify.register({attestationId:b})}let p;try{p=await this.client.core.crypto.encode(i,d)}catch(b){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),b}const v=Kn[n].req;return s&&(v.ttl=s),a&&(v.id=a),this.client.core.history.set(i,d),h?(v.internal=El(gi({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,p,v)):this.client.core.relayer.publish(i,p,v).catch(b=>this.client.logger.error(b)),d.id},this.sendResult=async t=>{const{id:i,topic:n,result:o,throwOnFailedPublish:s,encodeOpts:a}=t,u=Jg(i,o);let h;try{h=await this.client.core.crypto.encode(n,u,a)}catch(v){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),v}let d;try{d=await this.client.core.history.get(n,i)}catch(v){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${i}) failed`),v}const p=Kn[d.request.method].res;s?(p.internal=El(gi({},p.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,h,p)):this.client.core.relayer.publish(n,h,p).catch(v=>this.client.logger.error(v)),await this.client.core.history.resolve(u)},this.sendError=async t=>{const{id:i,topic:n,error:o,encodeOpts:s}=t,a=Xg(i,o);let u;try{u=await this.client.core.crypto.encode(n,a,s)}catch(p){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),p}let h;try{h=await this.client.core.history.get(n,i)}catch(p){throw this.client.logger.error(`sendError() -> history.get(${n}, ${i}) failed`),p}const d=Kn[h.request.method].res;this.client.core.relayer.publish(n,u,d),await this.client.core.history.resolve(a)},this.cleanup=async()=>{const t=[],i=[];this.client.session.getAll().forEach(n=>{let o=!1;wc(n.expiry)&&(o=!0),this.client.core.crypto.keychain.has(n.topic)||(o=!0),o&&t.push(n.topic)}),this.client.proposal.getAll().forEach(n=>{wc(n.expiryTimestamp)&&i.push(n.id)}),await Promise.all([...t.map(n=>this.deleteSession({topic:n})),...i.map(n=>this.deleteProposal(n))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===xa.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=xa.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(i=>setTimeout(i,300))}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=xa.idle},this.processRequest=t=>{const{topic:i,payload:n}=t,o=n.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:o}))switch(o){case"wc_sessionPropose":return this.onSessionProposeRequest(i,n);case"wc_sessionSettle":return this.onSessionSettleRequest(i,n);case"wc_sessionUpdate":return this.onSessionUpdateRequest(i,n);case"wc_sessionExtend":return this.onSessionExtendRequest(i,n);case"wc_sessionPing":return this.onSessionPingRequest(i,n);case"wc_sessionDelete":return this.onSessionDeleteRequest(i,n);case"wc_sessionRequest":return this.onSessionRequest(i,n);case"wc_sessionEvent":return this.onSessionEventRequest(i,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateRequest(i,n);default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async t=>{const{topic:i,payload:n}=t,o=(await this.client.core.history.get(i,n.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(i,n);case"wc_sessionSettle":return this.onSessionSettleResponse(i,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,n);case"wc_sessionExtend":return this.onSessionExtendResponse(i,n);case"wc_sessionPing":return this.onSessionPingResponse(i,n);case"wc_sessionRequest":return this.onSessionRequestResponse(i,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,n);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:i}=t,{message:n}=je("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.shouldIgnorePairingRequest=t=>{const{topic:i,requestMethod:n}=t,o=this.expectedPairingMethodMap.get(i);return!o||o.includes(n)?!1:!!(o.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async(t,i)=>{const{params:n,id:o}=i;try{this.isValidConnect(gi({},i.params));const s=n.expiryTimestamp||Li(Kn.wc_sessionPropose.req.ttl),a=gi({id:o,pairingTopic:t,expiryTimestamp:s},n);await this.setProposal(o,a);const u=Ol(JSON.stringify(i)),h=await this.getVerifyContext(u,a.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:a,verifyContext:h})}catch(s){await this.sendError({id:o,topic:t,error:s}),this.client.logger.error(s)}},this.onSessionProposeResponse=async(t,i)=>{const{id:n}=i;if(Ds(i)){const{result:o}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const s=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const a=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});const u=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:u});const h=await this.client.core.crypto.generateSharedKey(a,u);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const d=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:t})}else if($o(i)){await this.client.proposal.delete(n,Pr("USER_DISCONNECTED"));const o=ir("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(ir("session_connect"),{error:i.error})}},this.onSessionSettleRequest=async(t,i)=>{const{id:n,params:o}=i;try{this.isValidSessionSettleRequest(o);const{relay:s,controller:a,expiry:u,namespaces:h,sessionProperties:d,pairingTopic:p,sessionConfig:v}=i.params,b=gi(gi({topic:t,relay:s,expiry:u,namespaces:h,acknowledged:!0,pairingTopic:p,requiredNamespaces:{},optionalNamespaces:{},controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},d&&{sessionProperties:d}),v&&{sessionConfig:v});await this.sendResult({id:i.id,topic:t,result:!0,throwOnFailedPublish:!0});const I=ir("session_connect");if(this.events.listenerCount(I)===0)throw new Error(`emitting ${I} without any listeners 997`);this.events.emit(ir("session_connect"),{session:b}),this.cleanupDuplicatePairings(b)}catch(s){await this.sendError({id:n,topic:t,error:s}),this.client.logger.error(s)}},this.onSessionSettleResponse=async(t,i)=>{const{id:n}=i;Ds(i)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(ir("session_approve",n),{})):$o(i)&&(await this.client.session.delete(t,Pr("USER_DISCONNECTED")),this.events.emit(ir("session_approve",n),{error:i.error}))},this.onSessionUpdateRequest=async(t,i)=>{const{params:n,id:o}=i;try{const s=`${t}_session_update`,a=Md.get(s);if(a&&this.isRequestOutOfSync(a,o)){this.client.logger.info(`Discarding out of sync request - ${o}`),this.sendError({id:o,topic:t,error:Pr("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(gi({topic:t},n));try{Md.set(s,o),await this.client.session.update(t,{namespaces:n.namespaces}),await this.sendResult({id:o,topic:t,result:!0,throwOnFailedPublish:!0})}catch(u){throw Md.delete(s),u}this.client.events.emit("session_update",{id:o,topic:t,params:n})}catch(s){await this.sendError({id:o,topic:t,error:s}),this.client.logger.error(s)}},this.isRequestOutOfSync=(t,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,i)=>{const{id:n}=i,o=ir("session_update",n);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);Ds(i)?this.events.emit(ir("session_update",n),{}):$o(i)&&this.events.emit(ir("session_update",n),{error:i.error})},this.onSessionExtendRequest=async(t,i)=>{const{id:n}=i;try{this.isValidExtend({topic:t}),await this.setExpiry(t,Li(Zu)),await this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:n,topic:t})}catch(o){await this.sendError({id:n,topic:t,error:o}),this.client.logger.error(o)}},this.onSessionExtendResponse=(t,i)=>{const{id:n}=i,o=ir("session_extend",n);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);Ds(i)?this.events.emit(ir("session_extend",n),{}):$o(i)&&this.events.emit(ir("session_extend",n),{error:i.error})},this.onSessionPingRequest=async(t,i)=>{const{id:n}=i;try{this.isValidPing({topic:t}),await this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:n,topic:t})}catch(o){await this.sendError({id:n,topic:t,error:o}),this.client.logger.error(o)}},this.onSessionPingResponse=(t,i)=>{const{id:n}=i,o=ir("session_ping",n);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);setTimeout(()=>{Ds(i)?this.events.emit(ir("session_ping",n),{}):$o(i)&&this.events.emit(ir("session_ping",n),{error:i.error})},500)},this.onSessionDeleteRequest=async(t,i)=>{const{id:n}=i;try{this.isValidDisconnect({topic:t,reason:i.params}),await Promise.all([new Promise(o=>{this.client.core.relayer.once(Nn.publish,async()=>{o(await this.deleteSession({topic:t,id:n}))})}),this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:Pr("USER_DISCONNECTED")})])}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(t,i)=>{var n;const{id:o,params:s}=i;try{await this.isValidRequest(gi({topic:t},s));const a=Ol(JSON.stringify(dh("wc_sessionRequest",s,o))),u=this.client.session.get(t),h=await this.getVerifyContext(a,u.peer.metadata),d={id:o,topic:t,params:s,verifyContext:h};await this.setPendingSessionRequest(d),(n=this.client.signConfig)!=null&&n.disableRequestQueue?this.emitSessionRequest(d):(this.addSessionRequestToSessionRequestQueue(d),this.processSessionRequestQueue())}catch(a){await this.sendError({id:o,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionRequestResponse=(t,i)=>{const{id:n}=i,o=ir("session_request",n);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);Ds(i)?this.events.emit(ir("session_request",n),{result:i.result}):$o(i)&&this.events.emit(ir("session_request",n),{error:i.error})},this.onSessionEventRequest=async(t,i)=>{const{id:n,params:o}=i;try{const s=`${t}_session_event_${o.event.name}`,a=Md.get(s);if(a&&this.isRequestOutOfSync(a,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit(gi({topic:t},o)),this.client.events.emit("session_event",{id:n,topic:t,params:o}),Md.set(s,n)}catch(s){await this.sendError({id:n,topic:t,error:s}),this.client.logger.error(s)}},this.onSessionAuthenticateResponse=(t,i)=>{const{id:n}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:i}),Ds(i)?this.events.emit(ir("session_request",n),{result:i.result}):$o(i)&&this.events.emit(ir("session_request",n),{error:i.error})},this.onSessionAuthenticateRequest=async(t,i)=>{const{requester:n,authPayload:o,expiryTimestamp:s}=i.params,a=Ol(JSON.stringify(i)),u=await this.getVerifyContext(a,this.client.metadata),h={requester:n,pairingTopic:t,id:i.id,authPayload:o,verifyContext:u,expiryTimestamp:s};await this.setAuthRequest(i.id,{request:h,pairingTopic:t}),this.client.events.emit("session_authenticate",{topic:t,params:i.params,id:i.id})},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=xa.idle,this.processSessionRequestQueue()},Ye.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:i})=>{const n=this.client.core.history.pending;n.length>0&&n.filter(o=>o.topic===t&&o.request.method==="wc_sessionRequest").forEach(o=>{const s=o.request.id,a=ir("session_request",s);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(ir("session_request",o.request.id),{error:i})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===xa.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=xa.active,this.emitSessionRequest(t)}catch(i){this.client.logger.error(i)}},this.emitSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const i=this.client.proposal.getAll().find(n=>n.pairingTopic===t.topic);i&&this.onSessionProposeRequest(t.topic,dh("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties},i.id))},this.isValidConnect=async t=>{if(!Rn(t)){const{message:u}=je("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(u)}const{pairingTopic:i,requiredNamespaces:n,optionalNamespaces:o,sessionProperties:s,relays:a}=t;if(Dn(i)||await this.isValidPairingTopic(i),!cL(a)){const{message:u}=je("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(u)}!Dn(n)&&mf(n)!==0&&this.validateNamespaces(n,"requiredNamespaces"),!Dn(o)&&mf(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Dn(s)||this.validateSessionProps(s,"sessionProperties")},this.validateNamespaces=(t,i)=>{const n=aL(t,"connect()",i);if(n)throw new Error(n.message)},this.isValidApprove=async t=>{if(!Rn(t))throw new Error(je("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:i,namespaces:n,relayProtocol:o,sessionProperties:s}=t;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const a=this.client.proposal.get(i),u=dv(n,"approve()");if(u)throw new Error(u.message);const h=m6(a.requiredNamespaces,n,"approve()");if(h)throw new Error(h.message);if(!si(o,!0)){const{message:d}=je("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(d)}Dn(s)||this.validateSessionProps(s,"sessionProperties")},this.isValidReject=async t=>{if(!Rn(t)){const{message:o}=je("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(o)}const{id:i,reason:n}=t;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!uL(n)){const{message:o}=je("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(o)}},this.isValidSessionSettleRequest=t=>{if(!Rn(t)){const{message:h}=je("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(h)}const{relay:i,controller:n,namespaces:o,expiry:s}=t;if(!MA(i)){const{message:h}=je("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const a=tL(n,"onSessionSettleRequest()");if(a)throw new Error(a.message);const u=dv(o,"onSessionSettleRequest()");if(u)throw new Error(u.message);if(wc(s)){const{message:h}=je("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async t=>{if(!Rn(t)){const{message:u}=je("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(u)}const{topic:i,namespaces:n}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const o=this.client.session.get(i),s=dv(n,"update()");if(s)throw new Error(s.message);const a=m6(o.requiredNamespaces,n,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async t=>{if(!Rn(t)){const{message:n}=je("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(n)}const{topic:i}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)},this.isValidRequest=async t=>{if(!Rn(t)){const{message:u}=je("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(u)}const{topic:i,request:n,chainId:o,expiry:s}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:a}=this.client.session.get(i);if(!g6(a,o)){const{message:u}=je("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(u)}if(!hL(n)){const{message:u}=je("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(u)}if(!pL(a,o,n.method)){const{message:u}=je("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(u)}if(s&&!vL(s,_v)){const{message:u}=je("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${_v.min} and ${_v.max}`);throw new Error(u)}},this.isValidRespond=async t=>{var i;if(!Rn(t)){const{message:s}=je("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(s)}const{topic:n,response:o}=t;try{await this.isValidSessionTopic(n)}catch(s){throw(i=t==null?void 0:t.response)!=null&&i.id&&this.cleanupAfterResponse(t),s}if(!dL(o)){const{message:s}=je("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(s)}},this.isValidPing=async t=>{if(!Rn(t)){const{message:n}=je("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(n)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async t=>{if(!Rn(t)){const{message:a}=je("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(a)}const{topic:i,event:n,chainId:o}=t;await this.isValidSessionTopic(i);const{namespaces:s}=this.client.session.get(i);if(!g6(s,o)){const{message:a}=je("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(a)}if(!fL(n)){const{message:a}=je("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(a)}if(!gL(s,o,n.name)){const{message:a}=je("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(a)}},this.isValidDisconnect=async t=>{if(!Rn(t)){const{message:n}=je("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(n)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidAuthenticate=t=>{const{chains:i,uri:n,domain:o,nonce:s}=t;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!si(n,!1))throw new Error("uri is required parameter");if(!si(o,!1))throw new Error("domain is required parameter");if(!si(s,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(u=>f1(u).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=f1(i[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async(t,i)=>{const n={verified:{verifyUrl:i.verifyUrl||sh,validation:"UNKNOWN",origin:i.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:t,verifyUrl:i.verifyUrl});o&&(n.verified.origin=o.origin,n.verified.isScam=o.isScam,n.verified.validation=o.origin===new URL(i.url).origin?"VALID":"INVALID")}catch(o){this.client.logger.info(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(n)}`),n},this.validateSessionProps=(t,i)=>{Object.values(t).forEach(n=>{if(!si(n,!1)){const{message:o}=je("MISSING_OR_INVALID",`${i} must be in Record format. Received: ${JSON.stringify(n)}`);throw new Error(o)}})},this.getPendingAuthRequest=t=>{const i=this.client.auth.requests.get(t);return typeof i=="object"?i:void 0},this.addToRecentlyDeleted=(t,i)=>{if(this.recentlyDeletedMap.set(t,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let n=0;const o=this.recentlyDeletedLimit/2;for(const s of this.recentlyDeletedMap.keys()){if(n++>=o)break;this.recentlyDeletedMap.delete(s)}}},this.checkRecentlyDeleted=t=>{const i=this.recentlyDeletedMap.get(t);if(i){const{message:n}=je("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${t}`);throw new Error(n)}}}async isInitialized(){if(!this.initialized){const{message:e}=je("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Nn.message,async e=>{const{topic:t,message:i}=e,{publicKey:n}=this.client.auth.authKeys.keys.includes(x1)?this.client.auth.authKeys.get(x1):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(t,i,{receiverPublicKey:n});try{oy(o)?(this.client.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o})):em(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o}),this.client.core.history.delete(t,o.id)):this.onRelayEventUnknownPayload({topic:t,payload:o})}catch(s){this.client.logger.error(s)}})}registerExpirerEvents(){this.client.core.expirer.on(Po.expired,async e=>{const{topic:t,id:i}=Gx(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,je("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,je("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(oh.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(oh.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!si(e,!1)){const{message:t}=je("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=je("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(wc(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=je("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!si(e,!1)){const{message:t}=je("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=je("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(wc(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=je("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=je("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(si(e,!1)){const{message:t}=je("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=je("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!lL(e)){const{message:t}=je("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=je("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(wc(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=je("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class VH extends mu{constructor(e,t){super(e,t,kH,ay),this.core=e,this.logger=t}}class KH extends mu{constructor(e,t){super(e,t,OH,ay),this.core=e,this.logger=t}}class GH extends mu{constructor(e,t){super(e,t,DH,ay,i=>i.id),this.core=e,this.logger=t}}class ZH extends mu{constructor(e,t){super(e,t,BH,rm,()=>x1),this.core=e,this.logger=t}}class QH extends mu{constructor(e,t){super(e,t,UH,rm),this.core=e,this.logger=t}}class YH extends mu{constructor(e,t){super(e,t,LH,rm,i=>i.id),this.core=e,this.logger=t}}class JH{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new ZH(this.core,this.logger),this.pairingTopics=new QH(this.core,this.logger),this.requests=new YH(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class cy extends Wj{constructor(e){super(e),this.protocol=pE,this.version=gE,this.name=bv.name,this.events=new no.EventEmitter,this.on=(i,n)=>this.events.on(i,n),this.once=(i,n)=>this.events.once(i,n),this.off=(i,n)=>this.events.off(i,n),this.removeListener=(i,n)=>this.events.removeListener(i,n),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(n){throw this.logger.error(n.message),n}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(n){throw this.logger.error(n.message),n}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(n){throw this.logger.error(n.message),n}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(n){throw this.logger.error(n.message),n}},this.update=async i=>{try{return await this.engine.update(i)}catch(n){throw this.logger.error(n.message),n}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(n){throw this.logger.error(n.message),n}},this.request=async i=>{try{return await this.engine.request(i)}catch(n){throw this.logger.error(n.message),n}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(n){throw this.logger.error(n.message),n}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(n){throw this.logger.error(n.message),n}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(n){throw this.logger.error(n.message),n}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(n){throw this.logger.error(n.message),n}},this.find=i=>{try{return this.engine.find(i)}catch(n){throw this.logger.error(n.message),n}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.authenticate=async i=>{try{return await this.engine.authenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.formatAuthMessage=i=>{try{return this.engine.formatAuthMessage(i)}catch(n){throw this.logger.error(n.message),n}},this.approveSessionAuthenticate=async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.rejectSessionAuthenticate=async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.name=(e==null?void 0:e.name)||bv.name,this.metadata=(e==null?void 0:e.metadata)||y$(),this.signConfig=e==null?void 0:e.signConfig;const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:v0(Yg({level:(e==null?void 0:e.logger)||bv.logger}));this.core=(e==null?void 0:e.core)||new RH(e),this.logger=Ln(t,this.name),this.session=new KH(this.core,this.logger),this.proposal=new VH(this.core,this.logger),this.pendingRequest=new GH(this.core,this.logger),this.engine=new qH(this),this.auth=new JH(this.core,this.logger)}static async init(e){const t=new cy(e);return await t.initialize(),t}get context(){return Un(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var P2={exports:{}};(function(r,e){var t=typeof self<"u"?self:ln,i=function(){function o(){this.fetch=!1,this.DOMException=t.DOMException}return o.prototype=t,new o}();(function(o){(function(s){var a={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function u(g){return g&&DataView.prototype.isPrototypeOf(g)}if(a.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(g){return g&&h.indexOf(Object.prototype.toString.call(g))>-1};function p(g){if(typeof g!="string"&&(g=String(g)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(g))throw new TypeError("Invalid character in header field name");return g.toLowerCase()}function v(g){return typeof g!="string"&&(g=String(g)),g}function b(g){var w={next:function(){var C=g.shift();return{done:C===void 0,value:C}}};return a.iterable&&(w[Symbol.iterator]=function(){return w}),w}function I(g){this.map={},g instanceof I?g.forEach(function(w,C){this.append(C,w)},this):Array.isArray(g)?g.forEach(function(w){this.append(w[0],w[1])},this):g&&Object.getOwnPropertyNames(g).forEach(function(w){this.append(w,g[w])},this)}I.prototype.append=function(g,w){g=p(g),w=v(w);var C=this.map[g];this.map[g]=C?C+", "+w:w},I.prototype.delete=function(g){delete this.map[p(g)]},I.prototype.get=function(g){return g=p(g),this.has(g)?this.map[g]:null},I.prototype.has=function(g){return this.map.hasOwnProperty(p(g))},I.prototype.set=function(g,w){this.map[p(g)]=v(w)},I.prototype.forEach=function(g,w){for(var C in this.map)this.map.hasOwnProperty(C)&&g.call(w,this.map[C],C,this)},I.prototype.keys=function(){var g=[];return this.forEach(function(w,C){g.push(C)}),b(g)},I.prototype.values=function(){var g=[];return this.forEach(function(w){g.push(w)}),b(g)},I.prototype.entries=function(){var g=[];return this.forEach(function(w,C){g.push([C,w])}),b(g)},a.iterable&&(I.prototype[Symbol.iterator]=I.prototype.entries);function L(g){if(g.bodyUsed)return Promise.reject(new TypeError("Already read"));g.bodyUsed=!0}function $(g){return new Promise(function(w,C){g.onload=function(){w(g.result)},g.onerror=function(){C(g.error)}})}function K(g){var w=new FileReader,C=$(w);return w.readAsArrayBuffer(g),C}function P(g){var w=new FileReader,C=$(w);return w.readAsText(g),C}function q(g){for(var w=new Uint8Array(g),C=new Array(w.length),R=0;R-1?w:g}function x(g,w){w=w||{};var C=w.body;if(g instanceof x){if(g.bodyUsed)throw new TypeError("Already read");this.url=g.url,this.credentials=g.credentials,w.headers||(this.headers=new I(g.headers)),this.method=g.method,this.mode=g.mode,this.signal=g.signal,!C&&g._bodyInit!=null&&(C=g._bodyInit,g.bodyUsed=!0)}else this.url=String(g);if(this.credentials=w.credentials||this.credentials||"same-origin",(w.headers||!this.headers)&&(this.headers=new I(w.headers)),this.method=_(w.method||this.method||"GET"),this.mode=w.mode||this.mode||null,this.signal=w.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&C)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(C)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})};function M(g){var w=new FormData;return g.trim().split("&").forEach(function(C){if(C){var R=C.split("="),k=R.shift().replace(/\+/g," "),B=R.join("=").replace(/\+/g," ");w.append(decodeURIComponent(k),decodeURIComponent(B))}}),w}function j(g){var w=new I,C=g.replace(/\r?\n[\t ]+/g," ");return C.split(/\r?\n/).forEach(function(R){var k=R.split(":"),B=k.shift().trim();if(B){var N=k.join(":").trim();w.append(B,N)}}),w}U.call(x.prototype);function V(g,w){w||(w={}),this.type="default",this.status=w.status===void 0?200:w.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in w?w.statusText:"OK",this.headers=new I(w.headers),this.url=w.url||"",this._initBody(g)}U.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new I(this.headers),url:this.url})},V.error=function(){var g=new V(null,{status:0,statusText:""});return g.type="error",g};var Z=[301,302,303,307,308];V.redirect=function(g,w){if(Z.indexOf(w)===-1)throw new RangeError("Invalid status code");return new V(null,{status:w,headers:{location:g}})},s.DOMException=o.DOMException;try{new s.DOMException}catch{s.DOMException=function(w,C){this.message=w,this.name=C;var R=Error(w);this.stack=R.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function m(g,w){return new Promise(function(C,R){var k=new x(g,w);if(k.signal&&k.signal.aborted)return R(new s.DOMException("Aborted","AbortError"));var B=new XMLHttpRequest;function N(){B.abort()}B.onload=function(){var y={status:B.status,statusText:B.statusText,headers:j(B.getAllResponseHeaders()||"")};y.url="responseURL"in B?B.responseURL:y.headers.get("X-Request-URL");var H="response"in B?B.response:B.responseText;C(new V(H,y))},B.onerror=function(){R(new TypeError("Network request failed"))},B.ontimeout=function(){R(new TypeError("Network request failed"))},B.onabort=function(){R(new s.DOMException("Aborted","AbortError"))},B.open(k.method,k.url,!0),k.credentials==="include"?B.withCredentials=!0:k.credentials==="omit"&&(B.withCredentials=!1),"responseType"in B&&a.blob&&(B.responseType="blob"),k.headers.forEach(function(y,H){B.setRequestHeader(H,y)}),k.signal&&(k.signal.addEventListener("abort",N),B.onreadystatechange=function(){B.readyState===4&&k.signal.removeEventListener("abort",N)}),B.send(typeof k._bodyInit>"u"?null:k._bodyInit)})}return m.polyfill=!0,o.fetch||(o.fetch=m,o.Headers=I,o.Request=x,o.Response=V),s.Headers=I,s.Request=x,s.Response=V,s.fetch=m,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e})(P2,P2.exports);var XH=P2.exports;const o8=ea(XH);var eq=Object.defineProperty,tq=Object.defineProperties,rq=Object.getOwnPropertyDescriptors,s8=Object.getOwnPropertySymbols,iq=Object.prototype.hasOwnProperty,nq=Object.prototype.propertyIsEnumerable,a8=(r,e,t)=>e in r?eq(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,c8=(r,e)=>{for(var t in e||(e={}))iq.call(e,t)&&a8(r,t,e[t]);if(s8)for(var t of s8(e))nq.call(e,t)&&a8(r,t,e[t]);return r},l8=(r,e)=>tq(r,rq(e));const oq={Accept:"application/json","Content-Type":"application/json"},sq="POST",u8={headers:oq,method:sq},h8=10;let Kc=class{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new no.EventEmitter,this.isAvailable=!1,this.registering=!1,!D6(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=Ma(e),i=await(await o8(this.url,l8(c8({},u8),{body:t}))).json();this.onPayload({data:i})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!D6(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,n)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),n(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return n(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=Ma({id:1,jsonrpc:"2.0",method:"test",params:[]});await o8(e,l8(c8({},u8),{body:t}))}this.onOpen()}catch(t){const i=this.parseError(t);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?m0(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),n=i.message||i.toString(),o=Xg(e,n);this.events.emit("payload",o)}parseError(e,t=this.url){return ZA(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>h8&&this.events.setMaxListeners(h8)}};const d8="error",aq="wss://relay.walletconnect.com",cq="wc",lq="universal_provider",f8=`${cq}@2:${lq}:`,uq="https://rpc.walletconnect.com/v1/",Ja={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},D2={exports:{}};/** +* @license +* Lodash +* Copyright OpenJS Foundation and other contributors +* Released under MIT license +* Based on Underscore.js 1.8.3 +* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +*/(function(r,e){(function(){var t,i="4.17.21",n=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,d="__lodash_placeholder__",p=1,v=2,b=4,I=1,L=2,$=1,K=2,P=4,q=8,D=16,U=32,F=64,_=128,x=256,M=512,j=30,V="...",Z=800,m=16,g=1,w=2,C=3,R=1/0,k=9007199254740991,B=17976931348623157e292,N=NaN,y=4294967295,H=y-1,de=y>>>1,xe=[["ary",_],["bind",$],["bindKey",K],["curry",q],["curryRight",D],["flip",M],["partial",U],["partialRight",F],["rearg",x]],O="[object Arguments]",he="[object Array]",J="[object AsyncFunction]",re="[object Boolean]",oe="[object Date]",E="[object DOMException]",X="[object Error]",ve="[object Function]",Ee="[object GeneratorFunction]",Ce="[object Map]",Be="[object Number]",ot="[object Null]",Ge="[object Object]",dr="[object Promise]",mt="[object Proxy]",Qe="[object RegExp]",lt="[object Set]",ze="[object String]",Ke="[object Symbol]",xt="[object Undefined]",Fe="[object WeakMap]",Ze="[object WeakSet]",W="[object ArrayBuffer]",A="[object DataView]",T="[object Float32Array]",Q="[object Float64Array]",se="[object Int8Array]",ue="[object Int16Array]",ye="[object Int32Array]",Oe="[object Uint8Array]",Le="[object Uint8ClampedArray]",kt="[object Uint16Array]",at="[object Uint32Array]",st=/\b__p \+= '';/g,Zr=/\b(__p \+=) '' \+/g,lr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,fr=/&(?:amp|lt|gt|quot|#39);/g,Xi=/[&<>"']/g,Ot=RegExp(fr.source),At=RegExp(Xi.source),Ar=/<%-([\s\S]+?)%>/g,Pt=/<%([\s\S]+?)%>/g,It=/<%=([\s\S]+?)%>/g,gr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mt=/^\w*$/,Bt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Er=/[\\^$.*+?()[\]{}|]/g,Ut=RegExp(Er.source),Dt=/^\s+/,Tr=/\s/,Nt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,wt=/\{\n\/\* \[wrapped with (.+)\] \*/,Dr=/,? & /,Lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Rr=/[()=,{}\[\]\/\s]/,Go=/\\(\\)?/g,kr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,er=/\w*$/,uo=/^[-+]0x[0-9a-f]+$/i,ho=/^0b[01]+$/i,fo=/^\[object .+?Constructor\]$/,po=/^0o[0-7]+$/i,go=/^(?:0|[1-9]\d*)$/,Ai=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xs=/($^)/,rl=/['\n\r\u2028\u2029\\]/g,As="\\ud800-\\udfff",il="\\u0300-\\u036f",nl="\\ufe20-\\ufe2f",Es="\\u20d0-\\u20ff",rc=il+nl+Es,ic="\\u2700-\\u27bf",en="a-z\\xdf-\\xf6\\xf8-\\xff",ol="\\xac\\xb1\\xd7\\xf7",sl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",al="\\u2000-\\u206f",cl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",F0="A-Z\\xc0-\\xd6\\xd8-\\xde",z0="\\ufe0e\\ufe0f",ll=ol+sl+al+cl,dd="['’]",ul="["+As+"]",fd="["+ll+"]",hl="["+rc+"]",W0="\\d+",$m="["+ic+"]",H0="["+en+"]",q0="[^"+As+ll+W0+ic+en+F0+"]",Ru="\\ud83c[\\udffb-\\udfff]",Mm="(?:"+hl+"|"+Ru+")",V0="[^"+As+"]",ku="(?:\\ud83c[\\udde6-\\uddff]){2}",nc="[\\ud800-\\udbff][\\udc00-\\udfff]",Fn="["+F0+"]",K0="\\u200d",G0="(?:"+H0+"|"+q0+")",Cs="(?:"+Fn+"|"+q0+")",Z0="(?:"+dd+"(?:d|ll|m|re|s|t|ve))?",Q0="(?:"+dd+"(?:D|LL|M|RE|S|T|VE))?",Y0=Mm+"?",J0="["+z0+"]?",Bm="(?:"+K0+"(?:"+[V0,ku,nc].join("|")+")"+J0+Y0+")*",la="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",X0="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ep=J0+Y0+Bm,Ou="(?:"+[$m,ku,nc].join("|")+")"+ep,Um="(?:"+[V0+hl+"?",hl,ku,nc,ul].join("|")+")",pd=RegExp(dd,"g"),Lm=RegExp(hl,"g"),Pu=RegExp(Ru+"(?="+Ru+")|"+Um+ep,"g"),tp=RegExp([Fn+"?"+H0+"+"+Z0+"(?="+[fd,Fn,"$"].join("|")+")",Cs+"+"+Q0+"(?="+[fd,Fn+G0,"$"].join("|")+")",Fn+"?"+G0+"+"+Z0,Fn+"+"+Q0,X0,la,W0,Ou].join("|"),"g"),rp=RegExp("["+K0+As+rc+z0+"]"),dl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ip=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jm=-1,Br={};Br[T]=Br[Q]=Br[se]=Br[ue]=Br[ye]=Br[Oe]=Br[Le]=Br[kt]=Br[at]=!0,Br[O]=Br[he]=Br[W]=Br[re]=Br[A]=Br[oe]=Br[X]=Br[ve]=Br[Ce]=Br[Be]=Br[Ge]=Br[Qe]=Br[lt]=Br[ze]=Br[Fe]=!1;var Nr={};Nr[O]=Nr[he]=Nr[W]=Nr[A]=Nr[re]=Nr[oe]=Nr[T]=Nr[Q]=Nr[se]=Nr[ue]=Nr[ye]=Nr[Ce]=Nr[Be]=Nr[Ge]=Nr[Qe]=Nr[lt]=Nr[ze]=Nr[Ke]=Nr[Oe]=Nr[Le]=Nr[kt]=Nr[at]=!0,Nr[X]=Nr[ve]=Nr[Fe]=!1;var ne={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},fe={"&":"&","<":"<",">":">",'"':""","'":"'"},Re={"&":"&","<":"<",">":">",""":'"',"'":"'"},tt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ur=parseFloat,Wt=parseInt,Wr=typeof Ld=="object"&&Ld&&Ld.Object===Object&&Ld,hi=typeof self=="object"&&self&&self.Object===Object&&self,ur=Wr||hi||Function("return this")(),Lr=e&&!e.nodeType&&e,ti=Lr&&!0&&r&&!r.nodeType&&r,bn=ti&&ti.exports===Lr,di=bn&&Wr.process,Hr=function(){try{var pe=ti&&ti.require&&ti.require("util").types;return pe||di&&di.binding&&di.binding("util")}catch{}}(),tn=Hr&&Hr.isArrayBuffer,Zo=Hr&&Hr.isDate,mo=Hr&&Hr.isMap,Ss=Hr&&Hr.isRegExp,gd=Hr&&Hr.isSet,fl=Hr&&Hr.isTypedArray;function Ei(pe,Se,Ae){switch(Ae.length){case 0:return pe.call(Se);case 1:return pe.call(Se,Ae[0]);case 2:return pe.call(Se,Ae[0],Ae[1]);case 3:return pe.call(Se,Ae[0],Ae[1],Ae[2])}return pe.apply(Se,Ae)}function N9(pe,Se,Ae,rt){for(var Ft=-1,vr=pe==null?0:pe.length;++Ft-1}function Fm(pe,Se,Ae){for(var rt=-1,Ft=pe==null?0:pe.length;++rt-1;);return Ae}function hb(pe,Se){for(var Ae=pe.length;Ae--&&Du(Se,pe[Ae],0)>-1;);return Ae}function W9(pe,Se){for(var Ae=pe.length,rt=0;Ae--;)pe[Ae]===Se&&++rt;return rt}var H9=qm(ne),q9=qm(fe);function V9(pe){return"\\"+tt[pe]}function K9(pe,Se){return pe==null?t:pe[Se]}function Nu(pe){return rp.test(pe)}function G9(pe){return dl.test(pe)}function Z9(pe){for(var Se,Ae=[];!(Se=pe.next()).done;)Ae.push(Se.value);return Ae}function Zm(pe){var Se=-1,Ae=Array(pe.size);return pe.forEach(function(rt,Ft){Ae[++Se]=[Ft,rt]}),Ae}function db(pe,Se){return function(Ae){return pe(Se(Ae))}}function ac(pe,Se){for(var Ae=-1,rt=pe.length,Ft=0,vr=[];++Ae-1}function M7(c,l){var f=this.__data__,S=_p(f,c);return S<0?(++this.size,f.push([c,l])):f[S][1]=l,this}ua.prototype.clear=P7,ua.prototype.delete=D7,ua.prototype.get=N7,ua.prototype.has=$7,ua.prototype.set=M7;function ha(c){var l=-1,f=c==null?0:c.length;for(this.clear();++l=l?c:l)),c}function bo(c,l,f,S,z,Y){var ae,le=l&p,ge=l&v,Ie=l&b;if(f&&(ae=z?f(c,S,z,Y):f(c)),ae!==t)return ae;if(!Qr(c))return c;var Te=Ht(c);if(Te){if(ae=jS(c),!le)return _n(c,ae)}else{var ke=Vi(c),He=ke==ve||ke==Ee;if(fc(c))return Gb(c,le);if(ke==Ge||ke==O||He&&!z){if(ae=ge||He?{}:f5(c),!le)return ge?RS(c,J7(ae,c)):TS(c,Eb(ae,c))}else{if(!Nr[ke])return z?c:{};ae=FS(c,ke,le)}}Y||(Y=new Yo);var ut=Y.get(c);if(ut)return ut;Y.set(c,ae),z5(c)?c.forEach(function(Ct){ae.add(bo(Ct,l,f,Ct,c,Y))}):j5(c)&&c.forEach(function(Ct,rr){ae.set(rr,bo(Ct,l,f,rr,c,Y))});var Et=Ie?ge?_w:bw:ge?An:Ci,Yt=Te?t:Et(c);return wo(Yt||c,function(Ct,rr){Yt&&(rr=Ct,Ct=c[rr]),xd(ae,rr,bo(Ct,l,f,rr,c,Y))}),ae}function X7(c){var l=Ci(c);return function(f){return Cb(f,c,l)}}function Cb(c,l,f){var S=f.length;if(c==null)return!S;for(c=jr(c);S--;){var z=f[S],Y=l[z],ae=c[z];if(ae===t&&!(z in c)||!Y(ae))return!1}return!0}function Sb(c,l,f){if(typeof c!="function")throw new vo(s);return Rd(function(){c.apply(t,f)},l)}function Ad(c,l,f,S){var z=-1,Y=np,ae=!0,le=c.length,ge=[],Ie=l.length;if(!le)return ge;f&&(l=Vr(l,zn(f))),S?(Y=Fm,ae=!1):l.length>=n&&(Y=md,ae=!1,l=new ml(l));e:for(;++zz?0:z+f),S=S===t||S>z?z:Qt(S),S<0&&(S+=z),S=f>S?0:H5(S);f0&&f(le)?l>1?Ni(le,l-1,f,S,z):sc(z,le):S||(z[z.length]=le)}return z}var rw=e5(),Rb=e5(!0);function Is(c,l){return c&&rw(c,l,Ci)}function iw(c,l){return c&&Rb(c,l,Ci)}function Ap(c,l){return oc(l,function(f){return ma(c[f])})}function vl(c,l){l=hc(l,c);for(var f=0,S=l.length;c!=null&&fl}function rS(c,l){return c!=null&&Or.call(c,l)}function iS(c,l){return c!=null&&l in jr(c)}function nS(c,l,f){return c>=qi(l,f)&&c=120&&Te.length>=120)?new ml(ae&&Te):t}Te=c[0];var ke=-1,He=le[0];e:for(;++ke-1;)le!==c&&pp.call(le,ge,1),pp.call(c,ge,1);return c}function jb(c,l){for(var f=c?l.length:0,S=f-1;f--;){var z=l[f];if(f==S||z!==Y){var Y=z;ga(z)?pp.call(c,z,1):fw(c,z)}}return c}function uw(c,l){return c+wp(bb()*(l-c+1))}function wS(c,l,f,S){for(var z=-1,Y=pi(mp((l-c)/(f||1)),0),ae=Ae(Y);Y--;)ae[S?Y:++z]=c,c+=f;return ae}function hw(c,l){var f="";if(!c||l<1||l>k)return f;do l%2&&(f+=c),l=wp(l/2),l&&(c+=c);while(l);return f}function Xt(c,l){return Tw(m5(c,l,En),c+"")}function vS(c){return Ab(qu(c))}function yS(c,l){var f=qu(c);return Np(f,wl(l,0,f.length))}function Sd(c,l,f,S){if(!Qr(c))return c;l=hc(l,c);for(var z=-1,Y=l.length,ae=Y-1,le=c;le!=null&&++zz?0:z+l),f=f>z?z:f,f<0&&(f+=z),z=l>f?0:f-l>>>0,l>>>=0;for(var Y=Ae(z);++S>>1,ae=c[Y];ae!==null&&!Hn(ae)&&(f?ae<=l:ae=n){var Ie=l?null:DS(c);if(Ie)return sp(Ie);ae=!1,z=md,ge=new ml}else ge=l?[]:le;e:for(;++S=S?c:_o(c,l,f)}var Kb=u7||function(c){return ur.clearTimeout(c)};function Gb(c,l){if(l)return c.slice();var f=c.length,S=gb?gb(f):new c.constructor(f);return c.copy(S),S}function ww(c){var l=new c.constructor(c.byteLength);return new dp(l).set(new dp(c)),l}function ES(c,l){var f=l?ww(c.buffer):c.buffer;return new c.constructor(f,c.byteOffset,c.byteLength)}function CS(c){var l=new c.constructor(c.source,er.exec(c));return l.lastIndex=c.lastIndex,l}function SS(c){return _d?jr(_d.call(c)):{}}function Zb(c,l){var f=l?ww(c.buffer):c.buffer;return new c.constructor(f,c.byteOffset,c.length)}function Qb(c,l){if(c!==l){var f=c!==t,S=c===null,z=c===c,Y=Hn(c),ae=l!==t,le=l===null,ge=l===l,Ie=Hn(l);if(!le&&!Ie&&!Y&&c>l||Y&&ae&&ge&&!le&&!Ie||S&&ae&&ge||!f&&ge||!z)return 1;if(!S&&!Y&&!Ie&&c=le)return ge;var Ie=f[S];return ge*(Ie=="desc"?-1:1)}}return c.index-l.index}function Yb(c,l,f,S){for(var z=-1,Y=c.length,ae=f.length,le=-1,ge=l.length,Ie=pi(Y-ae,0),Te=Ae(ge+Ie),ke=!S;++le1?f[z-1]:t,ae=z>2?f[2]:t;for(Y=c.length>3&&typeof Y=="function"?(z--,Y):t,ae&&nn(f[0],f[1],ae)&&(Y=z<3?t:Y,z=1),l=jr(l);++S-1?z[Y?l[ae]:ae]:t}}function i5(c){return pa(function(l){var f=l.length,S=f,z=yo.prototype.thru;for(c&&l.reverse();S--;){var Y=l[S];if(typeof Y!="function")throw new vo(s);if(z&&!ae&&Pp(Y)=="wrapper")var ae=new yo([],!0)}for(S=ae?S:f;++S1&&hr.reverse(),Te&&gele))return!1;var Ie=Y.get(c),Te=Y.get(l);if(Ie&&Te)return Ie==l&&Te==c;var ke=-1,He=!0,ut=f&L?new ml:t;for(Y.set(c,l),Y.set(l,c);++ke1?"& ":"")+l[S],l=l.join(f>2?", ":" "),c.replace(Nt,`{ +/* [wrapped with `+l+`] */ +`)}function WS(c){return Ht(c)||_l(c)||!!(vb&&c&&c[vb])}function ga(c,l){var f=typeof c;return l=l??k,!!l&&(f=="number"||f!="symbol"&&go.test(c))&&c>-1&&c%1==0&&c0){if(++l>=Z)return arguments[0]}else l=0;return c.apply(t,arguments)}}function Np(c,l){var f=-1,S=c.length,z=S-1;for(l=l===t?S:l;++f1?c[l-1]:t;return f=typeof f=="function"?(c.pop(),f):t,T5(c,f)});function R5(c){var l=G(c);return l.__chain__=!0,l}function eT(c,l){return l(c),c}function $p(c,l){return l(c)}var tT=pa(function(c){var l=c.length,f=l?c[0]:0,S=this.__wrapped__,z=function(Y){return tw(Y,c)};return l>1||this.__actions__.length||!(S instanceof nr)||!ga(f)?this.thru(z):(S=S.slice(f,+f+(l?1:0)),S.__actions__.push({func:$p,args:[z],thisArg:t}),new yo(S,this.__chain__).thru(function(Y){return l&&!Y.length&&Y.push(t),Y}))});function rT(){return R5(this)}function iT(){return new yo(this.value(),this.__chain__)}function nT(){this.__values__===t&&(this.__values__=W5(this.value()));var c=this.__index__>=this.__values__.length,l=c?t:this.__values__[this.__index__++];return{done:c,value:l}}function oT(){return this}function sT(c){for(var l,f=this;f instanceof bp;){var S=x5(f);S.__index__=0,S.__values__=t,l?z.__wrapped__=S:l=S;var z=S;f=f.__wrapped__}return z.__wrapped__=c,l}function aT(){var c=this.__wrapped__;if(c instanceof nr){var l=c;return this.__actions__.length&&(l=new nr(this)),l=l.reverse(),l.__actions__.push({func:$p,args:[Rw],thisArg:t}),new yo(l,this.__chain__)}return this.thru(Rw)}function cT(){return qb(this.__wrapped__,this.__actions__)}var lT=Ip(function(c,l,f){Or.call(c,f)?++c[f]:da(c,f,1)});function uT(c,l,f){var S=Ht(c)?nb:eS;return f&&nn(c,l,f)&&(l=t),S(c,_t(l,3))}function hT(c,l){var f=Ht(c)?oc:Tb;return f(c,_t(l,3))}var dT=r5(A5),fT=r5(E5);function pT(c,l){return Ni(Mp(c,l),1)}function gT(c,l){return Ni(Mp(c,l),R)}function mT(c,l,f){return f=f===t?1:Qt(f),Ni(Mp(c,l),f)}function k5(c,l){var f=Ht(c)?wo:lc;return f(c,_t(l,3))}function O5(c,l){var f=Ht(c)?$9:Ib;return f(c,_t(l,3))}var wT=Ip(function(c,l,f){Or.call(c,f)?c[f].push(l):da(c,f,[l])});function vT(c,l,f,S){c=xn(c)?c:qu(c),f=f&&!S?Qt(f):0;var z=c.length;return f<0&&(f=pi(z+f,0)),Fp(c)?f<=z&&c.indexOf(l,f)>-1:!!z&&Du(c,l,f)>-1}var yT=Xt(function(c,l,f){var S=-1,z=typeof l=="function",Y=xn(c)?Ae(c.length):[];return lc(c,function(ae){Y[++S]=z?Ei(l,ae,f):Ed(ae,l,f)}),Y}),bT=Ip(function(c,l,f){da(c,f,l)});function Mp(c,l){var f=Ht(c)?Vr:Nb;return f(c,_t(l,3))}function _T(c,l,f,S){return c==null?[]:(Ht(l)||(l=l==null?[]:[l]),f=S?t:f,Ht(f)||(f=f==null?[]:[f]),Ub(c,l,f))}var xT=Ip(function(c,l,f){c[f?0:1].push(l)},function(){return[[],[]]});function AT(c,l,f){var S=Ht(c)?zm:cb,z=arguments.length<3;return S(c,_t(l,4),f,z,lc)}function ET(c,l,f){var S=Ht(c)?M9:cb,z=arguments.length<3;return S(c,_t(l,4),f,z,Ib)}function CT(c,l){var f=Ht(c)?oc:Tb;return f(c,Lp(_t(l,3)))}function ST(c){var l=Ht(c)?Ab:vS;return l(c)}function IT(c,l,f){(f?nn(c,l,f):l===t)?l=1:l=Qt(l);var S=Ht(c)?Z7:yS;return S(c,l)}function TT(c){var l=Ht(c)?Q7:_S;return l(c)}function RT(c){if(c==null)return 0;if(xn(c))return Fp(c)?$u(c):c.length;var l=Vi(c);return l==Ce||l==lt?c.size:aw(c).length}function kT(c,l,f){var S=Ht(c)?Wm:xS;return f&&nn(c,l,f)&&(l=t),S(c,_t(l,3))}var OT=Xt(function(c,l){if(c==null)return[];var f=l.length;return f>1&&nn(c,l[0],l[1])?l=[]:f>2&&nn(l[0],l[1],l[2])&&(l=[l[0]]),Ub(c,Ni(l,1),[])}),Bp=h7||function(){return ur.Date.now()};function PT(c,l){if(typeof l!="function")throw new vo(s);return c=Qt(c),function(){if(--c<1)return l.apply(this,arguments)}}function P5(c,l,f){return l=f?t:l,l=c&&l==null?c.length:l,fa(c,_,t,t,t,t,l)}function D5(c,l){var f;if(typeof l!="function")throw new vo(s);return c=Qt(c),function(){return--c>0&&(f=l.apply(this,arguments)),c<=1&&(l=t),f}}var Ow=Xt(function(c,l,f){var S=$;if(f.length){var z=ac(f,Wu(Ow));S|=U}return fa(c,S,l,f,z)}),N5=Xt(function(c,l,f){var S=$|K;if(f.length){var z=ac(f,Wu(N5));S|=U}return fa(l,S,c,f,z)});function $5(c,l,f){l=f?t:l;var S=fa(c,q,t,t,t,t,t,l);return S.placeholder=$5.placeholder,S}function M5(c,l,f){l=f?t:l;var S=fa(c,D,t,t,t,t,t,l);return S.placeholder=M5.placeholder,S}function B5(c,l,f){var S,z,Y,ae,le,ge,Ie=0,Te=!1,ke=!1,He=!0;if(typeof c!="function")throw new vo(s);l=Ao(l)||0,Qr(f)&&(Te=!!f.leading,ke="maxWait"in f,Y=ke?pi(Ao(f.maxWait)||0,l):Y,He="trailing"in f?!!f.trailing:He);function ut(ii){var Xo=S,va=z;return S=z=t,Ie=ii,ae=c.apply(va,Xo),ae}function Et(ii){return Ie=ii,le=Rd(rr,l),Te?ut(ii):ae}function Yt(ii){var Xo=ii-ge,va=ii-Ie,r4=l-Xo;return ke?qi(r4,Y-va):r4}function Ct(ii){var Xo=ii-ge,va=ii-Ie;return ge===t||Xo>=l||Xo<0||ke&&va>=Y}function rr(){var ii=Bp();if(Ct(ii))return hr(ii);le=Rd(rr,Yt(ii))}function hr(ii){return le=t,He&&S?ut(ii):(S=z=t,ae)}function qn(){le!==t&&Kb(le),Ie=0,S=ge=z=le=t}function on(){return le===t?ae:hr(Bp())}function Vn(){var ii=Bp(),Xo=Ct(ii);if(S=arguments,z=this,ge=ii,Xo){if(le===t)return Et(ge);if(ke)return Kb(le),le=Rd(rr,l),ut(ge)}return le===t&&(le=Rd(rr,l)),ae}return Vn.cancel=qn,Vn.flush=on,Vn}var DT=Xt(function(c,l){return Sb(c,1,l)}),NT=Xt(function(c,l,f){return Sb(c,Ao(l)||0,f)});function $T(c){return fa(c,M)}function Up(c,l){if(typeof c!="function"||l!=null&&typeof l!="function")throw new vo(s);var f=function(){var S=arguments,z=l?l.apply(this,S):S[0],Y=f.cache;if(Y.has(z))return Y.get(z);var ae=c.apply(this,S);return f.cache=Y.set(z,ae)||Y,ae};return f.cache=new(Up.Cache||ha),f}Up.Cache=ha;function Lp(c){if(typeof c!="function")throw new vo(s);return function(){var l=arguments;switch(l.length){case 0:return!c.call(this);case 1:return!c.call(this,l[0]);case 2:return!c.call(this,l[0],l[1]);case 3:return!c.call(this,l[0],l[1],l[2])}return!c.apply(this,l)}}function MT(c){return D5(2,c)}var BT=AS(function(c,l){l=l.length==1&&Ht(l[0])?Vr(l[0],zn(_t())):Vr(Ni(l,1),zn(_t()));var f=l.length;return Xt(function(S){for(var z=-1,Y=qi(S.length,f);++z=l}),_l=Ob(function(){return arguments}())?Ob:function(c){return Xr(c)&&Or.call(c,"callee")&&!wb.call(c,"callee")},Ht=Ae.isArray,JT=tn?zn(tn):sS;function xn(c){return c!=null&&jp(c.length)&&!ma(c)}function ri(c){return Xr(c)&&xn(c)}function XT(c){return c===!0||c===!1||Xr(c)&&rn(c)==re}var fc=f7||Ww,eR=Zo?zn(Zo):aS;function tR(c){return Xr(c)&&c.nodeType===1&&!kd(c)}function rR(c){if(c==null)return!0;if(xn(c)&&(Ht(c)||typeof c=="string"||typeof c.splice=="function"||fc(c)||Hu(c)||_l(c)))return!c.length;var l=Vi(c);if(l==Ce||l==lt)return!c.size;if(Td(c))return!aw(c).length;for(var f in c)if(Or.call(c,f))return!1;return!0}function iR(c,l){return Cd(c,l)}function nR(c,l,f){f=typeof f=="function"?f:t;var S=f?f(c,l):t;return S===t?Cd(c,l,t,f):!!S}function Dw(c){if(!Xr(c))return!1;var l=rn(c);return l==X||l==E||typeof c.message=="string"&&typeof c.name=="string"&&!kd(c)}function oR(c){return typeof c=="number"&&yb(c)}function ma(c){if(!Qr(c))return!1;var l=rn(c);return l==ve||l==Ee||l==J||l==mt}function L5(c){return typeof c=="number"&&c==Qt(c)}function jp(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=k}function Qr(c){var l=typeof c;return c!=null&&(l=="object"||l=="function")}function Xr(c){return c!=null&&typeof c=="object"}var j5=mo?zn(mo):lS;function sR(c,l){return c===l||sw(c,l,Aw(l))}function aR(c,l,f){return f=typeof f=="function"?f:t,sw(c,l,Aw(l),f)}function cR(c){return F5(c)&&c!=+c}function lR(c){if(VS(c))throw new Ft(o);return Pb(c)}function uR(c){return c===null}function hR(c){return c==null}function F5(c){return typeof c=="number"||Xr(c)&&rn(c)==Be}function kd(c){if(!Xr(c)||rn(c)!=Ge)return!1;var l=fp(c);if(l===null)return!0;var f=Or.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&lp.call(f)==a7}var Nw=Ss?zn(Ss):uS;function dR(c){return L5(c)&&c>=-k&&c<=k}var z5=gd?zn(gd):hS;function Fp(c){return typeof c=="string"||!Ht(c)&&Xr(c)&&rn(c)==ze}function Hn(c){return typeof c=="symbol"||Xr(c)&&rn(c)==Ke}var Hu=fl?zn(fl):dS;function fR(c){return c===t}function pR(c){return Xr(c)&&Vi(c)==Fe}function gR(c){return Xr(c)&&rn(c)==Ze}var mR=Op(cw),wR=Op(function(c,l){return c<=l});function W5(c){if(!c)return[];if(xn(c))return Fp(c)?Qo(c):_n(c);if(wd&&c[wd])return Z9(c[wd]());var l=Vi(c),f=l==Ce?Zm:l==lt?sp:qu;return f(c)}function wa(c){if(!c)return c===0?c:0;if(c=Ao(c),c===R||c===-R){var l=c<0?-1:1;return l*B}return c===c?c:0}function Qt(c){var l=wa(c),f=l%1;return l===l?f?l-f:l:0}function H5(c){return c?wl(Qt(c),0,y):0}function Ao(c){if(typeof c=="number")return c;if(Hn(c))return N;if(Qr(c)){var l=typeof c.valueOf=="function"?c.valueOf():c;c=Qr(l)?l+"":l}if(typeof c!="string")return c===0?c:+c;c=lb(c);var f=ho.test(c);return f||po.test(c)?Wt(c.slice(2),f?2:8):uo.test(c)?N:+c}function q5(c){return Ts(c,An(c))}function vR(c){return c?wl(Qt(c),-k,k):c===0?c:0}function Cr(c){return c==null?"":Wn(c)}var yR=Fu(function(c,l){if(Td(l)||xn(l)){Ts(l,Ci(l),c);return}for(var f in l)Or.call(l,f)&&xd(c,f,l[f])}),V5=Fu(function(c,l){Ts(l,An(l),c)}),zp=Fu(function(c,l,f,S){Ts(l,An(l),c,S)}),bR=Fu(function(c,l,f,S){Ts(l,Ci(l),c,S)}),_R=pa(tw);function xR(c,l){var f=ju(c);return l==null?f:Eb(f,l)}var AR=Xt(function(c,l){c=jr(c);var f=-1,S=l.length,z=S>2?l[2]:t;for(z&&nn(l[0],l[1],z)&&(S=1);++f1),Y}),Ts(c,_w(c),f),S&&(f=bo(f,p|v|b,NS));for(var z=l.length;z--;)fw(f,l[z]);return f});function FR(c,l){return G5(c,Lp(_t(l)))}var zR=pa(function(c,l){return c==null?{}:gS(c,l)});function G5(c,l){if(c==null)return{};var f=Vr(_w(c),function(S){return[S]});return l=_t(l),Lb(c,f,function(S,z){return l(S,z[0])})}function WR(c,l,f){l=hc(l,c);var S=-1,z=l.length;for(z||(z=1,c=t);++Sl){var S=c;c=l,l=S}if(f||c%1||l%1){var z=bb();return qi(c+z*(l-c+Ur("1e-"+((z+"").length-1))),l)}return uw(c,l)}var ek=zu(function(c,l,f){return l=l.toLowerCase(),c+(f?Y5(l):l)});function Y5(c){return Bw(Cr(c).toLowerCase())}function J5(c){return c=Cr(c),c&&c.replace(Ai,H9).replace(Lm,"")}function tk(c,l,f){c=Cr(c),l=Wn(l);var S=c.length;f=f===t?S:wl(Qt(f),0,S);var z=f;return f-=l.length,f>=0&&c.slice(f,z)==l}function rk(c){return c=Cr(c),c&&At.test(c)?c.replace(Xi,q9):c}function ik(c){return c=Cr(c),c&&Ut.test(c)?c.replace(Er,"\\$&"):c}var nk=zu(function(c,l,f){return c+(f?"-":"")+l.toLowerCase()}),ok=zu(function(c,l,f){return c+(f?" ":"")+l.toLowerCase()}),sk=t5("toLowerCase");function ak(c,l,f){c=Cr(c),l=Qt(l);var S=l?$u(c):0;if(!l||S>=l)return c;var z=(l-S)/2;return kp(wp(z),f)+c+kp(mp(z),f)}function ck(c,l,f){c=Cr(c),l=Qt(l);var S=l?$u(c):0;return l&&S>>0,f?(c=Cr(c),c&&(typeof l=="string"||l!=null&&!Nw(l))&&(l=Wn(l),!l&&Nu(c))?dc(Qo(c),0,f):c.split(l,f)):[]}var gk=zu(function(c,l,f){return c+(f?" ":"")+Bw(l)});function mk(c,l,f){return c=Cr(c),f=f==null?0:wl(Qt(f),0,c.length),l=Wn(l),c.slice(f,f+l.length)==l}function wk(c,l,f){var S=G.templateSettings;f&&nn(c,l,f)&&(l=t),c=Cr(c),l=zp({},l,S,c5);var z=zp({},l.imports,S.imports,c5),Y=Ci(z),ae=Gm(z,Y),le,ge,Ie=0,Te=l.interpolate||xs,ke="__p += '",He=Qm((l.escape||xs).source+"|"+Te.source+"|"+(Te===It?kr:xs).source+"|"+(l.evaluate||xs).source+"|$","g"),ut="//# sourceURL="+(Or.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jm+"]")+` +`;c.replace(He,function(Ct,rr,hr,qn,on,Vn){return hr||(hr=qn),ke+=c.slice(Ie,Vn).replace(rl,V9),rr&&(le=!0,ke+=`' + +__e(`+rr+`) + +'`),on&&(ge=!0,ke+=`'; +`+on+`; +__p += '`),hr&&(ke+=`' + +((__t = (`+hr+`)) == null ? '' : __t) + +'`),Ie=Vn+Ct.length,Ct}),ke+=`'; +`;var Et=Or.call(l,"variable")&&l.variable;if(!Et)ke=`with (obj) { +`+ke+` +} +`;else if(Rr.test(Et))throw new Ft(a);ke=(ge?ke.replace(st,""):ke).replace(Zr,"$1").replace(lr,"$1;"),ke="function("+(Et||"obj")+`) { +`+(Et?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(le?", __e = _.escape":"")+(ge?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+ke+`return __p +}`;var Yt=e4(function(){return vr(Y,ut+"return "+ke).apply(t,ae)});if(Yt.source=ke,Dw(Yt))throw Yt;return Yt}function vk(c){return Cr(c).toLowerCase()}function yk(c){return Cr(c).toUpperCase()}function bk(c,l,f){if(c=Cr(c),c&&(f||l===t))return lb(c);if(!c||!(l=Wn(l)))return c;var S=Qo(c),z=Qo(l),Y=ub(S,z),ae=hb(S,z)+1;return dc(S,Y,ae).join("")}function _k(c,l,f){if(c=Cr(c),c&&(f||l===t))return c.slice(0,fb(c)+1);if(!c||!(l=Wn(l)))return c;var S=Qo(c),z=hb(S,Qo(l))+1;return dc(S,0,z).join("")}function xk(c,l,f){if(c=Cr(c),c&&(f||l===t))return c.replace(Dt,"");if(!c||!(l=Wn(l)))return c;var S=Qo(c),z=ub(S,Qo(l));return dc(S,z).join("")}function Ak(c,l){var f=j,S=V;if(Qr(l)){var z="separator"in l?l.separator:z;f="length"in l?Qt(l.length):f,S="omission"in l?Wn(l.omission):S}c=Cr(c);var Y=c.length;if(Nu(c)){var ae=Qo(c);Y=ae.length}if(f>=Y)return c;var le=f-$u(S);if(le<1)return S;var ge=ae?dc(ae,0,le).join(""):c.slice(0,le);if(z===t)return ge+S;if(ae&&(le+=ge.length-le),Nw(z)){if(c.slice(le).search(z)){var Ie,Te=ge;for(z.global||(z=Qm(z.source,Cr(er.exec(z))+"g")),z.lastIndex=0;Ie=z.exec(Te);)var ke=Ie.index;ge=ge.slice(0,ke===t?le:ke)}}else if(c.indexOf(Wn(z),le)!=le){var He=ge.lastIndexOf(z);He>-1&&(ge=ge.slice(0,He))}return ge+S}function Ek(c){return c=Cr(c),c&&Ot.test(c)?c.replace(fr,X9):c}var Ck=zu(function(c,l,f){return c+(f?" ":"")+l.toUpperCase()}),Bw=t5("toUpperCase");function X5(c,l,f){return c=Cr(c),l=f?t:l,l===t?G9(c)?r7(c):L9(c):c.match(l)||[]}var e4=Xt(function(c,l){try{return Ei(c,t,l)}catch(f){return Dw(f)?f:new Ft(f)}}),Sk=pa(function(c,l){return wo(l,function(f){f=Rs(f),da(c,f,Ow(c[f],c))}),c});function Ik(c){var l=c==null?0:c.length,f=_t();return c=l?Vr(c,function(S){if(typeof S[1]!="function")throw new vo(s);return[f(S[0]),S[1]]}):[],Xt(function(S){for(var z=-1;++zk)return[];var f=y,S=qi(c,y);l=_t(l),c-=y;for(var z=Km(S,l);++f0||l<0)?new nr(f):(c<0?f=f.takeRight(-c):c&&(f=f.drop(c)),l!==t&&(l=Qt(l),f=l<0?f.dropRight(-l):f.take(l-c)),f)},nr.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},nr.prototype.toArray=function(){return this.take(y)},Is(nr.prototype,function(c,l){var f=/^(?:filter|find|map|reject)|While$/.test(l),S=/^(?:head|last)$/.test(l),z=G[S?"take"+(l=="last"?"Right":""):l],Y=S||/^find/.test(l);z&&(G.prototype[l]=function(){var ae=this.__wrapped__,le=S?[1]:arguments,ge=ae instanceof nr,Ie=le[0],Te=ge||Ht(ae),ke=function(rr){var hr=z.apply(G,sc([rr],le));return S&&He?hr[0]:hr};Te&&f&&typeof Ie=="function"&&Ie.length!=1&&(ge=Te=!1);var He=this.__chain__,ut=!!this.__actions__.length,Et=Y&&!He,Yt=ge&&!ut;if(!Y&&Te){ae=Yt?ae:new nr(this);var Ct=c.apply(ae,le);return Ct.__actions__.push({func:$p,args:[ke],thisArg:t}),new yo(Ct,He)}return Et&&Yt?c.apply(this,le):(Ct=this.thru(ke),Et?S?Ct.value()[0]:Ct.value():Ct)})}),wo(["pop","push","shift","sort","splice","unshift"],function(c){var l=ap[c],f=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",S=/^(?:pop|shift)$/.test(c);G.prototype[c]=function(){var z=arguments;if(S&&!this.__chain__){var Y=this.value();return l.apply(Ht(Y)?Y:[],z)}return this[f](function(ae){return l.apply(Ht(ae)?ae:[],z)})}}),Is(nr.prototype,function(c,l){var f=G[l];if(f){var S=f.name+"";Or.call(Lu,S)||(Lu[S]=[]),Lu[S].push({name:l,func:f})}}),Lu[Tp(t,K).name]=[{name:"wrapper",func:t}],nr.prototype.clone=E7,nr.prototype.reverse=C7,nr.prototype.value=S7,G.prototype.at=tT,G.prototype.chain=rT,G.prototype.commit=iT,G.prototype.next=nT,G.prototype.plant=sT,G.prototype.reverse=aT,G.prototype.toJSON=G.prototype.valueOf=G.prototype.value=cT,G.prototype.first=G.prototype.head,wd&&(G.prototype[wd]=oT),G},Mu=i7();ti?((ti.exports=Mu)._=Mu,Lr._=Mu):ur._=Mu}).call(Ld)})(D2,D2.exports);var hq=Object.defineProperty,dq=Object.defineProperties,fq=Object.getOwnPropertyDescriptors,p8=Object.getOwnPropertySymbols,pq=Object.prototype.hasOwnProperty,gq=Object.prototype.propertyIsEnumerable,g8=(r,e,t)=>e in r?hq(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yp=(r,e)=>{for(var t in e||(e={}))pq.call(e,t)&&g8(r,t,e[t]);if(p8)for(var t of p8(e))gq.call(e,t)&&g8(r,t,e[t]);return r},mq=(r,e)=>dq(r,fq(e));function Bc(r,e,t){var i;const n=f1(r);return((i=e.rpcMap)==null?void 0:i[n.reference])||`${uq}?chainId=${n.namespace}:${n.reference}&projectId=${t}`}function wu(r){return r.includes(":")?r.split(":")[1]:r}function vE(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function wq(r,e){const t=Object.keys(e.namespaces).filter(n=>n.includes(r));if(!t.length)return[];const i=[];return t.forEach(n=>{const o=e.namespaces[n].accounts;i.push(...o)}),i}function xv(r={},e={}){const t=m8(r),i=m8(e);return D2.exports.merge(t,i)}function m8(r){var e,t,i,n;const o={};if(!mf(r))return o;for(const[s,a]of Object.entries(r)){const u=ey(s)?[s]:a.chains,h=a.methods||[],d=a.events||[],p=a.rpcMap||{},v=Vd(s);o[v]=mq(Yp(Yp({},o[v]),a),{chains:p1(u,(e=o[v])==null?void 0:e.chains),methods:p1(h,(t=o[v])==null?void 0:t.methods),events:p1(d,(i=o[v])==null?void 0:i.events),rpcMap:Yp(Yp({},p),(n=o[v])==null?void 0:n.rpcMap)})}return o}function vq(r){return r.includes(":")?r.split(":")[2]:r}function w8(r){const e={};for(const[t,i]of Object.entries(r)){const n=i.methods||[],o=i.events||[],s=i.accounts||[],a=ey(t)?[t]:i.chains?i.chains:vE(i.accounts);e[t]={chains:a,methods:n,events:o,accounts:s}}return e}function Av(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const yE={},Gr=r=>yE[r],Ev=(r,e)=>{yE[r]=e};class yq{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Gr("events"),this.client=Gr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ja.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=wu(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Bc(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ya(new Kc(i,Gr("disableProviderPing")))}}class bq{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Gr("events"),this.client=Gr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Ja.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const i=t||Bc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ya(new Kc(i,Gr("disableProviderPing")))}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=parseInt(wu(t));e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let n=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";n=n.startsWith("0x")?n:`0x${n}`;const o=parseInt(n,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class _q{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Gr("events"),this.client=Gr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ja.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=wu(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Bc(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ya(new Kc(i,Gr("disableProviderPing")))}}class xq{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Gr("events"),this.client=Gr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ja.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=wu(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Bc(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ya(new Kc(i,Gr("disableProviderPing")))}}class Aq{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Gr("events"),this.client=Gr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ja.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const i=this.getCardanoRPCUrl(t),n=wu(t);e[n]=this.createHttpProvider(n,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ya(new Kc(i,Gr("disableProviderPing")))}}class Eq{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Gr("events"),this.client=Gr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ja.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=wu(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Bc(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ya(new Kc(i,Gr("disableProviderPing")))}}class Cq{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Gr("events"),this.client=Gr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ja.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=wu(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Bc(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ya(new Kc(i,Gr("disableProviderPing")))}}class Sq{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Gr("events"),this.client=Gr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const i=t||Bc(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(Ja.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Bc(e,this.namespace);return typeof i>"u"?void 0:new Ya(new Kc(i,Gr("disableProviderPing")))}}var Iq=Object.defineProperty,Tq=Object.defineProperties,Rq=Object.getOwnPropertyDescriptors,v8=Object.getOwnPropertySymbols,kq=Object.prototype.hasOwnProperty,Oq=Object.prototype.propertyIsEnumerable,y8=(r,e,t)=>e in r?Iq(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Jp=(r,e)=>{for(var t in e||(e={}))kq.call(e,t)&&y8(r,t,e[t]);if(v8)for(var t of v8(e))Oq.call(e,t)&&y8(r,t,e[t]);return r},Cv=(r,e)=>Tq(r,Rq(e));class ly{constructor(e){this.events=new L3,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:v0(Yg({level:(e==null?void 0:e.logger)||d8})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new ly(e);return await t.initialize(),t}async request(e,t,i){const[n,o]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:Jp({},e),chainId:`${n}:${o}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,n){const o=new Date().getTime();this.request(e,i,n).then(s=>t(null,Jg(o,s))).catch(s=>t(s,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Pr("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:t,response:i}=await this.client.authenticate(e);t&&(this.uri=t,this.events.emit("display_uri",t));const n=await i();if(this.session=n.session,this.session){const o=w8(this.session.namespaces);this.namespaces=xv(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return n}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await n().then(o=>{this.session=o;const s=w8(o.namespaces);this.namespaces=xv(this.namespaces,s),this.persist("namespaces",this.namespaces)}).catch(o=>{if(o.message!==wE)throw o;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[i,n]=this.validateChain(e);this.getProvider(i).setDefaultChain(n,t)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(Hs(t)){for(const i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await cy.init({logger:this.providerOpts.logger||d8,relayUrl:this.providerOpts.relayUrl||aq,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>Vd(t)))];Ev("client",this.client),Ev("events",this.events),Ev("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const i=wq(t,this.session),n=vE(i),o=xv(this.namespaces,this.optionalNamespaces),s=Cv(Jp({},o[t]),{accounts:i,chains:n});switch(t){case"eip155":this.rpcProviders[t]=new bq({namespace:s});break;case"solana":this.rpcProviders[t]=new _q({namespace:s});break;case"cosmos":this.rpcProviders[t]=new xq({namespace:s});break;case"polkadot":this.rpcProviders[t]=new yq({namespace:s});break;case"cip34":this.rpcProviders[t]=new Aq({namespace:s});break;case"elrond":this.rpcProviders[t]=new Eq({namespace:s});break;case"multiversx":this.rpcProviders[t]=new Cq({namespace:s});break;case"near":this.rpcProviders[t]=new Sq({namespace:s});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:i}=t;if(i.name==="accountsChanged"){const n=i.data;n&&Hs(n)&&this.events.emit("accountsChanged",n.map(vq))}else if(i.name==="chainChanged"){const n=t.chainId,o=t.event.data,s=Vd(n),a=Av(n)!==Av(o)?`${s}:${Av(o)}`:n;this.onChainChanged(a)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;const{namespaces:n}=t,o=(i=this.client)==null?void 0:i.session.get(e);this.session=Cv(Jp({},o),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Cv(Jp({},Pr("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ja.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:i,sessionProperties:n}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=n,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){const[t,i]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(s=>Vd(s)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];const n=Vd(Object.keys(this.namespaces)[0]),o=this.rpcProviders[n].getDefaultChain();return[n,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[i,n]=this.validateChain(e);n&&(t||this.getProvider(i).setDefaultChain(n),this.namespaces[i]?this.namespaces[i].defaultChain=n:this.namespaces[`${i}:${n}`]?this.namespaces[`${i}:${n}`].defaultChain=n:this.namespaces[`${i}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${f8}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${f8}/${e}`)}}const Pq=ly,Dq="wc",Nq="ethereum_provider",$q=`${Dq}@2:${Nq}:`,Mq="https://rpc.walletconnect.com/v1/",z1=["eth_sendTransaction","personal_sign"],uy=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],W1=["chainChanged","accountsChanged"],bE=["chainChanged","accountsChanged","message","disconnect","connect"];var Bq=Object.defineProperty,Uq=Object.defineProperties,Lq=Object.getOwnPropertyDescriptors,b8=Object.getOwnPropertySymbols,jq=Object.prototype.hasOwnProperty,Fq=Object.prototype.propertyIsEnumerable,_8=(r,e,t)=>e in r?Bq(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,eh=(r,e)=>{for(var t in e||(e={}))jq.call(e,t)&&_8(r,t,e[t]);if(b8)for(var t of b8(e))Fq.call(e,t)&&_8(r,t,e[t]);return r},Sv=(r,e)=>Uq(r,Lq(e));function H1(r){return Number(r[0].split(":")[1])}function Xp(r){return`0x${r.toString(16)}`}function zq(r){const{chains:e,optionalChains:t,methods:i,optionalMethods:n,events:o,optionalEvents:s,rpcMap:a}=r;if(!Hs(e))throw new Error("Invalid chains");const u={chains:e,methods:i||z1,events:o||W1,rpcMap:eh({},e.length?{[H1(e)]:a[H1(e)]}:{})},h=o==null?void 0:o.filter(b=>!W1.includes(b)),d=i==null?void 0:i.filter(b=>!z1.includes(b));if(!t&&!s&&!n&&!(h!=null&&h.length)&&!(d!=null&&d.length))return{required:e.length?u:void 0};const p=(h==null?void 0:h.length)&&(d==null?void 0:d.length)||!t,v={chains:[...new Set(p?u.chains.concat(t||[]):t)],methods:[...new Set(u.methods.concat(n!=null&&n.length?n:uy))],events:[...new Set(u.events.concat(s!=null&&s.length?s:bE))],rpcMap:a};return{required:e.length?u:void 0,optional:t.length?v:void 0}}let _E=class xE{constructor(){this.events=new no.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=$q,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new xE;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,i){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:i}=zq(this.rpc);try{const n=await new Promise(async(s,a)=>{var u;this.rpc.showQrModal&&((u=this.modal)==null||u.subscribeModal(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Sv(eh({namespaces:eh({},t&&{[this.namespace]:t})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(h=>{s(h)}).catch(h=>{a(new Error(h.message))})});if(!n)return;const o=R4(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:Xp(this.chainId)})}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async authenticate(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const t=await new Promise(async(n,o)=>{var s;this.rpc.showQrModal&&((s=this.modal)==null||s.subscribeModal(a=>{!a.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(Sv(eh({},e),{chains:this.rpc.chains})).then(a=>{n(a)}).catch(a=>{o(new Error(a.message))})}),i=t.session;if(i){const n=R4(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:n),this.setAccounts(n),this.events.emit("connect",{chainId:Xp(this.chainId)})}return t}catch(t){throw this.signer.logger.error(t),t}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:i}=t;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Xp(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Sv(eh({},Pr("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,i;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Xp(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,i,n]=e.split(":");return{chainId:`${t}:${i}`,address:n}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,i;const n=(t=e==null?void 0:e.chains)!=null?t:[],o=(i=e==null?void 0:e.optionalChains)!=null?i:[],s=n.concat(o);if(!s.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=n.length?(e==null?void 0:e.methods)||z1:[],u=n.length?(e==null?void 0:e.events)||W1:[],h=(e==null?void 0:e.optionalMethods)||[],d=(e==null?void 0:e.optionalEvents)||[],p=(e==null?void 0:e.rpcMap)||this.buildRpcMap(s,e.projectId),v=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:n==null?void 0:n.map(b=>this.formatChainId(b)),optionalChains:o.map(b=>this.formatChainId(b)),methods:a,events:u,optionalMethods:h,optionalEvents:d,rpcMap:p,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:v,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const i={};return e.forEach(n=>{i[n]=this.getRpcUrl(n,t)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?H1(this.rpc.chains):H1(this.rpc.optionalChains),this.signer=await Pq.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:i}=await Bo(()=>import("./index.hW7Iu6gF.js").then(n=>n.i),__vite__mapDeps([0,1]),import.meta.url);t=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(eh({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:i,rpcMap:n}=e;t&&Hs(t)&&(this.rpc.chains=t.map(o=>this.formatChainId(o)),t.forEach(o=>{this.rpc.rpcMap[o]=(n==null?void 0:n[o])||this.getRpcUrl(o)})),i&&Hs(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(o=>this.formatChainId(o)),i.forEach(o=>{this.rpc.rpcMap[o]=(n==null?void 0:n[o])||this.getRpcUrl(o)}))}getRpcUrl(e,t){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${Mq}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}};const Wq=_E,Hq=Object.freeze(Object.defineProperty({__proto__:null,EthereumProvider:Wq,OPTIONAL_EVENTS:bE,OPTIONAL_METHODS:uy,REQUIRED_EVENTS:W1,REQUIRED_METHODS:z1,default:_E},Symbol.toStringTag,{value:"Module"}));function qq(r){const e=t=>r(t.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function Vq(){const r=new Set;let e=[];const t=()=>qq(n=>{e.some(({info:o})=>o.uuid===n.info.uuid)||(e=[...e,n],r.forEach(o=>o(e,{added:[n]})))});let i=t();return{_listeners(){return r},clear(){r.forEach(n=>n([],{removed:[...e]})),e=[]},destroy(){this.clear(),r.clear(),i()},findProvider({rdns:n}){return e.find(o=>o.info.rdns===n)},getProviders(){return e},reset(){this.clear(),i(),i=t()},subscribe(n,{emitImmediately:o}={}){return r.add(n),o&&n(e,{added:e}),()=>r.delete(n)}}}var Kq={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Gq=r=>(e,t,i)=>{const n=i.subscribe;return i.subscribe=(s,a,u)=>{let h=s;if(a){const d=(u==null?void 0:u.equalityFn)||Object.is;let p=s(i.getState());h=v=>{const b=s(v);if(!d(p,b)){const I=p;a(p=b,I)}},u!=null&&u.fireImmediately&&a(p,p)}return n(h)},r(e,t,i)},Zq=Gq;function Qq(r,e){let t;try{t=r()}catch{return}return{getItem:n=>{var o;const s=u=>u===null?null:JSON.parse(u,void 0),a=(o=t.getItem(n))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(n,o)=>t.setItem(n,JSON.stringify(o,void 0)),removeItem:n=>t.removeItem(n)}}const bf=r=>e=>{try{const t=r(e);return t instanceof Promise?t:{then(i){return bf(i)(t)},catch(i){return this}}}catch(t){return{then(i){return this},catch(i){return bf(i)(t)}}}},Yq=(r,e)=>(t,i,n)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:$=>$,version:0,merge:($,K)=>({...K,...$}),...e},s=!1;const a=new Set,u=new Set;let h;try{h=o.getStorage()}catch{}if(!h)return r((...$)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...$)},i,n);const d=bf(o.serialize),p=()=>{const $=o.partialize({...i()});let K;const P=d({state:$,version:o.version}).then(q=>h.setItem(o.name,q)).catch(q=>{K=q});if(K)throw K;return P},v=n.setState;n.setState=($,K)=>{v($,K),p()};const b=r((...$)=>{t(...$),p()},i,n);let I;const L=()=>{var $;if(!h)return;s=!1,a.forEach(P=>P(i()));const K=(($=o.onRehydrateStorage)==null?void 0:$.call(o,i()))||void 0;return bf(h.getItem.bind(h))(o.name).then(P=>{if(P)return o.deserialize(P)}).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==o.version){if(o.migrate)return o.migrate(P.state,P.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return P.state}).then(P=>{var q;return I=o.merge(P,(q=i())!=null?q:b),t(I,!0),p()}).then(()=>{K==null||K(I,void 0),s=!0,u.forEach(P=>P(I))}).catch(P=>{K==null||K(void 0,P)})};return n.persist={setOptions:$=>{o={...o,...$},$.getStorage&&(h=$.getStorage())},clearStorage:()=>{h==null||h.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>L(),hasHydrated:()=>s,onHydrate:$=>(a.add($),()=>{a.delete($)}),onFinishHydration:$=>(u.add($),()=>{u.delete($)})},L(),I||b},Jq=(r,e)=>(t,i,n)=>{let o={storage:Qq(()=>localStorage),partialize:L=>L,version:0,merge:(L,$)=>({...$,...L}),...e},s=!1;const a=new Set,u=new Set;let h=o.storage;if(!h)return r((...L)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...L)},i,n);const d=()=>{const L=o.partialize({...i()});return h.setItem(o.name,{state:L,version:o.version})},p=n.setState;n.setState=(L,$)=>{p(L,$),d()};const v=r((...L)=>{t(...L),d()},i,n);let b;const I=()=>{var L,$;if(!h)return;s=!1,a.forEach(P=>{var q;return P((q=i())!=null?q:v)});const K=(($=o.onRehydrateStorage)==null?void 0:$.call(o,(L=i())!=null?L:v))||void 0;return bf(h.getItem.bind(h))(o.name).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==o.version){if(o.migrate)return o.migrate(P.state,P.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return P.state}).then(P=>{var q;return b=o.merge(P,(q=i())!=null?q:v),t(b,!0),d()}).then(()=>{K==null||K(b,void 0),b=i(),s=!0,u.forEach(P=>P(b))}).catch(P=>{K==null||K(void 0,P)})};return n.persist={setOptions:L=>{o={...o,...L},L.storage&&(h=L.storage)},clearStorage:()=>{h==null||h.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>I(),hasHydrated:()=>s,onHydrate:L=>(a.add(L),()=>{a.delete(L)}),onFinishHydration:L=>(u.add(L),()=>{u.delete(L)})},o.skipHydration||I(),b||v},Xq=(r,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((Kq?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Yq(r,e)):Jq(r,e),eV=Xq;var tV={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const x8=r=>{let e;const t=new Set,i=(u,h)=>{const d=typeof u=="function"?u(e):u;if(!Object.is(d,e)){const p=e;e=h??typeof d!="object"?d:Object.assign({},e,d),t.forEach(v=>v(e,p))}},n=()=>e,a={setState:i,getState:n,subscribe:u=>(t.add(u),()=>t.delete(u)),destroy:()=>{(tV?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}};return e=r(i,n,a),a},Iv=r=>r?x8(r):x8;var AE={exports:{}};(function(r){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function n(u,h,d){this.fn=u,this.context=h,this.once=d||!1}function o(u,h,d,p,v){if(typeof d!="function")throw new TypeError("The listener must be a function");var b=new n(d,p||u,v),I=t?t+h:h;return u._events[I]?u._events[I].fn?u._events[I]=[u._events[I],b]:u._events[I].push(b):(u._events[I]=b,u._eventsCount++),u}function s(u,h){--u._eventsCount===0?u._events=new i:delete u._events[h]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],d,p;if(this._eventsCount===0)return h;for(p in d=this._events)e.call(d,p)&&h.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},a.prototype.listeners=function(h){var d=t?t+h:h,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var v=0,b=p.length,I=new Array(b);v{let n=i;return(n==null?void 0:n.__type)==="bigint"&&(n=BigInt(n.value)),(n==null?void 0:n.__type)==="Map"&&(n=new Map(n.value)),(e==null?void 0:e(t,n))??n})}function A8(r,e){return r.slice(0,e).join(".")||"."}function E8(r,e){const{length:t}=r;for(let i=0;i{let s=o;return typeof s=="bigint"&&(s={__type:"bigint",value:o.toString()}),s instanceof Map&&(s={__type:"Map",value:Array.from(o.entries())}),(e==null?void 0:e(n,s))??s},i),t??void 0)}function lV(r){const{deserialize:e=sV,key:t="wagmi",serialize:i=cV,storage:n=EE}=r;function o(s){return s instanceof Promise?s.then(a=>a).catch(()=>null):s}return{...n,key:t,async getItem(s,a){const u=n.getItem(`${t}.${s}`),h=await o(u);return h?e(h)??null:a??null},async setItem(s,a){const u=`${t}.${s}`;a===null?await o(n.removeItem(u)):await o(n.setItem(u,i(a)))},async removeItem(s){await o(n.removeItem(`${t}.${s}`))}}}const EE={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};const A1="2.9.8",uV=()=>`@wagmi/core@${A1}`;var CE=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},q1,SE;class Ba extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return uV()}constructor(e,t={}){var o;super(),q1.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const i=t.cause instanceof Ba?t.cause.details:(o=t.cause)!=null&&o.message?t.cause.message:t.details,n=t.cause instanceof Ba&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: ${this.docsBaseUrl}${n}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...i?[`Details: ${i}`]:[],`Version: ${this.version}`].join(` +`),t.cause&&(this.cause=t.cause),this.details=i,this.docsPath=n,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return CE(this,q1,"m",SE).call(this,this,e)}}q1=new WeakSet,SE=function r(e,t){return t!=null&&t(e)?e:e.cause?CE(this,q1,"m",r).call(this,e.cause,t):e};class yh extends Ba{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class hV extends Ba{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class dV extends Ba{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class fV extends Ba{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class bc extends Ba{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class pV extends Ba{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}const gV=/(rabby|trustwallet)/,mV={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(r){return r!=null&&r.coinbaseWalletExtension?r.coinbaseWalletExtension:E1(r,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(r){return E1(r,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const i of t)if(e[i])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(r){var e,t;return(e=r==null?void 0:r.phantom)!=null&&e.ethereum?(t=r.phantom)==null?void 0:t.ethereum:E1(r,"isPhantom")}}};im.type="injected";function im(r={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=r;function i(){const u=r.target;if(typeof u=="function"){const h=u();if(h)return h}return typeof u=="object"?u:typeof u=="string"?{...mV[u]??{id:u,name:`${u[0].toUpperCase()}${u.slice(1)}`,provider:`is${u[0].toUpperCase()}${u.slice(1)}`}}:{id:"injected",name:"Injected",provider(h){return h==null?void 0:h.ethereum}}}let n,o,s,a;return u=>({get icon(){return i().icon},get id(){return i().id},get name(){return i().name},get supportsSimulation(){return gV.test(this.id.toLowerCase())},type:im.type,async setup(){const h=await this.getProvider();h&&r.target&&(s||(s=this.onConnect.bind(this),h.on("connect",s)),n||(n=this.onAccountsChanged.bind(this),h.on("accountsChanged",n)))},async connect({chainId:h,isReconnecting:d}={}){var b,I,L,$,K,P;const p=await this.getProvider();if(!p)throw new bc;let v=[];if(d)v=await this.getAccounts().catch(()=>[]);else if(e)try{v=($=(L=(I=(b=(await p.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:b.caveats)==null?void 0:I[0])==null?void 0:L.value)==null?void 0:$.map(D=>Zn(D))}catch(q){const D=q;if(D.code===cn.code)throw new cn(D);if(D.code===Hw.code)throw D}try{!(v!=null&&v.length)&&!d&&(v=(await p.request({method:"eth_requestAccounts"})).map(U=>Zn(U))),s&&(p.removeListener("connect",s),s=void 0),n||(n=this.onAccountsChanged.bind(this),p.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),p.on("chainChanged",o)),a||(a=this.onDisconnect.bind(this),p.on("disconnect",a));let q=await this.getChainId();if(h&&q!==h){const D=await this.switchChain({chainId:h}).catch(U=>{if(U.code===cn.code)throw U;return{id:q}});q=(D==null?void 0:D.id)??q}return e&&await((K=u.storage)==null?void 0:K.removeItem(`${this.id}.disconnected`)),r.target||await((P=u.storage)==null?void 0:P.setItem("injected.connected",!0)),{accounts:v,chainId:q}}catch(q){const D=q;throw D.code===cn.code?new cn(D):D.code===Hw.code?new Hw(D):D}},async disconnect(){var d,p;const h=await this.getProvider();if(!h)throw new bc;o&&(h.removeListener("chainChanged",o),o=void 0),a&&(h.removeListener("disconnect",a),a=void 0),s||(s=this.onConnect.bind(this),h.on("connect",s));try{await h.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]})}catch{}e&&await((d=u.storage)==null?void 0:d.setItem(`${this.id}.disconnected`,!0)),r.target||await((p=u.storage)==null?void 0:p.removeItem("injected.connected"))},async getAccounts(){const h=await this.getProvider();if(!h)throw new bc;return(await h.request({method:"eth_accounts"})).map(p=>Zn(p))},async getChainId(){const h=await this.getProvider();if(!h)throw new bc;const d=await h.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let h;const d=i();return typeof d.provider=="function"?h=d.provider(window):typeof d.provider=="string"?h=E1(window,d.provider):h=d.provider,h&&!h.removeListener&&("off"in h&&typeof h.off=="function"?h.removeListener=h.off:h.removeListener=()=>{}),h},async isAuthorized(){var h,d;try{if(e&&await((h=u.storage)==null?void 0:h.getItem(`${this.id}.disconnected`))||!r.target&&!await((d=u.storage)==null?void 0:d.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const I=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",I),!!await this.getProvider()),L=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(K=>window.addEventListener("ethereum#initialized",()=>K(I()),{once:!0}))]:[],new Promise(K=>setTimeout(()=>K(I()),L))]))return!0}throw new bc}return!!(await kO(()=>OO(()=>this.getAccounts(),{timeout:100}))).length}catch{return!1}},async switchChain({addEthereumChainParameter:h,chainId:d}){var b,I,L,$;const p=await this.getProvider();if(!p)throw new bc;const v=u.chains.find(K=>K.id===d);if(!v)throw new zl(new yh);try{return await Promise.all([p.request({method:"wallet_switchEthereumChain",params:[{chainId:$a(d)}]}).then(async()=>{await this.getChainId()===d&&u.emitter.emit("change",{chainId:d})}),new Promise(K=>u.emitter.once("change",({chainId:P})=>{P===d&&K()}))]),v}catch(K){const P=K;if(P.code===4902||((I=(b=P==null?void 0:P.data)==null?void 0:b.originalError)==null?void 0:I.code)===4902)try{const{default:q,...D}=v.blockExplorers??{};let U;h!=null&&h.blockExplorerUrls?U=h.blockExplorerUrls:q&&(U=[q.url,...Object.values(D).map(M=>M.url)]);let F;(L=h==null?void 0:h.rpcUrls)!=null&&L.length?F=h.rpcUrls:F=[(($=v.rpcUrls.default)==null?void 0:$.http[0])??""];const _={blockExplorerUrls:U,chainId:$a(d),chainName:(h==null?void 0:h.chainName)??v.name,iconUrls:h==null?void 0:h.iconUrls,nativeCurrency:(h==null?void 0:h.nativeCurrency)??v.nativeCurrency,rpcUrls:F};if(await p.request({method:"wallet_addEthereumChain",params:[_]}),await this.getChainId()!==d)throw new cn(new Error("User rejected switch after adding network."));return v}catch(q){throw new cn(q)}throw P.code===cn.code?new cn(P):new zl(P)}},async onAccountsChanged(h){var d;if(h.length===0)this.onDisconnect();else if(u.emitter.listenerCount("connect")){const p=(await this.getChainId()).toString();this.onConnect({chainId:p}),e&&await((d=u.storage)==null?void 0:d.removeItem(`${this.id}.disconnected`))}else u.emitter.emit("change",{accounts:h.map(p=>Zn(p))})},onChainChanged(h){const d=Number(h);u.emitter.emit("change",{chainId:d})},async onConnect(h){const d=await this.getAccounts();if(d.length===0)return;const p=Number(h.chainId);u.emitter.emit("connect",{accounts:d,chainId:p});const v=await this.getProvider();v&&(s&&(v.removeListener("connect",s),s=void 0),n||(n=this.onAccountsChanged.bind(this),v.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),v.on("chainChanged",o)),a||(a=this.onDisconnect.bind(this),v.on("disconnect",a)))},async onDisconnect(h){const d=await this.getProvider();h&&h.code===1013&&d&&(await this.getAccounts()).length||(u.emitter.emit("disconnect"),d&&(o&&(d.removeListener("chainChanged",o),o=void 0),a&&(d.removeListener("disconnect",a),a=void 0),s||(s=this.onConnect.bind(this),d.on("connect",s))))}})}function E1(r,e){function t(n){return typeof e=="function"?e(n):typeof e=="string"?n[e]:!0}const i=r.ethereum;if(i!=null&&i.providers)return i.providers.find(n=>t(n));if(i&&t(i))return i}const N2=256;let e1=N2,t1;function wV(r=11){if(!t1||e1+r>N2*2){t1="",e1=0;for(let e=0;eo.chains),u=Iv(()=>[...o.connectors??[],...n?[]:(s==null?void 0:s.getProviders().map(d))??[]].map(h));function h(D){var _;const U=oV(wV()),F={...D({emitter:U,chains:a.getState(),storage:t}),emitter:U,uid:U.uid};return U.on("connect",P),(_=F.setup)==null||_.call(F),F}function d(D){const{info:U}=D,F=D.provider;return im({target:{...U,id:U.rdns,provider:F}})}const p=new Map;function v(D={}){const U=D.chainId??$.getState().chainId,F=a.getState().find(x=>x.id===U);if(D.chainId&&!F)throw new yh;{const x=p.get($.getState().chainId);if(x&&!F)return x;if(!F)throw new yh}{const x=p.get(U);if(x)return x}let _;if(o.client)_=o.client({chain:F});else{const x=F.id,M=a.getState().map(Z=>Z.id),j={},V=Object.entries(o);for(const[Z,m]of V)if(!(Z==="chains"||Z==="client"||Z==="connectors"||Z==="transports"))if(typeof m=="object")if(x in m)j[Z]=m[x];else{if(M.some(w=>w in m))continue;j[Z]=m}else j[Z]=m;_=N3({...j,chain:F,batch:j.batch??{multicall:!0},transport:Z=>o.transports[x]({...Z,connectors:u})})}return p.set(U,_),_}function b(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let I;const L="0.0.0-canary-";A1.startsWith(L)?I=parseInt(A1.replace(L,"")):I=parseInt(A1.split(".")[0]??"0");const $=Iv(Zq(t?eV(b,{migrate(D,U){if(U===I)return D;const F=b(),_=D&&typeof D=="object"&&"chainId"in D&&typeof D.chainId=="number"?D.chainId:F.chainId;return{...F,chainId:_}},name:"store",partialize(D){return{connections:{__type:"Map",value:Array.from(D.connections.entries()).map(([U,F])=>{const{id:_,name:x,type:M,uid:j}=F.connector;return[U,{...F,connector:{id:_,name:x,type:M,uid:j}}]})},chainId:D.chainId,current:D.current}},skipHydration:n,storage:t,version:I}):b));i&&$.subscribe(({connections:D,current:U})=>{var F;return U?(F=D.get(U))==null?void 0:F.chainId:void 0},D=>{if(a.getState().some(F=>F.id===D))return $.setState(F=>({...F,chainId:D??F.chainId}))}),s==null||s.subscribe(D=>{const U=new Map;for(const _ of u.getState())U.set(_.id,!0);const F=[];for(const _ of D){const x=h(d(_));U.has(x.id)||F.push(x)}t&&!$.persist.hasHydrated()||u.setState(_=>[..._,...F],!0)});function K(D){$.setState(U=>{const F=U.connections.get(D.uid);return F?{...U,connections:new Map(U.connections).set(D.uid,{accounts:D.accounts??F.accounts,chainId:D.chainId??F.chainId,connector:F.connector})}:U})}function P(D){$.getState().status==="connecting"||$.getState().status==="reconnecting"||$.setState(U=>{const F=u.getState().find(_=>_.uid===D.uid);return F?(F.emitter.listenerCount("connect")&&F.emitter.off("connect",K),F.emitter.listenerCount("change")||F.emitter.on("change",K),F.emitter.listenerCount("disconnect")||F.emitter.on("disconnect",q),{...U,connections:new Map(U.connections).set(D.uid,{accounts:D.accounts,chainId:D.chainId,connector:F}),current:D.uid,status:"connected"}):U})}function q(D){$.setState(U=>{const F=U.connections.get(D.uid);if(F){const x=F.connector;x.emitter.listenerCount("change")&&F.connector.emitter.off("change",K),x.emitter.listenerCount("disconnect")&&F.connector.emitter.off("disconnect",q),x.emitter.listenerCount("connect")||F.connector.emitter.on("connect",P)}if(U.connections.delete(D.uid),U.connections.size===0)return{...U,connections:new Map,current:null,status:"disconnected"};const _=U.connections.values().next().value;return{...U,connections:new Map(U.connections),current:_.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return u.getState()},storage:t,getClient:v,get state(){return $.getState()},setState(D){let U;typeof D=="function"?U=D($.getState()):U=D;const F=b();typeof U!="object"&&(U=F),Object.keys(F).some(x=>!(x in U))&&(U=F),$.setState(U,!0)},subscribe(D,U,F){return $.subscribe(D,U,F?{...F,fireImmediately:F.emitImmediately}:void 0)},_internal:{mipd:s,store:$,ssr:!!n,syncConnectedChain:i,transports:o.transports,chains:{setState(D){const U=typeof D=="function"?D(a.getState()):D;if(U.length!==0)return a.setState(U,!0)},subscribe(D){return a.subscribe(D)}},connectors:{providerDetailToConnector:d,setup:h,setState(D){return u.setState(typeof D=="function"?D(u.getState()):D,!0)},subscribe(D){return u.subscribe(D)}},events:{change:K,connect:P,disconnect:q}}}}function Yi(r,e,t){const i=r[e.name];if(typeof i=="function")return i;const n=r[t];return typeof n=="function"?n:o=>e(r,o)}async function C8(r,e){var i;let t;if(typeof e.connector=="function"?t=r._internal.connectors.setup(e.connector):t=e.connector,t.uid===r.state.current)throw new hV;try{r.setState(s=>({...s,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const n=await t.connect({chainId:e.chainId}),o=n.accounts;return t.emitter.off("connect",r._internal.events.connect),t.emitter.on("change",r._internal.events.change),t.emitter.on("disconnect",r._internal.events.disconnect),await((i=r.storage)==null?void 0:i.setItem("recentConnectorId",t.id)),r.setState(s=>({...s,connections:new Map(s.connections).set(t.uid,{accounts:o,chainId:n.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:o,chainId:n.chainId}}catch(n){throw r.setState(o=>({...o,status:o.current?"connected":"disconnected"})),n}}async function IE(r,e={}){var n,o;let t;if(e.connector)t=e.connector;else{const{connections:s,current:a}=r.state,u=s.get(a);t=u==null?void 0:u.connector}const i=r.state.connections;t&&(await t.disconnect(),t.emitter.off("change",r._internal.events.change),t.emitter.off("disconnect",r._internal.events.disconnect),t.emitter.on("connect",r._internal.events.connect),i.delete(t.uid)),r.setState(s=>{if(i.size===0)return{...s,connections:new Map,current:null,status:"disconnected"};const a=i.values().next().value;return{...s,connections:new Map(i),current:a.connector.uid}});{const s=r.state.current;if(!s)return;const a=(n=r.state.connections.get(s))==null?void 0:n.connector;if(!a)return;await((o=r.storage)==null?void 0:o.setItem("recentConnectorId",a.id))}}async function _0(r,e={}){let t;if(e.connector){const{connector:u}=e,[h,d]=await Promise.all([u.getAccounts(),u.getChainId()]);t={accounts:h,chainId:d,connector:u}}else t=r.state.connections.get(r.state.current);if(!t)throw new dV;const i=e.chainId??t.chainId,n=t.connector;if(n.getClient)return n.getClient({chainId:i});const o=Lg(e.account??t.accounts[0]);o.address=Zn(o.address);const s=r.chains.find(u=>u.id===i),a=await t.connector.getProvider({chainId:i});if(e.account&&!t.accounts.some(u=>u.toLowerCase()===o.address.toLowerCase()))throw new fV({address:o.address,connector:n});return N3({account:o,chain:s,name:"Connector Client",transport:u=>fx(a)({...u,retryCount:0})})}async function yV(r,e){const{chainId:t,connector:i,...n}=e;let o;e.account?o=e.account:o=(await _0(r,{account:e.account,chainId:t,connector:i})).account;const s=r.getClient({chainId:t});return Yi(s,lx,"estimateGas")({...n,account:o})}function TE(r){return typeof r=="number"?r:r==="wei"?0:Math.abs(PO[r])}function x0(r){const e=r.state.current,t=r.state.connections.get(e),i=t==null?void 0:t.accounts,n=i==null?void 0:i[0],o=r.chains.find(a=>a.id===(t==null?void 0:t.chainId)),s=r.state.status;switch(s){case"connected":return{address:n,addresses:i,chain:o,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:s};case"reconnecting":return{address:n,addresses:i,chain:o,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!n,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:s};case"connecting":return{address:n,addresses:i,chain:o,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:s};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:s}}}async function bV(r,e){const{allowFailure:t=!0,chainId:i,contracts:n,...o}=e,s=r.getClient({chainId:i});return Yi(s,DO,"multicall")({allowFailure:t,contracts:n,...o})}function _V(r,e){const{chainId:t,...i}=e,n=r.getClient({chainId:t});return Yi(n,NO,"readContract")(i)}async function xV(r,e){const{allowFailure:t=!0,blockNumber:i,blockTag:n,...o}=e,s=e.contracts;try{const a=s.reduce((p,v,b)=>{const I=v.chainId??r.state.chainId;return{...p,[I]:[...p[I]||[],{contract:v,index:b}]}},{}),u=()=>Object.entries(a).map(([p,v])=>bV(r,{...o,allowFailure:t,blockNumber:i,blockTag:n,chainId:parseInt(p),contracts:v.map(({contract:b})=>b)})),h=(await Promise.all(u())).flat(),d=Object.values(a).flatMap(p=>p.map(({index:v})=>v));return h.reduce((p,v,b)=>(p&&(p[d[b]]=v),p),[])}catch(a){if(a instanceof ux)throw a;const u=()=>s.map(h=>_V(r,{...h,blockNumber:i,blockTag:n}));return t?(await Promise.allSettled(u())).map(h=>h.status==="fulfilled"?{result:h.value,status:"success"}:{error:h.reason,result:void 0,status:"failure"}):await Promise.all(u())}}async function AV(r,e){const{address:t,blockNumber:i,blockTag:n,chainId:o,token:s,unit:a="ether"}=e;if(s)try{return S8(r,{balanceAddress:t,chainId:o,symbolType:"string",tokenAddress:s})}catch(v){if(v instanceof ux){const b=await S8(r,{balanceAddress:t,chainId:o,symbolType:"bytes32",tokenAddress:s}),I=hx($O(b.symbol,{dir:"right"}));return{...b,symbol:I}}throw v}const u=r.getClient({chainId:o}),d=await Yi(u,MO,"getBalance")(i?{address:t,blockNumber:i}:{address:t,blockTag:n}),p=r.chains.find(v=>v.id===o)??u.chain;return{decimals:p.nativeCurrency.decimals,formatted:$3(d,TE(a)),symbol:p.nativeCurrency.symbol,value:d}}async function S8(r,e){const{balanceAddress:t,chainId:i,symbolType:n,tokenAddress:o,unit:s}=e,a={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:n}]}],address:o},[u,h,d]=await xV(r,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[t],chainId:i},{...a,functionName:"decimals",chainId:i},{...a,functionName:"symbol",chainId:i}]}),p=$3(u??"0",TE(s??h));return{decimals:h,formatted:p,symbol:d,value:u}}function $2(r,e){if(r===e)return!0;if(r&&e&&typeof r=="object"&&typeof e=="object"){if(r.constructor!==e.constructor)return!1;let t,i;if(Array.isArray(r)&&Array.isArray(e)){if(t=r.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!$2(r[i],e[i]))return!1;return!0}if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===e.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===e.toString();const n=Object.keys(r);if(t=n.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[i]))return!1;for(i=t;i--!==0;){const o=n[i];if(o&&!$2(r[o],e[o]))return!1}return!0}return r!==r&&e!==e}function EV(r,e){const{chainId:t,...i}=e,n=r.getClient({chainId:t});return Yi(n,BO,"getEnsAddress")(i)}function I8(r,e){const{chainId:t,...i}=e,n=r.getClient({chainId:t});return Yi(n,UO,"getEnsAvatar")(i)}function CV(r,e){const{chainId:t,...i}=e,n=r.getClient({chainId:t});return Yi(n,LO,"getEnsName")(i)}async function SV(r,e){const{account:t,chainId:i,...n}=e,o=t??x0(r).address,s=r.getClient({chainId:i});return Yi(s,cx,"prepareTransactionRequest")({...n,...o?{account:o}:{}})}let Tv=!1;async function RE(r,e={}){var h,d;if(Tv)return[];Tv=!0,r.setState(p=>({...p,status:p.current?"reconnecting":"connecting"}));const t=[];if((h=e.connectors)!=null&&h.length)for(const p of e.connectors){let v;typeof p=="function"?v=r._internal.connectors.setup(p):v=p,t.push(v)}else t.push(...r.connectors);let i;try{i=await((d=r.storage)==null?void 0:d.getItem("recentConnectorId"))}catch{}const n={};for(const[,p]of r.state.connections)n[p.connector.id]=1;i&&(n[i]=0);const o=Object.keys(n).length>0?[...t].sort((p,v)=>(n[p.id]??10)-(n[v.id]??10)):t;let s=!1;const a=[],u=[];for(const p of o){const v=await p.getProvider();if(!v||u.some(L=>L===v)||!await p.isAuthorized())continue;const I=await p.connect({isReconnecting:!0}).catch(()=>null);I&&(p.emitter.off("connect",r._internal.events.connect),p.emitter.on("change",r._internal.events.change),p.emitter.on("disconnect",r._internal.events.disconnect),r.setState(L=>{const $=new Map(s?L.connections:new Map).set(p.uid,{accounts:I.accounts,chainId:I.chainId,connector:p});return{...L,current:s?L.current:p.uid,connections:$}}),a.push({accounts:I.accounts,chainId:I.chainId,connector:p}),u.push(v),s=!0)}return(r.state.status==="reconnecting"||r.state.status==="connecting")&&(s?r.setState(p=>({...p,status:"connected"})):r.setState(p=>({...p,connections:new Map,current:null,status:"disconnected"}))),Tv=!1,a}async function IV(r,e){const{account:t,chainId:i,connector:n,gas:o,...s}=e;let a;typeof t=="object"&&t.type==="local"?a=r.getClient({chainId:i}):a=await _0(r,{account:t,chainId:i,connector:n});const{connector:u}=x0(r),h=await(async()=>{var v;if(!(!("data"in e)||!e.data)&&!((v=n??u)!=null&&v.supportsSimulation)&&o!==null)return o===void 0?Yi(a,lx,"estimateGas")({...s,account:t,chain:i?{id:i}:null}):o})();return await Yi(a,M3,"sendTransaction")({...s,...t?{account:t}:{},gas:h,chain:i?{id:i}:null})}async function TV(r,e){const{account:t,connector:i,...n}=e;let o;return typeof t=="object"&&t.type==="local"?o=r.getClient():o=await _0(r,{account:t,connector:i}),Yi(o,px,"signMessage")({...n,...t?{account:t}:{}})}async function RV(r,e){const{abi:t,chainId:i,connector:n,...o}=e;let s;e.account?s=e.account:s=(await _0(r,{chainId:i,connector:n})).account;const a=r.getClient({chainId:i}),u=Yi(a,jO,"simulateContract"),{result:h,request:d}=await u({...o,abi:t,account:s});return{chainId:a.chain.id,result:h,request:{__mode:"prepared",...d,chainId:i}}}async function kV(r,e){var s;const{addEthereumChainParameter:t,chainId:i}=e,n=r.state.connections.get(((s=e.connector)==null?void 0:s.uid)??r.state.current);if(n){const a=n.connector;if(!a.switchChain)throw new pV({connector:a});return await a.switchChain({addEthereumChainParameter:t,chainId:i})}const o=r.chains.find(a=>a.id===i);if(!o)throw new yh;return r.setState(a=>({...a,chainId:i})),o}function OV(r,e){const{onChange:t}=e;return r.subscribe(()=>x0(r),t,{equalityFn(i,n){const{connector:o,...s}=i,{connector:a,...u}=n;return $2(s,u)&&(o==null?void 0:o.id)===(a==null?void 0:a.id)&&(o==null?void 0:o.uid)===(a==null?void 0:a.uid)}})}function PV(r,e){const{onChange:t}=e;return r._internal.connectors.subscribe((i,n)=>{t(Object.values(i),n)})}async function DV(r,e){const{chainId:t,timeout:i=0,...n}=e,o=r.getClient({chainId:t}),a=await Yi(o,FO,"waitForTransactionReceipt")({...n,timeout:i});if(a.status==="reverted"){const h=await Yi(o,zO,"getTransaction")({hash:a.transactionHash}),p=await Yi(o,WO,"call")({...h,gasPrice:h.type!=="eip1559"?h.gasPrice:void 0,maxFeePerGas:h.type==="eip1559"?h.maxFeePerGas:void 0,maxPriorityFeePerGas:h.type==="eip1559"?h.maxPriorityFeePerGas:void 0}),v=p!=null&&p.data?hx(`0x${p.data.substring(138)}`):"unknown reason";throw new Error(v)}return{...a,chainId:o.chain.id}}async function NV(r,e){const{account:t,chainId:i,connector:n,__mode:o,...s}=e;let a;typeof t=="object"&&t.type==="local"?a=r.getClient({chainId:i}):a=await _0(r,{account:t,chainId:i,connector:n});const{connector:u}=x0(r);let h;if(o==="prepared"||u!=null&&u.supportsSimulation)h=s;else{const{request:v}=await RV(r,{...s,account:t,chainId:i});h=v}return await Yi(a,dx,"writeContract")({...h,...t?{account:t}:{},chain:i?{id:i}:null})}const $V=Symbol(),T8=Object.getPrototypeOf,M2=new WeakMap,MV=r=>r&&(M2.has(r)?M2.get(r):T8(r)===Object.prototype||T8(r)===Array.prototype),BV=r=>MV(r)&&r[$V]||null,R8=(r,e=!0)=>{M2.set(r,e)};var V1={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Rv=r=>typeof r=="object"&&r!==null,_c=new WeakMap,Kd=new WeakSet,UV=(r=Object.is,e=(h,d)=>new Proxy(h,d),t=h=>Rv(h)&&!Kd.has(h)&&(Array.isArray(h)||!(Symbol.iterator in h))&&!(h instanceof WeakMap)&&!(h instanceof WeakSet)&&!(h instanceof Error)&&!(h instanceof Number)&&!(h instanceof Date)&&!(h instanceof String)&&!(h instanceof RegExp)&&!(h instanceof ArrayBuffer),i=h=>{switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:throw h}},n=new WeakMap,o=(h,d,p=i)=>{const v=n.get(h);if((v==null?void 0:v[0])===d)return v[1];const b=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return R8(b,!0),n.set(h,[d,b]),Reflect.ownKeys(h).forEach(I=>{if(Object.getOwnPropertyDescriptor(b,I))return;const L=Reflect.get(h,I),$={value:L,enumerable:!0,configurable:!0};if(Kd.has(L))R8(L,!1);else if(L instanceof Promise)delete $.value,$.get=()=>p(L);else if(_c.has(L)){const[K,P]=_c.get(L);$.value=o(K,P(),p)}Object.defineProperty(b,I,$)}),Object.preventExtensions(b)},s=new WeakMap,a=[1,1],u=h=>{if(!Rv(h))throw new Error("object required");const d=s.get(h);if(d)return d;let p=a[0];const v=new Set,b=(M,j=++a[0])=>{p!==j&&(p=j,v.forEach(V=>V(M,j)))};let I=a[1];const L=(M=++a[1])=>(I!==M&&!v.size&&(I=M,K.forEach(([j])=>{const V=j[1](M);V>p&&(p=V)})),p),$=M=>(j,V)=>{const Z=[...j];Z[1]=[M,...Z[1]],b(Z,V)},K=new Map,P=(M,j)=>{if((V1?"production":void 0)!=="production"&&K.has(M))throw new Error("prop listener already exists");if(v.size){const V=j[3]($(M));K.set(M,[j,V])}else K.set(M,[j])},q=M=>{var j;const V=K.get(M);V&&(K.delete(M),(j=V[1])==null||j.call(V))},D=M=>(v.add(M),v.size===1&&K.forEach(([V,Z],m)=>{if((V1?"production":void 0)!=="production"&&Z)throw new Error("remove already exists");const g=V[3]($(m));K.set(m,[V,g])}),()=>{v.delete(M),v.size===0&&K.forEach(([V,Z],m)=>{Z&&(Z(),K.set(m,[V]))})}),U=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),_=e(U,{deleteProperty(M,j){const V=Reflect.get(M,j);q(j);const Z=Reflect.deleteProperty(M,j);return Z&&b(["delete",[j],V]),Z},set(M,j,V,Z){const m=Reflect.has(M,j),g=Reflect.get(M,j,Z);if(m&&(r(g,V)||s.has(V)&&r(g,s.get(V))))return!0;q(j),Rv(V)&&(V=BV(V)||V);let w=V;if(V instanceof Promise)V.then(C=>{V.status="fulfilled",V.value=C,b(["resolve",[j],C])}).catch(C=>{V.status="rejected",V.reason=C,b(["reject",[j],C])});else{!_c.has(V)&&t(V)&&(w=u(V));const C=!Kd.has(w)&&_c.get(w);C&&P(j,C)}return Reflect.set(M,j,w,Z),b(["set",[j],V,g]),!0}});s.set(h,_);const x=[U,L,o,D];return _c.set(_,x),Reflect.ownKeys(h).forEach(M=>{const j=Object.getOwnPropertyDescriptor(h,M);"value"in j&&(_[M]=h[M],delete j.value,delete j.writable),Object.defineProperty(U,M,j)}),_})=>[u,_c,Kd,r,e,t,i,n,o,s,a],[LV]=UV();function xi(r={}){return LV(r)}function pn(r,e,t){const i=_c.get(r);(V1?"production":void 0)!=="production"&&!i&&console.warn("Please use proxy object");let n;const o=[],s=i[3];let a=!1;const h=s(d=>{o.push(d),n||(n=Promise.resolve().then(()=>{n=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,h()}}function hy(r,e){const t=_c.get(r);(V1?"production":void 0)!=="production"&&!t&&console.warn("Please use proxy object");const[i,n,o]=t;return o(i,n(),e)}function Hl(r){return Kd.add(r),r}function yn(r,e,t,i){let n=r[e];return pn(r,()=>{const o=r[e];Object.is(n,o)||t(n=o)})}const kv="https://secure.walletconnect.com",kE=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:""}],ui={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:kv,SECURE_SITE_DASHBOARD:`${kv}/dashboard`,SECURE_SITE_FAVICON:`${kv}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NATIVE_TOKEN_ADDRESS:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",CONVERT_SLIPPAGE_TOLERANCE:1},$e={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(r,e=""){return r==null?void 0:r.id.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){const r=window.navigator.userAgent.toLowerCase();return $e.isMobile()&&r.includes("android")},isIos(){const r=window.navigator.userAgent.toLowerCase();return $e.isMobile()&&(r.includes("iphone")||r.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(r){return r?r-Date.now()<=ui.TEN_SEC_MS:!0},isAllowedRetry(r){return Date.now()-r>=ui.ONE_SEC_MS},copyToClopboard(r){navigator.clipboard.writeText(r)},getPairingExpiry(){return Date.now()+ui.FOUR_MINUTES_MS},getNetworkId(r){return r==null?void 0:r.split(":")[1]},getPlainAddress(r){return r==null?void 0:r.split(":")[2]},async wait(r){return new Promise(e=>{setTimeout(e,r)})},debounce(r,e=500){let t;return(...i)=>{function n(){r(...i)}t&&clearTimeout(t),t=setTimeout(n,e)}},isHttpUrl(r){return r.startsWith("http://")||r.startsWith("https://")},formatNativeUrl(r,e){if($e.isHttpUrl(r))return this.formatUniversalUrl(r,e);let t=r;t.includes("://")||(t=r.replaceAll("/","").replaceAll(":",""),t=`${t}://`),t.endsWith("/")||(t=`${t}/`);const i=encodeURIComponent(e);return{redirect:`${t}wc?uri=${i}`,href:t}},formatUniversalUrl(r,e){if(!$e.isHttpUrl(r))return this.formatNativeUrl(r,e);let t=r;t.endsWith("/")||(t=`${t}/`);const i=encodeURIComponent(e);return{redirect:`${t}wc?uri=${i}`,href:t}},openHref(r,e,t){window.open(r,e,t||"noreferrer noopener")},returnOpenHref(r,e,t){return window.open(r,e,t||"noreferrer noopener")},async preloadImage(r){const e=new Promise((t,i)=>{const n=new Image;n.onload=t,n.onerror=i,n.crossOrigin="anonymous",n.src=r});return Promise.race([e,$e.wait(2e3)])},formatBalance(r,e){var i;let t;if(r==="0")t="0.000";else if(typeof r=="string"){const n=Number(r);n&&(t=(i=n.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:i[0])}return t?`${t} ${e??""}`:`0.000 ${e??""}`},formatBalance2(r,e){var i;let t;if(r==="0")t="0";else if(typeof r=="string"){const n=Number(r);n&&(t=(i=n.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:i[0])}return{value:t??"0",rest:t==="0"?"000":"",symbol:e}},isRestrictedRegion(){try{const{timeZone:r}=new Intl.DateTimeFormat().resolvedOptions(),e=r.toUpperCase();return ui.RESTRICTED_TIMEZONES.includes(e)}catch{return!1}},getApiUrl(){return $e.isRestrictedRegion()?"https://api.web3modal.org":"https://api.web3modal.com"},getBlockchainApiUrl(){return $e.isRestrictedRegion()?"https://rpc.walletconnect.org":"https://rpc.walletconnect.com"},getAnalyticsUrl(){return $e.isRestrictedRegion()?"https://pulse.walletconnect.org":"https://pulse.walletconnect.com"},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})},parseError(r){var e,t;return typeof r=="string"?r:typeof((t=(e=r==null?void 0:r.issues)==null?void 0:e[0])==null?void 0:t.message)=="string"?r.issues[0].message:r instanceof Error?r.message:"Unknown error"},sortRequestedNetworks(r,e=[]){const t={};return e&&r&&(r.forEach((i,n)=>{t[i]=n}),e.sort((i,n)=>{const o=t[i.id],s=t[n.id];return o!==void 0&&s!==void 0?o-s:o!==void 0?-1:s!==void 0?1:0})),e},calculateBalance(r){let e=0;for(const t of r)e+=t.value??0;return e},formatTokenBalance(r){const e=r.toFixed(2),[t,i]=e.split(".");return{dollars:t,pennies:i}},isAddress(r){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(r)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(r)||/^(?:0x)?[0-9A-F]{40}$/iu.test(r))return!0}else return!1;return!1}};async function jd(...r){const e=await fetch(...r);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class dy{constructor({baseUrl:e}){this.baseUrl=e}async get({headers:e,signal:t,...i}){const n=this.createUrl(i);return(await jd(n,{method:"GET",headers:e,signal:t,cache:"no-cache"})).json()}async getBlob({headers:e,signal:t,...i}){const n=this.createUrl(i);return(await jd(n,{method:"GET",headers:e,signal:t})).blob()}async post({body:e,headers:t,signal:i,...n}){const o=this.createUrl(n);return(await jd(o,{method:"POST",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}async put({body:e,headers:t,signal:i,...n}){const o=this.createUrl(n);return(await jd(o,{method:"PUT",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}async delete({body:e,headers:t,signal:i,...n}){const o=this.createUrl(n);return(await jd(o,{method:"DELETE",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}createUrl({path:e,params:t}){const i=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([n,o])=>{o&&i.searchParams.append(n,o)}),i}}var OE={exports:{}};(function(r,e){(function(t,i){r.exports=i()})(ln,function(){var t=1e3,i=6e4,n=36e5,o="millisecond",s="second",a="minute",u="hour",h="day",d="week",p="month",v="quarter",b="year",I="date",L="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,K=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(g){var w=["th","st","nd","rd"],C=g%100;return"["+g+(w[(C-20)%10]||w[C]||w[0])+"]"}},q=function(g,w,C){var R=String(g);return!R||R.length>=w?g:""+Array(w+1-R.length).join(C)+g},D={s:q,z:function(g){var w=-g.utcOffset(),C=Math.abs(w),R=Math.floor(C/60),k=C%60;return(w<=0?"+":"-")+q(R,2,"0")+":"+q(k,2,"0")},m:function g(w,C){if(w.date()1)return g(N[0])}else{var y=w.name;F[y]=w,k=y}return!R&&k&&(U=k),k||!R&&U},j=function(g,w){if(x(g))return g.clone();var C=typeof w=="object"?w:{};return C.date=g,C.args=arguments,new Z(C)},V=D;V.l=M,V.i=x,V.w=function(g,w){return j(g,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var Z=function(){function g(C){this.$L=M(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[_]=!0}var w=g.prototype;return w.parse=function(C){this.$d=function(R){var k=R.date,B=R.utc;if(k===null)return new Date(NaN);if(V.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var N=k.match($);if(N){var y=N[2]-1||0,H=(N[7]||"0").substring(0,3);return B?new Date(Date.UTC(N[1],y,N[3]||1,N[4]||0,N[5]||0,N[6]||0,H)):new Date(N[1],y,N[3]||1,N[4]||0,N[5]||0,N[6]||0,H)}}return new Date(k)}(C),this.init()},w.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},w.$utils=function(){return V},w.isValid=function(){return this.$d.toString()!==L},w.isSame=function(C,R){var k=j(C);return this.startOf(R)<=k&&k<=this.endOf(R)},w.isAfter=function(C,R){return j(C)0,F<=U.r||!U.r){F<=1&&D>0&&(U=P[D-1]);var _=K[U.l];b&&(F=b(""+F)),L=typeof _=="string"?_.replace("%d",F):_(F,d,U.l,$);break}}if(d)return L;var x=$?K.future:K.past;return typeof x=="function"?x(L):x.replace("%s",L)},o.to=function(h,d){return a(h,d,this,!0)},o.from=function(h,d){return a(h,d,this)};var u=function(h){return h.$u?n.utc():n()};o.toNow=function(h){return this.to(u(this),h)},o.fromNow=function(h){return this.from(u(this),h)}}})})(DE);var WV=DE.exports;const HV=ea(WV);var NE={exports:{}};(function(r,e){(function(t,i){r.exports=i()})(ln,function(){return function(t,i,n){n.updateLocale=function(o,s){var a=n.Ls[o];if(a)return(s?Object.keys(s):[]).forEach(function(u){a[u]=s[u]}),a}}})})(NE);var qV=NE.exports;const VV=ea(qV);fh.extend(HV);fh.extend(VV);const KV={...zV,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};fh.locale("en-web3-modal",KV);const fy={getYear(r=new Date().toISOString()){return fh(r).year()},getRelativeDateFromNow(r){return fh(r).locale("en-web3-modal").fromNow(!0)},formatDate(r,e="DD MMM"){return fh(r).format(e)}},ss={caipNetworkIdToNumber(r){return r?Number(r.split(":")[1]):void 0}};var GV=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ov=Math.ceil,Ro=Math.floor,Tn="[BigNumber Error] ",k8=Tn+"Number primitive has more than 15 significant digits: ",rs=1e14,qt=14,Pv=9007199254740991,Dv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],gc=1e7,Ii=1e9;function $E(r){var e,t,i,n=P.prototype={constructor:P,toString:null,valueOf:null},o=new P(1),s=20,a=4,u=-7,h=21,d=-1e7,p=1e7,v=!1,b=1,I=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},$="0123456789abcdefghijklmnopqrstuvwxyz",K=!0;function P(x,M){var j,V,Z,m,g,w,C,R,k=this;if(!(k instanceof P))return new P(x,M);if(M==null){if(x&&x._isBigNumber===!0){k.s=x.s,!x.c||x.e>p?k.c=k.e=null:x.e=10;g/=10,m++);m>p?k.c=k.e=null:(k.e=m,k.c=[x]);return}R=String(x)}else{if(!GV.test(R=String(x)))return i(k,R,w);k.s=R.charCodeAt(0)==45?(R=R.slice(1),-1):1}(m=R.indexOf("."))>-1&&(R=R.replace(".","")),(g=R.search(/e/i))>0?(m<0&&(m=g),m+=+R.slice(g+1),R=R.substring(0,g)):m<0&&(m=R.length)}else{if(Yr(M,2,$.length,"Base"),M==10&&K)return k=new P(x),F(k,s+k.e+1,a);if(R=String(x),w=typeof x=="number"){if(x*0!=0)return i(k,R,w,M);if(k.s=1/x<0?(R=R.slice(1),-1):1,P.DEBUG&&R.replace(/^0\.0*|\./,"").length>15)throw Error(k8+x)}else k.s=R.charCodeAt(0)===45?(R=R.slice(1),-1):1;for(j=$.slice(0,M),m=g=0,C=R.length;gm){m=C;continue}}else if(!Z&&(R==R.toUpperCase()&&(R=R.toLowerCase())||R==R.toLowerCase()&&(R=R.toUpperCase()))){Z=!0,g=-1,m=0;continue}return i(k,String(x),w,M)}w=!1,R=t(R,M,10,k.s),(m=R.indexOf("."))>-1?R=R.replace(".",""):m=R.length}for(g=0;R.charCodeAt(g)===48;g++);for(C=R.length;R.charCodeAt(--C)===48;);if(R=R.slice(g,++C)){if(C-=g,w&&P.DEBUG&&C>15&&(x>Pv||x!==Ro(x)))throw Error(k8+k.s*x);if((m=m-g-1)>p)k.c=k.e=null;else if(m=-Ii&&Z<=Ii&&Z===Ro(Z)){if(V[0]===0){if(Z===0&&V.length===1)return!0;break e}if(M=(Z+1)%qt,M<1&&(M+=qt),String(V[0]).length==M){for(M=0;M=rs||j!==Ro(j))break e;if(j!==0)return!0}}}else if(V===null&&Z===null&&(m===null||m===1||m===-1))return!0;throw Error(Tn+"Invalid BigNumber: "+x)},P.maximum=P.max=function(){return D(arguments,-1)},P.minimum=P.min=function(){return D(arguments,1)},P.random=function(){var x=9007199254740992,M=Math.random()*x&2097151?function(){return Ro(Math.random()*x)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(j){var V,Z,m,g,w,C=0,R=[],k=new P(o);if(j==null?j=s:Yr(j,0,Ii),g=Ov(j/qt),v)if(crypto.getRandomValues){for(V=crypto.getRandomValues(new Uint32Array(g*=2));C>>11),w>=9e15?(Z=crypto.getRandomValues(new Uint32Array(2)),V[C]=Z[0],V[C+1]=Z[1]):(R.push(w%1e14),C+=2);C=g/2}else if(crypto.randomBytes){for(V=crypto.randomBytes(g*=7);C=9e15?crypto.randomBytes(7).copy(V,C):(R.push(w%1e14),C+=7);C=g/7}else throw v=!1,Error(Tn+"crypto unavailable");if(!v)for(;C=10;w/=10,C++);CZ-1&&(w[g+1]==null&&(w[g+1]=0),w[g+1]+=w[g]/Z|0,w[g]%=Z)}return w.reverse()}return function(j,V,Z,m,g){var w,C,R,k,B,N,y,H,de=j.indexOf("."),xe=s,O=a;for(de>=0&&(k=I,I=0,j=j.replace(".",""),H=new P(V),N=H.pow(j.length-de),I=k,H.c=M(Aa(Io(N.c),N.e,"0"),10,Z,x),H.e=H.c.length),y=M(j,V,Z,g?(w=$,x):(w=x,$)),R=k=y.length;y[--k]==0;y.pop());if(!y[0])return w.charAt(0);if(de<0?--R:(N.c=y,N.e=R,N.s=m,N=e(N,H,xe,O,Z),y=N.c,B=N.r,R=N.e),C=R+xe+1,de=y[C],k=Z/2,B=B||C<0||y[C+1]!=null,B=O<4?(de!=null||B)&&(O==0||O==(N.s<0?3:2)):de>k||de==k&&(O==4||B||O==6&&y[C-1]&1||O==(N.s<0?8:7)),C<1||!y[0])j=B?Aa(w.charAt(1),-xe,w.charAt(0)):w.charAt(0);else{if(y.length=C,B)for(--Z;++y[--C]>Z;)y[C]=0,C||(++R,y=[1].concat(y));for(k=y.length;!y[--k];);for(de=0,j="";de<=k;j+=w.charAt(y[de++]));j=Aa(j,R,w.charAt(0))}return j}}(),e=function(){function x(V,Z,m){var g,w,C,R,k=0,B=V.length,N=Z%gc,y=Z/gc|0;for(V=V.slice();B--;)C=V[B]%gc,R=V[B]/gc|0,g=y*C+R*N,w=N*C+g%gc*gc+k,k=(w/m|0)+(g/gc|0)+y*R,V[B]=w%m;return k&&(V=[k].concat(V)),V}function M(V,Z,m,g){var w,C;if(m!=g)C=m>g?1:-1;else for(w=C=0;wZ[w]?1:-1;break}return C}function j(V,Z,m,g){for(var w=0;m--;)V[m]-=w,w=V[m]1;V.splice(0,1));}return function(V,Z,m,g,w){var C,R,k,B,N,y,H,de,xe,O,he,J,re,oe,E,X,ve,Ee=V.s==Z.s?1:-1,Ce=V.c,Be=Z.c;if(!Ce||!Ce[0]||!Be||!Be[0])return new P(!V.s||!Z.s||(Ce?Be&&Ce[0]==Be[0]:!Be)?NaN:Ce&&Ce[0]==0||!Be?Ee*0:Ee/0);for(de=new P(Ee),xe=de.c=[],R=V.e-Z.e,Ee=m+R+1,w||(w=rs,R=ko(V.e/qt)-ko(Z.e/qt),Ee=Ee/qt|0),k=0;Be[k]==(Ce[k]||0);k++);if(Be[k]>(Ce[k]||0)&&R--,Ee<0)xe.push(1),B=!0;else{for(oe=Ce.length,X=Be.length,k=0,Ee+=2,N=Ro(w/(Be[0]+1)),N>1&&(Be=x(Be,N,w),Ce=x(Ce,N,w),X=Be.length,oe=Ce.length),re=X,O=Ce.slice(0,X),he=O.length;he=w/2&&E++;do{if(N=0,C=M(Be,O,X,he),C<0){if(J=O[0],X!=he&&(J=J*w+(O[1]||0)),N=Ro(J/E),N>1)for(N>=w&&(N=w-1),y=x(Be,N,w),H=y.length,he=O.length;M(y,O,H,he)==1;)N--,j(y,X=10;Ee/=10,k++);F(de,m+(de.e=k+R*qt-1)+1,g,B)}else de.e=R,de.r=+B;return de}}();function q(x,M,j,V){var Z,m,g,w,C;if(j==null?j=a:Yr(j,0,8),!x.c)return x.toString();if(Z=x.c[0],g=x.e,M==null)C=Io(x.c),C=V==1||V==2&&(g<=u||g>=h)?i1(C,g):Aa(C,g,"0");else if(x=F(new P(x),M,j),m=x.e,C=Io(x.c),w=C.length,V==1||V==2&&(M<=m||m<=u)){for(;ww){if(--M>0)for(C+=".";M--;C+="0");}else if(M+=m-w,M>0)for(m+1==w&&(C+=".");M--;C+="0");return x.s<0&&Z?"-"+C:C}function D(x,M){for(var j,V,Z=1,m=new P(x[0]);Z=10;Z/=10,V++);return(j=V+j*qt-1)>p?x.c=x.e=null:j=10;w/=10,Z++);if(m=M-Z,m<0)m+=qt,g=M,C=B[R=0],k=Ro(C/N[Z-g-1]%10);else if(R=Ov((m+1)/qt),R>=B.length)if(V){for(;B.length<=R;B.push(0));C=k=0,Z=1,m%=qt,g=m-qt+1}else break e;else{for(C=w=B[R],Z=1;w>=10;w/=10,Z++);m%=qt,g=m-qt+Z,k=g<0?0:Ro(C/N[Z-g-1]%10)}if(V=V||M<0||B[R+1]!=null||(g<0?C:C%N[Z-g-1]),V=j<4?(k||V)&&(j==0||j==(x.s<0?3:2)):k>5||k==5&&(j==4||V||j==6&&(m>0?g>0?C/N[Z-g]:0:B[R-1])%10&1||j==(x.s<0?8:7)),M<1||!B[0])return B.length=0,V?(M-=x.e+1,B[0]=N[(qt-M%qt)%qt],x.e=-M||0):B[0]=x.e=0,x;if(m==0?(B.length=R,w=1,R--):(B.length=R+1,w=N[qt-m],B[R]=g>0?Ro(C/N[Z-g]%N[g])*w:0),V)for(;;)if(R==0){for(m=1,g=B[0];g>=10;g/=10,m++);for(g=B[0]+=w,w=1;g>=10;g/=10,w++);m!=w&&(x.e++,B[0]==rs&&(B[0]=1));break}else{if(B[R]+=w,B[R]!=rs)break;B[R--]=0,w=1}for(m=B.length;B[--m]===0;B.pop());}x.e>p?x.c=x.e=null:x.e=h?i1(M,j):Aa(M,j,"0"),x.s<0?"-"+M:M)}return n.absoluteValue=n.abs=function(){var x=new P(this);return x.s<0&&(x.s=1),x},n.comparedTo=function(x,M){return Cl(this,new P(x,M))},n.decimalPlaces=n.dp=function(x,M){var j,V,Z,m=this;if(x!=null)return Yr(x,0,Ii),M==null?M=a:Yr(M,0,8),F(new P(m),x+m.e+1,M);if(!(j=m.c))return null;if(V=((Z=j.length-1)-ko(this.e/qt))*qt,Z=j[Z])for(;Z%10==0;Z/=10,V--);return V<0&&(V=0),V},n.dividedBy=n.div=function(x,M){return e(this,new P(x,M),s,a)},n.dividedToIntegerBy=n.idiv=function(x,M){return e(this,new P(x,M),0,1)},n.exponentiatedBy=n.pow=function(x,M){var j,V,Z,m,g,w,C,R,k,B=this;if(x=new P(x),x.c&&!x.isInteger())throw Error(Tn+"Exponent not an integer: "+_(x));if(M!=null&&(M=new P(M)),w=x.e>14,!B.c||!B.c[0]||B.c[0]==1&&!B.e&&B.c.length==1||!x.c||!x.c[0])return k=new P(Math.pow(+_(B),w?x.s*(2-r1(x)):+_(x))),M?k.mod(M):k;if(C=x.s<0,M){if(M.c?!M.c[0]:!M.s)return new P(NaN);V=!C&&B.isInteger()&&M.isInteger(),V&&(B=B.mod(M))}else{if(x.e>9&&(B.e>0||B.e<-1||(B.e==0?B.c[0]>1||w&&B.c[1]>=24e7:B.c[0]<8e13||w&&B.c[0]<=9999975e7)))return m=B.s<0&&r1(x)?-0:0,B.e>-1&&(m=1/m),new P(C?1/m:m);I&&(m=Ov(I/qt+2))}for(w?(j=new P(.5),C&&(x.s=1),R=r1(x)):(Z=Math.abs(+_(x)),R=Z%2),k=new P(o);;){if(R){if(k=k.times(B),!k.c)break;m?k.c.length>m&&(k.c.length=m):V&&(k=k.mod(M))}if(Z){if(Z=Ro(Z/2),Z===0)break;R=Z%2}else if(x=x.times(j),F(x,x.e+1,1),x.e>14)R=r1(x);else{if(Z=+_(x),Z===0)break;R=Z%2}B=B.times(B),m?B.c&&B.c.length>m&&(B.c.length=m):V&&(B=B.mod(M))}return V?k:(C&&(k=o.div(k)),M?k.mod(M):m?F(k,I,a,g):k)},n.integerValue=function(x){var M=new P(this);return x==null?x=a:Yr(x,0,8),F(M,M.e+1,x)},n.isEqualTo=n.eq=function(x,M){return Cl(this,new P(x,M))===0},n.isFinite=function(){return!!this.c},n.isGreaterThan=n.gt=function(x,M){return Cl(this,new P(x,M))>0},n.isGreaterThanOrEqualTo=n.gte=function(x,M){return(M=Cl(this,new P(x,M)))===1||M===0},n.isInteger=function(){return!!this.c&&ko(this.e/qt)>this.c.length-2},n.isLessThan=n.lt=function(x,M){return Cl(this,new P(x,M))<0},n.isLessThanOrEqualTo=n.lte=function(x,M){return(M=Cl(this,new P(x,M)))===-1||M===0},n.isNaN=function(){return!this.s},n.isNegative=function(){return this.s<0},n.isPositive=function(){return this.s>0},n.isZero=function(){return!!this.c&&this.c[0]==0},n.minus=function(x,M){var j,V,Z,m,g=this,w=g.s;if(x=new P(x,M),M=x.s,!w||!M)return new P(NaN);if(w!=M)return x.s=-M,g.plus(x);var C=g.e/qt,R=x.e/qt,k=g.c,B=x.c;if(!C||!R){if(!k||!B)return k?(x.s=-M,x):new P(B?g:NaN);if(!k[0]||!B[0])return B[0]?(x.s=-M,x):new P(k[0]?g:a==3?-0:0)}if(C=ko(C),R=ko(R),k=k.slice(),w=C-R){for((m=w<0)?(w=-w,Z=k):(R=C,Z=B),Z.reverse(),M=w;M--;Z.push(0));Z.reverse()}else for(V=(m=(w=k.length)<(M=B.length))?w:M,w=M=0;M0)for(;M--;k[j++]=0);for(M=rs-1;V>w;){if(k[--V]=0;){for(j=0,N=J[Z]%xe,y=J[Z]/xe|0,g=C,m=Z+g;m>Z;)R=he[--g]%xe,k=he[g]/xe|0,w=y*R+k*N,R=N*R+w%xe*xe+H[m]+j,j=(R/de|0)+(w/xe|0)+y*k,H[m--]=R%de;H[m]=j}return j?++V:H.splice(0,1),U(x,H,V)},n.negated=function(){var x=new P(this);return x.s=-x.s||null,x},n.plus=function(x,M){var j,V=this,Z=V.s;if(x=new P(x,M),M=x.s,!Z||!M)return new P(NaN);if(Z!=M)return x.s=-M,V.minus(x);var m=V.e/qt,g=x.e/qt,w=V.c,C=x.c;if(!m||!g){if(!w||!C)return new P(Z/0);if(!w[0]||!C[0])return C[0]?x:new P(w[0]?V:Z*0)}if(m=ko(m),g=ko(g),w=w.slice(),Z=m-g){for(Z>0?(g=m,j=C):(Z=-Z,j=w),j.reverse();Z--;j.push(0));j.reverse()}for(Z=w.length,M=C.length,Z-M<0&&(j=C,C=w,w=j,M=Z),Z=0;M;)Z=(w[--M]=w[M]+C[M]+Z)/rs|0,w[M]=rs===w[M]?0:w[M]%rs;return Z&&(w=[Z].concat(w),++g),U(x,w,g)},n.precision=n.sd=function(x,M){var j,V,Z,m=this;if(x!=null&&x!==!!x)return Yr(x,1,Ii),M==null?M=a:Yr(M,0,8),F(new P(m),x,M);if(!(j=m.c))return null;if(Z=j.length-1,V=Z*qt+1,Z=j[Z]){for(;Z%10==0;Z/=10,V--);for(Z=j[0];Z>=10;Z/=10,V++);}return x&&m.e+1>V&&(V=m.e+1),V},n.shiftedBy=function(x){return Yr(x,-Pv,Pv),this.times("1e"+x)},n.squareRoot=n.sqrt=function(){var x,M,j,V,Z,m=this,g=m.c,w=m.s,C=m.e,R=s+4,k=new P("0.5");if(w!==1||!g||!g[0])return new P(!w||w<0&&(!g||g[0])?NaN:g?m:1/0);if(w=Math.sqrt(+_(m)),w==0||w==1/0?(M=Io(g),(M.length+C)%2==0&&(M+="0"),w=Math.sqrt(+M),C=ko((C+1)/2)-(C<0||C%2),w==1/0?M="5e"+C:(M=w.toExponential(),M=M.slice(0,M.indexOf("e")+1)+C),j=new P(M)):j=new P(w+""),j.c[0]){for(C=j.e,w=C+R,w<3&&(w=0);;)if(Z=j,j=k.times(Z.plus(e(m,Z,R,1))),Io(Z.c).slice(0,w)===(M=Io(j.c)).slice(0,w))if(j.e0&&H>0){for(m=H%w||w,k=y.substr(0,m);m0&&(k+=R+y.slice(m)),N&&(k="-"+k)}V=B?k+(j.decimalSeparator||"")+((C=+j.fractionGroupSize)?B.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(j.fractionGroupSeparator||"")):B):k}return(j.prefix||"")+V+(j.suffix||"")},n.toFraction=function(x){var M,j,V,Z,m,g,w,C,R,k,B,N,y=this,H=y.c;if(x!=null&&(w=new P(x),!w.isInteger()&&(w.c||w.s!==1)||w.lt(o)))throw Error(Tn+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+_(w));if(!H)return new P(y);for(M=new P(o),R=j=new P(o),V=C=new P(o),N=Io(H),m=M.e=N.length-y.e-1,M.c[0]=Dv[(g=m%qt)<0?qt+g:g],x=!x||w.comparedTo(M)>0?m>0?M:R:w,g=p,p=1/0,w=new P(N),C.c[0]=0;k=e(w,M,0,1),Z=j.plus(k.times(V)),Z.comparedTo(x)!=1;)j=V,V=Z,R=C.plus(k.times(Z=R)),C=Z,M=w.minus(k.times(Z=M)),w=Z;return Z=e(x.minus(j),V,0,1),C=C.plus(Z.times(R)),j=j.plus(Z.times(V)),C.s=R.s=y.s,m=m*2,B=e(R,V,m,a).minus(y).abs().comparedTo(e(C,j,m,a).minus(y).abs())<1?[R,V]:[C,j],p=g,B},n.toNumber=function(){return+_(this)},n.toPrecision=function(x,M){return x!=null&&Yr(x,1,Ii),q(this,x,M,2)},n.toString=function(x){var M,j=this,V=j.s,Z=j.e;return Z===null?V?(M="Infinity",V<0&&(M="-"+M)):M="NaN":(x==null?M=Z<=u||Z>=h?i1(Io(j.c),Z):Aa(Io(j.c),Z,"0"):x===10&&K?(j=F(new P(j),s+Z+1,a),M=Aa(Io(j.c),j.e,"0")):(Yr(x,2,$.length,"Base"),M=t(Aa(Io(j.c),Z,"0"),10,x,V,!0)),V<0&&j.c[0]&&(M="-"+M)),M},n.valueOf=n.toJSON=function(){return _(this)},n._isBigNumber=!0,n[Symbol.toStringTag]="BigNumber",n[Symbol.for("nodejs.util.inspect.custom")]=n.valueOf,r!=null&&P.set(r),P}function ko(r){var e=r|0;return r>0||r===e?e:e-1}function Io(r){for(var e,t,i=1,n=r.length,o=r[0]+"";ih^t?1:-1;for(a=(u=n.length)<(h=o.length)?u:h,s=0;so[s]^t?1:-1;return u==h?0:u>h^t?1:-1}function Yr(r,e,t,i){if(rt||r!==Ro(r))throw Error(Tn+(i||"Argument")+(typeof r=="number"?rt?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function r1(r){var e=r.c.length-1;return ko(r.e/qt)==e&&r.c[e]%2!=0}function i1(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function Aa(r,e,t){var i,n;if(e<0){for(n=t+".";++e;n+=t);r=n+r}else if(i=r.length,++e>i){for(n=t,e-=i;--e;n+=t);r+=n}else e="0"&&r.key<="9";!n&&(o||s||a||u)&&r.preventDefault(),e==="0"&&!h&&!d&&r.key==="0"&&r.preventDefault(),e==="0"&&p&&(t(r.key),r.preventDefault()),(h||d)&&(e||(t("0."),r.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&r.preventDefault()),!p&&!i.includes(r.key)&&!d&&!h&&r.preventDefault()}},QV=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],py={URLS:{FAQ:"https://walletconnect.com/faq"}},Ic={WC_NAME_SUFFIX:".wcn.id",WC_NAMES_ALLOWED_DOMAINS:["walletconnect.com"]};function Tc(r,e){return e==="light"?{"--w3m-accent":(r==null?void 0:r["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(r==null?void 0:r["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}const Ti=xi({projectId:"",sdkType:"w3m",sdkVersion:"html-wagmi-undefined"}),nt={state:Ti,subscribeKey(r,e){return yn(Ti,r,e)},setProjectId(r){Ti.projectId=r},setAllWallets(r){Ti.allWallets=r},setIncludeWalletIds(r){Ti.includeWalletIds=r},setExcludeWalletIds(r){Ti.excludeWalletIds=r},setFeaturedWalletIds(r){Ti.featuredWalletIds=r},setTokens(r){Ti.tokens=r},setTermsConditionsUrl(r){Ti.termsConditionsUrl=r},setPrivacyPolicyUrl(r){Ti.privacyPolicyUrl=r},setCustomWallets(r){Ti.customWallets=r},setIsSiweEnabled(r){Ti.isSiweEnabled=r},setEnableAnalytics(r){Ti.enableAnalytics=r},setSdkVersion(r){Ti.sdkVersion=r},setMetadata(r){Ti.metadata=r},setOnrampEnabled(r){Ti.enableOnramp=r},setWalletFeaturesEnabled(r){Ti.enableWalletFeatures=r},getSnapshot(){return hy(Ti)}},YV={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},JV=$e.getBlockchainApiUrl(),Mi=new dy({baseUrl:JV}),li={fetchIdentity({address:r}){return Mi.get({path:`/v1/identity/${r}`,params:{projectId:nt.state.projectId}})},fetchTransactions({account:r,projectId:e,cursor:t,onramp:i,signal:n}){const o=t?{cursor:t}:{};return Mi.get({path:`/v1/account/${r}/history?projectId=${e}${i?`&onramp=${i}`:""}`,params:o,signal:n})},fetchSwapQuote({projectId:r,amount:e,userAddress:t,from:i,to:n,gasPrice:o}){return Mi.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{projectId:r,amount:e,userAddress:t,from:i,to:n,gasPrice:o}})},fetchSwapTokens({projectId:r,chainId:e}){return Mi.get({path:`/v1/convert/tokens?projectId=${r}&chainId=${e}`})},fetchTokenPrice({projectId:r,addresses:e}){return Mi.post({path:"/v1/fungible/price",body:{projectId:r,currency:"usd",addresses:e},headers:{"Content-Type":"application/json"}})},fetchSwapAllowance({projectId:r,tokenAddress:e,userAddress:t}){const{sdkType:i,sdkVersion:n}=nt.state;return Mi.get({path:`/v1/convert/allowance?projectId=${r}&tokenAddress=${e}&userAddress=${t}`,headers:{"Content-Type":"application/json","x-sdk-type":i,"x-sdk-version":n}})},fetchGasPrice({projectId:r,chainId:e}){const{sdkType:t,sdkVersion:i}=nt.state;return Mi.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json","x-sdk-type":t,"x-sdk-version":i},params:{projectId:r,chainId:e}})},generateSwapCalldata({amount:r,from:e,projectId:t,to:i,userAddress:n}){return Mi.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:r,eip155:{slippage:ui.CONVERT_SLIPPAGE_TOLERANCE},from:e,projectId:t,to:i,userAddress:n}})},generateApproveCalldata({from:r,projectId:e,to:t,userAddress:i}){const{sdkType:n,sdkVersion:o}=nt.state;return Mi.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json","x-sdk-type":n,"x-sdk-version":o},params:{projectId:e,userAddress:i,from:r,to:t}})},async getBalance(r,e,t){const{sdkType:i,sdkVersion:n}=nt.state;return Mi.get({path:`/v1/account/${r}/balance`,headers:{"x-sdk-type":i,"x-sdk-version":n},params:{currency:"usd",projectId:nt.state.projectId,chainId:e,forceUpdate:t}})},async lookupEnsName(r){return Mi.get({path:`/v1/profile/account/${r}${Ic.WC_NAME_SUFFIX}?projectId=${nt.state.projectId}`})},async reverseLookupEnsName({address:r}){return Mi.get({path:`/v1/profile/reverse/${r}?projectId=${nt.state.projectId}`})},async getEnsNameSuggestions(r){return Mi.get({path:`/v1/profile/suggestions/${r}?projectId=${nt.state.projectId}`})},async registerEnsName({coinType:r,address:e,message:t,signature:i}){return Mi.post({path:"/v1/profile/account",body:{coin_type:r,address:e,message:t,signature:i},headers:{"Content-Type":"application/json"}})},async generateOnRampURL({destinationWallets:r,partnerUserId:e,defaultNetwork:t,purchaseAmount:i,paymentAmount:n}){return(await Mi.post({path:`/v1/generators/onrampurl?projectId=${nt.state.projectId}`,body:{destinationWallets:r,defaultNetwork:t,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:i,presetFiatAmount:n}})).url},async getOnrampOptions(){try{return await Mi.get({path:`/v1/onramp/options?projectId=${nt.state.projectId}`})}catch{return YV}},async getOnrampQuote({purchaseCurrency:r,paymentCurrency:e,amount:t,network:i}){try{return await Mi.post({path:`/v1/onramp/quote?projectId=${nt.state.projectId}`,body:{purchaseCurrency:r,paymentCurrency:e,amount:t,network:i}})}catch{return{coinbaseFee:{amount:t,currency:e.id},networkFee:{amount:t,currency:e.id},paymentSubtotal:{amount:t,currency:e.id},paymentTotal:{amount:t,currency:e.id},purchaseAmount:{amount:t,currency:e.id},quoteId:"mocked-quote-id"}}}},Ea=xi({message:"",variant:"success",open:!1}),$t={state:Ea,subscribeKey(r,e){return yn(Ea,r,e)},showSuccess(r){Ea.message=r,Ea.variant="success",Ea.open=!0},showError(r){const e=$e.parseError(r);Ea.message=e,Ea.variant="error",Ea.open=!0},hide(){Ea.open=!1}},Nv="WALLETCONNECT_DEEPLINK_CHOICE",O8="@w3m/recent",$v="@w3m/connected_wallet_image_url",P8="@w3m/connected_connector",D8="@w3m/connected_social",XV="@w3m-storage/SOCIAL_USERNAME",Fr={setWalletConnectDeepLink({href:r,name:e}){try{localStorage.setItem(Nv,JSON.stringify({href:r,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const r=localStorage.getItem(Nv);if(r)return JSON.parse(r)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{localStorage.removeItem(Nv)}catch{console.info("Unable to delete WalletConnect deep link")}},setWeb3ModalRecent(r){try{const e=Fr.getRecentWallets();e.find(i=>i.id===r.id)||(e.unshift(r),e.length>2&&e.pop(),localStorage.setItem(O8,JSON.stringify(e)))}catch{console.info("Unable to set Web3Modal recent")}},getRecentWallets(){try{const r=localStorage.getItem(O8);return r?JSON.parse(r):[]}catch{console.info("Unable to get Web3Modal recent")}return[]},setConnectedWalletImageUrl(r){try{localStorage.setItem($v,r)}catch{console.info("Unable to set Connected Wallet Image Url")}},removeConnectedWalletImageUrl(){try{localStorage.removeItem($v)}catch{console.info("Unable to remove Connected Wallet Image Url")}},getConnectedWalletImageUrl(){try{return localStorage.getItem($v)}catch{console.info("Unable to set Connected Wallet Image Url")}},setConnectedConnector(r){try{localStorage.setItem(P8,r)}catch{console.info("Unable to set Connected Connector")}},getConnectedConnector(){try{return localStorage.getItem(P8)}catch{console.info("Unable to get Connected Connector")}},setConnectedSocialProvider(r){try{localStorage.setItem(D8,r)}catch{console.info("Unable to set Connected Social Provider")}},getConnectedSocialProvider(){try{return localStorage.getItem(D8)}catch{console.info("Unable to get Connected Social Provider")}},getConnectedSocialUsername(){try{return localStorage.getItem(XV)}catch{console.info("Unable to get Connected Social Username")}}},eK=$e.getAnalyticsUrl(),tK=new dy({baseUrl:eK}),rK=["MODAL_CREATED"],Qu=xi({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),bt={state:Qu,subscribe(r){return pn(Qu,()=>r(Qu))},_getApiHeaders(){const{projectId:r,sdkType:e,sdkVersion:t}=nt.state;return{"x-project-id":r,"x-sdk-type":e,"x-sdk-version":t}},async _sendAnalyticsEvent(r){try{if(rK.includes(r.data.event)||typeof window>"u")return;await tK.post({path:"/e",headers:bt._getApiHeaders(),body:{eventId:$e.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:r.timestamp,props:r.data}})}catch{}},sendEvent(r){Qu.timestamp=Date.now(),Qu.data=r,nt.state.enableAnalytics&&bt._sendAnalyticsEvent(Qu)}},Kr=xi({transactions:[],coinbaseTransactions:{},transactionsByYear:{},loading:!1,empty:!1,next:void 0}),Zi={state:Kr,subscribe(r){return pn(Kr,()=>r(Kr))},async fetchTransactions(r,e){const{projectId:t}=nt.state;if(!t||!r)throw new Error("Transactions can't be fetched without a projectId and an accountAddress");Kr.loading=!0;try{const i=await li.fetchTransactions({account:r,projectId:t,cursor:Kr.next,onramp:e}),n=this.filterSpamTransactions(i.data),o=[...Kr.transactions,...n];Kr.loading=!1,e==="coinbase"?Kr.coinbaseTransactions=this.groupTransactionsByYearAndMonth(Kr.coinbaseTransactions,i.data):(Kr.transactions=o,Kr.transactionsByYear=this.groupTransactionsByYearAndMonth(Kr.transactionsByYear,n)),Kr.empty=o.length===0,Kr.next=i.next?i.next:void 0}catch{bt.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:r,projectId:t,cursor:Kr.next}}),$t.showError("Failed to fetch transactions"),Kr.loading=!1,Kr.empty=!0,Kr.next=void 0}},groupTransactionsByYearAndMonth(r={},e=[]){const t=r;return e.forEach(i=>{const n=new Date(i.metadata.minedAt).getFullYear(),o=new Date(i.metadata.minedAt).getMonth(),s=t[n]??{},u=(s[o]??[]).filter(h=>h.id!==i.id);t[n]={...s,[o]:[...u,i].sort((h,d)=>new Date(d.metadata.minedAt).getTime()-new Date(h.metadata.minedAt).getTime())}}),t},filterSpamTransactions(r){return r.filter(e=>!e.transfers.every(i=>{var n;return((n=i.nft_info)==null?void 0:n.flags.is_spam)===!0}))},clearCursor(){Kr.next=void 0},resetTransactions(){Kr.transactions=[],Kr.transactionsByYear={},Kr.loading=!1,Kr.empty=!1,Kr.next=void 0}},Ri=xi({wcError:!1,buffering:!1}),vt={state:Ri,subscribeKey(r,e){return yn(Ri,r,e)},_getClient(){if(!Ri._client)throw new Error("ConnectionController client not set");return Ri._client},setClient(r){Ri._client=Hl(r)},connectWalletConnect(){Ri.wcPromise=this._getClient().connectWalletConnect(r=>{Ri.wcUri=r,Ri.wcPairingExpiry=$e.getPairingExpiry()}),Fr.setConnectedConnector("WALLET_CONNECT")},async connectExternal(r){var e,t;await((t=(e=this._getClient()).connectExternal)==null?void 0:t.call(e,r)),Fr.setConnectedConnector(r.type)},async reconnectExternal(r){var e,t;await((t=(e=this._getClient()).reconnectExternal)==null?void 0:t.call(e,r)),Fr.setConnectedConnector(r.type)},async signMessage(r){return this._getClient().signMessage(r)},parseUnits(r,e){return this._getClient().parseUnits(r,e)},formatUnits(r,e){return this._getClient().formatUnits(r,e)},async sendTransaction(r){return this._getClient().sendTransaction(r)},async estimateGas(r){return this._getClient().estimateGas(r)},async writeContract(r){return this._getClient().writeContract(r)},async getEnsAddress(r){return this._getClient().getEnsAddress(r)},async getEnsAvatar(r){return this._getClient().getEnsAvatar(r)},checkInstalled(r){var e,t;return(t=(e=this._getClient()).checkInstalled)==null?void 0:t.call(e,r)},resetWcConnection(){Ri.wcUri=void 0,Ri.wcPairingExpiry=void 0,Ri.wcPromise=void 0,Ri.wcLinking=void 0,Ri.recentWallet=void 0,Zi.resetTransactions(),Fr.deleteWalletConnectDeepLink()},setWcLinking(r){Ri.wcLinking=r},setWcError(r){Ri.wcError=r,Ri.buffering=!1},setRecentWallet(r){Ri.recentWallet=r},setBuffering(r){Ri.buffering=r},async disconnect(){await this._getClient().disconnect(),Fr.removeConnectedWalletImageUrl(),this.resetWcConnection()}},Fd=xi({loading:!1,open:!1,selectedNetworkId:void 0}),Ul={state:Fd,subscribe(r){return pn(Fd,()=>r(Fd))},set(r){Object.assign(Fd,{...Fd,...r})}},$r=xi({supportsAllNetworks:!0,isDefaultCaipNetwork:!1,smartAccountEnabledNetworks:[]}),Xe={state:$r,subscribe(r){return pn($r,()=>r($r))},subscribeKey(r,e){return yn($r,r,e)},_getClient(){if(!$r._client)throw new Error("NetworkController client not set");return $r._client},setClient(r){$r._client=Hl(r)},setCaipNetwork(r){$r.caipNetwork=r,Ul.set({selectedNetworkId:r==null?void 0:r.id}),this.state.allowUnsupportedChain||this.checkIfSupportedNetwork()},setDefaultCaipNetwork(r){$r.caipNetwork=r,Ul.set({selectedNetworkId:r==null?void 0:r.id}),$r.isDefaultCaipNetwork=!0},setRequestedCaipNetworks(r){$r.requestedCaipNetworks=r},setAllowUnsupportedChain(r){$r.allowUnsupportedChain=r},setSmartAccountEnabledNetworks(r){$r.smartAccountEnabledNetworks=r},getRequestedCaipNetworks(){const{approvedCaipNetworkIds:r,requestedCaipNetworks:e}=$r,t=r,i=e;return $e.sortRequestedNetworks(t,i)},async getApprovedCaipNetworksData(){const r=await this._getClient().getApprovedCaipNetworksData();$r.supportsAllNetworks=r.supportsAllNetworks,$r.approvedCaipNetworkIds=r.approvedCaipNetworkIds},async switchActiveNetwork(r){await this._getClient().switchCaipNetwork(r),$r.caipNetwork=r,r&&bt.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:r.id}})},checkIfSupportedNetwork(){var r;$r.isUnsupportedChain=!((r=$r.requestedCaipNetworks)!=null&&r.some(e=>{var t;return e.id===((t=$r.caipNetwork)==null?void 0:t.id)})),$r.isUnsupportedChain&&this.showUnsupportedChainUI()},checkIfSmartAccountEnabled(){var e,t;const r=ss.caipNetworkIdToNumber((e=$r.caipNetwork)==null?void 0:e.id);return r?!!((t=$r.smartAccountEnabledNetworks)!=null&&t.includes(r)):!1},resetNetwork(){$r.isDefaultCaipNetwork||($r.caipNetwork=void 0),$r.approvedCaipNetworkIds=void 0,$r.supportsAllNetworks=!0,$r.smartAccountEnabledNetworks=[]},showUnsupportedChainUI(){setTimeout(()=>{yt.open({view:"UnsupportedChain"})},300)}},Gd={async getTokenList(){var t,i;const r=await li.fetchSwapTokens({chainId:(t=Xe.state.caipNetwork)==null?void 0:t.id,projectId:nt.state.projectId});return((i=r==null?void 0:r.tokens)==null?void 0:i.map(n=>({...n,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0})))||[]},async fetchGasPrice(){const r=nt.state.projectId,e=Xe.state.caipNetwork;return e?await li.fetchGasPrice({projectId:r,chainId:e.id}):null},async fetchSwapAllowance({tokenAddress:r,userAddress:e,sourceTokenAmount:t,sourceTokenDecimals:i}){const n=nt.state.projectId,o=await li.fetchSwapAllowance({projectId:n,tokenAddress:r,userAddress:e});if(o!=null&&o.allowance&&t&&i){const s=vt.parseUnits(t,i);return BigInt(o.allowance)>=s}return!1},async getMyTokensWithBalance(r){const e=Pe.state.address,t=Xe.state.caipNetwork;if(!e||!t)return[];const n=(await li.getBalance(e,t.id,r)).balances.filter(o=>o.quantity.decimals!=="0");return Pe.setTokenBalance(n),this.mapBalancesToSwapTokens(n)},mapBalancesToSwapTokens(r){return(r==null?void 0:r.map(e=>({...e,address:e!=null&&e.address?e.address:`${e.chainId}:${ui.NATIVE_TOKEN_ADDRESS}`,decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1})))||[]}},qr=xi({view:"Connect",history:["Connect"],transactionStack:[]}),_e={state:qr,subscribeKey(r,e){return yn(qr,r,e)},pushTransactionStack(r){qr.transactionStack.push(r)},popTransactionStack(r){var t,i;const e=qr.transactionStack.pop();e&&(r?(this.goBack(),(t=e==null?void 0:e.onCancel)==null||t.call(e)):(e.goBack?this.goBack():e.view&&this.reset(e.view),(i=e==null?void 0:e.onSuccess)==null||i.call(e)))},push(r,e){r!==qr.view&&(qr.view=r,qr.history.push(r),qr.data=e)},reset(r){qr.view=r,qr.history=[r]},replace(r,e){qr.history.length>=1&&qr.history.at(-1)!==r&&(qr.view=r,qr.history[qr.history.length-1]=r,qr.data=e)},goBack(){if(qr.history.length>1){qr.history.pop();const[r]=qr.history.slice(-1);r&&(qr.view=r)}},goBackToIndex(r){if(qr.history.length>1){qr.history=qr.history.slice(0,r+1);const[e]=qr.history.slice(-1);e&&(qr.view=e)}}},Ia={getGasPriceInEther(r,e){const t=e*r;return Number(t)/1e18},getGasPriceInUSD(r,e,t){const i=Ia.getGasPriceInEther(e,t);return pr.bigNumber(r).multipliedBy(i).toNumber()},getPriceImpact({sourceTokenAmount:r,sourceTokenPriceInUSD:e,toTokenPriceInUSD:t,toTokenAmount:i}){const n=pr.bigNumber(r).multipliedBy(e),o=pr.bigNumber(i).multipliedBy(t);return n.minus(o).dividedBy(n).multipliedBy(100).toNumber()},getMaxSlippage(r,e){const t=pr.bigNumber(r).dividedBy(100);return pr.multiply(e,t).toNumber()},getProviderFee(r,e=.0085){return pr.bigNumber(r).multipliedBy(e).toString()},isInsufficientNetworkTokenForGas(r,e){const t=e||"0";return pr.bigNumber(r).isZero()?!0:pr.bigNumber(pr.bigNumber(t)).isGreaterThan(r)},isInsufficientSourceTokenForSwap(r,e,t){var o,s;const i=(s=(o=t==null?void 0:t.find(a=>a.address===e))==null?void 0:o.quantity)==null?void 0:s.numeric;return pr.bigNumber(i||"0").isLessThan(r)},getToTokenAmount({sourceToken:r,toToken:e,sourceTokenPrice:t,toTokenPrice:i,sourceTokenAmount:n}){if(n==="0"||!r||!e)return"0";const o=r.decimals,s=t,a=e.decimals,u=i;if(u<=0)return"0";const h=pr.bigNumber(n).multipliedBy(.0085),p=pr.bigNumber(n).minus(h).multipliedBy(pr.bigNumber(10).pow(o)),v=pr.bigNumber(s).dividedBy(u),b=o-a;return p.multipliedBy(v).dividedBy(pr.bigNumber(10).pow(b)).dividedBy(pr.bigNumber(10).pow(a)).toFixed(a).toString()}},N8=15e4,iK=6,Sn={initializing:!1,initialized:!1,loading:!1,loadingPrices:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,transactionLoading:!1,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:ui.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},be=xi(Sn),Ve={state:be,subscribe(r){return pn(be,()=>r(be))},subscribeKey(r,e){return yn(be,r,e)},getParams(){var s,a,u,h,d,p,v,b,I;const{address:r}=Pe.state,e=`${(s=Xe.state.caipNetwork)==null?void 0:s.id}:${ui.NATIVE_TOKEN_ADDRESS}`;if(!r)throw new Error("No address found to swap the tokens from.");const t=Pe.state.caipAddress,i=!((a=be.toToken)!=null&&a.address)||!((u=be.toToken)!=null&&u.decimals),n=!((h=be.sourceToken)!=null&&h.address)||!((d=be.sourceToken)!=null&&d.decimals)||!pr.bigNumber(be.sourceTokenAmount).isGreaterThan(0),o=!be.sourceTokenAmount;return{networkAddress:e,fromAddress:r,fromCaipAddress:Pe.state.caipAddress,sourceTokenAddress:(p=be.sourceToken)==null?void 0:p.address,toTokenAddress:(v=be.toToken)==null?void 0:v.address,toTokenAmount:be.toTokenAmount,toTokenDecimals:(b=be.toToken)==null?void 0:b.decimals,sourceTokenAmount:be.sourceTokenAmount,sourceTokenDecimals:(I=be.sourceToken)==null?void 0:I.decimals,invalidToToken:i,invalidSourceToken:n,invalidSourceTokenAmount:o,availableToSwap:t&&!i&&!n&&!o}},setLoading(r){be.loading=r},setSourceToken(r){if(!r){be.sourceToken=r,be.sourceTokenAmount="",be.sourceTokenPriceInUSD=0;return}be.sourceToken=r,this.setTokenPrice(r.address,"sourceToken")},setSourceTokenAmount(r){be.sourceTokenAmount=r},setToToken(r){if(!r){be.toToken=r,be.toTokenAmount="",be.toTokenPriceInUSD=0;return}be.toToken=r,this.setTokenPrice(r.address,"toToken")},setToTokenAmount(r){be.toTokenAmount=r?pr.formatNumberToLocalString(r,iK):""},async setTokenPrice(r,e){const{availableToSwap:t}=this.getParams();let i=be.tokensPriceMap[r]||0;i||(be.loadingPrices=!0,i=await this.getAddressPrice(r)),e==="sourceToken"?be.sourceTokenPriceInUSD=i:e==="toToken"&&(be.toTokenPriceInUSD=i),be.loadingPrices&&(be.loadingPrices=!1,t&&this.swapTokens())},switchTokens(){if(be.initializing||!be.initialized)return;const r=be.toToken?{...be.toToken}:void 0,e=be.sourceToken?{...be.sourceToken}:void 0,t=r&&be.toTokenAmount===""?"1":be.toTokenAmount;this.setSourceToken(r),this.setToToken(e),this.setSourceTokenAmount(t),this.setToTokenAmount(""),this.swapTokens()},resetState(){be.myTokensWithBalance=Sn.myTokensWithBalance,be.tokensPriceMap=Sn.tokensPriceMap,be.initialized=Sn.initialized,be.sourceToken=Sn.sourceToken,be.sourceTokenAmount=Sn.sourceTokenAmount,be.sourceTokenPriceInUSD=Sn.sourceTokenPriceInUSD,be.toToken=Sn.toToken,be.toTokenAmount=Sn.toTokenAmount,be.toTokenPriceInUSD=Sn.toTokenPriceInUSD,be.networkPrice=Sn.networkPrice,be.networkTokenSymbol=Sn.networkTokenSymbol,be.networkBalanceInUSD=Sn.networkBalanceInUSD,be.inputError=Sn.inputError},resetValues(){var t;const{networkAddress:r}=this.getParams(),e=(t=be.tokens)==null?void 0:t.find(i=>i.address===r);this.setSourceToken(e),this.setToToken(void 0)},clearError(){be.transactionError=void 0},async initializeState(){if(!be.initializing){if(be.initializing=!0,!be.initialized)try{await this.fetchTokens(),be.initialized=!0}catch{be.initialized=!1,$t.showError("Failed to initialize swap"),_e.goBack()}be.initializing=!1}},async fetchTokens(){var t;const{networkAddress:r}=this.getParams();await this.getTokenList(),await this.getNetworkTokenPrice(),await this.getMyTokensWithBalance();const e=(t=be.tokens)==null?void 0:t.find(i=>i.address===r);e&&(be.networkTokenSymbol=e.symbol,this.setSourceToken(e),this.setSourceTokenAmount("1"))},async getTokenList(){const r=await Gd.getTokenList();be.tokens=r,be.popularTokens=r.sort((e,t)=>e.symbolt.symbol?1:0).filter(e=>!!ui.SWAP_POPULAR_TOKENS.includes(e.symbol),{}),be.suggestedTokens=r.filter(e=>!!ui.SWAP_SUGGESTED_TOKENS.includes(e.symbol),{})},async getAddressPrice(r){var u,h;const e=be.tokensPriceMap[r];if(e)return e;const i=(await li.fetchTokenPrice({projectId:nt.state.projectId,addresses:[r]})).fungibles||[],n=[...be.tokens||[],...be.myTokensWithBalance||[]],o=(u=n==null?void 0:n.find(d=>d.address===r))==null?void 0:u.symbol,s=((h=i.find(d=>d.symbol.toLowerCase()===(o==null?void 0:o.toLowerCase())))==null?void 0:h.price)||0,a=parseFloat(s.toString());return be.tokensPriceMap[r]=a,a},async getNetworkTokenPrice(){var n;const{networkAddress:r}=this.getParams(),t=(n=(await li.fetchTokenPrice({projectId:nt.state.projectId,addresses:[r]})).fungibles)==null?void 0:n[0],i=(t==null?void 0:t.price.toString())||"0";be.tokensPriceMap[r]=parseFloat(i),be.networkTokenSymbol=(t==null?void 0:t.symbol)||"",be.networkPrice=i},async getMyTokensWithBalance(r){const e=await Gd.getMyTokensWithBalance(r);e&&(await this.getInitialGasPrice(),this.setBalances(e))},setBalances(r){const{networkAddress:e}=this.getParams(),t=Xe.state.caipNetwork;if(!t)return;const i=r.find(n=>n.address===e);r.forEach(n=>{be.tokensPriceMap[n.address]=n.price||0}),be.myTokensWithBalance=r.filter(n=>n.address.startsWith(t.id)),be.networkBalanceInUSD=i?pr.multiply(i.quantity.numeric,i.price).toString():"0"},async getInitialGasPrice(){const r=await Gd.fetchGasPrice();if(!r)return{gasPrice:null,gasPriceInUsd:null};const e=r.standard,t=BigInt(e),i=BigInt(N8),n=Ia.getGasPriceInUSD(be.networkPrice,i,t);return be.gasFee=e,be.gasPriceInUSD=n,{gasPrice:t,gasPriceInUSD:be.gasPriceInUSD}},async swapTokens(){var h,d;const r=Pe.state.address,e=be.sourceToken,t=be.toToken,i=pr.bigNumber(be.sourceTokenAmount).isGreaterThan(0);if(!t||!e||be.loadingPrices||!i)return;be.loading=!0;const n=pr.bigNumber(be.sourceTokenAmount).multipliedBy(10**e.decimals),o=await li.fetchSwapQuote({userAddress:r,projectId:nt.state.projectId,from:e.address,to:t.address,gasPrice:be.gasFee,amount:n.toString()}),s=(d=(h=o==null?void 0:o.quotes)==null?void 0:h[0])==null?void 0:d.toAmount;if(!s)return;const a=pr.bigNumber(s).dividedBy(10**t.decimals).toString();this.setToTokenAmount(a),this.hasInsufficientToken(be.sourceTokenAmount,e.address)?be.inputError="Insufficient balance":(be.inputError=void 0,this.setTransactionDetails()),be.loading=!1},async getTransaction(){const{fromCaipAddress:r,availableToSwap:e}=this.getParams(),t=be.sourceToken,i=be.toToken;if(!(!r||!e||!t||!i||be.loading))try{be.loading=!0;const n=await Gd.fetchSwapAllowance({userAddress:r,tokenAddress:t.address,sourceTokenAmount:be.sourceTokenAmount,sourceTokenDecimals:t.decimals});let o;return n?o=await this.createSwapTransaction():o=await this.createAllowanceTransaction(),be.loading=!1,be.fetchError=!1,o}catch{_e.goBack(),$t.showError("Failed to check allowance"),be.approvalTransaction=void 0,be.swapTransaction=void 0,be.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:r,fromAddress:e,sourceTokenAddress:t,toTokenAddress:i}=this.getParams();if(!(!r||!i)){if(!t)throw new Error(">>> createAllowanceTransaction - No source token address found.");try{const n=await li.generateApproveCalldata({projectId:nt.state.projectId,from:t,to:i,userAddress:r}),o=await vt.estimateGas({address:e,to:$e.getPlainAddress(n.tx.to),data:n.tx.data}),s={data:n.tx.data,to:$e.getPlainAddress(n.tx.from),gas:o,gasPrice:BigInt(n.tx.eip155.gasPrice),value:BigInt(n.tx.value),toAmount:be.toTokenAmount};return be.swapTransaction=void 0,be.approvalTransaction=s,s}catch{_e.goBack(),$t.showError("Failed to create approval transaction"),be.approvalTransaction=void 0,be.swapTransaction=void 0,be.fetchError=!0;return}}},async createSwapTransaction(){const{networkAddress:r,fromCaipAddress:e,sourceTokenAmount:t}=this.getParams(),i=be.sourceToken,n=be.toToken;if(!e||!t||!i||!n)return;const o=vt.parseUnits(t,i.decimals).toString();try{const s=await li.generateSwapCalldata({projectId:nt.state.projectId,userAddress:e,from:i.address,to:n.address,amount:o}),a=i.address===r,u=BigInt(s.tx.eip155.gas),h=BigInt(s.tx.eip155.gasPrice),d={data:s.tx.data,to:$e.getPlainAddress(s.tx.to),gas:u,gasPrice:h,value:BigInt(a?o:"0"),toAmount:be.toTokenAmount};return be.gasPriceInUSD=Ia.getGasPriceInUSD(be.networkPrice,u,h),be.approvalTransaction=void 0,be.swapTransaction=d,d}catch{_e.goBack(),$t.showError("Failed to create transaction"),be.approvalTransaction=void 0,be.swapTransaction=void 0,be.fetchError=!0;return}},async sendTransactionForApproval(r){const{fromAddress:e}=this.getParams();be.transactionLoading=!0,_e.pushTransactionStack({view:null,goBack:!0});try{await vt.sendTransaction({address:e,to:r.to,data:r.data,value:BigInt(r.value),gasPrice:BigInt(r.gasPrice)}),be.approvalTransaction=void 0,be.transactionLoading=!1,this.swapTokens()}catch(t){const i=t;be.transactionError=i==null?void 0:i.shortMessage,be.transactionLoading=!1}},async sendTransactionForSwap(r){var i,n,o,s;if(!r)return;const{fromAddress:e,toTokenAmount:t}=this.getParams();be.transactionLoading=!0,_e.pushTransactionStack({view:"Account",goBack:!1,onSuccess(){Ve.resetState()}});try{const a=`Swapped ${(i=be.sourceToken)==null?void 0:i.symbol} to ${pr.formatNumberToLocalString(t,3)} ${(n=be.toToken)==null?void 0:n.symbol}!`,u=[(o=be.sourceToken)==null?void 0:o.address,(s=be.toToken)==null?void 0:s.address].join(","),h=await vt.sendTransaction({address:e,to:r.to,data:r.data,gas:r.gas,gasPrice:BigInt(r.gasPrice),value:r.value});return be.transactionLoading=!1,$t.showSuccess(a),Ve.resetState(),Ve.getMyTokensWithBalance(u),h}catch(a){const u=a;be.transactionError=u==null?void 0:u.shortMessage,be.transactionLoading=!1,$t.showError((u==null?void 0:u.shortMessage)||"Transaction error");return}},hasInsufficientToken(r,e){const t=Ia.isInsufficientSourceTokenForSwap(r,e,be.myTokensWithBalance);return Ia.isInsufficientNetworkTokenForGas(be.networkBalanceInUSD,be.gasPriceInUSD)||t},setTransactionDetails(){const{toTokenAddress:r,toTokenDecimals:e}=this.getParams();!r||!e||(be.gasPriceInUSD=Ia.getGasPriceInUSD(be.networkPrice,BigInt(be.gasFee),BigInt(N8)),be.priceImpact=Ia.getPriceImpact({sourceTokenAmount:be.sourceTokenAmount,sourceTokenPriceInUSD:be.sourceTokenPriceInUSD,toTokenPriceInUSD:be.toTokenPriceInUSD,toTokenAmount:be.toTokenAmount}),be.maxSlippage=Ia.getMaxSlippage(be.slippage,be.toTokenAmount),be.providerFee=Ia.getProviderFee(be.sourceTokenAmount))}},sr=xi({isConnected:!1,currentTab:0,tokenBalance:[],smartAccountDeployed:!1}),Pe={state:sr,subscribe(r){return pn(sr,()=>r(sr))},subscribeKey(r,e){return yn(sr,r,e)},setIsConnected(r){sr.isConnected=r},setCaipAddress(r){sr.caipAddress=r,sr.address=r?$e.getPlainAddress(r):void 0},setBalance(r,e){sr.balance=r,sr.balanceSymbol=e},setProfileName(r){sr.profileName=r},setProfileImage(r){sr.profileImage=r},setAddressExplorerUrl(r){sr.addressExplorerUrl=r},setSmartAccountDeployed(r){sr.smartAccountDeployed=r},setCurrentTab(r){sr.currentTab=r},setTokenBalance(r){r&&(sr.tokenBalance=Hl(r))},setConnectedWalletInfo(r){sr.connectedWalletInfo=r},setPreferredAccountType(r){sr.preferredAccountType=r},setSocialProvider(r){r&&(sr.socialProvider=r)},setSocialWindow(r){r&&(sr.socialWindow=Hl(r))},async fetchTokenBalance(){var e;const r=(e=Xe.state.caipNetwork)==null?void 0:e.id;try{if(sr.address&&r){const t=await li.getBalance(sr.address,r),i=t.balances.filter(n=>n.quantity.decimals!=="0");this.setTokenBalance(i),Ve.setBalances(Gd.mapBalancesToSwapTokens(t.balances))}}catch{$t.showError("Failed to fetch token balance")}},resetAccount(){sr.isConnected=!1,sr.smartAccountDeployed=!1,sr.currentTab=0,sr.caipAddress=void 0,sr.address=void 0,sr.balance=void 0,sr.balanceSymbol=void 0,sr.profileName=void 0,sr.profileImage=void 0,sr.addressExplorerUrl=void 0,sr.tokenBalance=[],sr.connectedWalletInfo=void 0,sr.preferredAccountType=void 0,sr.socialProvider=void 0,sr.socialWindow=void 0}},is=xi({walletImages:{},networkImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),Di={state:is,subscribeNetworkImages(r){return pn(is.networkImages,()=>r(is.networkImages))},subscribeKey(r,e){return yn(is,r,e)},subscribe(r){return pn(is,()=>r(is))},setWalletImage(r,e){is.walletImages[r]=e},setNetworkImage(r,e){is.networkImages[r]=e},setConnectorImage(r,e){is.connectorImages[r]=e},setTokenImage(r,e){is.tokenImages[r]=e},setCurrencyImage(r,e){is.currencyImages[r]=e}},Ca=xi({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),oi={state:Ca,subscribe(r){return pn(Ca,()=>r(Ca))},setThemeMode(r){Ca.themeMode=r;try{const e=dt.getAuthConnector();if(e){const t=oi.getSnapshot().themeVariables;e.provider.syncTheme({themeMode:r,themeVariables:t,w3mThemeVariables:Tc(t,r)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(r){Ca.themeVariables={...Ca.themeVariables,...r};try{const e=dt.getAuthConnector();if(e){const t=oi.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:t,w3mThemeVariables:Tc(Ca.themeVariables,Ca.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return hy(Ca)}},mc=xi({connectors:[]}),dt={state:mc,subscribeKey(r,e){return yn(mc,r,e)},setConnectors(r){mc.connectors=r.map(e=>Hl(e))},addConnector(r){var e,t;if(mc.connectors.push(Hl(r)),r.id==="w3mAuth"){const i=r,n=hy(nt.state),o=oi.getSnapshot().themeMode,s=oi.getSnapshot().themeVariables;(t=(e=i==null?void 0:i.provider)==null?void 0:e.syncDappData)==null||t.call(e,{metadata:n.metadata,sdkVersion:n.sdkVersion,projectId:n.projectId}),i.provider.syncTheme({themeMode:o,themeVariables:s,w3mThemeVariables:Tc(s,o)})}},getAuthConnector(){return mc.connectors.find(r=>r.type==="AUTH")},getAnnouncedConnectorRdns(){return mc.connectors.filter(r=>r.type==="ANNOUNCED").map(r=>{var e;return(e=r.info)==null?void 0:e.rdns})},getConnectors(){return mc.connectors},getConnector(r,e){return mc.connectors.find(t=>{var i;return t.explorerId===r||((i=t.info)==null?void 0:i.rdns)===e})}},nK=$e.getApiUrl(),sn=new dy({baseUrl:nK}),oK="40",$8="4",Bi=xi({page:1,count:0,featured:[],recommended:[],wallets:[],search:[],isAnalyticsEnabled:!1}),Tt={state:Bi,subscribeKey(r,e){return yn(Bi,r,e)},_getApiHeaders(){const{projectId:r,sdkType:e,sdkVersion:t}=nt.state;return{"x-project-id":r,"x-sdk-type":e,"x-sdk-version":t}},async _fetchWalletImage(r){const e=`${sn.baseUrl}/getWalletImage/${r}`,t=await sn.getBlob({path:e,headers:Tt._getApiHeaders()});Di.setWalletImage(r,URL.createObjectURL(t))},async _fetchNetworkImage(r){const e=`${sn.baseUrl}/public/getAssetImage/${r}`,t=await sn.getBlob({path:e,headers:Tt._getApiHeaders()});Di.setNetworkImage(r,URL.createObjectURL(t))},async _fetchConnectorImage(r){const e=`${sn.baseUrl}/public/getAssetImage/${r}`,t=await sn.getBlob({path:e,headers:Tt._getApiHeaders()});Di.setConnectorImage(r,URL.createObjectURL(t))},async _fetchCurrencyImage(r){const e=`${sn.baseUrl}/public/getCurrencyImage/${r}`,t=await sn.getBlob({path:e,headers:Tt._getApiHeaders()});Di.setCurrencyImage(r,URL.createObjectURL(t))},async _fetchTokenImage(r){const e=`${sn.baseUrl}/public/getTokenImage/${r}`,t=await sn.getBlob({path:e,headers:Tt._getApiHeaders()});Di.setTokenImage(r,URL.createObjectURL(t))},async fetchNetworkImages(){const{requestedCaipNetworks:r}=Xe.state,e=r==null?void 0:r.map(({imageId:t})=>t).filter(Boolean);e&&await Promise.allSettled(e.map(t=>Tt._fetchNetworkImage(t)))},async fetchConnectorImages(){const{connectors:r}=dt.state,e=r.map(({imageId:t})=>t).filter(Boolean);await Promise.allSettled(e.map(t=>Tt._fetchConnectorImage(t)))},async fetchCurrencyImages(r=[]){await Promise.allSettled(r.map(e=>Tt._fetchCurrencyImage(e)))},async fetchTokenImages(r=[]){await Promise.allSettled(r.map(e=>Tt._fetchTokenImage(e)))},async fetchFeaturedWallets(){const{featuredWalletIds:r}=nt.state;if(r!=null&&r.length){const{data:e}=await sn.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",entries:r!=null&&r.length?String(r.length):$8,include:r==null?void 0:r.join(",")}});e.sort((i,n)=>r.indexOf(i.id)-r.indexOf(n.id));const t=e.map(i=>i.image_id).filter(Boolean);await Promise.allSettled(t.map(i=>Tt._fetchWalletImage(i))),Bi.featured=e}},async fetchRecommendedWallets(){var h;const{includeWalletIds:r,excludeWalletIds:e,featuredWalletIds:t}=nt.state,i=[...e??[],...t??[]].filter(Boolean),{data:n,count:o}=await sn.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",chains:(h=Xe.state.caipNetwork)==null?void 0:h.id,entries:$8,include:r==null?void 0:r.join(","),exclude:i==null?void 0:i.join(",")}}),s=Fr.getRecentWallets(),a=n.map(d=>d.image_id).filter(Boolean),u=s.map(d=>d.image_id).filter(Boolean);await Promise.allSettled([...a,...u].map(d=>Tt._fetchWalletImage(d))),Bi.recommended=n,Bi.count=o??0},async fetchWallets({page:r}){var u;const{includeWalletIds:e,excludeWalletIds:t,featuredWalletIds:i}=nt.state,n=[...Bi.recommended.map(({id:h})=>h),...t??[],...i??[]].filter(Boolean),{data:o,count:s}=await sn.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:String(r),entries:oK,chains:(u=Xe.state.caipNetwork)==null?void 0:u.id,include:e==null?void 0:e.join(","),exclude:n.join(",")}}),a=o.map(h=>h.image_id).filter(Boolean);await Promise.allSettled([...a.map(h=>Tt._fetchWalletImage(h)),$e.wait(300)]),Bi.wallets=[...Bi.wallets,...o],Bi.count=s>Bi.count?s:Bi.count,Bi.page=r},async searchWallet({search:r}){var o;const{includeWalletIds:e,excludeWalletIds:t}=nt.state;Bi.search=[];const{data:i}=await sn.get({path:"/getWallets",headers:Tt._getApiHeaders(),params:{page:"1",entries:"100",search:r==null?void 0:r.trim(),chains:(o=Xe.state.caipNetwork)==null?void 0:o.id,include:e==null?void 0:e.join(","),exclude:t==null?void 0:t.join(",")}}),n=i.map(s=>s.image_id).filter(Boolean);await Promise.allSettled([...n.map(s=>Tt._fetchWalletImage(s)),$e.wait(300)]),Bi.search=i},async reFetchWallets(){Bi.page=1,Bi.wallets=[],await Tt.fetchFeaturedWallets(),await Tt.fetchRecommendedWallets()},prefetch(){const r=[Tt.fetchFeaturedWallets(),Tt.fetchRecommendedWallets(),Tt.fetchNetworkImages(),Tt.fetchConnectorImages()];nt.state.enableAnalytics===void 0&&r.push(Tt.fetchAnalyticsConfig()),Bi.prefetchPromise=Promise.race([Promise.allSettled(r),$e.wait(3e3)])},async fetchAnalyticsConfig(){const{isAnalyticsEnabled:r}=await sn.get({path:"/getAnalyticsConfig",headers:Tt._getApiHeaders()});nt.setEnableAnalytics(r)}},Sl=xi({loading:!1,open:!1}),yt={state:Sl,subscribe(r){return pn(Sl,()=>r(Sl))},subscribeKey(r,e){return yn(Sl,r,e)},async open(r){await Tt.state.prefetchPromise;const e=Pe.state.isConnected;r!=null&&r.view?_e.reset(r.view):e?_e.reset("Account"):_e.reset("Connect"),Sl.open=!0,Ul.set({open:!0}),bt.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:e}})},close(){const r=Pe.state.isConnected;Sl.open=!1,Ul.set({open:!1}),bt.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:r}})},setLoading(r){Sl.loading=r,Ul.set({loading:r})}},ef={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},B2={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},sK={providers:kE,selectedProvider:null,error:null,purchaseCurrency:ef,paymentCurrency:B2,purchaseCurrencies:[ef],paymentCurrencies:[],quotesLoading:!1},yr=xi(sK),br={state:yr,subscribe(r){return pn(yr,()=>r(yr))},subscribeKey(r,e){return yn(yr,r,e)},setSelectedProvider(r){yr.selectedProvider=r},setPurchaseCurrency(r){yr.purchaseCurrency=r},setPaymentCurrency(r){yr.paymentCurrency=r},setPurchaseAmount(r){this.state.purchaseAmount=r},setPaymentAmount(r){this.state.paymentAmount=r},async getAvailableCurrencies(){const r=await li.getOnrampOptions();yr.purchaseCurrencies=r.purchaseCurrencies,yr.paymentCurrencies=r.paymentCurrencies,yr.paymentCurrency=r.paymentCurrencies[0]||B2,yr.purchaseCurrency=r.purchaseCurrencies[0]||ef,await Tt.fetchCurrencyImages(r.paymentCurrencies.map(e=>e.id)),await Tt.fetchTokenImages(r.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var r,e;yr.quotesLoading=!0;try{const t=await li.getOnrampQuote({purchaseCurrency:yr.purchaseCurrency,paymentCurrency:yr.paymentCurrency,amount:((r=yr.paymentAmount)==null?void 0:r.toString())||"0",network:(e=yr.purchaseCurrency)==null?void 0:e.symbol});return yr.quotesLoading=!1,yr.purchaseAmount=Number(t.purchaseAmount.amount),t}catch(t){return yr.error=t.message,yr.quotesLoading=!1,null}finally{yr.quotesLoading=!1}},resetState(){yr.providers=kE,yr.selectedProvider=null,yr.error=null,yr.purchaseCurrency=ef,yr.paymentCurrency=B2,yr.purchaseCurrencies=[ef],yr.paymentCurrencies=[],yr.paymentAmount=void 0,yr.purchaseAmount=void 0,yr.quotesLoading=!1}},ki=xi({loading:!1}),_r={state:ki,subscribe(r){return pn(ki,()=>r(ki))},subscribeKey(r,e){return yn(ki,r,e)},setToken(r){r&&(ki.token=Hl(r))},setTokenAmount(r){ki.sendTokenAmount=r},setReceiverAddress(r){ki.receiverAddress=r},setReceiverProfileImageUrl(r){ki.receiverProfileImageUrl=r},setReceiverProfileName(r){ki.receiverProfileName=r},setGasPrice(r){ki.gasPrice=r},setGasPriceInUsd(r){ki.gasPriceInUSD=r},setLoading(r){ki.loading=r},sendToken(){var r,e;(r=this.state.token)!=null&&r.address&&this.state.sendTokenAmount&&this.state.receiverAddress?this.sendERC20Token({receiverAddress:this.state.receiverAddress,tokenAddress:this.state.token.address,sendTokenAmount:this.state.sendTokenAmount,decimals:this.state.token.quantity.decimals}):this.state.receiverAddress&&this.state.sendTokenAmount&&this.state.gasPrice&&((e=this.state.token)!=null&&e.quantity.decimals)&&this.sendNativeToken({receiverAddress:this.state.receiverAddress,sendTokenAmount:this.state.sendTokenAmount,gasPrice:this.state.gasPrice,decimals:this.state.token.quantity.decimals})},async sendNativeToken(r){_e.pushTransactionStack({view:"Account",goBack:!1});const e=r.receiverAddress,t=Pe.state.address,i=vt.parseUnits(r.sendTokenAmount.toString(),Number(r.decimals)),n="0x";try{await vt.sendTransaction({to:e,address:t,data:n,value:i,gasPrice:r.gasPrice}),$t.showSuccess("Transaction started"),this.resetSend()}catch{$t.showError("Something went wrong")}},async sendERC20Token(r){_e.pushTransactionStack({view:"Account",goBack:!1});const e=vt.parseUnits(r.sendTokenAmount.toString(),Number(r.decimals));try{Pe.state.address&&r.sendTokenAmount&&r.receiverAddress&&r.tokenAddress&&(await vt.writeContract({fromAddress:Pe.state.address,tokenAddress:$e.getPlainAddress(r.tokenAddress),receiverAddress:r.receiverAddress,tokenAmount:e,method:"transfer",abi:QV}),$t.showSuccess("Transaction started"),this.resetSend())}catch{$t.showError("Something went wrong")}},resetSend(){ki.token=void 0,ki.sendTokenAmount=void 0,ki.receiverAddress=void 0,ki.receiverProfileImageUrl=void 0,ki.receiverProfileName=void 0,ki.loading=!1}},ns=xi({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),Gn={state:ns,subscribe(r){return pn(ns,()=>r(ns))},subscribeKey(r,e){return yn(ns,r,e)},showTooltip({message:r,triggerRect:e,variant:t}){ns.open=!0,ns.message=r,ns.triggerRect=e,ns.variant=t},hide(){ns.open=!1,ns.message="",ns.triggerRect={width:0,height:0,top:0,left:0}}},M8=2147483648,aK={convertEVMChainIdToCoinType(r){if(r>=M8)throw new Error("Invalid chainId");return(M8|r)>>>0}},To=xi({suggestions:[],loading:!1}),cs={state:To,subscribe(r){return pn(To,()=>r(To))},subscribeKey(r,e){return yn(To,r,e)},async resolveName(r){var e,t;try{return await li.lookupEnsName(r)}catch(i){const n=i;throw new Error(((t=(e=n==null?void 0:n.reasons)==null?void 0:e[0])==null?void 0:t.description)||"Error resolving name")}},async isNameRegistered(r){try{return await li.lookupEnsName(r),!0}catch{return!1}},async getSuggestions(r){try{To.loading=!0,To.suggestions=[];const e=await li.getEnsNameSuggestions(r);return To.suggestions=e.suggestions.map(t=>({...t,name:t.name.replace(Ic.WC_NAME_SUFFIX,"")}))||[],To.suggestions}catch(e){const t=this.parseEnsApiError(e,"Error fetching name suggestions");throw new Error(t)}finally{To.loading=!1}},async getNamesForAddress(r){try{return Xe.state.caipNetwork?await li.reverseLookupEnsName({address:r}):[]}catch(e){const t=this.parseEnsApiError(e,"Error fetching names for address");throw new Error(t)}},async registerName(r){const e=Xe.state.caipNetwork;if(!e)throw new Error("Network not found");const t=Pe.state.address,i=dt.getAuthConnector();if(!t||!i)throw new Error("Address or auth connector not found");if(!this.isAllowedToRegisterName())throw new Error("Not allowed to register name");To.loading=!0;try{const n=JSON.stringify({name:`${r}${Ic.WC_NAME_SUFFIX}`,attributes:{},timestamp:Math.floor(Date.now()/1e3)});_e.pushTransactionStack({view:"RegisterAccountNameSuccess",goBack:!1,replace:!0,onCancel(){To.loading=!1}});const o=await vt.signMessage(n),s=ss.caipNetworkIdToNumber(e.id);if(!s)throw new Error("Network not found");const a=aK.convertEVMChainIdToCoinType(s);await li.registerEnsName({coinType:a,address:t,signature:o,message:n}),Pe.setProfileName(`${r}${Ic.WC_NAME_SUFFIX}`),_e.replace("RegisterAccountNameSuccess")}catch(n){const o=this.parseEnsApiError(n,`Error registering name ${r}`);throw _e.replace("RegisterAccountName"),new Error(o)}finally{To.loading=!1}},validateName(r){return/^[a-zA-Z0-9-]{4,}$/u.test(r)},parseEnsApiError(r,e){var i,n;const t=r;return((n=(i=t==null?void 0:t.reasons)==null?void 0:i[0])==null?void 0:n.description)||e},isAllowedToRegisterName(){var i;const r=dt.getAuthConnector(),t=(i=((r==null?void 0:r.provider.getEmail())||"").split("@"))==null?void 0:i[1];return t&&Ic.WC_NAMES_ALLOWED_DOMAINS.includes(t)}},xr={getWalletImage(r){if(r!=null&&r.image_url)return r==null?void 0:r.image_url;if(r!=null&&r.image_id)return Di.state.walletImages[r.image_id]},getNetworkImage(r){if(r!=null&&r.imageUrl)return r==null?void 0:r.imageUrl;if(r!=null&&r.imageId)return Di.state.networkImages[r.imageId]},getConnectorImage(r){if(r!=null&&r.imageUrl)return r.imageUrl;if(r!=null&&r.imageId)return Di.state.connectorImages[r.imageId]}},nm={goBackOrCloseModal(){_e.state.history.length>1?_e.goBack():yt.close()},navigateAfterNetworkSwitch(){const{history:r}=_e.state,e=r.findIndex(t=>t==="Networks");e>=1?_e.goBackToIndex(e-1):yt.close()},navigateAfterPreferredAccountTypeSelect(){const{isSiweEnabled:r}=nt.state,{profileName:e}=Pe.state;r?_e.push("ConnectingSiwe"):e?_e.push("Account"):_e.push("ChooseAccountName")}};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const C1=globalThis,gy=C1.ShadowRoot&&(C1.ShadyCSS===void 0||C1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,my=Symbol(),B8=new WeakMap;let ME=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==my)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(gy&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=B8.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&B8.set(t,e))}return e}toString(){return this.cssText}};const Oo=r=>new ME(typeof r=="string"?r:r+"",void 0,my),We=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((i,n,o)=>i+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+r[o+1],r[0]);return new ME(t,r,my)},cK=(r,e)=>{if(gy)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),n=C1.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,r.appendChild(i)}},U8=gy?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Oo(t)})(r):r;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:lK,defineProperty:uK,getOwnPropertyDescriptor:hK,getOwnPropertyNames:dK,getOwnPropertySymbols:fK,getPrototypeOf:pK}=Object,Oc=globalThis,L8=Oc.trustedTypes,gK=L8?L8.emptyScript:"",Mv=Oc.reactiveElementPolyfillSupport,tf=(r,e)=>r,K1={toAttribute(r,e){switch(e){case Boolean:r=r?gK:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},wy=(r,e)=>!lK(r,e),j8={attribute:!0,type:String,converter:K1,reflect:!1,hasChanged:wy};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Oc.litPropertyMetadata??(Oc.litPropertyMetadata=new WeakMap);let th=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=j8){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&uK(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:o}=hK(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get(){return n==null?void 0:n.call(this)},set(s){const a=n==null?void 0:n.call(this);o.call(this,s),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??j8}static _$Ei(){if(this.hasOwnProperty(tf("elementProperties")))return;const e=pK(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(tf("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(tf("properties"))){const t=this.properties,i=[...dK(t),...fK(t)];for(const n of i)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)t.unshift(U8(n))}else e!==void 0&&t.push(U8(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return cK(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var o;const i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){const s=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:K1).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){var o;const i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){const s=i.getPropertyOptions(n),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((o=s.converter)==null?void 0:o.fromAttribute)!==void 0?s.converter:K1;this._$Em=n,this[n]=a.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??wy)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[o,s]of n)s.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],s)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EU()}catch(n){throw e=!1,this._$EU(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}};th.elementStyles=[],th.shadowRootOptions={mode:"open"},th[tf("elementProperties")]=new Map,th[tf("finalized")]=new Map,Mv==null||Mv({ReactiveElement:th}),(Oc.reactiveElementVersions??(Oc.reactiveElementVersions=[])).push("2.0.4");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const rf=globalThis,G1=rf.trustedTypes,F8=G1?G1.createPolicy("lit-html",{createHTML:r=>r}):void 0,BE="$lit$",Ec=`lit$${Math.random().toFixed(9).slice(2)}$`,UE="?"+Ec,mK=`<${UE}>`,ql=document,_f=()=>ql.createComment(""),xf=r=>r===null||typeof r!="object"&&typeof r!="function",LE=Array.isArray,wK=r=>LE(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",Bv=`[ +\f\r]`,zd=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,z8=/-->/g,W8=/>/g,Il=RegExp(`>|${Bv}(?:([^\\s"'>=/]+)(${Bv}*=${Bv}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),H8=/'/g,q8=/"/g,jE=/^(?:script|style|textarea|title)$/i,FE=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),we=FE(1),De=FE(2),Vl=Symbol.for("lit-noChange"),ai=Symbol.for("lit-nothing"),V8=new WeakMap,Dl=ql.createTreeWalker(ql,129);function zE(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return F8!==void 0?F8.createHTML(e):e}const vK=(r,e)=>{const t=r.length-1,i=[];let n,o=e===2?"":"",s=zd;for(let a=0;a"?(s=n??zd,p=-1):d[1]===void 0?p=-2:(p=s.lastIndex-d[2].length,h=d[1],s=d[3]===void 0?Il:d[3]==='"'?q8:H8):s===q8||s===H8?s=Il:s===z8||s===W8?s=zd:(s=Il,n=void 0);const b=s===Il&&r[a+1].startsWith("/>")?" ":"";o+=s===zd?u+mK:p>=0?(i.push(h),u.slice(0,p)+BE+u.slice(p)+Ec+b):u+Ec+(p===-2?a:b)}return[zE(r,o+(r[t]||"")+(e===2?"":"")),i]};let U2=class WE{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let o=0,s=0;const a=e.length-1,u=this.parts,[h,d]=vK(e,t);if(this.el=WE.createElement(h,i),Dl.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Dl.nextNode())!==null&&u.length0){n.textContent=G1?G1.emptyScript:"";for(let b=0;b2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ai}_$AI(e,t=this,i,n){const o=this.strings;let s=!1;if(o===void 0)e=bh(this,e,t,0),s=!xf(e)||e!==this._$AH&&e!==Vl,s&&(this._$AH=e);else{const a=e;let u,h;for(e=o[0],u=0;u{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const o=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new vy(e.insertBefore(_f(),o),o,void 0,t??{})}return n._$AI(r),n};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let qe=class extends th{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=EK(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Vl}};var Q_;qe._$litElement$=!0,qe.finalized=!0,(Q_=globalThis.litElementHydrateSupport)==null||Q_.call(globalThis,{LitElement:qe});const Lv=globalThis.litElementPolyfillSupport;Lv==null||Lv({LitElement:qe});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.6");let nf,Pc,Dc;function CK(r,e){nf=document.createElement("style"),Pc=document.createElement("style"),Dc=document.createElement("style"),nf.textContent=ph(r).core.cssText,Pc.textContent=ph(r).dark.cssText,Dc.textContent=ph(r).light.cssText,document.head.appendChild(nf),document.head.appendChild(Pc),document.head.appendChild(Dc),qE(e)}function qE(r){Pc&&Dc&&(r==="light"?(Pc.removeAttribute("media"),Dc.media="enabled"):(Dc.removeAttribute("media"),Pc.media="enabled"))}function SK(r){nf&&Pc&&Dc&&(nf.textContent=ph(r).core.cssText,Pc.textContent=ph(r).dark.cssText,Dc.textContent=ph(r).light.cssText)}function ph(r){return{core:We` + @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); + :root { + --w3m-modal-width: 360px; + --w3m-color-mix-strength: ${Oo(r!=null&&r["--w3m-color-mix-strength"]?`${r["--w3m-color-mix-strength"]}%`:"0%")}; + --w3m-font-family: ${Oo((r==null?void 0:r["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; + --w3m-font-size-master: ${Oo((r==null?void 0:r["--w3m-font-size-master"])||"10px")}; + --w3m-border-radius-master: ${Oo((r==null?void 0:r["--w3m-border-radius-master"])||"4px")}; + --w3m-z-index: ${Oo((r==null?void 0:r["--w3m-z-index"])||999)}; + + --wui-font-family: var(--w3m-font-family); + + --wui-font-size-mini: calc(var(--w3m-font-size-master) * 0.8); + --wui-font-size-micro: var(--w3m-font-size-master); + --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2); + --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4); + --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6); + --wui-font-size-medium: calc(var(--w3m-font-size-master) * 1.8); + --wui-font-size-large: calc(var(--w3m-font-size-master) * 2); + --wui-font-size-medium-title: calc(var(--w3m-font-size-master) * 2.4); + --wui-font-size-2xl: calc(var(--w3m-font-size-master) * 4); + + --wui-border-radius-5xs: var(--w3m-border-radius-master); + --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5); + --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2); + --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3); + --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4); + --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5); + --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7); + --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9); + --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20); + + --wui-font-weight-light: 400; + --wui-font-weight-regular: 500; + --wui-font-weight-medium: 600; + --wui-font-weight-bold: 700; + + --wui-letter-spacing-2xl: -1.6px; + --wui-letter-spacing-medium-title: -0.96px; + --wui-letter-spacing-large: -0.8px; + --wui-letter-spacing-medium: -0.72px; + --wui-letter-spacing-paragraph: -0.64px; + --wui-letter-spacing-small: -0.56px; + --wui-letter-spacing-tiny: -0.48px; + --wui-letter-spacing-micro: -0.2px; + --wui-letter-spacing-mini: -0.16px; + + --wui-spacing-0: 0px; + --wui-spacing-4xs: 2px; + --wui-spacing-3xs: 4px; + --wui-spacing-xxs: 6px; + --wui-spacing-2xs: 7px; + --wui-spacing-xs: 8px; + --wui-spacing-1xs: 10px; + --wui-spacing-s: 12px; + --wui-spacing-m: 14px; + --wui-spacing-l: 16px; + --wui-spacing-2l: 18px; + --wui-spacing-xl: 20px; + --wui-spacing-xxl: 24px; + --wui-spacing-2xl: 32px; + --wui-spacing-3xl: 40px; + --wui-spacing-4xl: 90px; + --wui-spacing-5xl: 95px; + + --wui-icon-box-size-xxs: 14px; + --wui-icon-box-size-xs: 20px; + --wui-icon-box-size-sm: 24px; + --wui-icon-box-size-md: 32px; + --wui-icon-box-size-lg: 40px; + --wui-icon-box-size-xl: 64px; + + --wui-icon-size-inherit: inherit; + --wui-icon-size-xxs: 10px; + --wui-icon-size-xs: 12px; + --wui-icon-size-sm: 14px; + --wui-icon-size-md: 16px; + --wui-icon-size-mdl: 18px; + --wui-icon-size-lg: 20px; + --wui-icon-size-xl: 24px; + --wui-icon-size-xxl: 28px; + + --wui-wallet-image-size-inherit: inherit; + --wui-wallet-image-size-sm: 40px; + --wui-wallet-image-size-md: 56px; + --wui-wallet-image-size-lg: 80px; + + --wui-visual-size-size-inherit: inherit; + --wui-visual-size-sm: 40px; + --wui-visual-size-md: 55px; + --wui-visual-size-lg: 80px; + + --wui-box-size-md: 100px; + --wui-box-size-lg: 120px; + + --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1); + --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1); + + --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1); + --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1); + --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1); + + --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1); + + --wui-duration-lg: 200ms; + --wui-duration-md: 125ms; + --wui-duration-sm: 75ms; + + --wui-path-network-sm: path( + 'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z' + ); + + --wui-path-network-md: path( + 'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z' + ); + + --wui-path-network-lg: path( + 'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z' + ); + + --wui-width-network-sm: 36px; + --wui-width-network-md: 48px; + --wui-width-network-lg: 86px; + + --wui-height-network-sm: 40px; + --wui-height-network-md: 54px; + --wui-height-network-lg: 96px; + + --wui-icon-size-network-xs: 12px; + --wui-icon-size-network-sm: 16px; + --wui-icon-size-network-md: 24px; + --wui-icon-size-network-lg: 42px; + + --wui-color-inherit: inherit; + + --wui-color-inverse-100: #fff; + --wui-color-inverse-000: #000; + + --wui-cover: rgba(20, 20, 20, 0.8); + + --wui-color-modal-bg: var(--wui-color-modal-bg-base); + + --wui-color-accent-100: var(--wui-color-accent-base-100); + --wui-color-accent-090: var(--wui-color-accent-base-090); + --wui-color-accent-080: var(--wui-color-accent-base-080); + + --wui-color-success-100: var(--wui-color-success-base-100); + + --wui-color-error-100: var(--wui-color-error-base-100); + + --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100); + --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100); + --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100); + --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100); + + --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-100); + + --wui-avatar-border: var(--wui-avatar-border-base); + + --wui-thumbnail-border: var(--wui-thumbnail-border-base); + + --wui-box-shadow-blue: var(--wui-color-accent-glass-020); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :root { + --wui-color-modal-bg: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-modal-bg-base) + ); + + --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 20%, transparent); + + --wui-color-accent-100: color-mix( + in srgb, + var(--wui-color-accent-base-100) 100%, + transparent + ); + --wui-color-accent-090: color-mix( + in srgb, + var(--wui-color-accent-base-100) 90%, + transparent + ); + --wui-color-accent-080: color-mix( + in srgb, + var(--wui-color-accent-base-100) 80%, + transparent + ); + --wui-color-accent-glass-090: color-mix( + in srgb, + var(--wui-color-accent-base-100) 90%, + transparent + ); + --wui-color-accent-glass-080: color-mix( + in srgb, + var(--wui-color-accent-base-100) 80%, + transparent + ); + --wui-color-accent-glass-020: color-mix( + in srgb, + var(--wui-color-accent-base-100) 20%, + transparent + ); + --wui-color-accent-glass-015: color-mix( + in srgb, + var(--wui-color-accent-base-100) 15%, + transparent + ); + --wui-color-accent-glass-010: color-mix( + in srgb, + var(--wui-color-accent-base-100) 10%, + transparent + ); + --wui-color-accent-glass-005: color-mix( + in srgb, + var(--wui-color-accent-base-100) 5%, + transparent + ); + --wui-color-accent-002: color-mix( + in srgb, + var(--wui-color-accent-base-100) 2%, + transparent + ); + + --wui-color-fg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-100) + ); + --wui-color-fg-125: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-125) + ); + --wui-color-fg-150: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-150) + ); + --wui-color-fg-175: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-175) + ); + --wui-color-fg-200: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-200) + ); + --wui-color-fg-225: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-225) + ); + --wui-color-fg-250: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-250) + ); + --wui-color-fg-275: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-275) + ); + --wui-color-fg-300: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-300) + ); + + --wui-color-bg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-100) + ); + --wui-color-bg-125: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-125) + ); + --wui-color-bg-150: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-150) + ); + --wui-color-bg-175: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-175) + ); + --wui-color-bg-200: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-200) + ); + --wui-color-bg-225: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-225) + ); + --wui-color-bg-250: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-250) + ); + --wui-color-bg-275: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-275) + ); + --wui-color-bg-300: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-300) + ); + + --wui-color-success-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-success-base-100) + ); + --wui-color-error-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-error-base-100) + ); + + --wui-icon-box-bg-error-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-error-base-100) + ); + --wui-icon-box-bg-accent-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-blue-base-100) + ); + --wui-icon-box-bg-success-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-success-base-100) + ); + --wui-icon-box-bg-inverse-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-inverse-base-100) + ); + + --wui-all-wallets-bg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-all-wallets-bg-100) + ); + + --wui-avatar-border: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-avatar-border-base) + ); + + --wui-thumbnail-border: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-thumbnail-border-base) + ); + } + } + `,light:We` + :root { + --w3m-color-mix: ${Oo((r==null?void 0:r["--w3m-color-mix"])||"#fff")}; + --w3m-accent: ${Oo(Tc(r,"dark")["--w3m-accent"])}; + --w3m-default: #fff; + + --wui-color-modal-bg-base: ${Oo(Tc(r,"dark")["--w3m-background"])}; + --wui-color-accent-base-100: var(--w3m-accent); + + --wui-color-blueberry-100: hsla(230, 100%, 67%, 1); + --wui-color-blueberry-090: hsla(231, 76%, 61%, 1); + --wui-color-blueberry-080: hsla(230, 59%, 55%, 1); + + --wui-color-fg-100: #e4e7e7; + --wui-color-fg-125: #d0d5d5; + --wui-color-fg-150: #a8b1b1; + --wui-color-fg-175: #a8b0b0; + --wui-color-fg-200: #949e9e; + --wui-color-fg-225: #868f8f; + --wui-color-fg-250: #788080; + --wui-color-fg-275: #788181; + --wui-color-fg-300: #6e7777; + + --wui-color-bg-100: #141414; + --wui-color-bg-125: #191a1a; + --wui-color-bg-150: #1e1f1f; + --wui-color-bg-175: #222525; + --wui-color-bg-200: #272a2a; + --wui-color-bg-225: #2c3030; + --wui-color-bg-250: #313535; + --wui-color-bg-275: #363b3b; + --wui-color-bg-300: #3b4040; + + --wui-color-success-base-100: #26d962; + --wui-color-error-base-100: #f25a67; + + --wui-color-success-glass-001: rgba(38, 217, 98, 0.01); + --wui-color-success-glass-002: rgba(38, 217, 98, 0.02); + --wui-color-success-glass-005: rgba(38, 217, 98, 0.05); + --wui-color-success-glass-010: rgba(38, 217, 98, 0.1); + --wui-color-success-glass-015: rgba(38, 217, 98, 0.15); + --wui-color-success-glass-020: rgba(38, 217, 98, 0.2); + --wui-color-success-glass-025: rgba(38, 217, 98, 0.25); + --wui-color-success-glass-030: rgba(38, 217, 98, 0.3); + --wui-color-success-glass-060: rgba(38, 217, 98, 0.6); + --wui-color-success-glass-080: rgba(38, 217, 98, 0.8); + + --wui-color-error-glass-001: rgba(242, 90, 103, 0.01); + --wui-color-error-glass-002: rgba(242, 90, 103, 0.02); + --wui-color-error-glass-005: rgba(242, 90, 103, 0.05); + --wui-color-error-glass-010: rgba(242, 90, 103, 0.1); + --wui-color-error-glass-015: rgba(242, 90, 103, 0.15); + --wui-color-error-glass-020: rgba(242, 90, 103, 0.2); + --wui-color-error-glass-025: rgba(242, 90, 103, 0.25); + --wui-color-error-glass-030: rgba(242, 90, 103, 0.3); + --wui-color-error-glass-060: rgba(242, 90, 103, 0.6); + --wui-color-error-glass-080: rgba(242, 90, 103, 0.8); + + --wui-color-gray-glass-001: rgba(255, 255, 255, 0.01); + --wui-color-gray-glass-002: rgba(255, 255, 255, 0.02); + --wui-color-gray-glass-005: rgba(255, 255, 255, 0.05); + --wui-color-gray-glass-010: rgba(255, 255, 255, 0.1); + --wui-color-gray-glass-015: rgba(255, 255, 255, 0.15); + --wui-color-gray-glass-020: rgba(255, 255, 255, 0.2); + --wui-color-gray-glass-025: rgba(255, 255, 255, 0.25); + --wui-color-gray-glass-030: rgba(255, 255, 255, 0.3); + --wui-color-gray-glass-060: rgba(255, 255, 255, 0.6); + --wui-color-gray-glass-080: rgba(255, 255, 255, 0.8); + --wui-color-gray-glass-090: rgba(255, 255, 255, 0.9); + + --wui-icon-box-bg-error-base-100: #3c2426; + --wui-icon-box-bg-blue-base-100: #20303f; + --wui-icon-box-bg-success-base-100: #1f3a28; + --wui-icon-box-bg-inverse-base-100: #243240; + + --wui-all-wallets-bg-100: #222b35; + + --wui-avatar-border-base: #252525; + + --wui-thumbnail-border-base: #252525; + } + `,dark:We` + :root { + --w3m-color-mix: ${Oo((r==null?void 0:r["--w3m-color-mix"])||"#000")}; + --w3m-accent: ${Oo(Tc(r,"light")["--w3m-accent"])}; + --w3m-default: #000; + + --wui-color-modal-bg-base: ${Oo(Tc(r,"light")["--w3m-background"])}; + --wui-color-accent-base-100: var(--w3m-accent); + + --wui-color-blueberry-100: hsla(231, 100%, 70%, 1); + --wui-color-blueberry-090: hsla(231, 97%, 72%, 1); + --wui-color-blueberry-080: hsla(231, 92%, 74%, 1); + + --wui-color-fg-100: #141414; + --wui-color-fg-125: #2d3131; + --wui-color-fg-150: #474d4d; + --wui-color-fg-175: #636d6d; + --wui-color-fg-200: #798686; + --wui-color-fg-225: #828f8f; + --wui-color-fg-250: #8b9797; + --wui-color-fg-275: #95a0a0; + --wui-color-fg-300: #9ea9a9; + + --wui-color-bg-100: #ffffff; + --wui-color-bg-125: #f5fafa; + --wui-color-bg-150: #f3f8f8; + --wui-color-bg-175: #eef4f4; + --wui-color-bg-200: #eaf1f1; + --wui-color-bg-225: #e5eded; + --wui-color-bg-250: #e1e9e9; + --wui-color-bg-275: #dce7e7; + --wui-color-bg-300: #d8e3e3; + + --wui-color-success-base-100: #26b562; + --wui-color-error-base-100: #f05142; + + --wui-color-success-glass-001: rgba(38, 181, 98, 0.01); + --wui-color-success-glass-002: rgba(38, 181, 98, 0.02); + --wui-color-success-glass-005: rgba(38, 181, 98, 0.05); + --wui-color-success-glass-010: rgba(38, 181, 98, 0.1); + --wui-color-success-glass-015: rgba(38, 181, 98, 0.15); + --wui-color-success-glass-020: rgba(38, 181, 98, 0.2); + --wui-color-success-glass-025: rgba(38, 181, 98, 0.25); + --wui-color-success-glass-030: rgba(38, 181, 98, 0.3); + --wui-color-success-glass-060: rgba(38, 181, 98, 0.6); + --wui-color-success-glass-080: rgba(38, 181, 98, 0.8); + + --wui-color-error-glass-001: rgba(240, 81, 66, 0.01); + --wui-color-error-glass-002: rgba(240, 81, 66, 0.02); + --wui-color-error-glass-005: rgba(240, 81, 66, 0.05); + --wui-color-error-glass-010: rgba(240, 81, 66, 0.1); + --wui-color-error-glass-015: rgba(240, 81, 66, 0.15); + --wui-color-error-glass-020: rgba(240, 81, 66, 0.2); + --wui-color-error-glass-025: rgba(240, 81, 66, 0.25); + --wui-color-error-glass-030: rgba(240, 81, 66, 0.3); + --wui-color-error-glass-060: rgba(240, 81, 66, 0.6); + --wui-color-error-glass-080: rgba(240, 81, 66, 0.8); + + --wui-icon-box-bg-error-base-100: #f4dfdd; + --wui-icon-box-bg-blue-base-100: #d9ecfb; + --wui-icon-box-bg-success-base-100: #daf0e4; + --wui-icon-box-bg-inverse-base-100: #dcecfc; + + --wui-all-wallets-bg-100: #e8f1fa; + + --wui-avatar-border-base: #f3f4f4; + + --wui-thumbnail-border-base: #eaefef; + + --wui-color-gray-glass-001: rgba(0, 0, 0, 0.01); + --wui-color-gray-glass-002: rgba(0, 0, 0, 0.02); + --wui-color-gray-glass-005: rgba(0, 0, 0, 0.05); + --wui-color-gray-glass-010: rgba(0, 0, 0, 0.1); + --wui-color-gray-glass-015: rgba(0, 0, 0, 0.15); + --wui-color-gray-glass-020: rgba(0, 0, 0, 0.2); + --wui-color-gray-glass-025: rgba(0, 0, 0, 0.25); + --wui-color-gray-glass-030: rgba(0, 0, 0, 0.3); + --wui-color-gray-glass-060: rgba(0, 0, 0, 0.6); + --wui-color-gray-glass-080: rgba(0, 0, 0, 0.8); + --wui-color-gray-glass-090: rgba(0, 0, 0, 0.9); + } + `}}const et=We` + *, + *::after, + *::before, + :host { + margin: 0; + padding: 0; + box-sizing: border-box; + font-style: normal; + text-rendering: optimizeSpeed; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-tap-highlight-color: transparent; + font-family: var(--wui-font-family); + backface-visibility: hidden; + } +`,Zt=We` + button, + a { + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + position: relative; + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, color; + outline: none; + border: none; + column-gap: var(--wui-spacing-3xs); + background-color: transparent; + text-decoration: none; + } + + button:disabled > wui-wallet-image, + button:disabled > wui-all-wallets-image, + button:disabled > wui-network-image, + button:disabled > wui-image, + button:disabled > wui-icon-box, + button:disabled > wui-transaction-visual, + button:disabled > wui-logo { + filter: grayscale(1); + } + + input { + border: none; + outline: none; + appearance: none; + } +`,yy=We` + .wui-color-inherit { + color: var(--wui-color-inherit); + } + + .wui-color-accent-100 { + color: var(--wui-color-accent-100); + } + + .wui-color-error-100 { + color: var(--wui-color-error-100); + } + + .wui-color-success-100 { + color: var(--wui-color-success-100); + } + + .wui-color-inverse-100 { + color: var(--wui-color-inverse-100); + } + + .wui-color-inverse-000 { + color: var(--wui-color-inverse-000); + } + + .wui-color-fg-100 { + color: var(--wui-color-fg-100); + } + + .wui-color-fg-200 { + color: var(--wui-color-fg-200); + } + + .wui-color-fg-300 { + color: var(--wui-color-fg-300); + } + + .wui-bg-color-inherit { + background-color: var(--wui-color-inherit); + } + + .wui-bg-color-blue-100 { + background-color: var(--wui-color-accent-100); + } + + .wui-bg-color-error-100 { + background-color: var(--wui-color-error-100); + } + + .wui-bg-color-success-100 { + background-color: var(--wui-color-success-100); + } + + .wui-bg-color-inverse-100 { + background-color: var(--wui-color-inverse-100); + } + + .wui-bg-color-inverse-000 { + background-color: var(--wui-color-inverse-000); + } + + .wui-bg-color-fg-100 { + background-color: var(--wui-color-fg-100); + } + + .wui-bg-color-fg-200 { + background-color: var(--wui-color-fg-200); + } + + .wui-bg-color-fg-300 { + background-color: var(--wui-color-fg-300); + } +`;function IK(r,e){const{kind:t,elements:i}=e;return{kind:t,elements:i,finisher(n){customElements.get(r)||customElements.define(r,n)}}}function TK(r,e){return customElements.get(r)||customElements.define(r,e),e}function me(r){return function(t){return typeof t=="function"?TK(r,t):IK(r,t)}}const RK=We` + :host { + display: block; + border-radius: clamp(0px, var(--wui-border-radius-l), 44px); + box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005); + background-color: var(--wui-color-modal-bg); + overflow: hidden; + } +`;var kK=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let L2=class extends qe{render(){return we``}};L2.styles=[et,RK];L2=kK([me("wui-card")],L2);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const OK={attribute:!0,type:String,converter:K1,reflect:!1,hasChanged:wy},PK=(r=OK,e,t)=>{const{kind:i,metadata:n}=t;let o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),o.set(t.name,r),i==="accessor"){const{name:s}=t;return{set(a){const u=e.get.call(this);e.set.call(this,a),this.requestUpdate(s,u,r)},init(a){return a!==void 0&&this.P(s,void 0,r),a}}}if(i==="setter"){const{name:s}=t;return function(a){const u=this[s];e.call(this,a),this.requestUpdate(s,u,r)}}throw Error("Unsupported decorator location: "+i)};function ie(r){return(e,t)=>typeof t=="object"?PK(r,e,t):((i,n,o)=>{const s=n.hasOwnProperty(o);return n.constructor.createProperty(o,s?{...i,wrapped:!0}:i),s?Object.getOwnPropertyDescriptor(n,o):void 0})(r,e,t)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function by(r){return ie({...r,state:!0,attribute:!1})}const DK=We` + :host { + display: flex; + aspect-ratio: 1 / 1; + color: var(--local-color); + width: var(--local-width); + } + + svg { + width: inherit; + height: inherit; + object-fit: contain; + object-position: center; + } +`,NK=De` + `,$K=De` + +`,MK=De` + `,BK=De` + + + + + + + + + +`,UK=De` + + + + + + + + + + + + + +`,LK=De` + +`,jK=De` + +`,FK=De` + +`,zK=De` + +`,WK=De` + `,HK=De` + + +`,qK=De` + `,VK=De` + +`,KK=De` + + +`,GK=De` + +`,ZK=De` + +`,QK=De` + +`,YK=De` + +`,JK=De` + + + + + + + + + + + + + + + + + + + + + +`,XK=De` + +`,eG=De` + +`,tG=De` + +`,rG=De` + +`,iG=De` + `,nG=De` + +`,oG=De` + + + + `,sG=De` + + +`,aG=De` + +`,cG=De` + + + + + + + + + + +`,lG=De` + +`,uG=De` + +`,hG=De` + +`,dG=De` + + + + + + + + + + + + + + + +`,fG=De` + +`,pG=De` + + + + + + + + + + + + + +`,gG=De` + + + + +`,mG=De` + + +`,wG=De` + + +`,vG=De` + +`,yG=De` + + +`,bG=De` + + +`,_G=De` + + +`,xG=De` + +`,AG=De` + +`,EG=De` + + + + + + +`,CG=De` + `,SG=De` + +`,IG=De` + `,TG=De` + +`,RG=De` + +`,kG=De` + + `,OG=De` + +`,PG=De` + +`,DG=De` + + + +`,NG=De` + +`,$G=De` + +`,MG=De` + + + + + + + + + + + `,BG=De` + + + + + + + + + + + + + +`,UG=De` + +`,LG=De` + +`,jG=De` + +`,FG=De` + + + + +`,zG=De` + +`,WG=De` + + +`,HG=De` + + +`,qG=De` + +`,K8=De` + + + + + + + +`;var sm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const VG={add:NK,allWallets:$K,arrowBottomCircle:MK,appStore:BK,apple:UK,arrowBottom:LK,arrowLeft:jK,arrowRight:FK,arrowTop:zK,bank:WK,browser:HK,card:qK,checkmark:KK,checkmarkBold:VK,chevronBottom:GK,chevronLeft:ZK,chevronRight:QK,chevronTop:YK,chromeStore:JK,clock:XK,close:eG,compass:rG,coinPlaceholder:tG,copy:iG,cursor:nG,cursorTransparent:oG,desktop:sG,disconnect:aG,discord:cG,etherscan:lG,extension:uG,externalLink:hG,facebook:dG,filters:fG,github:pG,google:gG,helpCircle:mG,id:qG,infoCircle:wG,mail:vG,mobile:yG,more:bG,networkPlaceholder:_G,nftPlaceholder:xG,off:AG,playStore:EG,plus:CG,qrCode:SG,recycleHorizontal:IG,refresh:TG,search:RG,send:kG,swapHorizontal:OG,swapHorizontalMedium:DG,swapHorizontalBold:PG,swapHorizontalRoundedBold:NG,swapVertical:$G,telegram:MG,twitch:BG,twitter:K8,twitterIcon:UG,verify:LG,verifyFilled:jG,wallet:zG,walletConnect:WG,walletPlaceholder:FG,warningCircle:HG,x:K8};let _h=class extends qe{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300"}render(){return this.style.cssText=` + --local-color: ${`var(--wui-color-${this.color});`} + --local-width: ${`var(--wui-icon-size-${this.size});`} + `,we`${VG[this.name]}`}};_h.styles=[et,yy,DK];sm([ie()],_h.prototype,"size",void 0);sm([ie()],_h.prototype,"name",void 0);sm([ie()],_h.prototype,"color",void 0);_h=sm([me("wui-icon")],_h);const KG=We` + :host { + display: block; + width: var(--local-width); + height: var(--local-height); + } + + img { + display: block; + width: 100%; + height: 100%; + object-fit: cover; + object-position: center center; + border-radius: inherit; + } +`;var am=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let xh=class extends qe{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=` + --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; + --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; + `,we`${this.alt}`}};xh.styles=[et,yy,KG];am([ie()],xh.prototype,"src",void 0);am([ie()],xh.prototype,"alt",void 0);am([ie()],xh.prototype,"size",void 0);xh=am([me("wui-image")],xh);const GG=We` + :host { + display: block; + width: var(--wui-box-size-lg); + height: var(--wui-box-size-lg); + } + + svg { + width: var(--wui-box-size-lg); + height: var(--wui-box-size-lg); + fill: none; + stroke: transparent; + stroke-linecap: round; + } + + use { + stroke: var(--wui-color-accent-100); + stroke-width: 2px; + stroke-dasharray: 54, 118; + stroke-dashoffset: 172; + animation: dash 1s linear infinite; + } + + @keyframes dash { + to { + stroke-dashoffset: 0px; + } + } +`;var ZG=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let j2=class extends qe{render(){return we` + + + + + `}};j2.styles=[et,GG];j2=ZG([me("wui-loading-hexagon")],j2);const QG=We` + :host { + display: flex; + } + + :host([data-size='sm']) > svg { + width: 12px; + height: 12px; + } + + :host([data-size='md']) > svg { + width: 16px; + height: 16px; + } + + :host([data-size='lg']) > svg { + width: 24px; + height: 24px; + } + + :host([data-size='xl']) > svg { + width: 32px; + height: 32px; + } + + svg { + animation: rotate 2s linear infinite; + } + + circle { + fill: none; + stroke: var(--local-color); + stroke-width: 4px; + stroke-dasharray: 1, 124; + stroke-dashoffset: 0; + stroke-linecap: round; + animation: dash 1.5s ease-in-out infinite; + } + + :host([data-size='md']) > svg > circle { + stroke-width: 6px; + } + + :host([data-size='sm']) > svg > circle { + stroke-width: 8px; + } + + @keyframes rotate { + 100% { + transform: rotate(360deg); + } + } + + @keyframes dash { + 0% { + stroke-dasharray: 1, 124; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 90, 124; + stroke-dashoffset: -35; + } + + 100% { + stroke-dashoffset: -125; + } + } +`;var _y=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Af=class extends qe{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: ${this.color==="inherit"?"inherit":`var(--wui-color-${this.color})`}`,this.dataset.size=this.size,we` + + `}};Af.styles=[et,QG];_y([ie()],Af.prototype,"color",void 0);_y([ie()],Af.prototype,"size",void 0);Af=_y([me("wui-loading-spinner")],Af);const YG=We` + :host { + display: block; + width: var(--wui-box-size-md); + height: var(--wui-box-size-md); + } + + svg { + width: var(--wui-box-size-md); + height: var(--wui-box-size-md); + } + + rect { + fill: none; + stroke: var(--wui-color-accent-100); + stroke-width: 4px; + stroke-linecap: round; + animation: dash 1s linear infinite; + } + + @keyframes dash { + to { + stroke-dashoffset: 0px; + } + } +`;var VE=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Z1=class extends qe{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,i=36-e,n=116+i,o=245+i,s=360+i*1.75;return we` + + + + `}};Z1.styles=[et,YG];VE([ie({type:Number})],Z1.prototype,"radius",void 0);Z1=VE([me("wui-loading-thumbnail")],Z1);const JG=We` + :host { + display: block; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + background: linear-gradient( + 120deg, + var(--wui-color-bg-200) 5%, + var(--wui-color-bg-200) 48%, + var(--wui-color-bg-300) 55%, + var(--wui-color-bg-300) 60%, + var(--wui-color-bg-300) calc(60% + 10px), + var(--wui-color-bg-200) calc(60% + 12px), + var(--wui-color-bg-200) 100% + ); + background-size: 250%; + animation: shimmer 3s linear infinite reverse; + } + + :host([variant='light']) { + background: linear-gradient( + 120deg, + var(--wui-color-bg-150) 5%, + var(--wui-color-bg-150) 48%, + var(--wui-color-bg-200) 55%, + var(--wui-color-bg-200) 60%, + var(--wui-color-bg-200) calc(60% + 10px), + var(--wui-color-bg-150) calc(60% + 12px), + var(--wui-color-bg-150) 100% + ); + background-size: 250%; + } + + @keyframes shimmer { + from { + background-position: -250% 0; + } + to { + background-position: 250% 0; + } + } +`;var A0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Kl=class extends qe{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=` + width: ${this.width}; + height: ${this.height}; + border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`}; + `,we``}};Kl.styles=[JG];A0([ie()],Kl.prototype,"width",void 0);A0([ie()],Kl.prototype,"height",void 0);A0([ie()],Kl.prototype,"borderRadius",void 0);A0([ie()],Kl.prototype,"variant",void 0);Kl=A0([me("wui-shimmer")],Kl);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const KE={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},GE=r=>(...e)=>({_$litDirective$:r,values:e});let ZE=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const QE=GE(class extends ZE{constructor(r){var e;if(super(r),r.type!==KE.ATTRIBUTE||r.name!=="class"||((e=r.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){var i,n;if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!((i=this.nt)!=null&&i.has(o))&&this.st.add(o);return this.render(e)}const t=r.element.classList;for(const o of this.st)o in e||(t.remove(o),this.st.delete(o));for(const o in e){const s=!!e[o];s===this.st.has(o)||(n=this.nt)!=null&&n.has(o)||(s?(t.add(o),this.st.add(o)):(t.remove(o),this.st.delete(o)))}return Vl}}),XG=We` + :host { + display: inline-flex !important; + } + + slot { + width: 100%; + display: inline-block; + font-style: normal; + font-family: var(--wui-font-family); + font-feature-settings: + 'tnum' on, + 'lnum' on, + 'case' on; + line-height: 130%; + font-weight: var(--wui-font-weight-regular); + overflow: inherit; + text-overflow: inherit; + text-align: var(--local-align); + color: var(--local-color); + } + + .wui-font-medium-400 { + font-size: var(--wui-font-size-medium); + font-weight: var(--wui-font-weight-light); + letter-spacing: var(--wui-letter-spacing-medium); + } + + .wui-font-medium-600 { + font-size: var(--wui-font-size-medium); + letter-spacing: var(--wui-letter-spacing-medium); + } + + .wui-font-medium-title-600 { + font-size: var(--wui-font-size-medium-title); + letter-spacing: var(--wui-letter-spacing-medium-title); + } + + .wui-font-mini-700 { + font-size: var(--wui-font-size-mini); + letter-spacing: var(--wui-letter-spacing-mini); + text-transform: uppercase; + } + + .wui-font-large-500, + .wui-font-large-600, + .wui-font-large-700 { + font-size: var(--wui-font-size-large); + letter-spacing: var(--wui-letter-spacing-large); + } + + .wui-font-2xl-500, + .wui-font-2xl-600, + .wui-font-2xl-700 { + font-size: var(--wui-font-size-2xl); + letter-spacing: var(--wui-letter-spacing-2xl); + } + + .wui-font-paragraph-400, + .wui-font-paragraph-500, + .wui-font-paragraph-600, + .wui-font-paragraph-700 { + font-size: var(--wui-font-size-paragraph); + letter-spacing: var(--wui-letter-spacing-paragraph); + } + + .wui-font-small-400, + .wui-font-small-500, + .wui-font-small-600 { + font-size: var(--wui-font-size-small); + letter-spacing: var(--wui-letter-spacing-small); + } + + .wui-font-tiny-400, + .wui-font-tiny-500, + .wui-font-tiny-600 { + font-size: var(--wui-font-size-tiny); + letter-spacing: var(--wui-letter-spacing-tiny); + } + + .wui-font-micro-700, + .wui-font-micro-600 { + font-size: var(--wui-font-size-micro); + letter-spacing: var(--wui-letter-spacing-micro); + text-transform: uppercase; + } + + .wui-font-tiny-400, + .wui-font-small-400, + .wui-font-paragraph-400 { + font-weight: var(--wui-font-weight-light); + } + + .wui-font-large-700, + .wui-font-paragraph-700, + .wui-font-micro-700, + .wui-font-mini-700 { + font-weight: var(--wui-font-weight-bold); + } + + .wui-font-medium-600, + .wui-font-medium-title-600, + .wui-font-large-600, + .wui-font-paragraph-600, + .wui-font-small-600, + .wui-font-tiny-600, + .wui-font-micro-600 { + font-weight: var(--wui-font-weight-medium); + } +`;var cm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ah=class extends qe{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left"}render(){const e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0};return this.style.cssText=` + --local-align: ${this.align}; + --local-color: var(--wui-color-${this.color}); + `,we``}};Ah.styles=[et,XG];cm([ie()],Ah.prototype,"variant",void 0);cm([ie()],Ah.prototype,"color",void 0);cm([ie()],Ah.prototype,"align",void 0);Ah=cm([me("wui-text")],Ah);const eZ=De` + + + + + + + + `,tZ=De` + + + + + + + + + + + + + + + + `,rZ=De` + + + + + + + + + + + + +`,iZ=De` + + + + + + + + + + + + + `,nZ=De` + + + + + + + + + + + + + + + `,oZ=De` + + + + + +`,sZ=De` + + + + + +`,aZ=De` + + + + + + + + + + `,cZ=De` + + + + + + + + + + + + + + + +`,lZ=De` + + + + + + + + + + `,uZ=De` + + + + + + + + +`,hZ=De` + + + + + + + + + + + + + + + `,dZ=De` + + + + + + + + + + + + + + `,fZ=De` + + + + + + + + + +`,pZ=De` + + + + + + + + + + +`,gZ=De` + + + + + + + + + + +`,mZ=De` + + + + + + + + + + + + +`,wZ=De` + + + + + + + + + + + + +`,vZ=De` + + + + + + + + + +`,yZ=De` + + + + + + + + + + + + + + + + + + +`,bZ=De` + + + + + + + + + + + + + + + + +`,_Z=We` + :host { + display: block; + width: var(--local-size); + height: var(--local-size); + } + + :host svg { + width: 100%; + height: 100%; + } +`;var xy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const xZ={browser:eZ,dao:tZ,defi:rZ,defiAlt:iZ,eth:nZ,layers:oZ,lock:sZ,login:aZ,network:cZ,nft:lZ,noun:uZ,profile:hZ,system:dZ,coinbase:fZ,onrampCard:wZ,moonpay:pZ,stripe:gZ,paypal:mZ,google:vZ,pencil:yZ,lightbulb:bZ};let Ef=class extends qe{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=` + --local-size: var(--wui-visual-size-${this.size}); + `,we`${xZ[this.name]}`}};Ef.styles=[et,_Z];xy([ie()],Ef.prototype,"name",void 0);xy([ie()],Ef.prototype,"size",void 0);Ef=xy([me("wui-visual")],Ef);/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Lo=r=>r??ai,gt={getSpacingStyles(r,e){if(Array.isArray(r))return r[e]?`var(--wui-spacing-${r[e]})`:void 0;if(typeof r=="string")return`var(--wui-spacing-${r})`},getFormattedDate(r){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(r)},getHostName(r){try{return new URL(r).hostname}catch{return""}},getTruncateString({string:r,charsStart:e,charsEnd:t,truncate:i}){return r.length<=e+t?r:i==="end"?`${r.substring(0,e)}...`:i==="start"?`...${r.substring(r.length-t)}`:`${r.substring(0,Math.floor(e))}...${r.substring(r.length-Math.floor(t))}`},generateAvatarColors(r){const t=r.toLowerCase().replace(/^0x/iu,"").substring(0,6),i=this.hexToRgb(t),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),s=100-3*Number(n==null?void 0:n.replace("px","")),a=`${s}% ${s}% at 65% 40%`,u=[];for(let h=0;h<5;h+=1){const d=this.tintColor(i,.15*h);u.push(`rgb(${d[0]}, ${d[1]}, ${d[2]})`)}return` + --local-color-1: ${u[0]}; + --local-color-2: ${u[1]}; + --local-color-3: ${u[2]}; + --local-color-4: ${u[3]}; + --local-color-5: ${u[4]}; + --local-radial-circle: ${a} + `},hexToRgb(r){const e=parseInt(r,16),t=e>>16&255,i=e>>8&255,n=e&255;return[t,i,n]},tintColor(r,e){const[t,i,n]=r,o=Math.round(t+(255-t)*e),s=Math.round(i+(255-i)*e),a=Math.round(n+(255-n)*e);return[o,s,a]},isNumber(r){return{number:/^[0-9]+$/u}.number.test(r)},getColorTheme(r){return r||(typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark")},splitBalance(r){const e=r.split(".");return e.length===2?[e[0],e[1]]:["0","00"]},roundNumber(r,e,t){return r.toString().length>=e?Number(r).toFixed(t):r},formatNumberToLocalString(r,e=2){return r===void 0?"0.00":typeof r=="number"?r.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(r).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})}},AZ=We` + :host { + display: flex; + width: inherit; + height: inherit; + } +`;var so=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let gn=class extends qe{render(){return this.style.cssText=` + flex-direction: ${this.flexDirection}; + flex-wrap: ${this.flexWrap}; + flex-basis: ${this.flexBasis}; + flex-grow: ${this.flexGrow}; + flex-shrink: ${this.flexShrink}; + align-items: ${this.alignItems}; + justify-content: ${this.justifyContent}; + column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; + row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; + gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; + padding-top: ${this.padding&>.getSpacingStyles(this.padding,0)}; + padding-right: ${this.padding&>.getSpacingStyles(this.padding,1)}; + padding-bottom: ${this.padding&>.getSpacingStyles(this.padding,2)}; + padding-left: ${this.padding&>.getSpacingStyles(this.padding,3)}; + margin-top: ${this.margin&>.getSpacingStyles(this.margin,0)}; + margin-right: ${this.margin&>.getSpacingStyles(this.margin,1)}; + margin-bottom: ${this.margin&>.getSpacingStyles(this.margin,2)}; + margin-left: ${this.margin&>.getSpacingStyles(this.margin,3)}; + `,we``}};gn.styles=[et,AZ];so([ie()],gn.prototype,"flexDirection",void 0);so([ie()],gn.prototype,"flexWrap",void 0);so([ie()],gn.prototype,"flexBasis",void 0);so([ie()],gn.prototype,"flexGrow",void 0);so([ie()],gn.prototype,"flexShrink",void 0);so([ie()],gn.prototype,"alignItems",void 0);so([ie()],gn.prototype,"justifyContent",void 0);so([ie()],gn.prototype,"columnGap",void 0);so([ie()],gn.prototype,"rowGap",void 0);so([ie()],gn.prototype,"gap",void 0);so([ie()],gn.prototype,"padding",void 0);so([ie()],gn.prototype,"margin",void 0);gn=so([me("wui-flex")],gn);const EZ=We` + :host { + display: block; + width: var(--wui-icon-box-size-xl); + height: var(--wui-icon-box-size-xl); + border-radius: var(--wui-border-radius-3xl); + box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); + overflow: hidden; + position: relative; + } + + :host([data-variant='generated']) { + --mixed-local-color-1: var(--local-color-1); + --mixed-local-color-2: var(--local-color-2); + --mixed-local-color-3: var(--local-color-3); + --mixed-local-color-4: var(--local-color-4); + --mixed-local-color-5: var(--local-color-5); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :host([data-variant='generated']) { + --mixed-local-color-1: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-1) + ); + --mixed-local-color-2: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-2) + ); + --mixed-local-color-3: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-3) + ); + --mixed-local-color-4: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-4) + ); + --mixed-local-color-5: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-5) + ); + } + } + + :host([data-variant='generated']) { + box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); + background: radial-gradient( + var(--local-radial-circle), + #fff 0.52%, + var(--mixed-local-color-5) 31.25%, + var(--mixed-local-color-3) 51.56%, + var(--mixed-local-color-2) 65.63%, + var(--mixed-local-color-1) 82.29%, + var(--mixed-local-color-4) 100% + ); + } + + :host([data-variant='default']) { + box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); + background: radial-gradient( + 75.29% 75.29% at 64.96% 24.36%, + #fff 0.52%, + #f5ccfc 31.25%, + #dba4f5 51.56%, + #9a8ee8 65.63%, + #6493da 82.29%, + #6ebdea 100% + ); + } +`;var lm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Eh=class extends qe{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0}render(){return we`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",we``;if(this.address){this.dataset.variant="generated";const e=gt.generateAvatarColors(this.address);return this.style.cssText=e,null}return this.dataset.variant="default",null}};Eh.styles=[et,EZ];lm([ie()],Eh.prototype,"imageSrc",void 0);lm([ie()],Eh.prototype,"alt",void 0);lm([ie()],Eh.prototype,"address",void 0);Eh=lm([me("wui-avatar")],Eh);const CZ=We` + :host { + display: inline-flex; + justify-content: center; + align-items: center; + position: relative; + overflow: hidden; + background-color: var(--wui-color-gray-glass-020); + border-radius: var(--local-border-radius); + border: var(--local-border); + box-sizing: content-box; + width: var(--local-size); + height: var(--local-size); + min-height: var(--local-size); + min-width: var(--local-size); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :host { + background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent); + } + } +`;var Xa=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ps=class extends qe{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const e=this.iconSize||this.size,t=this.size==="lg",i=this.size==="xl",n=t?"12%":"16%",o=t?"xxs":i?"s":"3xl",s=this.background==="gray",a=this.background==="opaque",u=this.backgroundColor==="accent-100"&&a||this.backgroundColor==="success-100"&&a||this.backgroundColor==="error-100"&&a||this.backgroundColor==="inverse-100"&&a;let h=`var(--wui-color-${this.backgroundColor})`;return u?h=`var(--wui-icon-box-bg-${this.backgroundColor})`:s&&(h=`var(--wui-gray-${this.backgroundColor})`),this.style.cssText=` + --local-bg-value: ${h}; + --local-bg-mix: ${u||s?"100%":n}; + --local-border-radius: var(--wui-border-radius-${o}); + --local-size: var(--wui-icon-box-size-${this.size}); + --local-border: ${this.borderColor==="wui-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"} + `,we` `}};ps.styles=[et,Zt,CZ];Xa([ie()],ps.prototype,"size",void 0);Xa([ie()],ps.prototype,"backgroundColor",void 0);Xa([ie()],ps.prototype,"iconColor",void 0);Xa([ie()],ps.prototype,"iconSize",void 0);Xa([ie()],ps.prototype,"background",void 0);Xa([ie({type:Boolean})],ps.prototype,"border",void 0);Xa([ie()],ps.prototype,"borderColor",void 0);Xa([ie()],ps.prototype,"icon",void 0);ps=Xa([me("wui-icon-box")],ps);const SZ=We` + :host { + display: block; + } + + button { + border-radius: var(--wui-border-radius-3xl); + background: var(--wui-color-gray-glass-002); + display: flex; + gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs) + var(--wui-spacing-xs); + border: 1px solid var(--wui-color-gray-glass-005); + } + + button:disabled { + background: var(--wui-color-gray-glass-015); + } + + button:disabled > wui-text { + color: var(--wui-color-gray-glass-015); + } + + button:disabled > wui-flex > wui-text { + color: var(--wui-color-gray-glass-015); + } + + button:disabled > wui-image, + button:disabled > wui-icon-box, + button:disabled > wui-flex > wui-avatar { + filter: grayscale(1); + } + + button:has(wui-image) { + padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs) + var(--wui-spacing-xs); + } + + wui-text { + color: var(--wui-color-fg-100); + } + + wui-flex > wui-text { + color: var(--wui-color-fg-200); + } + + wui-image, + wui-icon-box { + border-radius: var(--wui-border-radius-3xl); + width: 24px; + height: 24px; + box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); + } + + wui-flex { + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-color-gray-glass-005); + background: var(--wui-color-gray-glass-005); + padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs); + } + + button.local-no-balance { + border-radius: 0px; + border: none; + background: transparent; + } + + wui-avatar { + width: 20px; + height: 20px; + box-shadow: 0 0 0 2px var(--wui-color-accent-glass-010); + } + + @media (max-width: 500px) { + button { + gap: 0px; + padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important; + height: 32px; + } + wui-image, + wui-icon-box, + button > wui-text { + visibility: hidden; + width: 0px; + height: 0px; + } + button { + border-radius: 0px; + border: none; + background: transparent; + padding: 0px; + } + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled > wui-flex > wui-text { + color: var(--wui-color-fg-175); + } + + button:active:enabled > wui-flex > wui-text { + color: var(--wui-color-fg-175); + } + } +`;var ra=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let jo=class extends qe{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return we` + + `}balanceTemplate(){if(this.isUnsupportedChain)return we` + Switch Network`;if(this.balance){const e=this.networkSrc?we``:we` + + `;return we` + ${e} + ${this.balance} + `}return null}};jo.styles=[et,Zt,SZ];ra([ie()],jo.prototype,"networkSrc",void 0);ra([ie()],jo.prototype,"avatarSrc",void 0);ra([ie()],jo.prototype,"balance",void 0);ra([ie({type:Boolean})],jo.prototype,"isUnsupportedChain",void 0);ra([ie({type:Boolean})],jo.prototype,"disabled",void 0);ra([ie()],jo.prototype,"address",void 0);ra([ie()],jo.prototype,"profileName",void 0);ra([ie()],jo.prototype,"charsStart",void 0);ra([ie()],jo.prototype,"charsEnd",void 0);jo=ra([me("wui-account-button")],jo);const IZ=We` + :host { + position: relative; + background-color: var(--wui-color-gray-glass-002); + display: flex; + justify-content: center; + align-items: center; + width: var(--local-size); + height: var(--local-size); + border-radius: inherit; + border-radius: var(--local-border-radius); + } + + :host > wui-flex { + overflow: hidden; + border-radius: inherit; + border-radius: var(--local-border-radius); + } + + :host::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-color-gray-glass-010); + pointer-events: none; + } + + :host([name='Extension'])::after { + border: 1px solid var(--wui-color-accent-glass-010); + } + + :host([data-wallet-icon='allWallets']) { + background-color: var(--wui-all-wallets-bg-100); + } + + :host([data-wallet-icon='allWallets'])::after { + border: 1px solid var(--wui-color-accent-glass-010); + } + + wui-icon[data-parent-size='inherit'] { + width: 75%; + height: 75%; + align-items: center; + } + + wui-icon[data-parent-size='sm'] { + width: 18px; + height: 18px; + } + + wui-icon[data-parent-size='md'] { + width: 24px; + height: 24px; + } + + wui-icon[data-parent-size='lg'] { + width: 42px; + height: 42px; + } + + wui-icon[data-parent-size='full'] { + width: 100%; + height: 100%; + } + + :host > wui-icon-box { + position: absolute; + overflow: hidden; + right: -1px; + bottom: -2px; + z-index: 1; + border: 2px solid var(--wui-color-bg-150, #1e1f1f); + padding: 1px; + } +`;var vu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ua=class extends qe{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=` + --local-border-radius: var(--wui-border-radius-${e}); + --local-size: var(--wui-wallet-image-size-${this.size}); + `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),we` + ${this.templateVisual()} + `}templateVisual(){return this.imageSrc?we``:this.walletIcon?we``:we``}};Ua.styles=[et,IZ];vu([ie()],Ua.prototype,"size",void 0);vu([ie()],Ua.prototype,"name",void 0);vu([ie()],Ua.prototype,"imageSrc",void 0);vu([ie()],Ua.prototype,"walletIcon",void 0);vu([ie({type:Boolean})],Ua.prototype,"installed",void 0);vu([ie()],Ua.prototype,"badgeSize",void 0);Ua=vu([me("wui-wallet-image")],Ua);const TZ=We` + :host { + position: relative; + border-radius: var(--wui-border-radius-xxs); + width: 40px; + height: 40px; + overflow: hidden; + background: var(--wui-color-gray-glass-002); + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; + gap: var(--wui-spacing-4xs); + padding: 3.75px !important; + } + + :host::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-color-gray-glass-010); + pointer-events: none; + } + + :host > wui-wallet-image { + width: 14px; + height: 14px; + border-radius: var(--wui-border-radius-5xs); + } + + :host > wui-flex { + padding: 2px; + position: fixed; + overflow: hidden; + left: 34px; + bottom: 8px; + background: var(--dark-background-150, #1e1f1f); + border-radius: 50%; + z-index: 2; + display: flex; + } +`;var YE=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const jv=4;let Q1=class extends qe{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.lengthwe` + + `)} + ${e?[...Array(jv-this.walletImages.length)].map(()=>we` `):null} + + + `}};Q1.styles=[et,TZ];YE([ie({type:Array})],Q1.prototype,"walletImages",void 0);Q1=YE([me("wui-all-wallets-image")],Q1);const RZ=We` + :host { + width: var(--local-width); + position: relative; + } + + button { + border: none; + border-radius: var(--local-border-radius); + width: var(--local-width); + white-space: nowrap; + } + + /* -- Sizes --------------------------------------------------- */ + button[data-size='md'] { + padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l); + height: 36px; + } + + button[data-size='md'][data-icon-left='true'][data-icon-right='false'] { + padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s); + } + + button[data-size='md'][data-icon-right='true'][data-icon-left='false'] { + padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l); + } + + button[data-size='lg'] { + padding: var(--wui-spacing-m) var(--wui-spacing-2l); + height: 48px; + } + + /* -- Variants --------------------------------------------------------- */ + button[data-variant='main'] { + background-color: var(--wui-color-accent-100); + color: var(--wui-color-inverse-100); + border: none; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } + + button[data-variant='inverse'] { + background-color: var(--wui-color-inverse-100); + color: var(--wui-color-inverse-000); + border: none; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } + + button[data-variant='accent'] { + background-color: var(--wui-color-accent-glass-010); + color: var(--wui-color-accent-100); + border: none; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + } + + button[data-variant='accent-error'] { + background: var(--wui-color-error-glass-015); + color: var(--wui-color-error-100); + border: none; + box-shadow: inset 0 0 0 1px var(--wui-color-error-glass-010); + } + + button[data-variant='accent-success'] { + background: var(--wui-color-success-glass-015); + color: var(--wui-color-success-100); + border: none; + box-shadow: inset 0 0 0 1px var(--wui-color-success-glass-010); + } + + button[data-variant='neutral'] { + background: transparent; + color: var(--wui-color-fg-100); + border: none; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + } + + /* -- Focus states --------------------------------------------------- */ + button[data-variant='main']:focus-visible:enabled { + background-color: var(--wui-color-accent-090); + box-shadow: + inset 0 0 0 1px var(--wui-color-accent-100), + 0 0 0 4px var(--wui-color-accent-glass-020); + } + button[data-variant='inverse']:focus-visible:enabled { + background-color: var(--wui-color-inverse-100); + box-shadow: + inset 0 0 0 1px var(--wui-color-gray-glass-010), + 0 0 0 4px var(--wui-color-accent-glass-020); + } + button[data-variant='accent']:focus-visible:enabled { + background-color: var(--wui-color-accent-glass-010); + box-shadow: + inset 0 0 0 1px var(--wui-color-accent-100), + 0 0 0 4px var(--wui-color-accent-glass-020); + } + button[data-variant='accent-error']:focus-visible:enabled { + background: var(--wui-color-error-glass-015); + box-shadow: + inset 0 0 0 1px var(--wui-color-error-100), + 0 0 0 4px var(--wui-color-error-glass-020); + } + button[data-variant='accent-success']:focus-visible:enabled { + background: var(--wui-color-success-glass-015); + box-shadow: + inset 0 0 0 1px var(--wui-color-success-100), + 0 0 0 4px var(--wui-color-success-glass-020); + } + button[data-variant='neutral']:focus-visible:enabled { + background: var(--wui-color-gray-glass-005); + box-shadow: + inset 0 0 0 1px var(--wui-color-gray-glass-010), + 0 0 0 4px var(--wui-color-gray-glass-002); + } + + /* -- Hover & Active states ----------------------------------------------------------- */ + button[data-variant='main']:hover:enabled { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='main']:active:enabled { + background-color: var(--wui-color-accent-080); + } + + button[data-variant='inverse']:hover:enabled { + background-color: var(--wui-color-inverse-100); + } + + button[data-variant='accent']:hover:enabled { + background-color: var(--wui-color-accent-glass-010); + } + + button[data-variant='accent-error']:hover:enabled { + background: var(--wui-color-error-glass-015); + color: var(--wui-color-error-100); + } + + button[data-variant='accent-success']:hover:enabled { + background: var(--wui-color-success-glass-015); + color: var(--wui-color-success-100); + } + + button[data-variant='neutral']:hover:enabled { + background: var(--wui-color-gray-glass-005); + } + + button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] { + padding-left: var(--wui-spacing-m); + } + + button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] { + padding-right: var(--wui-spacing-m); + } + + /* -- Disabled state --------------------------------------------------- */ + button:disabled { + background-color: var(--wui-color-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); + color: var(--wui-color-gray-glass-020); + cursor: not-allowed; + } + + button > wui-text { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + ::slotted(*) { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + wui-loading-spinner { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + opacity: var(--local-opacity-000); + } +`;var ia=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const G8={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},kZ={lg:"paragraph-600",md:"small-600"},OZ={lg:"md",md:"md"};let Fo=class extends qe{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=` + --local-width: ${this.fullWidth?"100%":"auto"}; + --local-opacity-100: ${this.loading?0:1}; + --local-opacity-000: ${this.loading?1:0}; + --local-border-radius: var(--wui-border-radius-${this.borderRadius}); + `;const e=this.textVariant??kZ[this.size];return we` + + `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){const e=OZ[this.size],t=this.disabled?G8.disabled:G8[this.variant];return we``}return we``}};Fo.styles=[et,Zt,RZ];ia([ie()],Fo.prototype,"size",void 0);ia([ie({type:Boolean})],Fo.prototype,"disabled",void 0);ia([ie({type:Boolean})],Fo.prototype,"fullWidth",void 0);ia([ie({type:Boolean})],Fo.prototype,"loading",void 0);ia([ie()],Fo.prototype,"variant",void 0);ia([ie({type:Boolean})],Fo.prototype,"hasIconLeft",void 0);ia([ie({type:Boolean})],Fo.prototype,"hasIconRight",void 0);ia([ie()],Fo.prototype,"borderRadius",void 0);ia([ie()],Fo.prototype,"textVariant",void 0);Fo=ia([me("wui-button")],Fo);const JE=De` + +`,PZ=We` + :host { + display: flex; + flex-direction: column; + align-items: center; + width: 76px; + row-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xs) 10px; + background-color: var(--wui-color-gray-glass-002); + border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); + position: relative; + } + + wui-shimmer[data-type='network'] { + border: none; + -webkit-clip-path: var(--wui-path-network); + clip-path: var(--wui-path-network); + } + + svg { + position: absolute; + width: 48px; + height: 54px; + z-index: 1; + } + + svg > path { + stroke: var(--wui-color-gray-glass-010); + stroke-width: 1px; + } +`;var XE=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Y1=class extends qe{constructor(){super(...arguments),this.type="wallet"}render(){return we` + ${this.shimmerTemplate()} + + `}shimmerTemplate(){return this.type==="network"?we` + ${JE}`:we``}};Y1.styles=[et,Zt,PZ];XE([ie()],Y1.prototype,"type",void 0);Y1=XE([me("wui-card-select-loader")],Y1);const DZ=De` + + + +`,NZ=De` + +`,$Z=We` + :host { + position: relative; + border-radius: inherit; + display: flex; + justify-content: center; + align-items: center; + width: var(--local-width); + height: var(--local-height); + } + + svg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; + fill: var(--wui-color-gray-glass-002); + } + + svg > path { + stroke: var(--local-stroke); + } + + wui-image { + width: 100%; + height: 100%; + -webkit-clip-path: var(--local-path); + clip-path: var(--local-path); + background: var(--wui-color-gray-glass-002); + } + + wui-icon { + transform: translateY(-5%); + width: var(--local-icon-size); + height: var(--local-icon-size); + } +`;var E0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Gl=class extends qe{constructor(){super(...arguments),this.size="md",this.name="uknown",this.selected=!1}render(){const e={sm:DZ,md:JE,lg:NZ};return this.style.cssText=` + --local-stroke: ${this.selected?"var(--wui-color-accent-100)":"var(--wui-color-gray-glass-010)"}; + --local-path: var(--wui-path-network-${this.size}); + --local-width: var(--wui-width-network-${this.size}); + --local-height: var(--wui-height-network-${this.size}); + --local-icon-size: var(--wui-icon-size-network-${this.size}); + `,we`${this.templateVisual()} ${e[this.size]}`}templateVisual(){return this.imageSrc?we``:we``}};Gl.styles=[et,$Z];E0([ie()],Gl.prototype,"size",void 0);E0([ie()],Gl.prototype,"name",void 0);E0([ie()],Gl.prototype,"imageSrc",void 0);E0([ie({type:Boolean})],Gl.prototype,"selected",void 0);Gl=E0([me("wui-network-image")],Gl);const MZ=We` + button { + flex-direction: column; + width: 76px; + row-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xs) var(--wui-spacing-0); + background-color: var(--wui-color-gray-glass-002); + border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); + } + + button > wui-text { + color: var(--wui-color-fg-100); + max-width: var(--wui-icon-box-size-xl); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + justify-content: center; + } + + button:hover:enabled { + background-color: var(--wui-color-gray-glass-005); + } + + button:disabled > wui-text { + color: var(--wui-color-gray-glass-015); + } + + [data-selected='true'] { + background-color: var(--wui-color-accent-glass-020); + } + + @media (hover: hover) and (pointer: fine) { + [data-selected='true']:hover:enabled { + background-color: var(--wui-color-accent-glass-015); + } + } + + [data-selected='true']:active:enabled { + background-color: var(--wui-color-accent-glass-010); + } +`;var yu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let La=class extends qe{constructor(){super(...arguments),this.name="Unknown",this.type="wallet",this.imageSrc=void 0,this.disabled=!1,this.selected=!1,this.installed=!1}render(){return we` + + `}imageTemplate(){return this.type==="network"?we` + + + `:we` + + + `}};La.styles=[et,Zt,MZ];yu([ie()],La.prototype,"name",void 0);yu([ie()],La.prototype,"type",void 0);yu([ie()],La.prototype,"imageSrc",void 0);yu([ie({type:Boolean})],La.prototype,"disabled",void 0);yu([ie({type:Boolean})],La.prototype,"selected",void 0);yu([ie({type:Boolean})],La.prototype,"installed",void 0);La=yu([me("wui-card-select")],La);const BZ=We` + a { + border: 1px solid var(--wui-color-gray-glass-010); + border-radius: var(--wui-border-radius-3xl); + } + + wui-image { + border-radius: var(--wui-border-radius-3xl); + overflow: hidden; + } + + a.disabled > wui-icon, + a.disabled > wui-image { + filter: grayscale(1); + } + + a[data-variant='fill'] { + color: var(--wui-color-inverse-100); + background-color: var(--wui-color-accent-100); + } + + a[data-variant='shade'], + a[data-variant='shadeSmall'] { + background-color: transparent; + background-color: var(--wui-color-gray-glass-010); + color: var(--wui-color-fg-200); + } + + a[data-variant='success'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-color-success-glass-010); + background-color: var(--wui-color-success-glass-010); + color: var(--wui-color-success-100); + } + + a[data-variant='error'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-color-error-glass-010); + background-color: var(--wui-color-error-glass-010); + color: var(--wui-color-error-100); + } + + a[data-variant='transparent'] { + column-gap: var(--wui-spacing-xxs); + background-color: transparent; + color: var(--wui-color-fg-150); + } + + a[data-variant='transparent'], + a[data-variant='success'], + a[data-variant='shadeSmall'], + a[data-variant='error'] { + padding: 7px var(--wui-spacing-s) 7px 10px; + } + + a[data-variant='transparent']:has(wui-text:first-child), + a[data-variant='success']:has(wui-text:first-child), + a[data-variant='shadeSmall']:has(wui-text:first-child), + a[data-variant='error']:has(wui-text:first-child) { + padding: 7px var(--wui-spacing-s); + } + + a[data-variant='fill'], + a[data-variant='shade'] { + column-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) + var(--wui-spacing-xs); + } + + a[data-variant='fill']:has(wui-text:first-child), + a[data-variant='shade']:has(wui-text:first-child) { + padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); + } + + a[data-variant='fill'] > wui-image, + a[data-variant='shade'] > wui-image { + width: 24px; + height: 24px; + } + + a[data-variant='fill'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); + } + + a[data-variant='shade'] > wui-image, + a[data-variant='shadeSmall'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } + + a[data-variant='fill'] > wui-icon, + a[data-variant='shade'] > wui-icon { + width: 14px; + height: 14px; + } + + a[data-variant='transparent'] > wui-image, + a[data-variant='success'] > wui-image, + a[data-variant='shadeSmall'] > wui-image, + a[data-variant='error'] > wui-image { + width: 14px; + height: 14px; + } + + a[data-variant='transparent'] > wui-icon, + a[data-variant='success'] > wui-icon, + a[data-variant='shadeSmall'] > wui-icon, + a[data-variant='error'] > wui-icon { + width: 12px; + height: 12px; + } + + a[data-variant='fill']:focus-visible { + background-color: var(--wui-color-accent-090); + } + + a[data-variant='shade']:focus-visible, + a[data-variant='shadeSmall']:focus-visible { + background-color: var(--wui-color-gray-glass-015); + } + + a[data-variant='transparent']:focus-visible { + background-color: var(--wui-color-gray-glass-005); + } + + a[data-variant='success']:focus-visible { + background-color: var(--wui-color-success-glass-015); + } + + a[data-variant='error']:focus-visible { + background-color: var(--wui-color-error-glass-015); + } + + a.disabled { + color: var(--wui-color-gray-glass-015); + background-color: var(--wui-color-gray-glass-015); + pointer-events: none; + } + + @media (hover: hover) and (pointer: fine) { + a[data-variant='fill']:hover { + background-color: var(--wui-color-accent-090); + } + + a[data-variant='shade']:hover, + a[data-variant='shadeSmall']:hover { + background-color: var(--wui-color-gray-glass-015); + } + + a[data-variant='transparent']:hover { + background-color: var(--wui-color-gray-glass-005); + } + + a[data-variant='success']:hover { + background-color: var(--wui-color-success-glass-015); + } + + a[data-variant='error']:hover { + background-color: var(--wui-color-error-glass-015); + } + } + + a[data-variant='fill']:active { + background-color: var(--wui-color-accent-080); + } + + a[data-variant='shade']:active, + a[data-variant='shadeSmall']:active { + background-color: var(--wui-color-gray-glass-020); + } + + a[data-variant='transparent']:active { + background-color: var(--wui-color-gray-glass-010); + } + + a[data-variant='success']:active { + background-color: var(--wui-color-success-glass-020); + } + + a[data-variant='error']:active { + background-color: var(--wui-color-error-glass-020); + } +`;var bu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ja=class extends qe{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){const t=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return we` + + ${this.imageTemplate()} + + ${this.title?this.title:gt.getHostName(this.href)} + + + + `}imageTemplate(){return this.imageSrc?we``:null}};ja.styles=[et,Zt,BZ];bu([ie()],ja.prototype,"variant",void 0);bu([ie()],ja.prototype,"imageSrc",void 0);bu([ie({type:Boolean})],ja.prototype,"disabled",void 0);bu([ie()],ja.prototype,"icon",void 0);bu([ie()],ja.prototype,"href",void 0);bu([ie()],ja.prototype,"text",void 0);ja=bu([me("wui-chip")],ja);const UZ=We` + :host { + position: relative; + display: block; + } + + button { + background: var(--wui-color-accent-100); + border: 1px solid var(--wui-color-gray-glass-010); + border-radius: var(--wui-border-radius-m); + gap: var(--wui-spacing-xs); + } + + button.loading { + background: var(--wui-color-gray-glass-010); + border: 1px solid var(--wui-color-gray-glass-010); + pointer-events: none; + } + + button:disabled { + background-color: var(--wui-color-gray-glass-015); + border: 1px solid var(--wui-color-gray-glass-010); + } + + button:disabled > wui-text { + color: var(--wui-color-gray-glass-015); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-accent-090); + } + + button:active:enabled { + background-color: var(--wui-color-accent-080); + } + } + + button:focus-visible { + border: 1px solid var(--wui-color-gray-glass-010); + background-color: var(--wui-color-accent-090); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + button[data-size='sm'] { + padding: 6.75px 10px 7.25px; + } + + ::slotted(*) { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + button > wui-text { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + color: var(--wui-color-inverse-100); + } + + button[data-size='md'] { + padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l); + } + + button[data-size='md'] + wui-text { + padding-left: var(--wui-spacing-3xs); + } + + @media (max-width: 500px) { + button[data-size='md'] { + height: 32px; + padding: 5px 12px; + } + + button[data-size='md'] > wui-text > slot { + font-size: 14px !important; + } + } + + wui-loading-spinner { + width: 14px; + height: 14px; + } + + wui-loading-spinner::slotted(svg) { + width: 10px !important; + height: 10px !important; + } + + button[data-size='sm'] > wui-loading-spinner { + width: 12px; + height: 12px; + } +`;var Ay=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Cf=class extends qe{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){const e=this.size==="md"?"paragraph-600":"small-600";return we` + + `}loadingTemplate(){return this.loading?we``:null}};Cf.styles=[et,Zt,UZ];Ay([ie()],Cf.prototype,"size",void 0);Ay([ie({type:Boolean})],Cf.prototype,"loading",void 0);Cf=Ay([me("wui-connect-button")],Cf);const LZ=We` + wui-flex { + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } +`;var um=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ch=class extends qe{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return we` + + ${this.label} + + + + `}};Ch.styles=[et,Zt,LZ];um([ie({type:Boolean})],Ch.prototype,"disabled",void 0);um([ie()],Ch.prototype,"label",void 0);um([ie()],Ch.prototype,"buttonLabel",void 0);Ch=um([me("wui-cta-button")],Ch);const jZ=We` + :host { + display: block; + padding: var(--wui-spacing-l) var(--wui-spacing-m); + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + width: 100%; + } +`;var FZ=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let F2=class extends qe{render(){return we` + + + + `}};F2.styles=[et,Zt,jZ];F2=FZ([me("wui-details-group")],F2);const zZ=We` + :host { + display: flex; + flex-direction: row; + gap: var(--wui-spacing-l); + width: 100%; + border-radius: var(--wui-border-radius-xs); + } +`;var eC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let J1=class extends qe{constructor(){super(...arguments),this.name=""}render(){return we` + + ${this.name} + + + + + `}};J1.styles=[et,Zt,zZ];eC([ie()],J1.prototype,"name",void 0);J1=eC([me("wui-details-group-item")],J1);/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const WZ=r=>r.strings===void 0;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const of=(r,e)=>{var i;const t=r._$AN;if(t===void 0)return!1;for(const n of t)(i=n._$AO)==null||i.call(n,e,!1),of(n,e);return!0},X1=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while((t==null?void 0:t.size)===0)},tC=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),VZ(e)}};function HZ(r){this._$AN!==void 0?(X1(this),this._$AM=r,tC(this)):this._$AM=r}function qZ(r,e=!1,t=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(i))for(let o=t;o{r.type==KE.CHILD&&(r._$AP??(r._$AP=qZ),r._$AQ??(r._$AQ=HZ))};let KZ=class extends ZE{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),tC(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,n;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),t&&(of(this,e),X1(this))}setValue(e){if(WZ(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ey=()=>new GZ;let GZ=class{};const Fv=new WeakMap,Cy=GE(class extends KZ{render(r){return ai}update(r,[e]){var i;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=r.options)==null?void 0:i.host,this.rt(this.ct=r.element)),ai}rt(r){if(this.isConnected||(r=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let t=Fv.get(e);t===void 0&&(t=new WeakMap,Fv.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,r),r!==void 0&&this.Y.call(this.ht,r)}else this.Y.value=r}get lt(){var r,e;return typeof this.Y=="function"?(r=Fv.get(this.ht??globalThis))==null?void 0:r.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),ZZ=We` + :host { + position: relative; + width: 100%; + display: inline-block; + color: var(--wui-color-fg-275); + } + + input { + width: 100%; + border-radius: var(--wui-border-radius-xs); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); + background: var(--wui-color-gray-glass-002); + font-size: var(--wui-font-size-paragraph); + letter-spacing: var(--wui-letter-spacing-paragraph); + color: var(--wui-color-fg-100); + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, border-color, box-shadow; + caret-color: var(--wui-color-accent-100); + } + + input:disabled { + cursor: not-allowed; + border: 1px solid var(--wui-color-gray-glass-010); + } + + input:disabled::placeholder, + input:disabled + wui-icon { + color: var(--wui-color-fg-300); + } + + input::placeholder { + color: var(--wui-color-fg-275); + } + + input:focus:enabled { + background-color: var(--wui-color-gray-glass-005); + -webkit-box-shadow: + inset 0 0 0 1px var(--wui-color-accent-100), + 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: + inset 0 0 0 1px var(--wui-color-accent-100), + 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: + inset 0 0 0 1px var(--wui-color-accent-100), + 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + input:hover:enabled { + background-color: var(--wui-color-gray-glass-005); + } + + wui-icon { + position: absolute; + top: 50%; + transform: translateY(-50%); + pointer-events: none; + } + + .wui-size-sm { + padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s); + } + + wui-icon + .wui-size-sm { + padding: 9px var(--wui-spacing-m) 10px 36px; + } + + wui-icon[data-input='sm'] { + left: var(--wui-spacing-s); + } + + .wui-size-md { + padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m); + } + + wui-icon + .wui-size-md, + wui-loading-spinner + .wui-size-md { + padding: 10.5px var(--wui-spacing-3xl) 10.5px var(--wui-spacing-3xl); + } + + wui-icon[data-input='md'] { + left: var(--wui-spacing-l); + } + + .wui-size-lg { + padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l); + letter-spacing: var(--wui-letter-spacing-medium-title); + font-size: var(--wui-font-size-medium-title); + font-weight: var(--wui-font-weight-light); + line-height: 130%; + color: var(--wui-color-fg-100); + height: 64px; + } + + .wui-padding-right-xs { + padding-right: var(--wui-spacing-xs); + } + + .wui-padding-right-s { + padding-right: var(--wui-spacing-s); + } + + .wui-padding-right-m { + padding-right: var(--wui-spacing-m); + } + + .wui-padding-right-l { + padding-right: var(--wui-spacing-l); + } + + .wui-padding-right-xl { + padding-right: var(--wui-spacing-xl); + } + + .wui-padding-right-2xl { + padding-right: var(--wui-spacing-2xl); + } + + .wui-padding-right-3xl { + padding-right: var(--wui-spacing-3xl); + } + + .wui-padding-right-4xl { + padding-right: var(--wui-spacing-4xl); + } + + .wui-padding-right-5xl { + padding-right: var(--wui-spacing-5xl); + } + + wui-icon + .wui-size-lg, + wui-loading-spinner + .wui-size-lg { + padding-left: 50px; + } + + wui-icon[data-input='lg'] { + left: var(--wui-spacing-l); + } + + .wui-size-mdl { + padding: 17.25px var(--wui-spacing-m) 17.25px var(--wui-spacing-m); + } + wui-icon + .wui-size-mdl, + wui-loading-spinner + .wui-size-mdl { + padding: 17.25px var(--wui-spacing-3xl) 17.25px 40px; + } + wui-icon[data-input='mdl'] { + left: var(--wui-spacing-m); + } + + input:placeholder-shown ~ ::slotted(wui-input-element), + input:placeholder-shown ~ ::slotted(wui-icon) { + opacity: 0; + pointer-events: none; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input[type='number'] { + -moz-appearance: textfield; + } + + ::slotted(wui-input-element), + ::slotted(wui-icon) { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + + ::slotted(wui-input-element) { + right: var(--wui-spacing-m); + } + + ::slotted(wui-icon) { + right: 0px; + } +`;var ec=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let gs=class extends qe{constructor(){super(...arguments),this.inputElementRef=Ey(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){const e=`wui-padding-right-${this.inputRightPadding}`,i={[`wui-size-${this.size}`]:!0,[e]:!!this.inputRightPadding};return we`${this.templateIcon()} + + `}templateIcon(){return this.icon?we``:null}dispatchInputChangeEvent(){var e;this.dispatchEvent(new CustomEvent("inputChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.value,bubbles:!0,composed:!0}))}};gs.styles=[et,Zt,ZZ];ec([ie()],gs.prototype,"size",void 0);ec([ie()],gs.prototype,"icon",void 0);ec([ie({type:Boolean})],gs.prototype,"disabled",void 0);ec([ie()],gs.prototype,"placeholder",void 0);ec([ie()],gs.prototype,"type",void 0);ec([ie()],gs.prototype,"keyHint",void 0);ec([ie()],gs.prototype,"value",void 0);ec([ie()],gs.prototype,"inputRightPadding",void 0);gs=ec([me("wui-input-text")],gs);const QZ=We` + :host { + position: relative; + display: inline-block; + } + + wui-text { + margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); + } +`;var hm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Sh=class extends qe{constructor(){super(...arguments),this.disabled=!1}render(){return we` + + ${this.templateError()} + `}templateError(){return this.errorMessage?we`${this.errorMessage}`:null}};Sh.styles=[et,QZ];hm([ie()],Sh.prototype,"errorMessage",void 0);hm([ie({type:Boolean})],Sh.prototype,"disabled",void 0);hm([ie()],Sh.prototype,"value",void 0);Sh=hm([me("wui-email-input")],Sh);const YZ=We` + :host { + position: relative; + width: 100%; + display: inline-block; + color: var(--wui-color-fg-275); + } + + .error { + margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); + } + + .base-name { + position: absolute; + right: 45px; + top: 15px; + text-align: right; + } +`;var C0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Zl=class extends qe{constructor(){super(...arguments),this.disabled=!1,this.loading=!1}render(){return we` + + ${this.baseNameTemplate()} ${this.errorTemplate()}${this.loadingTemplate()} + + `}baseNameTemplate(){return we` + ${Ic.WC_NAME_SUFFIX} + `}loadingTemplate(){return this.loading?we``:null}errorTemplate(){return this.errorMessage?we`${this.errorMessage}`:null}};Zl.styles=[et,YZ];C0([ie()],Zl.prototype,"errorMessage",void 0);C0([ie({type:Boolean})],Zl.prototype,"disabled",void 0);C0([ie()],Zl.prototype,"value",void 0);C0([ie({type:Boolean})],Zl.prototype,"loading",void 0);Zl=C0([me("wui-ens-input")],Zl);const JZ=We` + button { + border-radius: var(--local-border-radius); + color: var(--wui-color-fg-100); + padding: var(--local-padding); + } + + button:hover:enabled { + background-color: var(--wui-color-gray-glass-005); + } + + @media (max-width: 700px) { + button { + padding: var(--wui-spacing-s); + } + } + + button > wui-icon { + pointer-events: none; + } + + button:disabled > wui-icon { + color: var(--wui-color-bg-300) !important; + } + + button:disabled { + background-color: transparent; + } +`;var S0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ql=class extends qe{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){const e=this.size==="lg"?"--wui-border-radius-xs":"--wui-border-radius-xxs",t=this.size==="lg"?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=` + --local-border-radius: var(${e}); + --local-padding: var(${t}); +`,we` + + `}};Ql.styles=[et,Zt,yy,JZ];S0([ie()],Ql.prototype,"size",void 0);S0([ie({type:Boolean})],Ql.prototype,"disabled",void 0);S0([ie()],Ql.prototype,"icon",void 0);S0([ie()],Ql.prototype,"iconColor",void 0);Ql=S0([me("wui-icon-link")],Ql);const XZ=We` + button { + background-color: var(--wui-color-fg-300); + border-radius: var(--wui-border-radius-4xs); + width: 16px; + height: 16px; + } + + button:disabled { + background-color: var(--wui-color-bg-300); + } + + wui-icon { + color: var(--wui-color-bg-200) !important; + } + + button:focus-visible { + background-color: var(--wui-color-fg-250); + border: 1px solid var(--wui-color-accent-100); + } + + button:active:enabled { + background-color: var(--wui-color-fg-225); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-fg-250); + } + } +`;var rC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let eg=class extends qe{constructor(){super(...arguments),this.icon="copy"}render(){return we` + + `}};eg.styles=[et,Zt,XZ];rC([ie()],eg.prototype,"icon",void 0);eg=rC([me("wui-input-element")],eg);const eQ=We` + :host { + position: relative; + display: inline-block; + } + + input { + width: 50px; + height: 50px; + background: var(--wui-color-gray-glass-010); + border-radius: var(--wui-border-radius-xs); + border: 1px solid var(--wui-color-gray-glass-005); + font-family: var(--wui-font-family); + font-size: var(--wui-font-size-large); + font-weight: var(--wui-font-weight-regular); + letter-spacing: var(--wui-letter-spacing-large); + text-align: center; + color: var(--wui-color-fg-100); + caret-color: var(--wui-color-accent-100); + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, border-color, box-shadow; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input[type='number'] { + -moz-appearance: textfield; + } + + input:disabled { + cursor: not-allowed; + border: 1px solid var(--wui-color-gray-glass-010); + background: var(--wui-color-gray-glass-005); + } + + input:focus:enabled { + background-color: var(--wui-color-gray-glass-015); + border: 1px solid var(--wui-color-accent-100); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + @media (hover: hover) and (pointer: fine) { + input:hover:enabled { + background-color: var(--wui-color-gray-glass-015); + } + } +`;var Sy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Sf=class extends qe{constructor(){super(...arguments),this.disabled=!1,this.value=""}render(){return we` `}};Sf.styles=[et,Zt,eQ];Sy([ie({type:Boolean})],Sf.prototype,"disabled",void 0);Sy([ie({type:String})],Sf.prototype,"value",void 0);Sf=Sy([me("wui-input-numeric")],Sf);const tQ=We` + button { + padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); + border-radius: var(--wui-border-radius-3xs); + background-color: transparent; + color: var(--wui-color-accent-100); + } + + button:disabled { + background-color: transparent; + color: var(--wui-color-gray-glass-015); + } + + button:hover { + background-color: var(--wui-color-gray-glass-005); + } +`;var Iy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let If=class extends qe{constructor(){super(...arguments),this.disabled=!1,this.color="inherit"}render(){return we` + + `}};If.styles=[et,Zt,tQ];Iy([ie({type:Boolean})],If.prototype,"disabled",void 0);Iy([ie()],If.prototype,"color",void 0);If=Iy([me("wui-link")],If);const rQ=We` + button { + column-gap: var(--wui-spacing-s); + padding: 11px 18px 11px var(--wui-spacing-s); + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + transition: + color var(--wui-ease-out-power-1) var(--wui-duration-md), + background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: color, background-color; + } + + button[data-iconvariant='square'], + button[data-iconvariant='square-blue'] { + padding: 6px 18px 6px 9px; + } + + button > wui-flex { + flex: 1; + } + + button > wui-image { + width: 32px; + height: 32px; + box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); + border-radius: var(--wui-border-radius-3xl); + } + + button > wui-icon { + width: 36px; + height: 36px; + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + } + + button > wui-icon-box[data-variant='blue'] { + box-shadow: 0 0 0 2px var(--wui-color-accent-glass-005); + } + + button > wui-icon-box[data-variant='overlay'] { + box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); + } + + button > wui-icon-box[data-variant='square-blue'] { + border-radius: var(--wui-border-radius-3xs); + position: relative; + border: none; + width: 36px; + height: 36px; + } + + button > wui-icon-box[data-variant='square-blue']::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-color-accent-glass-010); + pointer-events: none; + } + + button > wui-icon:last-child { + width: 14px; + height: 14px; + } + + button:hover:enabled { + background-color: var(--wui-color-gray-glass-005); + } + + button:disabled { + background-color: var(--wui-color-gray-glass-015); + color: var(--wui-color-gray-glass-015); + } + + button[data-loading='true'] > wui-icon { + opacity: 0; + } + + wui-loading-spinner { + position: absolute; + right: 18px; + top: 50%; + transform: translateY(-50%); + } +`;var na=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let zo=class extends qe{constructor(){super(...arguments),this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return we` + + `}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return we``;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return we``;if(this.variant==="icon"&&this.icon&&this.iconVariant){const e=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",t=this.iconVariant==="square-blue"?"mdl":"md",i=this.iconSize?this.iconSize:t;return we` + + `}return null}loadingTemplate(){return this.loading?we``:we``}chevronTemplate(){return this.chevron?we``:null}};zo.styles=[et,Zt,rQ];na([ie()],zo.prototype,"icon",void 0);na([ie()],zo.prototype,"iconSize",void 0);na([ie()],zo.prototype,"variant",void 0);na([ie()],zo.prototype,"iconVariant",void 0);na([ie({type:Boolean})],zo.prototype,"disabled",void 0);na([ie()],zo.prototype,"imageSrc",void 0);na([ie()],zo.prototype,"alt",void 0);na([ie({type:Boolean})],zo.prototype,"chevron",void 0);na([ie({type:Boolean})],zo.prototype,"loading",void 0);zo=na([me("wui-list-item")],zo);var z2;(function(r){r.approve="approved",r.bought="bought",r.borrow="borrowed",r.burn="burnt",r.cancel="canceled",r.claim="claimed",r.deploy="deployed",r.deposit="deposited",r.execute="executed",r.mint="minted",r.receive="received",r.repay="repaid",r.send="sent",r.sell="sold",r.stake="staked",r.trade="swapped",r.unstake="unstaked",r.withdraw="withdrawn"})(z2||(z2={}));const iQ=We` + :host > wui-flex { + display: flex; + justify-content: center; + align-items: center; + position: relative; + width: 40px; + height: 40px; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + background-color: var(--wui-color-gray-glass-005); + } + + :host > wui-flex wui-image { + display: block; + } + + :host > wui-flex, + :host > wui-flex wui-image, + .swap-images-container, + .swap-images-container.nft, + wui-image.nft { + border-top-left-radius: var(--local-left-border-radius); + border-top-right-radius: var(--local-right-border-radius); + border-bottom-left-radius: var(--local-left-border-radius); + border-bottom-right-radius: var(--local-right-border-radius); + } + + wui-icon { + width: 20px; + height: 20px; + } + + wui-icon-box { + position: absolute; + right: 0; + bottom: 0; + transform: translate(20%, 20%); + } + + .swap-images-container { + position: relative; + width: 40px; + height: 40px; + overflow: hidden; + } + + .swap-images-container wui-image:first-child { + position: absolute; + width: 40px; + height: 40px; + top: 0; + left: 0%; + clip-path: inset(0px calc(50% + 2px) 0px 0%); + } + + .swap-images-container wui-image:last-child { + clip-path: inset(0px 0px 0px calc(50% + 2px)); + } +`;var _u=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Fa=class extends qe{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){const[e,t]=this.images,i=(e==null?void 0:e.type)==="NFT",n=t!=null&&t.url?t.type==="NFT":i,o=i?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)",s=n?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)";return this.style.cssText=` + --local-left-border-radius: ${o}; + --local-right-border-radius: ${s}; + `,we` ${this.templateVisual()} ${this.templateIcon()} `}templateVisual(){const[e,t]=this.images,i=e==null?void 0:e.type;return this.images.length===2&&(e!=null&&e.url||t!=null&&t.url)?we`
+ ${e!=null&&e.url?we``:null} + ${t!=null&&t.url?we``:null} +
`:e!=null&&e.url?we``:i==="NFT"?we``:we``}templateIcon(){let e="accent-100",t;return t=this.getIcon(),this.status&&(e=this.getStatusColor()),t?we` + + `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};Fa.styles=[iQ];_u([ie()],Fa.prototype,"type",void 0);_u([ie()],Fa.prototype,"status",void 0);_u([ie()],Fa.prototype,"direction",void 0);_u([ie({type:Boolean})],Fa.prototype,"onlyDirectionIcon",void 0);_u([ie({type:Array})],Fa.prototype,"images",void 0);_u([ie({type:Object})],Fa.prototype,"secondImage",void 0);Fa=_u([me("wui-transaction-visual")],Fa);const nQ=We` + :host > wui-flex:first-child { + align-items: center; + column-gap: var(--wui-spacing-s); + padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs); + width: 100%; + } + + :host > wui-flex:first-child wui-text:nth-child(1) { + text-transform: capitalize; + } + + wui-transaction-visual { + width: 40px; + height: 40px; + } + + wui-flex { + flex: 1; + } + + :host wui-flex wui-flex { + overflow: hidden; + } + + :host .description-container wui-text span { + word-break: break-all; + } + + :host .description-container wui-text { + overflow: hidden; + } + + :host .description-separator-icon { + margin: 0px 6px; + } + + :host wui-text > span { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + } +`;var vs=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Xn=class extends qe{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return we` + + + + + ${z2[this.type]||this.type} + + + ${this.templateDescription()} ${this.templateSecondDescription()} + + + ${this.date} + + `}templateDescription(){var t;const e=(t=this.descriptions)==null?void 0:t[0];return e?we` + + ${e} + + `:null}templateSecondDescription(){var t;const e=(t=this.descriptions)==null?void 0:t[1];return e?we` + + + ${e} + + `:null}};Xn.styles=[et,nQ];vs([ie()],Xn.prototype,"type",void 0);vs([ie({type:Array})],Xn.prototype,"descriptions",void 0);vs([ie()],Xn.prototype,"date",void 0);vs([ie({type:Boolean})],Xn.prototype,"onlyDirectionIcon",void 0);vs([ie()],Xn.prototype,"status",void 0);vs([ie()],Xn.prototype,"direction",void 0);vs([ie({type:Array})],Xn.prototype,"images",void 0);vs([ie({type:Array})],Xn.prototype,"price",void 0);vs([ie({type:Array})],Xn.prototype,"amount",void 0);vs([ie({type:Array})],Xn.prototype,"symbol",void 0);Xn=vs([me("wui-transaction-list-item")],Xn);const oQ=We` + :host > wui-flex:first-child { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + } + + wui-flex { + display: flex; + flex: 1; + } +`;var sQ=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let W2=class extends qe{render(){return we` + + + + + + + + + `}};W2.styles=[et,oQ];W2=sQ([me("wui-transaction-list-item-loader")],W2);const aQ=We` + :host { + display: flex; + justify-content: center; + align-items: center; + height: var(--wui-spacing-m); + padding: 0 var(--wui-spacing-3xs) !important; + border-radius: var(--wui-border-radius-5xs); + } + + :host > wui-text { + transform: translateY(5%); + } + + :host([data-variant='main']) { + background-color: var(--wui-color-accent-glass-015); + color: var(--wui-color-accent-100); + } + + :host([data-variant='shade']) { + background-color: var(--wui-color-gray-glass-010); + color: var(--wui-color-fg-200); + } + + :host([data-variant='success']) { + background-color: var(--wui-icon-box-bg-success-100); + color: var(--wui-color-success-100); + } + + :host([data-variant='error']) { + background-color: var(--wui-icon-box-bg-error-100); + color: var(--wui-color-error-100); + } + + :host([data-size='lg']) { + padding: 11px 5px !important; + } + + :host([data-size='lg']) > wui-text { + transform: translateY(2%); + } +`;var Ty=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Tf=class extends qe{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const e=this.size==="md"?"mini-700":"micro-700";return we` + + + + `}};Tf.styles=[et,aQ];Ty([ie()],Tf.prototype,"variant",void 0);Ty([ie()],Tf.prototype,"size",void 0);Tf=Ty([me("wui-tag")],Tf);const cQ=We` + button { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-100); + } + + button > wui-text:nth-child(2) { + display: flex; + flex: 1; + } + + button:hover:enabled { + background-color: var(--wui-color-gray-glass-005); + } + + button:disabled { + background-color: var(--wui-color-gray-glass-015); + color: var(--wui-color-gray-glass-015); + } + + button:disabled > wui-tag { + background-color: var(--wui-color-gray-glass-010); + color: var(--wui-color-fg-300); + } + + wui-icon { + color: var(--wui-color-fg-200) !important; + } +`;var ys=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let eo=class extends qe{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.installed=!1,this.disabled=!1,this.showAllWallets=!1}render(){return we` + + `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?we` `:this.showAllWallets&&this.walletIcon?we` `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?we``:!this.showAllWallets&&!this.imageSrc?we``:null}templateStatus(){return this.tagLabel&&this.tagVariant?we`${this.tagLabel}`:this.icon?we``:null}};eo.styles=[et,Zt,cQ];ys([ie({type:Array})],eo.prototype,"walletImages",void 0);ys([ie()],eo.prototype,"imageSrc",void 0);ys([ie()],eo.prototype,"name",void 0);ys([ie()],eo.prototype,"tagLabel",void 0);ys([ie()],eo.prototype,"tagVariant",void 0);ys([ie()],eo.prototype,"icon",void 0);ys([ie()],eo.prototype,"walletIcon",void 0);ys([ie({type:Boolean})],eo.prototype,"installed",void 0);ys([ie({type:Boolean})],eo.prototype,"disabled",void 0);ys([ie({type:Boolean})],eo.prototype,"showAllWallets",void 0);eo=ys([me("wui-list-wallet")],eo);const lQ=We` + :host { + display: flex; + justify-content: center; + align-items: center; + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-color-gray-glass-005); + overflow: hidden; + } + + wui-icon { + width: 100%; + height: 100%; + } +`;var iC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let tg=class extends qe{constructor(){super(...arguments),this.logo="google"}render(){return we` `}};tg.styles=[et,lQ];iC([ie()],tg.prototype,"logo",void 0);tg=iC([me("wui-logo")],tg);const uQ=We` + :host { + display: block; + width: 100%; + } + + button { + width: 100%; + height: 56px; + background: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } +`;var Ry=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Rf=class extends qe{constructor(){super(...arguments),this.logo="google",this.disabled=!1}render(){return we` + + `}};Rf.styles=[et,Zt,uQ];Ry([ie()],Rf.prototype,"logo",void 0);Ry([ie({type:Boolean})],Rf.prototype,"disabled",void 0);Rf=Ry([me("wui-logo-select")],Rf);const hQ=We` + :host { + display: block; + } + + button { + border-radius: var(--wui-border-radius-3xl); + display: flex; + gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs) + var(--wui-spacing-xs); + border: 1px solid var(--wui-color-gray-glass-010); + background-color: var(--wui-color-gray-glass-005); + color: var(--wui-color-fg-100); + } + + button:disabled { + border: 1px solid var(--wui-color-gray-glass-005); + background-color: var(--wui-color-gray-glass-015); + color: var(--wui-color-gray-glass-015); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-gray-glass-010); + } + + button:active:enabled { + background-color: var(--wui-color-gray-glass-015); + } + } + + wui-image, + wui-icon-box { + border-radius: var(--wui-border-radius-3xl); + width: 24px; + height: 24px; + box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); + } +`;var dm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ih=class extends qe{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return we` + + `}visualTemplate(){return this.isUnsupportedChain?we` + + `:this.imageSrc?we``:we` + + `}};Ih.styles=[et,Zt,hQ];dm([ie()],Ih.prototype,"imageSrc",void 0);dm([ie({type:Boolean})],Ih.prototype,"isUnsupportedChain",void 0);dm([ie({type:Boolean})],Ih.prototype,"disabled",void 0);Ih=dm([me("wui-network-button")],Ih);const dQ=We` + :host { + position: relative; + display: block; + } +`;var fm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Th=class extends qe{constructor(){super(...arguments),this.length=6,this.otp="",this.values=Array.from({length:this.length}).map(()=>""),this.numerics=[],this.shouldInputBeEnabled=e=>this.values.slice(0,e).every(i=>i!==""),this.handleKeyDown=(e,t)=>{const i=e.target,n=this.getInputElement(i),o=["ArrowLeft","ArrowRight","Shift","Delete"];if(!n)return;o.includes(e.key)&&e.preventDefault();const s=n.selectionStart;switch(e.key){case"ArrowLeft":s&&n.setSelectionRange(s+1,s+1),this.focusInputField("prev",t);break;case"ArrowRight":this.focusInputField("next",t);break;case"Shift":this.focusInputField("next",t);break;case"Delete":n.value===""?this.focusInputField("prev",t):this.updateInput(n,t,"");break;case"Backspace":n.value===""?this.focusInputField("prev",t):this.updateInput(n,t,"");break}},this.focusInputField=(e,t)=>{if(e==="next"){const i=t+1;if(!this.shouldInputBeEnabled(i))return;const n=this.numerics[i-1?i:t],o=n?this.getInputElement(n):void 0;o&&o.focus()}}}firstUpdated(){var t,i;this.otp&&(this.values=this.otp.split(""));const e=(t=this.shadowRoot)==null?void 0:t.querySelectorAll("wui-input-numeric");e&&(this.numerics=Array.from(e)),(i=this.numerics[0])==null||i.focus()}render(){return we` + + ${Array.from({length:this.length}).map((e,t)=>we` + this.handleInput(i,t)} + @click=${i=>this.selectInput(i)} + @keydown=${i=>this.handleKeyDown(i,t)} + .disabled=${!this.shouldInputBeEnabled(t)} + .value=${this.values[t]||""} + > + + `)} + + `}updateInput(e,t,i){const n=this.numerics[t],o=e||(n?this.getInputElement(n):void 0);o&&(o.value=i,this.values=this.values.map((s,a)=>a===t?i:s))}selectInput(e){const t=e.target;if(t){const i=this.getInputElement(t);i==null||i.select()}}handleInput(e,t){const i=e.target,n=this.getInputElement(i);if(n){const o=n.value;e.inputType==="insertFromPaste"?this.handlePaste(n,o,t):gt.isNumber(o)&&e.data?(this.updateInput(n,t,e.data),this.focusInputField("next",t)):this.updateInput(n,t,"")}this.dispatchInputChangeEvent()}handlePaste(e,t,i){const n=t[0];if(n&>.isNumber(n)){this.updateInput(e,i,n);const s=t.substring(1);if(i+140)throw new Error('"version" should be in range from 1 to 40');return e*4+17};ao.getSymbolTotalCodewords=function(e){return pQ[e]};ao.getBCHDigit=function(r){let e=0;for(;r!==0;)e++,r>>>=1;return e};ao.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ky=e};ao.isKanjiModeEnabled=function(){return typeof ky<"u"};ao.toSJIS=function(e){return ky(e)};var pm={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,n){if(r.isValid(i))return i;try{return e(i)}catch{return n}}})(pm);function oC(){this.buffer=[],this.length=0}oC.prototype={get:function(r){const e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(let t=0;t>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var gQ=oC;function T0(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}T0.prototype.set=function(r,e,t,i){const n=r*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};T0.prototype.get=function(r,e){return this.data[r*this.size+e]};T0.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t};T0.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var mQ=T0,sC={};(function(r){const e=ao.getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,o=e(i),s=o===145?26:Math.ceil((o-13)/(2*n-2))*2,a=[o-7];for(let u=1;u=0&&n<=7},r.from=function(n){return r.isValid(n)?parseInt(n,10):void 0},r.getPenaltyN1=function(n){const o=n.size;let s=0,a=0,u=0,h=null,d=null;for(let p=0;p=5&&(s+=e.N1+(a-5)),h=b,a=1),b=n.get(v,p),b===d?u++:(u>=5&&(s+=e.N1+(u-5)),d=b,u=1)}a>=5&&(s+=e.N1+(a-5)),u>=5&&(s+=e.N1+(u-5))}return s},r.getPenaltyN2=function(n){const o=n.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,u=u<<1&2047|n.get(d,h),d>=10&&(u===1488||u===93)&&s++}return s*e.N3},r.getPenaltyN4=function(n){let o=0;const s=n.data.length;for(let u=0;u=0;){const s=o[0];for(let u=0;u0){const o=new Uint8Array(this.degree);return o.set(i,n),o}return i};var vQ=Oy,hC={},Gc={},Py={};Py.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var oa={};const dC="[0-9]+",yQ="[A-Z $%*+\\-./:]+";let kf="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kf=kf.replace(/u/g,"\\u");const bQ="(?:(?![A-Z0-9 $%*+\\-./:]|"+kf+`)(?:.|[\r +]))+`;oa.KANJI=new RegExp(kf,"g");oa.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");oa.BYTE=new RegExp(bQ,"g");oa.NUMERIC=new RegExp(dC,"g");oa.ALPHANUMERIC=new RegExp(yQ,"g");const _Q=new RegExp("^"+kf+"$"),xQ=new RegExp("^"+dC+"$"),AQ=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");oa.testKanji=function(e){return _Q.test(e)};oa.testNumeric=function(e){return xQ.test(e)};oa.testAlphanumeric=function(e){return AQ.test(e)};(function(r){const e=Py,t=oa;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},r.getBestModeForData=function(o){return t.testNumeric(o)?r.NUMERIC:t.testAlphanumeric(o)?r.ALPHANUMERIC:t.testKanji(o)?r.KANJI:r.BYTE},r.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},r.isValid=function(o){return o&&o.bit&&o.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+n)}}r.from=function(o,s){if(r.isValid(o))return o;try{return i(o)}catch{return s}}})(Gc);(function(r){const e=ao,t=gm,i=pm,n=Gc,o=Py,s=7973,a=e.getBCHDigit(s);function u(v,b,I){for(let L=1;L<=40;L++)if(b<=r.getCapacity(L,I,v))return L}function h(v,b){return n.getCharCountIndicator(v,b)+4}function d(v,b){let I=0;return v.forEach(function(L){const $=h(L.mode,b);I+=$+L.getBitsLength()}),I}function p(v,b){for(let I=1;I<=40;I++)if(d(v,I)<=r.getCapacity(I,b,n.MIXED))return I}r.from=function(b,I){return o.isValid(b)?parseInt(b,10):I},r.getCapacity=function(b,I,L){if(!o.isValid(b))throw new Error("Invalid QR Code version");typeof L>"u"&&(L=n.BYTE);const $=e.getSymbolTotalCodewords(b),K=t.getTotalCodewordsCount(b,I),P=($-K)*8;if(L===n.MIXED)return P;const q=P-h(L,b);switch(L){case n.NUMERIC:return Math.floor(q/10*3);case n.ALPHANUMERIC:return Math.floor(q/11*2);case n.KANJI:return Math.floor(q/13);case n.BYTE:default:return Math.floor(q/8)}},r.getBestVersionForData=function(b,I){let L;const $=i.from(I,i.M);if(Array.isArray(b)){if(b.length>1)return p(b,$);if(b.length===0)return 1;L=b[0]}else L=b;return u(L.mode,L.getLength(),$)},r.getEncodedBits=function(b){if(!o.isValid(b)||b<7)throw new Error("Invalid QR Code version");let I=b<<12;for(;e.getBCHDigit(I)-a>=0;)I^=s<=0;)n^=pC<0&&(i=this.data.substr(t),n=parseInt(i,10),e.put(n,o*3+1))};var SQ=Rh;const IQ=Gc,zv=["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 kh(r){this.mode=IQ.ALPHANUMERIC,this.data=r}kh.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};kh.prototype.getLength=function(){return this.data.length};kh.prototype.getBitsLength=function(){return kh.getBitsLength(this.data.length)};kh.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let i=zv.indexOf(this.data[t])*45;i+=zv.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(zv.indexOf(this.data[t]),6)};var TQ=kh,RQ=function(e){for(var t=[],i=e.length,n=0;n=55296&&o<=56319&&i>n+1){var s=e.charCodeAt(n+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,n+=1)}if(o<128){t.push(o);continue}if(o<2048){t.push(o>>6|192),t.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){t.push(o>>12|224),t.push(o>>6&63|128),t.push(o&63|128);continue}if(o>=65536&&o<=1114111){t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(o&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const kQ=RQ,OQ=Gc;function Oh(r){this.mode=OQ.BYTE,typeof r=="string"&&(r=kQ(r)),this.data=new Uint8Array(r)}Oh.getBitsLength=function(e){return e*8};Oh.prototype.getLength=function(){return this.data.length};Oh.prototype.getBitsLength=function(){return Oh.getBitsLength(this.data.length)};Oh.prototype.write=function(r){for(let e=0,t=this.data.length;e=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` +Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var $Q=Ph,mC={exports:{}};(function(r){var e={single_source_shortest_paths:function(t,i,n){var o={},s={};s[i]=0;var a=e.PriorityQueue.make();a.push(i,0);for(var u,h,d,p,v,b,I,L,$;!a.empty();){u=a.pop(),h=u.value,p=u.cost,v=t[h]||{};for(d in v)v.hasOwnProperty(d)&&(b=v[d],I=p+b,L=s[d],$=typeof s[d]>"u",($||L>I)&&(s[d]=I,a.push(d,I),o[d]=h))}if(typeof n<"u"&&typeof s[n]>"u"){var K=["Could not find a path from ",i," to ",n,"."].join("");throw new Error(K)}return o},extract_shortest_path_from_predecessor_list:function(t,i){for(var n=[],o=i;o;)n.push(o),t[o],o=t[o];return n.reverse(),n},find_path:function(t,i,n){var o=e.single_source_shortest_paths(t,i,n);return e.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(t){var i=e.PriorityQueue,n={},o;t=t||{};for(o in i)i.hasOwnProperty(o)&&(n[o]=i[o]);return n.queue=[],n.sorter=t.sorter||i.default_sorter,n},default_sorter:function(t,i){return t.cost-i.cost},push:function(t,i){var n={value:t,cost:i};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=e})(mC);var MQ=mC.exports;(function(r){const e=Gc,t=SQ,i=TQ,n=PQ,o=$Q,s=oa,a=ao,u=MQ;function h(K){return unescape(encodeURIComponent(K)).length}function d(K,P,q){const D=[];let U;for(;(U=K.exec(q))!==null;)D.push({data:U[0],index:U.index,mode:P,length:U[0].length});return D}function p(K){const P=d(s.NUMERIC,e.NUMERIC,K),q=d(s.ALPHANUMERIC,e.ALPHANUMERIC,K);let D,U;return a.isKanjiModeEnabled()?(D=d(s.BYTE,e.BYTE,K),U=d(s.KANJI,e.KANJI,K)):(D=d(s.BYTE_KANJI,e.BYTE,K),U=[]),P.concat(q,D,U).sort(function(_,x){return _.index-x.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function v(K,P){switch(P){case e.NUMERIC:return t.getBitsLength(K);case e.ALPHANUMERIC:return i.getBitsLength(K);case e.KANJI:return o.getBitsLength(K);case e.BYTE:return n.getBitsLength(K)}}function b(K){return K.reduce(function(P,q){const D=P.length-1>=0?P[P.length-1]:null;return D&&D.mode===q.mode?(P[P.length-1].data+=q.data,P):(P.push(q),P)},[])}function I(K){const P=[];for(let q=0;q=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?r.set(o+a,s+u,!0,!0):r.set(o+a,s+u,!1,!0))}}function qQ(r){const e=r.size;for(let t=8;t>a&1)===1,r.set(n,o,s,!0),r.set(o,n,s,!0)}function qv(r,e,t){const i=r.size,n=zQ.getEncodedBits(e,t);let o,s;for(o=0;o<15;o++)s=(n>>o&1)===1,o<6?r.set(o,8,s,!0):o<8?r.set(o+1,8,s,!0):r.set(i-15+o,8,s,!0),o<8?r.set(8,i-o-1,s,!0):o<9?r.set(8,15-o-1+1,s,!0):r.set(8,15-o-1,s,!0);r.set(i-8,8,1,!0)}function GQ(r,e){const t=r.size;let i=-1,n=t-1,o=7,s=0;for(let a=t-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!r.isReserved(n,a-u)){let h=!1;s>>o&1)===1),r.set(n,a-u,h),o--,o===-1&&(s++,o=7)}if(n+=i,n<0||t<=n){n-=i,i=-i;break}}}function ZQ(r,e,t){const i=new BQ;t.forEach(function(u){i.put(u.mode.bit,4),i.put(u.getLength(),WQ.getCharCountIndicator(u.mode,r)),u.write(i)});const n=wm.getSymbolTotalCodewords(r),o=V2.getTotalCodewordsCount(r,e),s=(n-o)*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const a=(s-i.getLengthInBits())/8;for(let u=0;u=7&&KQ(u,e),GQ(u,s),isNaN(i)&&(i=q2.getBestMask(u,qv.bind(null,u,t))),q2.applyMask(i,u),qv(u,t,i),{modules:u,version:e,errorCorrectionLevel:t,maskPattern:i,segments:n}}nC.create=function(e,t){if(typeof e>"u"||e==="")throw new Error("No input text");let i=Wv.M,n,o;return typeof t<"u"&&(i=Wv.from(t.errorCorrectionLevel,Wv.M),n=ig.from(t.version),o=q2.from(t.maskPattern),t.toSJISFunc&&wm.setToSJISFunction(t.toSJISFunc)),YQ(e,n,i,o)};var wC={},Dy={};(function(r){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let i=t.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+t);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(o){return[o,o]}))),i.length===6&&i.push("F","F");const n=parseInt(i.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+i.slice(0,6).join("")}}r.getOptions=function(i){i||(i={}),i.color||(i.color={});const n=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,o=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:o,scale:o?4:s,margin:n,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},r.getScale=function(i,n){return n.width&&n.width>=i+n.margin*2?n.width/(i+n.margin*2):n.scale},r.getImageWidth=function(i,n){const o=r.getScale(i,n);return Math.floor((i+n.margin*2)*o)},r.qrToImageData=function(i,n,o){const s=n.modules.size,a=n.modules.data,u=r.getScale(s,o),h=Math.floor((s+o.margin*2)*u),d=o.margin*u,p=[o.color.light,o.color.dark];for(let v=0;v=d&&b>=d&&v"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(h=i()),u=e.getOptions(u);const d=e.getImageWidth(o.modules.size,u),p=h.getContext("2d"),v=p.createImageData(d,d);return e.qrToImageData(v.data,o,u),t(p,h,d),p.putImageData(v,0,0),h},r.renderToDataURL=function(o,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const h=r.render(o,s,u),d=u.type||"image/png",p=u.rendererOpts||{};return h.toDataURL(d,p.quality)}})(wC);var vC={};const JQ=Dy;function Y8(r,e){const t=r.a/255,i=e+'="'+r.hex+'"';return t<1?i+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':i}function Vv(r,e,t){let i=r+e;return typeof t<"u"&&(i+=" "+t),i}function XQ(r,e,t){let i="",n=0,o=!1,s=0;for(let a=0;a0&&u>0&&r[a-1]||(i+=o?Vv("M",u+t,.5+h+t):Vv("m",n,0),n=0,o=!1),u+1':"",h="',d='viewBox="0 0 '+a+" "+a+'"',v=''+u+h+` +`;return typeof i=="function"&&i(null,v),v};const eY=fQ,K2=nC,yC=wC,tY=vC;function Ny(r,e,t,i,n){const o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!eY())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(n=t,t=e,e=i=void 0):s===3&&(e.getContext&&typeof n>"u"?(n=i,i=void 0):(n=i,i=t,t=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(t=e,e=i=void 0):s===2&&!e.getContext&&(i=t,t=e,e=void 0),new Promise(function(u,h){try{const d=K2.create(t,i);u(r(d,e,i))}catch(d){h(d)}})}try{const u=K2.create(t,i);n(null,r(u,e,i))}catch(u){n(u)}}I0.create=K2.create;I0.toCanvas=Ny.bind(null,yC.render);I0.toDataURL=Ny.bind(null,yC.renderToDataURL);I0.toString=Ny.bind(null,function(r,e,t){return tY.render(r,t)});const rY=.1,J8=2.5,Sa=7;function Kv(r,e,t){return r===e?!1:(r-e<0?e-r:r-e)<=t+rY}function iY(r,e){const t=Array.prototype.slice.call(I0.create(r,{errorCorrectionLevel:e}).modules.data,0),i=Math.sqrt(t.length);return t.reduce((n,o,s)=>(s%i===0?n.push([o]):n[n.length-1].push(o))&&n,[])}const nY={generate(r,e,t){const i="#141414",n="transparent",s=[],a=iY(r,"Q"),u=e/a.length,h=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];h.forEach(({x:L,y:$})=>{const K=(a.length-Sa)*u*L,P=(a.length-Sa)*u*$,q=.45;for(let D=0;D + `)}});const d=Math.floor((t+25)/u),p=a.length/2-d/2,v=a.length/2+d/2-1,b=[];a.forEach((L,$)=>{L.forEach((K,P)=>{if(a[$][P]&&!($a.length-(Sa+1)&&Pa.length-(Sa+1))&&!($>p&&$p&&P{var K;I[L]?(K=I[L])==null||K.push($):I[L]=[$]}),Object.entries(I).map(([L,$])=>{const K=$.filter(P=>$.every(q=>!Kv(P,q,u)));return[Number(L),K]}).forEach(([L,$])=>{$.forEach(K=>{s.push(De``)})}),Object.entries(I).filter(([L,$])=>$.length>1).map(([L,$])=>{const K=$.filter(P=>$.some(q=>Kv(P,q,u)));return[Number(L),K]}).map(([L,$])=>{$.sort((P,q)=>PD.some(U=>Kv(P,U,u)));q?q.push(P):K.push([P])}return[L,K.map(P=>[P[0],P[P.length-1]])]}).forEach(([L,$])=>{$.forEach(([K,P])=>{s.push(De` + + `)})}),s}},oY=We` + :host { + position: relative; + user-select: none; + display: block; + overflow: hidden; + aspect-ratio: 1 / 1; + width: var(--local-size); + } + + :host([data-theme='dark']) { + border-radius: clamp(0px, var(--wui-border-radius-l), 40px); + background-color: var(--wui-color-inverse-100); + padding: var(--wui-spacing-l); + } + + :host([data-theme='light']) { + box-shadow: 0 0 0 1px var(--wui-color-bg-125); + background-color: var(--wui-color-bg-125); + } + + :host([data-clear='true']) > wui-icon { + display: none; + } + + svg:first-child, + wui-image, + wui-icon { + position: absolute; + top: 50%; + left: 50%; + transform: translateY(-50%) translateX(-50%); + } + + wui-image { + width: 25%; + height: 25%; + border-radius: var(--wui-border-radius-xs); + } + + wui-icon { + width: 100%; + height: 100%; + color: #3396ff !important; + transform: translateY(-50%) translateX(-50%) scale(0.25); + } +`;var xu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let za=class extends qe{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`--local-size: ${this.size}px`,we`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const e=this.theme==="light"?this.size:this.size-32;return De` + + ${nY.generate(this.uri,e,this.arenaClear?0:e/4)} + + `}templateVisual(){return this.imageSrc?we``:we``}};za.styles=[et,oY];xu([ie()],za.prototype,"uri",void 0);xu([ie({type:Number})],za.prototype,"size",void 0);xu([ie()],za.prototype,"theme",void 0);xu([ie()],za.prototype,"imageSrc",void 0);xu([ie()],za.prototype,"alt",void 0);xu([ie({type:Boolean})],za.prototype,"arenaClear",void 0);za=xu([me("wui-qr-code")],za);const sY=We` + :host { + position: relative; + display: inline-block; + width: 100%; + } +`;var aY=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let G2=class extends qe{constructor(){super(...arguments),this.inputComponentRef=Ey()}render(){return we` + + + + `}clearValue(){const e=this.inputComponentRef.value,t=e==null?void 0:e.inputElementRef.value;t&&(t.value="",t.focus(),t.dispatchEvent(new Event("input")))}};G2.styles=[et,sY];G2=aY([me("wui-search-bar")],G2);const cY=We` + :host { + display: flex; + column-gap: var(--wui-spacing-xs); + align-items: center; + padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-color-gray-glass-005); + box-sizing: border-box; + max-height: 40px; + background-color: var(--wui-color-bg-175); + box-shadow: + 0px 14px 64px -4px rgba(0, 0, 0, 0.15), + 0px 8px 22px -6px rgba(0, 0, 0, 0.15); + } +`;var R0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Yl=class extends qe{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message=""}render(){return we` + + ${this.message} + `}};Yl.styles=[et,cY];R0([ie()],Yl.prototype,"backgroundColor",void 0);R0([ie()],Yl.prototype,"iconColor",void 0);R0([ie()],Yl.prototype,"icon",void 0);R0([ie()],Yl.prototype,"message",void 0);Yl=R0([me("wui-snackbar")],Yl);const lY=We` + :host { + display: inline-flex; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + padding: var(--wui-spacing-3xs); + position: relative; + height: 36px; + overflow: hidden; + } + + :host::before { + content: ''; + position: absolute; + pointer-events: none; + top: 4px; + left: 4px; + display: block; + width: var(--local-tab-width); + height: 28px; + border-radius: var(--wui-border-radius-3xl); + background-color: var(--wui-color-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); + transform: translateX(calc(var(--local-tab) * var(--local-tab-width))); + transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color, opacity; + } + + :host([data-type='flex'])::before { + left: 3px; + transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px))); + } + + :host([data-type='flex']) { + display: flex; + padding: 0px 0px 0px 12px; + gap: 4px; + } + + :host([data-type='flex']) > button > wui-text { + position: absolute; + left: 18px; + opacity: 0; + } + + button[data-active='true'] > wui-icon, + button[data-active='true'] > wui-text { + color: var(--wui-color-fg-100); + } + + button[data-active='false'] > wui-icon, + button[data-active='false'] > wui-text { + color: var(--wui-color-fg-200); + } + + button[data-active='true']:disabled, + button[data-active='false']:disabled { + background-color: transparent; + opacity: 0.5; + cursor: not-allowed; + } + + button[data-active='true']:disabled > wui-text { + color: var(--wui-color-fg-200); + } + + button[data-active='false']:disabled > wui-text { + color: var(--wui-color-fg-300); + } + + button > wui-icon, + button > wui-text { + pointer-events: none; + transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md); + will-change: color; + } + + button { + width: var(--local-tab-width); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + :host([data-type='flex']) > button { + width: 34px; + position: relative; + display: flex; + justify-content: flex-start; + } + + button:hover:enabled, + button:active:enabled { + background-color: transparent !important; + } + + button:hover:enabled > wui-icon, + button:active:enabled > wui-icon { + color: var(--wui-color-fg-125); + } + + button:hover:enabled > wui-text, + button:active:enabled > wui-text { + color: var(--wui-color-fg-125); + } + + button { + border-radius: var(--wui-border-radius-3xl); + } +`;var Zc=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let qs=class extends qe{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=` + --local-tab: ${this.activeTab}; + --local-tab-width: ${this.localTabWidth}; + `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,t)=>{var n;const i=t===this.activeTab;return we` + + `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?we``:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,t){const i=this.buttons[this.activeTab],n=this.buttons[e],o=i==null?void 0:i.querySelector("wui-text"),s=n==null?void 0:n.querySelector("wui-text"),a=n==null?void 0:n.getBoundingClientRect(),u=s==null?void 0:s.getBoundingClientRect();i&&o&&!t&&e!==this.activeTab&&(o.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),i.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),n&&a&&u&&s&&(e!==this.activeTab||t)&&(this.localTabWidth=`${Math.round(a.width+u.width)+6}px`,n.animate([{width:`${a.width+u.width}px`}],{duration:t?0:500,fill:"forwards",easing:"ease"}),s.animate([{opacity:1}],{duration:t?0:125,delay:t?0:200,fill:"forwards",easing:"ease"}))}};qs.styles=[et,Zt,lY];Zc([ie({type:Array})],qs.prototype,"tabs",void 0);Zc([ie()],qs.prototype,"onTabChange",void 0);Zc([ie({type:Array})],qs.prototype,"buttons",void 0);Zc([ie({type:Boolean})],qs.prototype,"disabled",void 0);Zc([ie()],qs.prototype,"localTabWidth",void 0);Zc([by()],qs.prototype,"activeTab",void 0);Zc([by()],qs.prototype,"isDense",void 0);qs=Zc([me("wui-tabs")],qs);const uY=We` + :host { + display: block; + } + + :host > button { + gap: var(--wui-spacing-xxs); + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-1xs); + height: 40px; + border-radius: var(--wui-border-radius-l); + background: var(--wui-color-gray-glass-002); + border-width: 0px; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); + } + + :host > button wui-image { + width: 24px; + height: 24px; + border-radius: var(--wui-border-radius-s); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } +`;var $y=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Of=class extends qe{constructor(){super(...arguments),this.text=""}render(){return we` + + `}tokenTemplate(){return this.imageSrc?we``:we` + + `}};Of.styles=[et,Zt,uY];$y([ie()],Of.prototype,"imageSrc",void 0);$y([ie()],Of.prototype,"text",void 0);Of=$y([me("wui-token-button")],Of);const hY=We` + :host { + display: block; + padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + + color: var(--wui-color-bg-100); + position: relative; + } + + :host([data-variant='shade']) { + background-color: var(--wui-color-bg-150); + border: 1px solid var(--wui-color-gray-glass-005); + } + + :host([data-variant='shade']) > wui-text { + color: var(--wui-color-fg-150); + } + + :host([data-variant='fill']) { + background-color: var(--wui-color-fg-100); + border: none; + } + + wui-icon { + position: absolute; + width: 12px !important; + height: 4px !important; + } + + wui-icon[data-placement='top'] { + bottom: 0px; + left: 50%; + transform: translate(-50%, 95%); + } + + wui-icon[data-placement='bottom'] { + top: 0; + left: 50%; + transform: translate(-50%, -95%) rotate(180deg); + } + + wui-icon[data-placement='right'] { + top: 50%; + left: 0; + transform: translate(-65%, -50%) rotate(90deg); + } + + wui-icon[data-placement='left'] { + top: 50%; + right: 0%; + transform: translate(65%, -50%) rotate(270deg); + } +`;var vm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Dh=class extends qe{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,we` + ${this.message}`}};Dh.styles=[et,Zt,hY];vm([ie()],Dh.prototype,"placement",void 0);vm([ie()],Dh.prototype,"variant",void 0);vm([ie()],Dh.prototype,"message",void 0);Dh=vm([me("wui-tooltip")],Dh);const dY=We` + :host > wui-flex { + cursor: pointer; + display: flex; + column-gap: var(--wui-spacing-s); + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-l); + width: 100%; + background-color: transparent; + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + transition: background-color 0.2s linear; + } + + :host > wui-flex:hover { + background-color: var(--wui-color-gray-glass-002); + } + + :host([disabled]) > wui-flex { + opacity: 0.6; + } + + :host([disabled]) > wui-flex:hover { + background-color: transparent; + } + + :host > wui-flex > wui-flex { + flex: 1; + } + + :host > wui-flex > wui-image { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-3xl); + position: relative; + } + + :host > wui-flex > wui-image::after { + position: absolute; + content: ''; + inset: 0; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + border-radius: var(--wui-border-radius-l); + } + + button > wui-icon-box[data-variant='square-blue'] { + border-radius: var(--wui-border-radius-3xs); + position: relative; + border: none; + width: 36px; + height: 36px; + } +`;var od=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Uc=class extends qe{constructor(){super(...arguments),this.imageSrc=void 0,this.name=void 0,this.symbol=void 0,this.price=void 0,this.amount=void 0}render(){var t;const e=this.amount&&this.price?(t=pr.multiply(this.price,this.amount))==null?void 0:t.toFixed(3):null;return we` + + ${this.visualTemplate()} + + + ${this.name} + ${e?we` + + $${gt.formatNumberToLocalString(e,3)} + + `:null} + + + ${this.symbol} + ${this.amount?we` + ${gt.formatNumberToLocalString(this.amount,4)} + `:null} + + + + `}visualTemplate(){return this.imageSrc?we``:null}};Uc.styles=[et,Zt,dY];od([ie()],Uc.prototype,"imageSrc",void 0);od([ie()],Uc.prototype,"name",void 0);od([ie()],Uc.prototype,"symbol",void 0);od([ie()],Uc.prototype,"price",void 0);od([ie()],Uc.prototype,"amount",void 0);Uc=od([me("wui-token-list-item")],Uc);const fY=We` + :host { + display: flex; + justify-content: center; + align-items: center; + width: var(--wui-icon-box-size-xl); + height: var(--wui-icon-box-size-xl); + box-shadow: 0 0 0 8px var(--wui-thumbnail-border); + border-radius: var(--local-border-radius); + overflow: hidden; + } + + wui-icon { + width: 32px; + height: 32px; + } +`;var ym=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Nh=class extends qe{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"};`,we`${this.templateVisual()}`}templateVisual(){return this.imageSrc?we``:we``}};Nh.styles=[et,fY];ym([ie()],Nh.prototype,"imageSrc",void 0);ym([ie()],Nh.prototype,"alt",void 0);ym([ie({type:Boolean})],Nh.prototype,"borderRadiusFull",void 0);Nh=ym([me("wui-visual-thumbnail")],Nh);const pY=We` + :host { + display: block; + } + + button { + width: 100%; + display: block; + padding-top: var(--wui-spacing-l); + padding-bottom: var(--wui-spacing-l); + padding-left: var(--wui-spacing-s); + padding-right: var(--wui-spacing-2l); + border-radius: var(--wui-border-radius-s); + background-color: var(--wui-color-accent-glass-015); + } + + button:hover { + background-color: var(--wui-color-accent-glass-010) !important; + } + + button:active { + background-color: var(--wui-color-accent-glass-020) !important; + } +`;var bm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let $h=class extends qe{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return we` + + `}};$h.styles=[et,Zt,pY];bm([ie()],$h.prototype,"label",void 0);bm([ie()],$h.prototype,"description",void 0);bm([ie()],$h.prototype,"icon",void 0);$h=bm([me("wui-notice-card")],$h);const gY=We` + button { + height: auto; + position: relative; + flex-direction: column; + gap: var(--wui-spacing-s); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + .overflowedContent { + width: 100%; + overflow: hidden; + } + + .overflowedContent[data-active='false']:after { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + bottom: 0; + background: linear-gradient(to top, var(--wui-color-bg-200), transparent); + border-bottom-left-radius: var(--wui-border-radius-xs); + border-bottom-right-radius: var(--wui-border-radius-xs); + } + + .heightContent { + max-height: 100px; + } + + pre { + text-align: left; + white-space: pre-wrap; + height: auto; + overflow-x: auto; + overflow-wrap: anywhere; + } +`;var My=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const Gv=100;let Pf=class extends qe{constructor(){super(...arguments),this.textTitle="",this.overflowedContent="",this.toggled=!1,this.enableAccordion=!1,this.scrollElement=void 0,this.scrollHeightElement=0}updated(e){super.updated(e),(e.has("textTitle")||e.has("overflowedContent"))&&setTimeout(()=>{this.checkHeight()},1)}checkHeight(){this.updateComplete.then(()=>{var i,n;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".heightContent"),t=(n=this.shadowRoot)==null?void 0:n.querySelector(".textContent");if(e&&t){this.scrollElement=e;const o=t==null?void 0:t.scrollHeight;o&&o>Gv&&(this.enableAccordion=!0,this.scrollHeightElement=o,this.requestUpdate())}})}render(){return we` + + `}onClick(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-icon");this.enableAccordion&&(this.toggled=!this.toggled,this.requestUpdate(),this.scrollElement&&this.scrollElement.animate([{maxHeight:this.toggled?`${Gv}px`:`${this.scrollHeightElement}px`},{maxHeight:this.toggled?`${this.scrollHeightElement}px`:`${Gv}px`}],{duration:300,fill:"forwards",easing:"ease"}),e&&e.animate([{transform:this.toggled?"rotate(0deg)":"rotate(180deg)"},{transform:this.toggled?"rotate(180deg)":"rotate(0deg)"}],{duration:300,fill:"forwards",easing:"ease"}))}chevronTemplate(){return this.enableAccordion?we` `:null}};Pf.styles=[et,Zt,gY];My([ie()],Pf.prototype,"textTitle",void 0);My([ie()],Pf.prototype,"overflowedContent",void 0);Pf=My([me("wui-list-accordion")],Pf);const mY=We` + :host { + display: flex; + column-gap: var(--wui-spacing-s); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + wui-image { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + border-radius: var(--wui-border-radius-3xl); + } + + wui-icon { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + } +`;var _m=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Mh=class extends qe{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return we` + + + ${this.textTitle} + + ${this.templateContent()} + + `}templateContent(){return this.imageSrc?we``:this.textValue?we` ${this.textValue} `:we``}};Mh.styles=[et,Zt,mY];_m([ie()],Mh.prototype,"imageSrc",void 0);_m([ie()],Mh.prototype,"textTitle",void 0);_m([ie()],Mh.prototype,"textValue",void 0);Mh=_m([me("wui-list-content")],Mh);const wY=We` + button { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-100); + } + + button > wui-text:nth-child(2) { + display: flex; + flex: 1; + } + + button[data-transparent='true'] { + pointer-events: none; + background-color: transparent; + } + + wui-icon { + color: var(--wui-color-fg-200) !important; + } + + button:disabled { + background-color: var(--wui-color-gray-glass-015); + color: var(--wui-color-gray-glass-015); + } + + button:disabled > wui-tag { + background-color: var(--wui-color-gray-glass-010); + color: var(--wui-color-fg-300); + } +`;var k0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Jl=class extends qe{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.transparent=!1}render(){return we` + + `}templateNetworkImage(){return this.imageSrc?we``:this.imageSrc?null:we``}};Jl.styles=[et,Zt,wY];k0([ie()],Jl.prototype,"imageSrc",void 0);k0([ie()],Jl.prototype,"name",void 0);k0([ie({type:Boolean})],Jl.prototype,"disabled",void 0);k0([ie({type:Boolean})],Jl.prototype,"transparent",void 0);Jl=k0([me("wui-list-network")],Jl);const vY=We` + :host { + display: flex; + flex-direction: column; + gap: var(--wui-spacing-l); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + wui-image { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + border-radius: var(--wui-border-radius-3xl); + } + + wui-icon { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + } +`;var sd=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Lc=class extends qe{constructor(){super(...arguments),this.amount="",this.networkCurreny="",this.networkImageUrl="",this.receiverAddress="",this.addressExplorerUrl=""}render(){return we` + + Sending + + + ${this.amount} ${this.networkCurreny} + + ${this.templateNetworkVisual()} + + + + To + + + `}templateNetworkVisual(){return this.networkImageUrl?we``:we``}};Lc.styles=[et,Zt,vY];sd([ie()],Lc.prototype,"amount",void 0);sd([ie()],Lc.prototype,"networkCurreny",void 0);sd([ie()],Lc.prototype,"networkImageUrl",void 0);sd([ie()],Lc.prototype,"receiverAddress",void 0);sd([ie()],Lc.prototype,"addressExplorerUrl",void 0);Lc=sd([me("wui-list-wallet-transaction")],Lc);const yY=We` + :host { + width: 100%; + } + + :host > wui-flex { + width: 100%; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xs); + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + gap: var(--wui-spacing-s); + } + + :host > wui-flex:hover { + background-color: var(--wui-color-gray-glass-002); + } + + .purchase-image-container { + display: flex; + justify-content: center; + align-items: center; + position: relative; + width: var(--wui-icon-box-size-lg); + height: var(--wui-icon-box-size-lg); + } + + .purchase-image-container wui-image { + width: 100%; + height: 100%; + position: relative; + border-radius: calc(var(--wui-icon-box-size-lg) / 2); + } + + .purchase-image-container wui-image::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-icon-box-size-lg) / 2); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + } + + .purchase-image-container wui-icon-box { + position: absolute; + right: 0; + bottom: 0; + transform: translate(20%, 20%); + } +`;var co=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let mn=class extends qe{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return we` + + ${this.imageTemplate()} + + + ${this.statusIconTemplate()} + ${this.label} + + + + ${this.purchaseValue} ${this.purchaseCurrency} + + + ${this.inProgress?we``:we`${this.date}`} + + `}async fetchTokenImage(){await Tt._fetchTokenImage(this.purchaseCurrency)}statusIconTemplate(){return this.inProgress?null:this.completed?this.boughtIconTemplate():this.errorIconTemplate()}errorIconTemplate(){return we``}imageTemplate(){const e=this.icon||`https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;return we` + + `}boughtIconTemplate(){return we``}};mn.styles=[et,Zt,yY];co([ie({type:Boolean})],mn.prototype,"disabled",void 0);co([ie()],mn.prototype,"color",void 0);co([ie()],mn.prototype,"label",void 0);co([ie()],mn.prototype,"purchaseValue",void 0);co([ie()],mn.prototype,"purchaseCurrency",void 0);co([ie()],mn.prototype,"date",void 0);co([ie({type:Boolean})],mn.prototype,"completed",void 0);co([ie({type:Boolean})],mn.prototype,"inProgress",void 0);co([ie({type:Boolean})],mn.prototype,"failed",void 0);co([ie()],mn.prototype,"onClick",void 0);co([ie()],mn.prototype,"symbol",void 0);co([ie()],mn.prototype,"icon",void 0);mn=co([me("wui-onramp-activity-item")],mn);const bY=We` + button { + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xs); + background-color: var(--wui-color-gray-glass-002); + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + gap: var(--wui-spacing-s); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + button:hover { + background-color: var(--wui-color-gray-glass-005); + } + + .provider-image { + width: var(--wui-spacing-3xl); + min-width: var(--wui-spacing-3xl); + height: var(--wui-spacing-3xl); + border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); + position: relative; + overflow: hidden; + } + + .provider-image::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + } + + .network-icon { + width: var(--wui-spacing-m); + height: var(--wui-spacing-m); + border-radius: calc(var(--wui-spacing-m) / 2); + overflow: hidden; + box-shadow: + 0 0 0 3px var(--wui-color-gray-glass-002), + 0 0 0 3px var(--wui-color-modal-bg); + transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: box-shadow; + } + + button:hover .network-icon { + box-shadow: + 0 0 0 3px var(--wui-color-gray-glass-005), + 0 0 0 3px var(--wui-color-modal-bg); + } +`;var Qc=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Vs=class extends qe{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return we` + + `}networksTemplate(){var i;const e=Xe.getRequestedCaipNetworks(),t=(i=e==null?void 0:e.filter(n=>n==null?void 0:n.imageId))==null?void 0:i.slice(0,5);return we` + + ${t==null?void 0:t.map(n=>we` + + + + `)} + + `}};Vs.styles=[et,Zt,bY];Qc([ie({type:Boolean})],Vs.prototype,"disabled",void 0);Qc([ie()],Vs.prototype,"color",void 0);Qc([ie()],Vs.prototype,"name",void 0);Qc([ie()],Vs.prototype,"label",void 0);Qc([ie()],Vs.prototype,"feeRange",void 0);Qc([ie({type:Boolean})],Vs.prototype,"loading",void 0);Qc([ie()],Vs.prototype,"onClick",void 0);Vs=Qc([me("wui-onramp-provider-item")],Vs);const _Y=We` + button { + display: flex; + gap: var(--wui-spacing-3xs); + align-items: center; + padding: 6.25px var(--wui-spacing-xs) 7.25px var(--wui-spacing-s); + background-color: var(--wui-color-gray-glass-090); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-color-gray-glass-060); + transition: background-color var(--wui-duration-md) var(--wui-ease-inout-power-1); + will-change: background-color; + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-gray-glass-080); + } + + button:active:enabled { + background-color: var(--wui-color-gray-glass-060); + } + } +`;var bC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ng=class extends qe{constructor(){super(...arguments),this.text=""}render(){return we``}};ng.styles=[et,Zt,_Y];bC([ie()],ng.prototype,"text",void 0);ng=bC([me("wui-promo")],ng);const xY=We` + span { + font-weight: 500; + font-size: 40px; + color: var(--wui-color-fg-100); + line-height: 130%; /* 52px */ + letter-spacing: -1.6px; + text-align: center; + } + + .pennies { + color: var(--wui-color-fg-200); + } +`;var By=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Df=class extends qe{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return we`$${this.dollars}.${this.pennies}`}};Df.styles=[et,xY];By([ie()],Df.prototype,"dollars",void 0);By([ie()],Df.prototype,"pennies",void 0);Df=By([me("wui-balance")],Df);const AY=We` + button { + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-color-gray-glass-002); + padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); + position: relative; + } + + wui-avatar { + width: 32px; + height: 32px; + box-shadow: 0 0 0 0; + outline: 3px solid var(--wui-color-gray-glass-005); + } + + wui-icon-box, + wui-image { + width: 16px; + height: 16px; + border-radius: var(--wui-border-radius-3xl); + position: absolute; + left: 26px; + top: 24px; + } + + wui-image { + outline: 2px solid var(--wui-color-bg-125); + } + + wui-icon-box { + outline: 2px solid var(--wui-color-bg-200); + background-color: var(--wui-color-bg-250); + } +`;var ad=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let jc=class extends qe{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="chevronBottom"}render(){return we``}networkImageTemplate(){return this.networkSrc?we``:we` + + `}};jc.styles=[et,Zt,AY];ad([ie()],jc.prototype,"networkSrc",void 0);ad([ie()],jc.prototype,"avatarSrc",void 0);ad([ie()],jc.prototype,"profileName",void 0);ad([ie()],jc.prototype,"address",void 0);ad([ie()],jc.prototype,"icon",void 0);jc=ad([me("wui-profile-button")],jc);const EY=We` + button { + border: none; + border-radius: var(--wui-border-radius-3xl); + } + + button[data-variant='main'] { + background-color: var(--wui-color-accent-100); + color: var(--wui-color-inverse-100); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } + + button[data-variant='accent'] { + background-color: var(--wui-color-accent-glass-010); + color: var(--wui-color-accent-100); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + } + + button[data-variant='gray'] { + background-color: transparent; + color: var(--wui-color-fg-200); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } + + button[data-variant='shade'] { + background-color: transparent; + color: var(--wui-color-accent-100); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } + + button[data-size='sm'] { + height: 32px; + padding: 0 var(--wui-spacing-s); + } + + button[data-size='md'] { + height: 40px; + padding: 0 var(--wui-spacing-l); + } + + button[data-size='sm'] > wui-image { + width: 16px; + height: 16px; + } + + button[data-size='md'] > wui-image { + width: 24px; + height: 24px; + } + + button[data-size='sm'] > wui-icon { + width: 12px; + height: 12px; + } + + button[data-size='md'] > wui-icon { + width: 14px; + height: 14px; + } + + wui-image { + border-radius: var(--wui-border-radius-3xl); + overflow: hidden; + } + + button.disabled > wui-icon, + button.disabled > wui-image { + filter: grayscale(1); + } + + button[data-variant='main'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); + } + + button[data-variant='shade'] > wui-image, + button[data-variant='gray'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } + + @media (hover: hover) and (pointer: fine) { + button[data-variant='main']:focus-visible { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='shade']:focus-visible, + button[data-variant='gray']:focus-visible, + button[data-variant='shade']:hover, + button[data-variant='gray']:hover { + background-color: var(--wui-color-gray-glass-002); + } + + button[data-variant='gray']:active, + button[data-variant='shade']:active { + background-color: var(--wui-color-gray-glass-005); + } + } + + button.disabled { + color: var(--wui-color-gray-glass-020); + background-color: var(--wui-color-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); + pointer-events: none; + } +`;var Au=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Wa=class extends qe{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){const e=this.size==="sm"?"small-600":"paragraph-600";return we` + + `}};Wa.styles=[et,Zt,EY];Au([ie()],Wa.prototype,"variant",void 0);Au([ie()],Wa.prototype,"imageSrc",void 0);Au([ie({type:Boolean})],Wa.prototype,"disabled",void 0);Au([ie()],Wa.prototype,"icon",void 0);Au([ie()],Wa.prototype,"size",void 0);Au([ie()],Wa.prototype,"text",void 0);Wa=Au([me("wui-chip-button")],Wa);const CY=We` + button { + display: flex; + gap: var(--wui-spacing-xl); + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + padding: var(--wui-spacing-m) var(--wui-spacing-s); + } + + wui-text { + width: 100%; + } + + wui-flex { + width: auto; + } + + .network-icon { + width: var(--wui-spacing-2l); + height: var(--wui-spacing-2l); + border-radius: calc(var(--wui-spacing-2l) / 2); + overflow: hidden; + box-shadow: + 0 0 0 3px var(--wui-color-gray-glass-002), + 0 0 0 3px var(--wui-color-modal-bg); + } +`;var Uy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Nf=class extends qe{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return we` + + `}networksTemplate(){const e=this.networkImages.slice(0,5);return we` + ${e==null?void 0:e.map(t=>we` `)} + `}};Nf.styles=[et,Zt,CY];Uy([ie({type:Array})],Nf.prototype,"networkImages",void 0);Uy([ie()],Nf.prototype,"text",void 0);Nf=Uy([me("wui-compatible-network")],Nf);const SY=We` + wui-flex { + width: 100%; + background-color: var(--wui-color-gray-glass-005); + border-radius: var(--wui-border-radius-s); + padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) + var(--wui-spacing-1xs); + } +`;var Ly=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let $f=class extends qe{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return we` + + + ${this.text} + + `}};$f.styles=[et,Zt,SY];Ly([ie()],$f.prototype,"icon",void 0);Ly([ie()],$f.prototype,"text",void 0);$f=Ly([me("wui-banner")],$f);const IY=We` + button { + padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); + display: flex; + justify-content: space-between; + width: 100%; + border-radius: var(--wui-border-radius-xs); + background-color: var(--wui-color-gray-glass-002); + } + + button[data-clickable='false'] { + pointer-events: none; + background-color: transparent; + } + + wui-image, + wui-icon { + width: var(--wui-spacing-3xl); + height: var(--wui-spacing-3xl); + } + + wui-image { + border-radius: var(--wui-border-radius-3xl); + } +`;var Eu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ha=class extends qe{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return we` + + `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?we``:we``}};Ha.styles=[et,Zt,IY];Eu([ie()],Ha.prototype,"tokenName",void 0);Eu([ie()],Ha.prototype,"tokenImageUrl",void 0);Eu([ie({type:Number})],Ha.prototype,"tokenValue",void 0);Eu([ie()],Ha.prototype,"tokenAmount",void 0);Eu([ie()],Ha.prototype,"tokenCurrency",void 0);Eu([ie({type:Boolean})],Ha.prototype,"clickable",void 0);Ha=Eu([me("wui-list-token")],Ha);const TY=We` + button { + width: 100%; + display: flex; + gap: var(--wui-spacing-s); + align-items: center; + justify-content: flex-start; + padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s); + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } + + wui-icon-box { + width: var(--wui-spacing-2xl); + height: var(--wui-spacing-2xl); + } + + wui-flex { + width: auto; + } +`;var Yc=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ks=class extends qe{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return we` + + `}titleTemplate(){return this.tag?we` ${this.text}${this.tag} + `:we`${this.text}`}};Ks.styles=[et,Zt,TY];Yc([ie()],Ks.prototype,"icon",void 0);Yc([ie()],Ks.prototype,"text",void 0);Yc([ie()],Ks.prototype,"description",void 0);Yc([ie()],Ks.prototype,"tag",void 0);Yc([ie()],Ks.prototype,"iconBackgroundColor",void 0);Yc([ie()],Ks.prototype,"iconColor",void 0);Yc([ie({type:Boolean})],Ks.prototype,"disabled",void 0);Ks=Yc([me("wui-list-description")],Ks);const RY=We` + :host { + position: relative; + display: inline-block; + } + + input { + background: transparent; + width: 100%; + height: auto; + font-family: var(--wui-font-family); + color: var(--wui-color-fg-100); + + font-feature-settings: 'case' on; + font-size: 32px; + font-weight: var(--wui-font-weight-light); + caret-color: var(--wui-color-accent-100); + line-height: 130%; + letter-spacing: -1.28px; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input::placeholder { + color: var(--wui-color-fg-275); + } +`,kY=/[.*+?^${}()|[\]\\]/gu,OY=/[0-9,.]/u;var xm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Bh=class extends qe{constructor(){super(...arguments),this.inputElementRef=Ey(),this.disabled=!1,this.value="",this.placeholder="0"}render(){var e;return(e=this.inputElementRef)!=null&&e.value&&this.value&&(this.inputElementRef.value.value=this.value),we` `}dispatchInputChangeEvent(e){var i,n;const t=e.data;if(t&&((i=this.inputElementRef)!=null&&i.value))if(t===","){const o=this.inputElementRef.value.value.replace(",",".");this.inputElementRef.value.value=o,this.value=`${this.value}${o}`}else OY.test(t)||(this.inputElementRef.value.value=this.value.replace(new RegExp(t.replace(kY,"\\$&"),"gu"),""));this.dispatchEvent(new CustomEvent("inputChange",{detail:(n=this.inputElementRef.value)==null?void 0:n.value,bubbles:!0,composed:!0}))}};Bh.styles=[et,Zt,RY];xm([ie({type:Boolean})],Bh.prototype,"disabled",void 0);xm([ie({type:String})],Bh.prototype,"value",void 0);xm([ie({type:String})],Bh.prototype,"placeholder",void 0);Bh=xm([me("wui-input-amount")],Bh);const PY=We` + :host { + display: flex; + gap: var(--wui-spacing-xs); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-color-gray-glass-002); + background: var(--wui-color-gray-glass-002); + padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs) + var(--wui-spacing-s); + align-items: center; + } + + wui-avatar, + wui-icon, + wui-image { + width: 32px; + height: 32px; + border: 1px solid var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + box-shadow: 0 0 0 2px var(--wui-color-gray-glass-002); + } +`;var O0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Xl=class extends qe{constructor(){super(...arguments),this.text="",this.address="",this.isAddress=!1}render(){return we`${this.text} + ${this.imageTemplate()}`}imageTemplate(){return this.isAddress?we``:this.imageSrc?we``:we``}};Xl.styles=[et,Zt,PY];O0([ie()],Xl.prototype,"text",void 0);O0([ie()],Xl.prototype,"address",void 0);O0([ie()],Xl.prototype,"imageSrc",void 0);O0([ie({type:Boolean})],Xl.prototype,"isAddress",void 0);Xl=O0([me("wui-preview-item")],Xl);const DY=We` + :host { + position: relative; + } + + button { + display: flex; + justify-content: center; + align-items: center; + height: 48px; + width: 100%; + background-color: var(--wui-color-accent-glass-010); + border-radius: var(--wui-border-radius-xs); + border: 1px solid var(--wui-color-accent-glass-010); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + wui-tooltip { + padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s); + position: absolute; + top: -8px; + left: 50%; + transform: translate(-50%, -100%); + opacity: 0; + display: none; + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-accent-glass-015); + } + + button:active:enabled { + background-color: var(--wui-color-accent-glass-020); + } + } +`;var jy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Mf=class extends qe{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return we``}};Mf.styles=[et,Zt,DY];jy([ie()],Mf.prototype,"text",void 0);jy([ie()],Mf.prototype,"icon",void 0);Mf=jy([me("wui-icon-button")],Mf);const NY=We` + button { + column-gap: var(--wui-spacing-s); + padding: 16.5px var(--wui-spacing-l) 16.5px var(--wui-spacing-xs); + width: 100%; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-100); + justify-content: center; + align-items: center; + } + + button:disabled { + background-color: var(--wui-color-gray-glass-015); + color: var(--wui-color-gray-glass-015); + } +`;var Fy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Bf=class extends qe{constructor(){super(...arguments),this.text="",this.disabled=!1}render(){return we` + + `}};Bf.styles=[et,Zt,NY];Fy([ie()],Bf.prototype,"text",void 0);Fy([ie({type:Boolean})],Bf.prototype,"disabled",void 0);Bf=Fy([me("wui-list-button")],Bf);const $Y=We` + button { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + justify-content: flex-start; + background-color: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-100); + } + + wui-text { + text-transform: capitalize; + } + + wui-text[data-align='left'] { + display: flex; + flex: 1; + } + + wui-text[data-align='center'] { + display: flex; + flex: 1; + justify-content: center; + } + + .invisible { + opacity: 0; + pointer-events: none; + } + + button:disabled { + background-color: var(--wui-color-gray-glass-015); + color: var(--wui-color-gray-glass-015); + } +`;var P0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let eu=class extends qe{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return we` + + `}templatePlacement(){return this.align==="center"?we` `:null}};eu.styles=[et,Zt,$Y];P0([ie()],eu.prototype,"logo",void 0);P0([ie()],eu.prototype,"name",void 0);P0([ie()],eu.prototype,"align",void 0);P0([ie({type:Boolean})],eu.prototype,"disabled",void 0);eu=P0([me("wui-list-social")],eu);const MY=We` + :host { + display: grid; + width: inherit; + height: inherit; + } +`;var Vo=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Bn=class extends qe{render(){return this.style.cssText=` + grid-template-rows: ${this.gridTemplateRows}; + grid-template-columns: ${this.gridTemplateColumns}; + justify-items: ${this.justifyItems}; + align-items: ${this.alignItems}; + justify-content: ${this.justifyContent}; + align-content: ${this.alignContent}; + column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; + row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; + gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; + padding-top: ${this.padding&>.getSpacingStyles(this.padding,0)}; + padding-right: ${this.padding&>.getSpacingStyles(this.padding,1)}; + padding-bottom: ${this.padding&>.getSpacingStyles(this.padding,2)}; + padding-left: ${this.padding&>.getSpacingStyles(this.padding,3)}; + margin-top: ${this.margin&>.getSpacingStyles(this.margin,0)}; + margin-right: ${this.margin&>.getSpacingStyles(this.margin,1)}; + margin-bottom: ${this.margin&>.getSpacingStyles(this.margin,2)}; + margin-left: ${this.margin&>.getSpacingStyles(this.margin,3)}; + `,we``}};Bn.styles=[et,MY];Vo([ie()],Bn.prototype,"gridTemplateRows",void 0);Vo([ie()],Bn.prototype,"gridTemplateColumns",void 0);Vo([ie()],Bn.prototype,"justifyItems",void 0);Vo([ie()],Bn.prototype,"alignItems",void 0);Vo([ie()],Bn.prototype,"justifyContent",void 0);Vo([ie()],Bn.prototype,"alignContent",void 0);Vo([ie()],Bn.prototype,"columnGap",void 0);Vo([ie()],Bn.prototype,"rowGap",void 0);Vo([ie()],Bn.prototype,"gap",void 0);Vo([ie()],Bn.prototype,"padding",void 0);Vo([ie()],Bn.prototype,"margin",void 0);Bn=Vo([me("wui-grid")],Bn);const BY=We` + :host { + position: relative; + display: flex; + width: 100%; + height: 1px; + background-color: var(--wui-color-gray-glass-005); + justify-content: center; + align-items: center; + } + + :host > wui-text { + position: absolute; + padding: 0px 10px; + background-color: var(--wui-color-modal-bg); + } +`;var _C=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let og=class extends qe{constructor(){super(...arguments),this.text=""}render(){return we`${this.template()}`}template(){return this.text?we`${this.text}`:null}};og.styles=[et,BY];_C([ie()],og.prototype,"text",void 0);og=_C([me("wui-separator")],og);const a1={interpolate(r,e,t){if(r.length!==2||e.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");const i=r[0]||0,n=r[1]||0,o=e[0]||0,s=e[1]||0;return tn?s:(s-o)/(n-i)*(t-i)+o}},UY=3,LY=["receive","deposit","borrow","claim"],jY=["withdraw","repay","burn"],Nl={getMonthName(r){const e=new Date;return e.setMonth(r),e.toLocaleString("en-US",{month:"long"})},getTransactionGroupTitle(r,e){const t=fy.getYear(),i=this.getMonthName(e);return r===t?i:`${i} ${r}`},getTransactionImages(r){const[e,t]=r,i=!!e&&(r==null?void 0:r.every(s=>!!s.nft_info)),n=(r==null?void 0:r.length)>1;return(r==null?void 0:r.length)===2&&!i?[this.getTransactionImage(e),this.getTransactionImage(t)]:n?r.map(s=>this.getTransactionImage(s)):[this.getTransactionImage(e)]},getTransactionImage(r){return{type:Nl.getTransactionTransferTokenType(r),url:Nl.getTransactionImageURL(r)}},getTransactionImageURL(r){var n,o,s,a,u;let e;const t=!!(r!=null&&r.nft_info),i=!!(r!=null&&r.fungible_info);return r&&t?e=(s=(o=(n=r==null?void 0:r.nft_info)==null?void 0:n.content)==null?void 0:o.preview)==null?void 0:s.url:r&&i&&(e=(u=(a=r==null?void 0:r.fungible_info)==null?void 0:a.icon)==null?void 0:u.url),e},getTransactionTransferTokenType(r){if(r!=null&&r.fungible_info)return"FUNGIBLE";if(r!=null&&r.nft_info)return"NFT"},getTransactionDescriptions(r){var p,v,b;const e=(p=r==null?void 0:r.metadata)==null?void 0:p.operationType,t=r==null?void 0:r.transfers,i=((v=r==null?void 0:r.transfers)==null?void 0:v.length)>0,n=((b=r==null?void 0:r.transfers)==null?void 0:b.length)>1,o=i&&(t==null?void 0:t.every(I=>!!(I!=null&&I.fungible_info))),[s,a]=t;let u=this.getTransferDescription(s),h=this.getTransferDescription(a);if(!i)return(e==="send"||e==="receive")&&o?(u=gt.getTruncateString({string:r==null?void 0:r.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),h=gt.getTruncateString({string:r==null?void 0:r.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[u,h]):[r.metadata.status];if(n)return t.map(I=>this.getTransferDescription(I));let d="";return LY.includes(e)?d="+":jY.includes(e)&&(d="-"),u=d.concat(u),[u]},getTransferDescription(r){var t;let e="";return r&&(r!=null&&r.nft_info?e=((t=r==null?void 0:r.nft_info)==null?void 0:t.name)||"-":r!=null&&r.fungible_info&&(e=this.getFungibleTransferDescription(r)||"-")),e},getFungibleTransferDescription(r){var i;return r?[this.getQuantityFixedValue(r==null?void 0:r.quantity.numeric),(i=r==null?void 0:r.fungible_info)==null?void 0:i.symbol].join(" ").trim():null},getQuantityFixedValue(r){return r?parseFloat(r).toFixed(UY):null}};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const S1=globalThis,zy=S1.ShadowRoot&&(S1.ShadyCSS===void 0||S1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Wy=Symbol(),X8=new WeakMap;let xC=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Wy)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(zy&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=X8.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&X8.set(t,e))}return e}toString(){return this.cssText}};const FY=r=>new xC(typeof r=="string"?r:r+"",void 0,Wy),ct=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((i,n,o)=>i+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+r[o+1],r[0]);return new xC(t,r,Wy)},zY=(r,e)=>{if(zy)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),n=S1.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,r.appendChild(i)}},e_=zy?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return FY(t)})(r):r;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:WY,defineProperty:HY,getOwnPropertyDescriptor:qY,getOwnPropertyNames:VY,getOwnPropertySymbols:KY,getPrototypeOf:GY}=Object,Nc=globalThis,t_=Nc.trustedTypes,ZY=t_?t_.emptyScript:"",Zv=Nc.reactiveElementPolyfillSupport,af=(r,e)=>r,sg={toAttribute(r,e){switch(e){case Boolean:r=r?ZY:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Hy=(r,e)=>!WY(r,e),r_={attribute:!0,type:String,converter:sg,reflect:!1,hasChanged:Hy};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Nc.litPropertyMetadata??(Nc.litPropertyMetadata=new WeakMap);class rh extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=r_){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&HY(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:o}=qY(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get(){return n==null?void 0:n.call(this)},set(s){const a=n==null?void 0:n.call(this);o.call(this,s),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??r_}static _$Ei(){if(this.hasOwnProperty(af("elementProperties")))return;const e=GY(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(af("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(af("properties"))){const t=this.properties,i=[...VY(t),...KY(t)];for(const n of i)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)t.unshift(e_(n))}else e!==void 0&&t.push(e_(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return zY(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var o;const i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){const s=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:sg).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){var o;const i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){const s=i.getPropertyOptions(n),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((o=s.converter)==null?void 0:o.fromAttribute)!==void 0?s.converter:sg;this._$Em=n,this[n]=a.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Hy)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[o,s]of n)s.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],s)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EU()}catch(n){throw e=!1,this._$EU(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}rh.elementStyles=[],rh.shadowRootOptions={mode:"open"},rh[af("elementProperties")]=new Map,rh[af("finalized")]=new Map,Zv==null||Zv({ReactiveElement:rh}),(Nc.reactiveElementVersions??(Nc.reactiveElementVersions=[])).push("2.0.4");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const cf=globalThis,ag=cf.trustedTypes,i_=ag?ag.createPolicy("lit-html",{createHTML:r=>r}):void 0,AC="$lit$",Cc=`lit$${Math.random().toFixed(9).slice(2)}$`,EC="?"+Cc,QY=`<${EC}>`,tu=document,Uf=()=>tu.createComment(""),Lf=r=>r===null||typeof r!="object"&&typeof r!="function",CC=Array.isArray,YY=r=>CC(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",Qv=`[ +\f\r]`,Wd=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,n_=/-->/g,o_=/>/g,Tl=RegExp(`>|${Qv}(?:([^\\s"'>=/]+)(${Qv}*=${Qv}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),s_=/'/g,a_=/"/g,SC=/^(?:script|style|textarea|title)$/i,JY=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),te=JY(1),Uh=Symbol.for("lit-noChange"),ci=Symbol.for("lit-nothing"),c_=new WeakMap,$l=tu.createTreeWalker(tu,129);function IC(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return i_!==void 0?i_.createHTML(e):e}const XY=(r,e)=>{const t=r.length-1,i=[];let n,o=e===2?"":"",s=Wd;for(let a=0;a"?(s=n??Wd,p=-1):d[1]===void 0?p=-2:(p=s.lastIndex-d[2].length,h=d[1],s=d[3]===void 0?Tl:d[3]==='"'?a_:s_):s===a_||s===s_?s=Tl:s===n_||s===o_?s=Wd:(s=Tl,n=void 0);const b=s===Tl&&r[a+1].startsWith("/>")?" ":"";o+=s===Wd?u+QY:p>=0?(i.push(h),u.slice(0,p)+AC+u.slice(p)+Cc+b):u+Cc+(p===-2?a:b)}return[IC(r,o+(r[t]||"")+(e===2?"":"")),i]};class jf{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let o=0,s=0;const a=e.length-1,u=this.parts,[h,d]=XY(e,t);if(this.el=jf.createElement(h,i),$l.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=$l.nextNode())!==null&&u.length0){n.textContent=ag?ag.emptyScript:"";for(let b=0;b2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ci}_$AI(e,t=this,i,n){const o=this.strings;let s=!1;if(o===void 0)e=Lh(this,e,t,0),s=!Lf(e)||e!==this._$AH&&e!==Uh,s&&(this._$AH=e);else{const a=e;let u,h;for(e=o[0],u=0;u{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const o=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new D0(e.insertBefore(Uf(),o),o,void 0,t??{})}return n._$AI(r),n};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let Me=class extends rh{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=oJ(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Uh}};var Y_;Me._$litElement$=!0,Me.finalized=!0,(Y_=globalThis.litElementHydrateSupport)==null||Y_.call(globalThis,{LitElement:Me});const Jv=globalThis.litElementPolyfillSupport;Jv==null||Jv({LitElement:Me});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.6");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const sJ={attribute:!0,type:String,converter:sg,reflect:!1,hasChanged:Hy},aJ=(r=sJ,e,t)=>{const{kind:i,metadata:n}=t;let o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),o.set(t.name,r),i==="accessor"){const{name:s}=t;return{set(a){const u=e.get.call(this);e.set.call(this,a),this.requestUpdate(s,u,r)},init(a){return a!==void 0&&this.P(s,void 0,r),a}}}if(i==="setter"){const{name:s}=t;return function(a){const u=this[s];e.call(this,a),this.requestUpdate(s,u,r)}}throw Error("Unsupported decorator location: "+i)};function St(r){return(e,t)=>typeof t=="object"?aJ(r,e,t):((i,n,o)=>{const s=n.hasOwnProperty(o);return n.constructor.createProperty(o,s?{...i,wrapped:!0}:i),s?Object.getOwnPropertyDescriptor(n,o):void 0})(r,e,t)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function ce(r){return St({...r,state:!0,attribute:!1})}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ft=r=>r??ci;var Ko=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let to=class extends Me{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.address=Pe.state.address,this.balanceVal=Pe.state.balance,this.balanceSymbol=Pe.state.balanceSymbol,this.profileName=Pe.state.profileName,this.profileImage=Pe.state.profileImage,this.network=Xe.state.caipNetwork,this.isUnsupportedChain=Xe.state.isUnsupportedChain,this.unsubscribe.push(Pe.subscribe(e=>{e.isConnected?(this.address=e.address,this.balanceVal=e.balance,this.profileName=e.profileName,this.profileImage=e.profileImage,this.balanceSymbol=e.balanceSymbol):(this.address="",this.balanceVal="",this.profileName="",this.profileImage="",this.balanceSymbol="")}),Xe.subscribeKey("caipNetwork",e=>this.network=e),Xe.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=xr.getNetworkImage(this.network),t=this.balance==="show";return te` + + + `}onClick(){this.isUnsupportedChain?yt.open({view:"UnsupportedChain"}):yt.open()}};Ko([St({type:Boolean})],to.prototype,"disabled",void 0);Ko([St()],to.prototype,"balance",void 0);Ko([St()],to.prototype,"charsStart",void 0);Ko([St()],to.prototype,"charsEnd",void 0);Ko([ce()],to.prototype,"address",void 0);Ko([ce()],to.prototype,"balanceVal",void 0);Ko([ce()],to.prototype,"balanceSymbol",void 0);Ko([ce()],to.prototype,"profileName",void 0);Ko([ce()],to.prototype,"profileImage",void 0);Ko([ce()],to.prototype,"network",void 0);Ko([ce()],to.prototype,"isUnsupportedChain",void 0);to=Ko([me("w3m-account-button")],to);const cJ=ct` + :host { + display: block; + width: max-content; + } +`;var sa=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Wo=class extends Me{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.isAccount=Pe.state.isConnected,this.isLoading=yt.state.loading,this.unsubscribe.push(Pe.subscribeKey("isConnected",e=>{this.isAccount=e}),yt.subscribeKey("loading",e=>{this.isLoading=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.isAccount&&!this.isLoading?te` + + + `:te` + + `}};Wo.styles=cJ;sa([St({type:Boolean})],Wo.prototype,"disabled",void 0);sa([St()],Wo.prototype,"balance",void 0);sa([St()],Wo.prototype,"size",void 0);sa([St()],Wo.prototype,"label",void 0);sa([St()],Wo.prototype,"loadingLabel",void 0);sa([St()],Wo.prototype,"charsStart",void 0);sa([St()],Wo.prototype,"charsEnd",void 0);sa([ce()],Wo.prototype,"isAccount",void 0);sa([ce()],Wo.prototype,"isLoading",void 0);Wo=sa([me("w3m-button")],Wo);var cd=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ru=class extends Me{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=yt.state.open,this.loading=yt.state.loading,this.unsubscribe.push(yt.subscribe(e=>{this.open=e.open,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.loading||this.open;return te` + + ${e?this.loadingLabel:this.label} + + `}onClick(){this.open?yt.close():this.loading||yt.open()}};cd([St()],ru.prototype,"size",void 0);cd([St()],ru.prototype,"label",void 0);cd([St()],ru.prototype,"loadingLabel",void 0);cd([ce()],ru.prototype,"open",void 0);cd([ce()],ru.prototype,"loading",void 0);ru=cd([me("w3m-connect-button")],ru);const lJ=ct` + :host { + z-index: var(--w3m-z-index); + display: block; + backface-visibility: hidden; + will-change: opacity; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + pointer-events: none; + opacity: 0; + background-color: var(--wui-cover); + transition: opacity 0.2s var(--wui-ease-out-power-2); + will-change: opacity; + } + + :host(.open) { + opacity: 1; + } + + @keyframes zoom-in { + 0% { + transform: scale(0.95) translateY(0); + } + 100% { + transform: scale(1) translateY(0); + } + } + + @keyframes slide-in { + 0% { + transform: scale(1) translateY(50px); + } + 100% { + transform: scale(1) translateY(0); + } + } + + wui-card { + max-width: var(--w3m-modal-width); + width: 100%; + position: relative; + animation-duration: 0.2s; + animation-name: zoom-in; + animation-fill-mode: backwards; + animation-timing-function: var(--wui-ease-out-power-2); + outline: none; + } + + wui-flex { + overflow-x: hidden; + overflow-y: auto; + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + } + + @media (max-height: 700px) and (min-width: 431px) { + wui-flex { + align-items: flex-start; + } + + wui-card { + margin: var(--wui-spacing-xxl) 0px; + } + } + + @media (max-width: 430px) { + wui-flex { + align-items: flex-end; + } + + wui-card { + max-width: 100%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom: none; + animation-name: slide-in; + } + } +`;var ld=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const l_="scroll-lock";let qa=class extends Me{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.open=yt.state.open,this.caipAddress=Pe.state.caipAddress,this.isSiweEnabled=nt.state.isSiweEnabled,this.connected=Pe.state.isConnected,this.loading=yt.state.loading,this.initializeTheming(),Tt.prefetch(),this.unsubscribe.push(yt.subscribeKey("open",e=>e?this.onOpen():this.onClose()),yt.subscribeKey("loading",e=>{this.loading=e,this.onNewAddress(Pe.state.caipAddress)}),Pe.subscribeKey("isConnected",e=>this.connected=e),Pe.subscribeKey("caipAddress",e=>this.onNewAddress(e)),nt.subscribeKey("isSiweEnabled",e=>this.isSiweEnabled=e)),bt.sendEvent({type:"track",event:"MODAL_LOADED"})}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.open?te` + + + + + + + + + `:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Bo(()=>import("./index.CaJWFNre.js"),[],import.meta.url);e.state.status!=="success"&&await vt.disconnect()}yt.close()}initializeTheming(){const{themeVariables:e,themeMode:t}=oi.state,i=gt.getColorTheme(t);CK(e,i)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),$t.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=l_,e.textContent=` + html, body { + touch-action: none; + overflow: hidden; + overscroll-behavior: contain; + } + w3m-modal { + pointer-events: auto; + } + `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${l_}"]`);e&&e.remove()}onAddKeyboardListener(){var t;this.abortController=new AbortController;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",i=>{if(i.key==="Escape")this.handleClose();else if(i.key==="Tab"){const{tagName:n}=i.target;n&&!n.includes("W3M-")&&!n.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}async onNewAddress(e){var s,a;if(!this.connected||this.loading)return;const t=$e.getPlainAddress(this.caipAddress),i=$e.getPlainAddress(e),n=$e.getNetworkId(this.caipAddress),o=$e.getNetworkId(e);if(this.caipAddress=e,this.isSiweEnabled){const{SIWEController:u}=await Bo(()=>import("./index.CaJWFNre.js"),[],import.meta.url),h=await u.getSession();if(h&&t&&i&&t!==i){(s=u.state._client)!=null&&s.options.signOutOnAccountChange&&(await u.signOut(),this.onSiweNavigation());return}if(h&&n&&o&&n!==o){(a=u.state._client)!=null&&a.options.signOutOnNetworkChange&&(await u.signOut(),this.onSiweNavigation());return}this.onSiweNavigation()}}onSiweNavigation(){this.open?_e.push("ConnectingSiwe"):yt.open({view:"ConnectingSiwe"})}};qa.styles=lJ;ld([ce()],qa.prototype,"open",void 0);ld([ce()],qa.prototype,"caipAddress",void 0);ld([ce()],qa.prototype,"isSiweEnabled",void 0);ld([ce()],qa.prototype,"connected",void 0);ld([ce()],qa.prototype,"loading",void 0);qa=ld([me("w3m-modal")],qa);const uJ=Object.freeze(Object.defineProperty({__proto__:null,get W3mModal(){return qa}},Symbol.toStringTag,{value:"Module"})),hJ=ct` + :host { + display: block; + width: max-content; + } +`;var ud=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Fc=class extends Me{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=Xe.state.caipNetwork,this.connected=Pe.state.isConnected,this.loading=yt.state.loading,this.isUnsupportedChain=Xe.state.isUnsupportedChain,this.unsubscribe.push(Xe.subscribeKey("caipNetwork",e=>this.network=e),Pe.subscribeKey("isConnected",e=>this.connected=e),yt.subscribeKey("loading",e=>this.loading=e),Xe.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return te` + + ${this.isUnsupportedChain?"Switch Network":((e=this.network)==null?void 0:e.name)??(this.connected?"Unknown Network":"Select Network")} + + `}onClick(){this.loading||(bt.sendEvent({type:"track",event:"CLICK_NETWORKS"}),yt.open({view:"Networks"}))}};Fc.styles=hJ;ud([St({type:Boolean})],Fc.prototype,"disabled",void 0);ud([ce()],Fc.prototype,"network",void 0);ud([ce()],Fc.prototype,"connected",void 0);ud([ce()],Fc.prototype,"loading",void 0);ud([ce()],Fc.prototype,"isUnsupportedChain",void 0);Fc=ud([me("w3m-network-button")],Fc);const dJ=ct` + :host { + display: block; + will-change: transform, opacity; + } +`;var TC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let cg=class extends Me{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=_e.state.view,this.unsubscribe.push(_e.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(async([e])=>{const t=`${e==null?void 0:e.contentRect.height}px`;this.prevHeight!=="0px"&&(await this.animate([{height:this.prevHeight},{height:t}],{duration:150,easing:"ease",fill:"forwards"}).finished,this.style.height="auto"),this.prevHeight=t}),this.resizeObserver.observe(this.getWrapper())}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.unobserve(this.getWrapper()),this.unsubscribe.forEach(t=>t())}render(){return te`
${this.viewTemplate()}
`}viewTemplate(){switch(this.view){case"Account":return te``;case"AccountSettings":return te``;case"AllWallets":return te``;case"ApproveTransaction":return te``;case"BuyInProgress":return te``;case"ChooseAccountName":return te``;case"Connect":return te``;case"ConnectingWalletConnect":return te``;case"ConnectingExternal":return te``;case"ConnectingSiwe":return te``;case"ConnectWallets":return te``;case"ConnectSocials":return te``;case"ConnectingSocial":return te``;case"Downloads":return te``;case"EmailVerifyOtp":return te``;case"EmailVerifyDevice":return te``;case"Networks":return te``;case"RegisterAccountName":return te``;case"RegisterAccountNameSuccess":return te``;case"SwitchNetwork":return te``;case"GetWallet":return te``;case"Transactions":return te``;case"OnRampProviders":return te``;case"OnRampActivity":return te``;case"OnRampTokenSelect":return te``;case"OnRampFiatSelect":return te``;case"UpgradeEmailWallet":return te``;case"UpgradeToSmartAccount":return te``;case"UpdateEmailWallet":return te``;case"UpdateEmailPrimaryOtp":return te``;case"UpdateEmailSecondaryOtp":return te``;case"UnsupportedChain":return te``;case"WalletReceive":return te``;case"WalletCompatibleNetworks":return te``;case"Swap":return te``;case"SwapSelectToken":return te``;case"SwapPreview":return te``;case"WalletSend":return te``;case"WalletSendSelectToken":return te``;case"WalletSendPreview":return te``;case"WhatIsABuy":return te``;case"WhatIsANetwork":return te``;case"WhatIsAWallet":return te``;default:return te``}}async onViewChange(e){Gn.hide();const{history:t}=_e.state;let i=-10,n=10;t.length wui-flex { + width: 100%; + max-width: 360px; + } + + :host > wui-flex > wui-flex { + border-radius: var(--wui-border-radius-l); + width: 100%; + } + + .amounts-container { + width: 100%; + } +`;var Jc=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const pJ={USD:"$",EUR:"€",GBP:"£"},gJ=[100,250,500,1e3];let Gs=class extends Me{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.connected=Pe.state.isConnected,this.loading=yt.state.loading,this.paymentCurrency=br.state.paymentCurrency,this.paymentAmount=br.state.paymentAmount,this.purchaseAmount=br.state.purchaseAmount,this.quoteLoading=br.state.quotesLoading,this.unsubscribe.push(Pe.subscribeKey("isConnected",e=>{this.connected=e}),yt.subscribeKey("loading",e=>{this.loading=e}),br.subscribe(e=>{this.paymentCurrency=e.paymentCurrency,this.paymentAmount=e.paymentAmount,this.purchaseAmount=e.purchaseAmount,this.quoteLoading=e.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` + + + + + + ${gJ.map(e=>{var t;return te`this.selectPresetAmount(e)} + >${`${pJ[((t=this.paymentCurrency)==null?void 0:t.id)||"USD"]} ${e}`}`})} + + ${this.templateButton()} + + + `}templateButton(){return this.connected?te` + Get quotes + `:te` + Connect wallet + `}getQuotes(){this.loading||yt.open({view:"OnRampProviders"})}openModal(){yt.open({view:"Connect"})}async onPaymentAmountChange(e){br.setPaymentAmount(Number(e.detail)),await br.getQuote()}async selectPresetAmount(e){br.setPaymentAmount(e),await br.getQuote()}};Gs.styles=fJ;Jc([St({type:Boolean})],Gs.prototype,"disabled",void 0);Jc([ce()],Gs.prototype,"connected",void 0);Jc([ce()],Gs.prototype,"loading",void 0);Jc([ce()],Gs.prototype,"paymentCurrency",void 0);Jc([ce()],Gs.prototype,"paymentAmount",void 0);Jc([ce()],Gs.prototype,"purchaseAmount",void 0);Jc([ce()],Gs.prototype,"quoteLoading",void 0);Gs=Jc([me("w3m-onramp-widget")],Gs);const mJ=ct` + wui-flex { + width: 100%; + } + + wui-icon-link { + margin-right: calc(var(--wui-icon-box-size-md) * -1); + } + + .account-links { + display: flex; + justify-content: space-between; + align-items: center; + } + + .account-links wui-flex { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + flex: 1; + background: red; + align-items: center; + justify-content: center; + height: 48px; + padding: 10px; + flex: 1 0 0; + + border-radius: var(--XS, 16px); + border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + .account-links wui-flex:hover { + background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); + } + + .account-links wui-flex wui-icon { + width: var(--S, 20px); + height: var(--S, 20px); + } + + .account-links wui-flex wui-icon svg path { + stroke: #47a1ff; + } +`;var RC={},Em={};Em.byteLength=yJ;Em.toByteArray=_J;Em.fromByteArray=EJ;var Us=[],No=[],wJ=typeof Uint8Array<"u"?Uint8Array:Array,Xv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Yu=0,vJ=Xv.length;Yu0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}function yJ(r){var e=kC(r),t=e[0],i=e[1];return(t+i)*3/4-i}function bJ(r,e,t){return(e+t)*3/4-t}function _J(r){var e,t=kC(r),i=t[0],n=t[1],o=new wJ(bJ(r,i,n)),s=0,a=n>0?i-4:i,u;for(u=0;u>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=No[r.charCodeAt(u)]<<2|No[r.charCodeAt(u+1)]>>4,o[s++]=e&255),n===1&&(e=No[r.charCodeAt(u)]<<10|No[r.charCodeAt(u+1)]<<4|No[r.charCodeAt(u+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function xJ(r){return Us[r>>18&63]+Us[r>>12&63]+Us[r>>6&63]+Us[r&63]}function AJ(r,e,t){for(var i,n=[],o=e;oa?a:s+o));return i===1?(e=r[t-1],n.push(Us[e>>2]+Us[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(Us[e>>10]+Us[e>>4&63]+Us[e<<2&63]+"=")),n.join("")}var qy={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */qy.read=function(r,e,t,i,n){var o,s,a=n*8-i-1,u=(1<>1,d=-7,p=t?n-1:0,v=t?-1:1,b=r[e+p];for(p+=v,o=b&(1<<-d)-1,b>>=-d,d+=a;d>0;o=o*256+r[e+p],p+=v,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=i;d>0;s=s*256+r[e+p],p+=v,d-=8);if(o===0)o=1-h;else{if(o===u)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-h}return(b?-1:1)*s*Math.pow(2,o-i)};qy.write=function(r,e,t,i,n,o){var s,a,u,h=o*8-n-1,d=(1<>1,v=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=i?0:o-1,I=i?1:-1,L=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+p>=1?e+=v/u:e+=v*Math.pow(2,1-p),e*u>=2&&(s++,u/=2),s+p>=d?(a=0,s=d):s+p>=1?(a=(e*u-1)*Math.pow(2,n),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,n),s=0));n>=8;r[t+b]=a&255,b+=I,a/=256,n-=8);for(s=s<0;r[t+b]=s&255,b+=I,s/=256,h-=8);r[t+b-I]|=L*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(r){const e=Em,t=qy,i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=a,r.SlowBuffer=P,r.INSPECT_MAX_BYTES=50;const n=2147483647;r.kMaxLength=n,a.TYPED_ARRAY_SUPPORT=o(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function o(){try{const W=new Uint8Array(1),A={foo:function(){return 42}};return Object.setPrototypeOf(A,Uint8Array.prototype),Object.setPrototypeOf(W,A),W.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(W){if(W>n)throw new RangeError('The value "'+W+'" is invalid for option "size"');const A=new Uint8Array(W);return Object.setPrototypeOf(A,a.prototype),A}function a(W,A,T){if(typeof W=="number"){if(typeof A=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(W)}return u(W,A,T)}a.poolSize=8192;function u(W,A,T){if(typeof W=="string")return v(W,A);if(ArrayBuffer.isView(W))return I(W);if(W==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof W);if(ze(W,ArrayBuffer)||W&&ze(W.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ze(W,SharedArrayBuffer)||W&&ze(W.buffer,SharedArrayBuffer)))return L(W,A,T);if(typeof W=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Q=W.valueOf&&W.valueOf();if(Q!=null&&Q!==W)return a.from(Q,A,T);const se=$(W);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof W[Symbol.toPrimitive]=="function")return a.from(W[Symbol.toPrimitive]("string"),A,T);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof W)}a.from=function(W,A,T){return u(W,A,T)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function h(W){if(typeof W!="number")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 d(W,A,T){return h(W),W<=0?s(W):A!==void 0?typeof T=="string"?s(W).fill(A,T):s(W).fill(A):s(W)}a.alloc=function(W,A,T){return d(W,A,T)};function p(W){return h(W),s(W<0?0:K(W)|0)}a.allocUnsafe=function(W){return p(W)},a.allocUnsafeSlow=function(W){return p(W)};function v(W,A){if((typeof A!="string"||A==="")&&(A="utf8"),!a.isEncoding(A))throw new TypeError("Unknown encoding: "+A);const T=q(W,A)|0;let Q=s(T);const se=Q.write(W,A);return se!==T&&(Q=Q.slice(0,se)),Q}function b(W){const A=W.length<0?0:K(W.length)|0,T=s(A);for(let Q=0;Q=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return W|0}function P(W){return+W!=W&&(W=0),a.alloc(+W)}a.isBuffer=function(A){return A!=null&&A._isBuffer===!0&&A!==a.prototype},a.compare=function(A,T){if(ze(A,Uint8Array)&&(A=a.from(A,A.offset,A.byteLength)),ze(T,Uint8Array)&&(T=a.from(T,T.offset,T.byteLength)),!a.isBuffer(A)||!a.isBuffer(T))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(A===T)return 0;let Q=A.length,se=T.length;for(let ue=0,ye=Math.min(Q,se);uese.length?(a.isBuffer(ye)||(ye=a.from(ye)),ye.copy(se,ue)):Uint8Array.prototype.set.call(se,ye,ue);else if(a.isBuffer(ye))ye.copy(se,ue);else throw new TypeError('"list" argument must be an Array of Buffers');ue+=ye.length}return se};function q(W,A){if(a.isBuffer(W))return W.length;if(ArrayBuffer.isView(W)||ze(W,ArrayBuffer))return W.byteLength;if(typeof W!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof W);const T=W.length,Q=arguments.length>2&&arguments[2]===!0;if(!Q&&T===0)return 0;let se=!1;for(;;)switch(A){case"ascii":case"latin1":case"binary":return T;case"utf8":case"utf-8":return Ge(W).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T*2;case"hex":return T>>>1;case"base64":return Qe(W).length;default:if(se)return Q?-1:Ge(W).length;A=(""+A).toLowerCase(),se=!0}}a.byteLength=q;function D(W,A,T){let Q=!1;if((A===void 0||A<0)&&(A=0),A>this.length||((T===void 0||T>this.length)&&(T=this.length),T<=0)||(T>>>=0,A>>>=0,T<=A))return"";for(W||(W="utf8");;)switch(W){case"hex":return B(this,A,T);case"utf8":case"utf-8":return g(this,A,T);case"ascii":return R(this,A,T);case"latin1":case"binary":return k(this,A,T);case"base64":return m(this,A,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,A,T);default:if(Q)throw new TypeError("Unknown encoding: "+W);W=(W+"").toLowerCase(),Q=!0}}a.prototype._isBuffer=!0;function U(W,A,T){const Q=W[A];W[A]=W[T],W[T]=Q}a.prototype.swap16=function(){const A=this.length;if(A%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let T=0;TT&&(A+=" ... "),""},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(A,T,Q,se,ue){if(ze(A,Uint8Array)&&(A=a.from(A,A.offset,A.byteLength)),!a.isBuffer(A))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof A);if(T===void 0&&(T=0),Q===void 0&&(Q=A?A.length:0),se===void 0&&(se=0),ue===void 0&&(ue=this.length),T<0||Q>A.length||se<0||ue>this.length)throw new RangeError("out of range index");if(se>=ue&&T>=Q)return 0;if(se>=ue)return-1;if(T>=Q)return 1;if(T>>>=0,Q>>>=0,se>>>=0,ue>>>=0,this===A)return 0;let ye=ue-se,Oe=Q-T;const Le=Math.min(ye,Oe),kt=this.slice(se,ue),at=A.slice(T,Q);for(let st=0;st2147483647?T=2147483647:T<-2147483648&&(T=-2147483648),T=+T,Ke(T)&&(T=se?0:W.length-1),T<0&&(T=W.length+T),T>=W.length){if(se)return-1;T=W.length-1}else if(T<0)if(se)T=0;else return-1;if(typeof A=="string"&&(A=a.from(A,Q)),a.isBuffer(A))return A.length===0?-1:_(W,A,T,Q,se);if(typeof A=="number")return A=A&255,typeof Uint8Array.prototype.indexOf=="function"?se?Uint8Array.prototype.indexOf.call(W,A,T):Uint8Array.prototype.lastIndexOf.call(W,A,T):_(W,[A],T,Q,se);throw new TypeError("val must be string, number or Buffer")}function _(W,A,T,Q,se){let ue=1,ye=W.length,Oe=A.length;if(Q!==void 0&&(Q=String(Q).toLowerCase(),Q==="ucs2"||Q==="ucs-2"||Q==="utf16le"||Q==="utf-16le")){if(W.length<2||A.length<2)return-1;ue=2,ye/=2,Oe/=2,T/=2}function Le(at,st){return ue===1?at[st]:at.readUInt16BE(st*ue)}let kt;if(se){let at=-1;for(kt=T;ktye&&(T=ye-Oe),kt=T;kt>=0;kt--){let at=!0;for(let st=0;stse&&(Q=se)):Q=se;const ue=A.length;Q>ue/2&&(Q=ue/2);let ye;for(ye=0;ye>>0,isFinite(Q)?(Q=Q>>>0,se===void 0&&(se="utf8")):(se=Q,Q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ue=this.length-T;if((Q===void 0||Q>ue)&&(Q=ue),A.length>0&&(Q<0||T<0)||T>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let ye=!1;for(;;)switch(se){case"hex":return x(this,A,T,Q);case"utf8":case"utf-8":return M(this,A,T,Q);case"ascii":case"latin1":case"binary":return j(this,A,T,Q);case"base64":return V(this,A,T,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,A,T,Q);default:if(ye)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),ye=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function m(W,A,T){return A===0&&T===W.length?e.fromByteArray(W):e.fromByteArray(W.slice(A,T))}function g(W,A,T){T=Math.min(W.length,T);const Q=[];let se=A;for(;se239?4:ue>223?3:ue>191?2:1;if(se+Oe<=T){let Le,kt,at,st;switch(Oe){case 1:ue<128&&(ye=ue);break;case 2:Le=W[se+1],(Le&192)===128&&(st=(ue&31)<<6|Le&63,st>127&&(ye=st));break;case 3:Le=W[se+1],kt=W[se+2],(Le&192)===128&&(kt&192)===128&&(st=(ue&15)<<12|(Le&63)<<6|kt&63,st>2047&&(st<55296||st>57343)&&(ye=st));break;case 4:Le=W[se+1],kt=W[se+2],at=W[se+3],(Le&192)===128&&(kt&192)===128&&(at&192)===128&&(st=(ue&15)<<18|(Le&63)<<12|(kt&63)<<6|at&63,st>65535&&st<1114112&&(ye=st))}}ye===null?(ye=65533,Oe=1):ye>65535&&(ye-=65536,Q.push(ye>>>10&1023|55296),ye=56320|ye&1023),Q.push(ye),se+=Oe}return C(Q)}const w=4096;function C(W){const A=W.length;if(A<=w)return String.fromCharCode.apply(String,W);let T="",Q=0;for(;QQ)&&(T=Q);let se="";for(let ue=A;ueQ&&(A=Q),T<0?(T+=Q,T<0&&(T=0)):T>Q&&(T=Q),TT)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(A,T,Q){A=A>>>0,T=T>>>0,Q||y(A,T,this.length);let se=this[A],ue=1,ye=0;for(;++ye>>0,T=T>>>0,Q||y(A,T,this.length);let se=this[A+--T],ue=1;for(;T>0&&(ue*=256);)se+=this[A+--T]*ue;return se},a.prototype.readUint8=a.prototype.readUInt8=function(A,T){return A=A>>>0,T||y(A,1,this.length),this[A]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(A,T){return A=A>>>0,T||y(A,2,this.length),this[A]|this[A+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(A,T){return A=A>>>0,T||y(A,2,this.length),this[A]<<8|this[A+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(A,T){return A=A>>>0,T||y(A,4,this.length),(this[A]|this[A+1]<<8|this[A+2]<<16)+this[A+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(A,T){return A=A>>>0,T||y(A,4,this.length),this[A]*16777216+(this[A+1]<<16|this[A+2]<<8|this[A+3])},a.prototype.readBigUInt64LE=Fe(function(A){A=A>>>0,Ee(A,"offset");const T=this[A],Q=this[A+7];(T===void 0||Q===void 0)&&Ce(A,this.length-8);const se=T+this[++A]*2**8+this[++A]*2**16+this[++A]*2**24,ue=this[++A]+this[++A]*2**8+this[++A]*2**16+Q*2**24;return BigInt(se)+(BigInt(ue)<>>0,Ee(A,"offset");const T=this[A],Q=this[A+7];(T===void 0||Q===void 0)&&Ce(A,this.length-8);const se=T*2**24+this[++A]*2**16+this[++A]*2**8+this[++A],ue=this[++A]*2**24+this[++A]*2**16+this[++A]*2**8+Q;return(BigInt(se)<>>0,T=T>>>0,Q||y(A,T,this.length);let se=this[A],ue=1,ye=0;for(;++ye=ue&&(se-=Math.pow(2,8*T)),se},a.prototype.readIntBE=function(A,T,Q){A=A>>>0,T=T>>>0,Q||y(A,T,this.length);let se=T,ue=1,ye=this[A+--se];for(;se>0&&(ue*=256);)ye+=this[A+--se]*ue;return ue*=128,ye>=ue&&(ye-=Math.pow(2,8*T)),ye},a.prototype.readInt8=function(A,T){return A=A>>>0,T||y(A,1,this.length),this[A]&128?(255-this[A]+1)*-1:this[A]},a.prototype.readInt16LE=function(A,T){A=A>>>0,T||y(A,2,this.length);const Q=this[A]|this[A+1]<<8;return Q&32768?Q|4294901760:Q},a.prototype.readInt16BE=function(A,T){A=A>>>0,T||y(A,2,this.length);const Q=this[A+1]|this[A]<<8;return Q&32768?Q|4294901760:Q},a.prototype.readInt32LE=function(A,T){return A=A>>>0,T||y(A,4,this.length),this[A]|this[A+1]<<8|this[A+2]<<16|this[A+3]<<24},a.prototype.readInt32BE=function(A,T){return A=A>>>0,T||y(A,4,this.length),this[A]<<24|this[A+1]<<16|this[A+2]<<8|this[A+3]},a.prototype.readBigInt64LE=Fe(function(A){A=A>>>0,Ee(A,"offset");const T=this[A],Q=this[A+7];(T===void 0||Q===void 0)&&Ce(A,this.length-8);const se=this[A+4]+this[A+5]*2**8+this[A+6]*2**16+(Q<<24);return(BigInt(se)<>>0,Ee(A,"offset");const T=this[A],Q=this[A+7];(T===void 0||Q===void 0)&&Ce(A,this.length-8);const se=(T<<24)+this[++A]*2**16+this[++A]*2**8+this[++A];return(BigInt(se)<>>0,T||y(A,4,this.length),t.read(this,A,!0,23,4)},a.prototype.readFloatBE=function(A,T){return A=A>>>0,T||y(A,4,this.length),t.read(this,A,!1,23,4)},a.prototype.readDoubleLE=function(A,T){return A=A>>>0,T||y(A,8,this.length),t.read(this,A,!0,52,8)},a.prototype.readDoubleBE=function(A,T){return A=A>>>0,T||y(A,8,this.length),t.read(this,A,!1,52,8)};function H(W,A,T,Q,se,ue){if(!a.isBuffer(W))throw new TypeError('"buffer" argument must be a Buffer instance');if(A>se||AW.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(A,T,Q,se){if(A=+A,T=T>>>0,Q=Q>>>0,!se){const Oe=Math.pow(2,8*Q)-1;H(this,A,T,Q,Oe,0)}let ue=1,ye=0;for(this[T]=A&255;++ye>>0,Q=Q>>>0,!se){const Oe=Math.pow(2,8*Q)-1;H(this,A,T,Q,Oe,0)}let ue=Q-1,ye=1;for(this[T+ue]=A&255;--ue>=0&&(ye*=256);)this[T+ue]=A/ye&255;return T+Q},a.prototype.writeUint8=a.prototype.writeUInt8=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,1,255,0),this[T]=A&255,T+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,2,65535,0),this[T]=A&255,this[T+1]=A>>>8,T+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,2,65535,0),this[T]=A>>>8,this[T+1]=A&255,T+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,4,4294967295,0),this[T+3]=A>>>24,this[T+2]=A>>>16,this[T+1]=A>>>8,this[T]=A&255,T+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,4,4294967295,0),this[T]=A>>>24,this[T+1]=A>>>16,this[T+2]=A>>>8,this[T+3]=A&255,T+4};function de(W,A,T,Q,se){ve(A,Q,se,W,T,7);let ue=Number(A&BigInt(4294967295));W[T++]=ue,ue=ue>>8,W[T++]=ue,ue=ue>>8,W[T++]=ue,ue=ue>>8,W[T++]=ue;let ye=Number(A>>BigInt(32)&BigInt(4294967295));return W[T++]=ye,ye=ye>>8,W[T++]=ye,ye=ye>>8,W[T++]=ye,ye=ye>>8,W[T++]=ye,T}function xe(W,A,T,Q,se){ve(A,Q,se,W,T,7);let ue=Number(A&BigInt(4294967295));W[T+7]=ue,ue=ue>>8,W[T+6]=ue,ue=ue>>8,W[T+5]=ue,ue=ue>>8,W[T+4]=ue;let ye=Number(A>>BigInt(32)&BigInt(4294967295));return W[T+3]=ye,ye=ye>>8,W[T+2]=ye,ye=ye>>8,W[T+1]=ye,ye=ye>>8,W[T]=ye,T+8}a.prototype.writeBigUInt64LE=Fe(function(A,T=0){return de(this,A,T,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Fe(function(A,T=0){return xe(this,A,T,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(A,T,Q,se){if(A=+A,T=T>>>0,!se){const Le=Math.pow(2,8*Q-1);H(this,A,T,Q,Le-1,-Le)}let ue=0,ye=1,Oe=0;for(this[T]=A&255;++ue>0)-Oe&255;return T+Q},a.prototype.writeIntBE=function(A,T,Q,se){if(A=+A,T=T>>>0,!se){const Le=Math.pow(2,8*Q-1);H(this,A,T,Q,Le-1,-Le)}let ue=Q-1,ye=1,Oe=0;for(this[T+ue]=A&255;--ue>=0&&(ye*=256);)A<0&&Oe===0&&this[T+ue+1]!==0&&(Oe=1),this[T+ue]=(A/ye>>0)-Oe&255;return T+Q},a.prototype.writeInt8=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,1,127,-128),A<0&&(A=255+A+1),this[T]=A&255,T+1},a.prototype.writeInt16LE=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,2,32767,-32768),this[T]=A&255,this[T+1]=A>>>8,T+2},a.prototype.writeInt16BE=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,2,32767,-32768),this[T]=A>>>8,this[T+1]=A&255,T+2},a.prototype.writeInt32LE=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,4,2147483647,-2147483648),this[T]=A&255,this[T+1]=A>>>8,this[T+2]=A>>>16,this[T+3]=A>>>24,T+4},a.prototype.writeInt32BE=function(A,T,Q){return A=+A,T=T>>>0,Q||H(this,A,T,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),this[T]=A>>>24,this[T+1]=A>>>16,this[T+2]=A>>>8,this[T+3]=A&255,T+4},a.prototype.writeBigInt64LE=Fe(function(A,T=0){return de(this,A,T,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Fe(function(A,T=0){return xe(this,A,T,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function O(W,A,T,Q,se,ue){if(T+Q>W.length)throw new RangeError("Index out of range");if(T<0)throw new RangeError("Index out of range")}function he(W,A,T,Q,se){return A=+A,T=T>>>0,se||O(W,A,T,4),t.write(W,A,T,Q,23,4),T+4}a.prototype.writeFloatLE=function(A,T,Q){return he(this,A,T,!0,Q)},a.prototype.writeFloatBE=function(A,T,Q){return he(this,A,T,!1,Q)};function J(W,A,T,Q,se){return A=+A,T=T>>>0,se||O(W,A,T,8),t.write(W,A,T,Q,52,8),T+8}a.prototype.writeDoubleLE=function(A,T,Q){return J(this,A,T,!0,Q)},a.prototype.writeDoubleBE=function(A,T,Q){return J(this,A,T,!1,Q)},a.prototype.copy=function(A,T,Q,se){if(!a.isBuffer(A))throw new TypeError("argument should be a Buffer");if(Q||(Q=0),!se&&se!==0&&(se=this.length),T>=A.length&&(T=A.length),T||(T=0),se>0&&se=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),A.length-T>>0,Q=Q===void 0?this.length:Q>>>0,A||(A=0);let ue;if(typeof A=="number")for(ue=T;ue2**32?se=E(String(T)):typeof T=="bigint"&&(se=String(T),(T>BigInt(2)**BigInt(32)||T<-(BigInt(2)**BigInt(32)))&&(se=E(se)),se+="n"),Q+=` It must be ${A}. Received ${se}`,Q},RangeError);function E(W){let A="",T=W.length;const Q=W[0]==="-"?1:0;for(;T>=Q+4;T-=3)A=`_${W.slice(T-3,T)}${A}`;return`${W.slice(0,T)}${A}`}function X(W,A,T){Ee(A,"offset"),(W[A]===void 0||W[A+T]===void 0)&&Ce(A,W.length-(T+1))}function ve(W,A,T,Q,se,ue){if(W>T||W= 0${ye} and < 2${ye} ** ${(ue+1)*8}${ye}`:Oe=`>= -(2${ye} ** ${(ue+1)*8-1}${ye}) and < 2 ** ${(ue+1)*8-1}${ye}`,new re.ERR_OUT_OF_RANGE("value",Oe,W)}X(Q,se,ue)}function Ee(W,A){if(typeof W!="number")throw new re.ERR_INVALID_ARG_TYPE(A,"number",W)}function Ce(W,A,T){throw Math.floor(W)!==W?(Ee(W,T),new re.ERR_OUT_OF_RANGE("offset","an integer",W)):A<0?new re.ERR_BUFFER_OUT_OF_BOUNDS:new re.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${A}`,W)}const Be=/[^+/0-9A-Za-z-_]/g;function ot(W){if(W=W.split("=")[0],W=W.trim().replace(Be,""),W.length<2)return"";for(;W.length%4!==0;)W=W+"=";return W}function Ge(W,A){A=A||1/0;let T;const Q=W.length;let se=null;const ue=[];for(let ye=0;ye55295&&T<57344){if(!se){if(T>56319){(A-=3)>-1&&ue.push(239,191,189);continue}else if(ye+1===Q){(A-=3)>-1&&ue.push(239,191,189);continue}se=T;continue}if(T<56320){(A-=3)>-1&&ue.push(239,191,189),se=T;continue}T=(se-55296<<10|T-56320)+65536}else se&&(A-=3)>-1&&ue.push(239,191,189);if(se=null,T<128){if((A-=1)<0)break;ue.push(T)}else if(T<2048){if((A-=2)<0)break;ue.push(T>>6|192,T&63|128)}else if(T<65536){if((A-=3)<0)break;ue.push(T>>12|224,T>>6&63|128,T&63|128)}else if(T<1114112){if((A-=4)<0)break;ue.push(T>>18|240,T>>12&63|128,T>>6&63|128,T&63|128)}else throw new Error("Invalid code point")}return ue}function dr(W){const A=[];for(let T=0;T>8,se=T%256,ue.push(se),ue.push(Q);return ue}function Qe(W){return e.toByteArray(ot(W))}function lt(W,A,T,Q){let se;for(se=0;se=A.length||se>=W.length);++se)A[se+T]=W[se];return se}function ze(W,A){return W instanceof A||W!=null&&W.constructor!=null&&W.constructor.name!=null&&W.constructor.name===A.name}function Ke(W){return W!==W}const xt=function(){const W="0123456789abcdef",A=new Array(256);for(let T=0;T<16;++T){const Q=T*16;for(let se=0;se<16;++se)A[Q+se]=W[T]+W[se]}return A}();function Fe(W){return typeof BigInt>"u"?Ze:W}function Ze(){throw new Error("BigInt not supported")}})(RC);var J_;typeof window<"u"&&(window.Buffer||(window.Buffer=RC.Buffer),window.global||(window.global=window),window.process||(window.process={}),(J_=window.process)!=null&&J_.env||(window.process={env:{}}));var CJ={};const SJ=CJ.NEXT_PUBLIC_SECURE_SITE_SDK_URL||"https://secure.walletconnect.com/sdk",Ne={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@w3m-storage/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",SOCIAL:"@w3m/connected_social",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},Qi={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}};var wr;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const o={};for(const s of n)o[s]=s;return o},r.getValidEnumValues=n=>{const o=r.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(const a of o)s[a]=n[a];return r.objectValues(s)},r.objectValues=n=>r.objectKeys(n).map(function(o){return n[o]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const o=[];for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&o.push(s);return o},r.find=(n,o)=>{for(const s of n)if(o(s))return s},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}r.joinValues=i,r.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(wr||(wr={}));var Z2;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Z2||(Z2={}));const Je=wr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sc=r=>{switch(typeof r){case"undefined":return Je.undefined;case"string":return Je.string;case"number":return isNaN(r)?Je.nan:Je.number;case"boolean":return Je.boolean;case"function":return Je.function;case"bigint":return Je.bigint;case"symbol":return Je.symbol;case"object":return Array.isArray(r)?Je.array:r===null?Je.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Je.promise:typeof Map<"u"&&r instanceof Map?Je.map:typeof Set<"u"&&r instanceof Set?Je.set:typeof Date<"u"&&r instanceof Date?Je.date:Je.object;default:return Je.unknown}},Ue=wr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),IJ=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class ds extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(o){return o.message},i={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)i._errors.push(t(s));else{let a=i,u=0;for(;ut.message){const t={},i=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}ds.create=r=>new ds(r);const Ff=(r,e)=>{let t;switch(r.code){case Ue.invalid_type:r.received===Je.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Ue.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,wr.jsonStringifyReplacer)}`;break;case Ue.unrecognized_keys:t=`Unrecognized key(s) in object: ${wr.joinValues(r.keys,", ")}`;break;case Ue.invalid_union:t="Invalid input";break;case Ue.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${wr.joinValues(r.options)}`;break;case Ue.invalid_enum_value:t=`Invalid enum value. Expected ${wr.joinValues(r.options)}, received '${r.received}'`;break;case Ue.invalid_arguments:t="Invalid function arguments";break;case Ue.invalid_return_type:t="Invalid function return type";break;case Ue.invalid_date:t="Invalid date";break;case Ue.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:wr.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Ue.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case Ue.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case Ue.custom:t="Invalid input";break;case Ue.invalid_intersection_types:t="Intersection results could not be merged";break;case Ue.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case Ue.not_finite:t="Number must be finite";break;default:t=e.defaultError,wr.assertNever(r)}return{message:t}};let OC=Ff;function TJ(r){OC=r}function lg(){return OC}const ug=r=>{const{data:e,path:t,errorMaps:i,issueData:n}=r,o=[...t,...n.path||[]],s={...n,path:o};let a="";const u=i.filter(h=>!!h).slice().reverse();for(const h of u)a=h(s,{data:e,defaultError:a}).message;return{...n,path:o,message:n.message||a}},RJ=[];function it(r,e){const t=ug({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,lg(),Ff].filter(i=>!!i)});r.common.issues.push(t)}class Ji{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const n of t){if(n.status==="aborted")return zt;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const n of t)i.push({key:await n.key,value:await n.value});return Ji.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const n of t){const{key:o,value:s}=n;if(o.status==="aborted"||s.status==="aborted")return zt;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(i[o.value]=s.value)}return{status:e.value,value:i}}}const zt=Object.freeze({status:"aborted"}),PC=r=>({status:"dirty",value:r}),wn=r=>({status:"valid",value:r}),Q2=r=>r.status==="aborted",Y2=r=>r.status==="dirty",zf=r=>r.status==="valid",hg=r=>typeof Promise<"u"&&r instanceof Promise;var pt;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pt||(pt={}));class Zs{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const u_=(r,e)=>{if(zf(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ds(r.common.issues);return this._error=t,this._error}}};function Kt(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:n}=r;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:i??a.defaultError}:{message:t??a.defaultError},description:n}}class Jt{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Sc(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ji,ctx:{common:e.parent.common,data:e.data,parsedType:Sc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(hg(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const n={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sc(e)},o=this._parseSync({data:e,path:n.path,parent:n});return u_(n,o)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sc(e)},n=this._parse({data:e,path:i.path,parent:i}),o=await(hg(n)?n:Promise.resolve(n));return u_(i,o)}refine(e,t){const i=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,o)=>{const s=e(n),a=()=>o.addIssue({code:Ue.custom,...i(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,t){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof t=="function"?t(i,n):t),!1))}_refinement(e){return new ms({schema:this,typeName:Rt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Pa.create(this,this._def)}nullable(){return ou.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fs.create(this,this._def)}promise(){return Fh.create(this,this._def)}or(e){return Vf.create([this,e],this._def)}and(e){return Kf.create(this,e,this._def)}transform(e){return new ms({...Kt(this._def),schema:this,typeName:Rt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Jf({...Kt(this._def),innerType:this,defaultValue:t,typeName:Rt.ZodDefault})}brand(){return new NC({typeName:Rt.ZodBranded,type:this,...Kt(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new gg({...Kt(this._def),innerType:this,catchValue:t,typeName:Rt.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return N0.create(this,e)}readonly(){return wg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kJ=/^c[^\s-]{8,}$/i,OJ=/^[a-z][a-z0-9]*$/,PJ=/^[0-9A-HJKMNP-TV-Z]{26}$/,DJ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,NJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$J="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let e2;const MJ=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,BJ=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,UJ=r=>r.precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):r.precision===0?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function LJ(r,e){return!!((e==="v4"||!e)&&MJ.test(r)||(e==="v6"||!e)&&BJ.test(r))}class hs extends Jt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Je.string){const o=this._getOrReturnCtx(e);return it(o,{code:Ue.invalid_type,expected:Je.string,received:o.parsedType}),zt}const i=new Ji;let n;for(const o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),it(n,{code:Ue.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.lengthe.test(n),{validation:t,code:Ue.invalid_string,...pt.errToObj(i)})}_addCheck(e){return new hs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pt.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...pt.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...pt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...pt.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...pt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...pt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...pt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...pt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...pt.errToObj(t)})}nonempty(e){return this.min(1,pt.errToObj(e))}trim(){return new hs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new hs({checks:[],typeName:Rt.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...Kt(r)})};function jJ(r,e){const t=(r.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=t>i?t:i,o=parseInt(r.toFixed(n).replace(".","")),s=parseInt(e.toFixed(n).replace(".",""));return o%s/Math.pow(10,n)}class zc extends Jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Je.number){const o=this._getOrReturnCtx(e);return it(o,{code:Ue.invalid_type,expected:Je.number,received:o.parsedType}),zt}let i;const n=new Ji;for(const o of this._def.checks)o.kind==="int"?wr.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),it(i,{code:Ue.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),it(i,{code:Ue.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?jJ(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),it(i,{code:Ue.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),it(i,{code:Ue.not_finite,message:o.message}),n.dirty()):wr.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,pt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,pt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,pt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,pt.toString(t))}setLimit(e,t,i,n){return new zc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:pt.toString(n)}]})}_addCheck(e){return new zc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:pt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:pt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&wr.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.valuenew zc({checks:[],typeName:Rt.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...Kt(r)});class Wc extends Jt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Je.bigint){const o=this._getOrReturnCtx(e);return it(o,{code:Ue.invalid_type,expected:Je.bigint,received:o.parsedType}),zt}let i;const n=new Ji;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),it(i,{code:Ue.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),it(i,{code:Ue.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):wr.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,pt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,pt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,pt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,pt.toString(t))}setLimit(e,t,i,n){return new Wc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:pt.toString(n)}]})}_addCheck(e){return new Wc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:pt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new Wc({checks:[],typeName:Rt.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...Kt(r)})};class Wf extends Jt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Je.boolean){const i=this._getOrReturnCtx(e);return it(i,{code:Ue.invalid_type,expected:Je.boolean,received:i.parsedType}),zt}return wn(e.data)}}Wf.create=r=>new Wf({typeName:Rt.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...Kt(r)});class iu extends Jt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Je.date){const o=this._getOrReturnCtx(e);return it(o,{code:Ue.invalid_type,expected:Je.date,received:o.parsedType}),zt}if(isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return it(o,{code:Ue.invalid_date}),zt}const i=new Ji;let n;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),it(n,{code:Ue.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):wr.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new iu({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:pt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:pt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew iu({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:Rt.ZodDate,...Kt(r)});class dg extends Jt{_parse(e){if(this._getType(e)!==Je.symbol){const i=this._getOrReturnCtx(e);return it(i,{code:Ue.invalid_type,expected:Je.symbol,received:i.parsedType}),zt}return wn(e.data)}}dg.create=r=>new dg({typeName:Rt.ZodSymbol,...Kt(r)});class Hf extends Jt{_parse(e){if(this._getType(e)!==Je.undefined){const i=this._getOrReturnCtx(e);return it(i,{code:Ue.invalid_type,expected:Je.undefined,received:i.parsedType}),zt}return wn(e.data)}}Hf.create=r=>new Hf({typeName:Rt.ZodUndefined,...Kt(r)});class qf extends Jt{_parse(e){if(this._getType(e)!==Je.null){const i=this._getOrReturnCtx(e);return it(i,{code:Ue.invalid_type,expected:Je.null,received:i.parsedType}),zt}return wn(e.data)}}qf.create=r=>new qf({typeName:Rt.ZodNull,...Kt(r)});class jh extends Jt{constructor(){super(...arguments),this._any=!0}_parse(e){return wn(e.data)}}jh.create=r=>new jh({typeName:Rt.ZodAny,...Kt(r)});class Ll extends Jt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wn(e.data)}}Ll.create=r=>new Ll({typeName:Rt.ZodUnknown,...Kt(r)});class Va extends Jt{_parse(e){const t=this._getOrReturnCtx(e);return it(t,{code:Ue.invalid_type,expected:Je.never,received:t.parsedType}),zt}}Va.create=r=>new Va({typeName:Rt.ZodNever,...Kt(r)});class fg extends Jt{_parse(e){if(this._getType(e)!==Je.undefined){const i=this._getOrReturnCtx(e);return it(i,{code:Ue.invalid_type,expected:Je.void,received:i.parsedType}),zt}return wn(e.data)}}fg.create=r=>new fg({typeName:Rt.ZodVoid,...Kt(r)});class fs extends Jt{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),n=this._def;if(t.parsedType!==Je.array)return it(t,{code:Ue.invalid_type,expected:Je.array,received:t.parsedType}),zt;if(n.exactLength!==null){const s=t.data.length>n.exactLength.value,a=t.data.lengthn.maxLength.value&&(it(t,{code:Ue.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((s,a)=>n.type._parseAsync(new Zs(t,s,t.path,a)))).then(s=>Ji.mergeArray(i,s));const o=[...t.data].map((s,a)=>n.type._parseSync(new Zs(t,s,t.path,a)));return Ji.mergeArray(i,o)}get element(){return this._def.type}min(e,t){return new fs({...this._def,minLength:{value:e,message:pt.toString(t)}})}max(e,t){return new fs({...this._def,maxLength:{value:e,message:pt.toString(t)}})}length(e,t){return new fs({...this._def,exactLength:{value:e,message:pt.toString(t)}})}nonempty(e){return this.min(1,e)}}fs.create=(r,e)=>new fs({type:r,minLength:null,maxLength:null,exactLength:null,typeName:Rt.ZodArray,...Kt(e)});function ih(r){if(r instanceof Jr){const e={};for(const t in r.shape){const i=r.shape[t];e[t]=Pa.create(ih(i))}return new Jr({...r._def,shape:()=>e})}else return r instanceof fs?new fs({...r._def,type:ih(r.element)}):r instanceof Pa?Pa.create(ih(r.unwrap())):r instanceof ou?ou.create(ih(r.unwrap())):r instanceof Qs?Qs.create(r.items.map(e=>ih(e))):r}class Jr extends Jt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=wr.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Je.object){const h=this._getOrReturnCtx(e);return it(h,{code:Ue.invalid_type,expected:Je.object,received:h.parsedType}),zt}const{status:i,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Va&&this._def.unknownKeys==="strip"))for(const h in n.data)s.includes(h)||a.push(h);const u=[];for(const h of s){const d=o[h],p=n.data[h];u.push({key:{status:"valid",value:h},value:d._parse(new Zs(n,p,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Va){const h=this._def.unknownKeys;if(h==="passthrough")for(const d of a)u.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(h==="strict")a.length>0&&(it(n,{code:Ue.unrecognized_keys,keys:a}),i.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const d of a){const p=n.data[d];u.push({key:{status:"valid",value:d},value:h._parse(new Zs(n,p,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const h=[];for(const d of u){const p=await d.key;h.push({key:p,value:await d.value,alwaysSet:d.alwaysSet})}return h}).then(h=>Ji.mergeObjectSync(i,h)):Ji.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return pt.errToObj,new Jr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var n,o,s,a;const u=(s=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,t,i).message)!==null&&s!==void 0?s:i.defaultError;return t.code==="unrecognized_keys"?{message:(a=pt.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Jr({...this._def,unknownKeys:"strip"})}passthrough(){return new Jr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Jr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Jr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Rt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Jr({...this._def,catchall:e})}pick(e){const t={};return wr.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new Jr({...this._def,shape:()=>t})}omit(e){const t={};return wr.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new Jr({...this._def,shape:()=>t})}deepPartial(){return ih(this)}partial(e){const t={};return wr.objectKeys(this.shape).forEach(i=>{const n=this.shape[i];e&&!e[i]?t[i]=n:t[i]=n.optional()}),new Jr({...this._def,shape:()=>t})}required(e){const t={};return wr.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Pa;)o=o._def.innerType;t[i]=o}}),new Jr({...this._def,shape:()=>t})}keyof(){return DC(wr.objectKeys(this.shape))}}Jr.create=(r,e)=>new Jr({shape:()=>r,unknownKeys:"strip",catchall:Va.create(),typeName:Rt.ZodObject,...Kt(e)});Jr.strictCreate=(r,e)=>new Jr({shape:()=>r,unknownKeys:"strict",catchall:Va.create(),typeName:Rt.ZodObject,...Kt(e)});Jr.lazycreate=(r,e)=>new Jr({shape:r,unknownKeys:"strip",catchall:Va.create(),typeName:Rt.ZodObject,...Kt(e)});class Vf extends Jt{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function n(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new ds(a.ctx.common.issues));return it(t,{code:Ue.invalid_union,unionErrors:s}),zt}if(t.common.async)return Promise.all(i.map(async o=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(n);{let o;const s=[];for(const u of i){const h={...t,common:{...t.common,issues:[]},parent:null},d=u._parseSync({data:t.data,path:t.path,parent:h});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:h}),h.common.issues.length&&s.push(h.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(u=>new ds(u));return it(t,{code:Ue.invalid_union,unionErrors:a}),zt}}get options(){return this._def.options}}Vf.create=(r,e)=>new Vf({options:r,typeName:Rt.ZodUnion,...Kt(e)});const I1=r=>r instanceof Zf?I1(r.schema):r instanceof ms?I1(r.innerType()):r instanceof Qf?[r.value]:r instanceof Hc?r.options:r instanceof Yf?Object.keys(r.enum):r instanceof Jf?I1(r._def.innerType):r instanceof Hf?[void 0]:r instanceof qf?[null]:null;class Cm extends Jt{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Je.object)return it(t,{code:Ue.invalid_type,expected:Je.object,received:t.parsedType}),zt;const i=this.discriminator,n=t.data[i],o=this.optionsMap.get(n);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(it(t,{code:Ue.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),zt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const n=new Map;for(const o of t){const s=I1(o.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,o)}}return new Cm({typeName:Rt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Kt(i)})}}function J2(r,e){const t=Sc(r),i=Sc(e);if(r===e)return{valid:!0,data:r};if(t===Je.object&&i===Je.object){const n=wr.objectKeys(e),o=wr.objectKeys(r).filter(a=>n.indexOf(a)!==-1),s={...r,...e};for(const a of o){const u=J2(r[a],e[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(t===Je.array&&i===Je.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let o=0;o{if(Q2(o)||Q2(s))return zt;const a=J2(o.value,s.value);return a.valid?((Y2(o)||Y2(s))&&t.dirty(),{status:t.value,value:a.data}):(it(i,{code:Ue.invalid_intersection_types}),zt)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>n(o,s)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Kf.create=(r,e,t)=>new Kf({left:r,right:e,typeName:Rt.ZodIntersection,...Kt(t)});class Qs extends Jt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Je.array)return it(i,{code:Ue.invalid_type,expected:Je.array,received:i.parsedType}),zt;if(i.data.lengththis._def.items.length&&(it(i,{code:Ue.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...i.data].map((s,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new Zs(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Ji.mergeArray(t,s)):Ji.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Qs({...this._def,rest:e})}}Qs.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qs({items:r,typeName:Rt.ZodTuple,rest:null,...Kt(e)})};class Gf extends Jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Je.object)return it(i,{code:Ue.invalid_type,expected:Je.object,received:i.parsedType}),zt;const n=[],o=this._def.keyType,s=this._def.valueType;for(const a in i.data)n.push({key:o._parse(new Zs(i,a,i.path,a)),value:s._parse(new Zs(i,i.data[a],i.path,a))});return i.common.async?Ji.mergeObjectAsync(t,n):Ji.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof Jt?new Gf({keyType:e,valueType:t,typeName:Rt.ZodRecord,...Kt(i)}):new Gf({keyType:hs.create(),valueType:e,typeName:Rt.ZodRecord,...Kt(t)})}}class pg extends Jt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Je.map)return it(i,{code:Ue.invalid_type,expected:Je.map,received:i.parsedType}),zt;const n=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,u],h)=>({key:n._parse(new Zs(i,a,i.path,[h,"key"])),value:o._parse(new Zs(i,u,i.path,[h,"value"]))}));if(i.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of s){const h=await u.key,d=await u.value;if(h.status==="aborted"||d.status==="aborted")return zt;(h.status==="dirty"||d.status==="dirty")&&t.dirty(),a.set(h.value,d.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const u of s){const h=u.key,d=u.value;if(h.status==="aborted"||d.status==="aborted")return zt;(h.status==="dirty"||d.status==="dirty")&&t.dirty(),a.set(h.value,d.value)}return{status:t.value,value:a}}}}pg.create=(r,e,t)=>new pg({valueType:e,keyType:r,typeName:Rt.ZodMap,...Kt(t)});class nu extends Jt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Je.set)return it(i,{code:Ue.invalid_type,expected:Je.set,received:i.parsedType}),zt;const n=this._def;n.minSize!==null&&i.data.sizen.maxSize.value&&(it(i,{code:Ue.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function s(u){const h=new Set;for(const d of u){if(d.status==="aborted")return zt;d.status==="dirty"&&t.dirty(),h.add(d.value)}return{status:t.value,value:h}}const a=[...i.data.values()].map((u,h)=>o._parse(new Zs(i,u,i.path,h)));return i.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(e,t){return new nu({...this._def,minSize:{value:e,message:pt.toString(t)}})}max(e,t){return new nu({...this._def,maxSize:{value:e,message:pt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}nu.create=(r,e)=>new nu({valueType:r,minSize:null,maxSize:null,typeName:Rt.ZodSet,...Kt(e)});class gh extends Jt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Je.function)return it(t,{code:Ue.invalid_type,expected:Je.function,received:t.parsedType}),zt;function i(a,u){return ug({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,lg(),Ff].filter(h=>!!h),issueData:{code:Ue.invalid_arguments,argumentsError:u}})}function n(a,u){return ug({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,lg(),Ff].filter(h=>!!h),issueData:{code:Ue.invalid_return_type,returnTypeError:u}})}const o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Fh){const a=this;return wn(async function(...u){const h=new ds([]),d=await a._def.args.parseAsync(u,o).catch(b=>{throw h.addIssue(i(u,b)),h}),p=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(p,o).catch(b=>{throw h.addIssue(n(p,b)),h})})}else{const a=this;return wn(function(...u){const h=a._def.args.safeParse(u,o);if(!h.success)throw new ds([i(u,h.error)]);const d=Reflect.apply(s,this,h.data),p=a._def.returns.safeParse(d,o);if(!p.success)throw new ds([n(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new gh({...this._def,args:Qs.create(e).rest(Ll.create())})}returns(e){return new gh({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new gh({args:e||Qs.create([]).rest(Ll.create()),returns:t||Ll.create(),typeName:Rt.ZodFunction,...Kt(i)})}}class Zf extends Jt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Zf.create=(r,e)=>new Zf({getter:r,typeName:Rt.ZodLazy,...Kt(e)});class Qf extends Jt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return it(t,{received:t.data,code:Ue.invalid_literal,expected:this._def.value}),zt}return{status:"valid",value:e.data}}get value(){return this._def.value}}Qf.create=(r,e)=>new Qf({value:r,typeName:Rt.ZodLiteral,...Kt(e)});function DC(r,e){return new Hc({values:r,typeName:Rt.ZodEnum,...Kt(e)})}class Hc extends Jt{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return it(t,{expected:wr.joinValues(i),received:t.parsedType,code:Ue.invalid_type}),zt}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),i=this._def.values;return it(t,{received:t.data,code:Ue.invalid_enum_value,options:i}),zt}return wn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Hc.create(e)}exclude(e){return Hc.create(this.options.filter(t=>!e.includes(t)))}}Hc.create=DC;class Yf extends Jt{_parse(e){const t=wr.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==Je.string&&i.parsedType!==Je.number){const n=wr.objectValues(t);return it(i,{expected:wr.joinValues(n),received:i.parsedType,code:Ue.invalid_type}),zt}if(t.indexOf(e.data)===-1){const n=wr.objectValues(t);return it(i,{received:i.data,code:Ue.invalid_enum_value,options:n}),zt}return wn(e.data)}get enum(){return this._def.values}}Yf.create=(r,e)=>new Yf({values:r,typeName:Rt.ZodNativeEnum,...Kt(e)});class Fh extends Jt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Je.promise&&t.common.async===!1)return it(t,{code:Ue.invalid_type,expected:Je.promise,received:t.parsedType}),zt;const i=t.parsedType===Je.promise?t.data:Promise.resolve(t.data);return wn(i.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Fh.create=(r,e)=>new Fh({type:r,typeName:Rt.ZodPromise,...Kt(e)});class ms extends Jt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Rt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:s=>{it(i,s),s.fatal?t.abort():t.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){const s=n.transform(i.data,o);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:i.path,parent:i})):this._def.schema._parseSync({data:s,path:i.path,parent:i})}if(n.type==="refinement"){const s=a=>{const u=n.refinement(a,o);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){const a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?zt:(a.status==="dirty"&&t.dirty(),s(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?zt:(a.status==="dirty"&&t.dirty(),s(a.value).then(()=>({status:t.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){const s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!zf(s))return s;const a=n.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>zf(s)?Promise.resolve(n.transform(s.value,o)).then(a=>({status:t.value,value:a})):s);wr.assertNever(n)}}ms.create=(r,e,t)=>new ms({schema:r,typeName:Rt.ZodEffects,effect:e,...Kt(t)});ms.createWithPreprocess=(r,e,t)=>new ms({schema:e,effect:{type:"preprocess",transform:r},typeName:Rt.ZodEffects,...Kt(t)});class Pa extends Jt{_parse(e){return this._getType(e)===Je.undefined?wn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pa.create=(r,e)=>new Pa({innerType:r,typeName:Rt.ZodOptional,...Kt(e)});class ou extends Jt{_parse(e){return this._getType(e)===Je.null?wn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ou.create=(r,e)=>new ou({innerType:r,typeName:Rt.ZodNullable,...Kt(e)});class Jf extends Jt{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===Je.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Jf.create=(r,e)=>new Jf({innerType:r,typeName:Rt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Kt(e)});class gg extends Jt{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return hg(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ds(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ds(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}gg.create=(r,e)=>new gg({innerType:r,typeName:Rt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Kt(e)});class mg extends Jt{_parse(e){if(this._getType(e)!==Je.nan){const i=this._getOrReturnCtx(e);return it(i,{code:Ue.invalid_type,expected:Je.nan,received:i.parsedType}),zt}return{status:"valid",value:e.data}}}mg.create=r=>new mg({typeName:Rt.ZodNaN,...Kt(r)});const FJ=Symbol("zod_brand");class NC extends Jt{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class N0 extends Jt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?zt:o.status==="dirty"?(t.dirty(),PC(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{const n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?zt:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,t){return new N0({in:e,out:t,typeName:Rt.ZodPipeline})}}class wg extends Jt{_parse(e){const t=this._def.innerType._parse(e);return zf(t)&&(t.value=Object.freeze(t.value)),t}}wg.create=(r,e)=>new wg({innerType:r,typeName:Rt.ZodReadonly,...Kt(e)});const $C=(r,e={},t)=>r?jh.create().superRefine((i,n)=>{var o,s;if(!r(i)){const a=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,u=(s=(o=a.fatal)!==null&&o!==void 0?o:t)!==null&&s!==void 0?s:!0,h=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...h,fatal:u})}}):jh.create(),zJ={object:Jr.lazycreate};var Rt;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(Rt||(Rt={}));const WJ=(r,e={message:`Input not instance of ${r.name}`})=>$C(t=>t instanceof r,e),MC=hs.create,BC=zc.create,HJ=mg.create,qJ=Wc.create,UC=Wf.create,VJ=iu.create,KJ=dg.create,GJ=Hf.create,ZJ=qf.create,QJ=jh.create,YJ=Ll.create,JJ=Va.create,XJ=fg.create,eX=fs.create,tX=Jr.create,rX=Jr.strictCreate,iX=Vf.create,nX=Cm.create,oX=Kf.create,sX=Qs.create,aX=Gf.create,cX=pg.create,lX=nu.create,uX=gh.create,hX=Zf.create,dX=Qf.create,fX=Hc.create,pX=Yf.create,gX=Fh.create,h_=ms.create,mX=Pa.create,wX=ou.create,vX=ms.createWithPreprocess,yX=N0.create,bX=()=>MC().optional(),_X=()=>BC().optional(),xX=()=>UC().optional(),AX={string:r=>hs.create({...r,coerce:!0}),number:r=>zc.create({...r,coerce:!0}),boolean:r=>Wf.create({...r,coerce:!0}),bigint:r=>Wc.create({...r,coerce:!0}),date:r=>iu.create({...r,coerce:!0})},EX=zt;var ee=Object.freeze({__proto__:null,defaultErrorMap:Ff,setErrorMap:TJ,getErrorMap:lg,makeIssue:ug,EMPTY_PATH:RJ,addIssueToContext:it,ParseStatus:Ji,INVALID:zt,DIRTY:PC,OK:wn,isAborted:Q2,isDirty:Y2,isValid:zf,isAsync:hg,get util(){return wr},get objectUtil(){return Z2},ZodParsedType:Je,getParsedType:Sc,ZodType:Jt,ZodString:hs,ZodNumber:zc,ZodBigInt:Wc,ZodBoolean:Wf,ZodDate:iu,ZodSymbol:dg,ZodUndefined:Hf,ZodNull:qf,ZodAny:jh,ZodUnknown:Ll,ZodNever:Va,ZodVoid:fg,ZodArray:fs,ZodObject:Jr,ZodUnion:Vf,ZodDiscriminatedUnion:Cm,ZodIntersection:Kf,ZodTuple:Qs,ZodRecord:Gf,ZodMap:pg,ZodSet:nu,ZodFunction:gh,ZodLazy:Zf,ZodLiteral:Qf,ZodEnum:Hc,ZodNativeEnum:Yf,ZodPromise:Fh,ZodEffects:ms,ZodTransformer:ms,ZodOptional:Pa,ZodNullable:ou,ZodDefault:Jf,ZodCatch:gg,ZodNaN:mg,BRAND:FJ,ZodBranded:NC,ZodPipeline:N0,ZodReadonly:wg,custom:$C,Schema:Jt,ZodSchema:Jt,late:zJ,get ZodFirstPartyTypeKind(){return Rt},coerce:AX,any:QJ,array:eX,bigint:qJ,boolean:UC,date:VJ,discriminatedUnion:nX,effect:h_,enum:fX,function:uX,instanceof:WJ,intersection:oX,lazy:hX,literal:dX,map:cX,nan:HJ,nativeEnum:pX,never:JJ,null:ZJ,nullable:wX,number:BC,object:tX,oboolean:xX,onumber:_X,optional:mX,ostring:bX,pipeline:yX,preprocess:vX,promise:gX,record:aX,set:lX,strictObject:rX,string:MC,symbol:KJ,transformer:h_,tuple:sX,undefined:GJ,union:iX,unknown:YJ,void:XJ,NEVER:EX,ZodIssueCode:Ue,quotelessJson:IJ,ZodError:ds});const mi=ee.object({message:ee.string()});function ht(r){return ee.literal(Ne[r])}ee.object({accessList:ee.array(ee.string()),blockHash:ee.string().nullable(),blockNumber:ee.string().nullable(),chainId:ee.string(),from:ee.string(),gas:ee.string(),hash:ee.string(),input:ee.string().nullable(),maxFeePerGas:ee.string(),maxPriorityFeePerGas:ee.string(),nonce:ee.string(),r:ee.string(),s:ee.string(),to:ee.string(),transactionIndex:ee.string().nullable(),type:ee.string(),v:ee.string(),value:ee.string()});const CX=ee.object({chainId:ee.number()}),SX=ee.object({email:ee.string().email()}),IX=ee.object({otp:ee.string()}),TX=ee.object({uri:ee.string()}),RX=ee.object({chainId:ee.optional(ee.number()),preferredAccountType:ee.optional(ee.string())}),kX=ee.object({provider:ee.enum(["google","github","apple","facebook","x","discord"])}),OX=ee.object({email:ee.string().email()}),PX=ee.object({otp:ee.string()}),DX=ee.object({otp:ee.string()}),NX=ee.object({themeMode:ee.optional(ee.enum(["light","dark"])),themeVariables:ee.optional(ee.record(ee.string(),ee.string().or(ee.number()))),w3mThemeVariables:ee.optional(ee.record(ee.string(),ee.string()))}),$X=ee.object({metadata:ee.object({name:ee.string(),description:ee.string(),url:ee.string(),icons:ee.array(ee.string())}).optional(),sdkVersion:ee.string(),projectId:ee.string()}),MX=ee.object({type:ee.string()}),BX=ee.object({action:ee.enum(["VERIFY_DEVICE","VERIFY_OTP"])}),UX=ee.object({email:ee.string(),address:ee.string(),chainId:ee.number(),userName:ee.string().optional()}),LX=ee.object({action:ee.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),jX=ee.object({email:ee.string().email(),address:ee.string(),chainId:ee.number(),smartAccountDeployed:ee.optional(ee.boolean()),preferredAccountType:ee.optional(ee.string())}),FX=ee.object({uri:ee.string()}),zX=ee.object({isConnected:ee.boolean()}),WX=ee.object({chainId:ee.number()}),HX=ee.object({chainId:ee.number()}),qX=ee.object({newEmail:ee.string().email()}),VX=ee.object({smartAccountEnabledNetworks:ee.array(ee.number())});ee.object({address:ee.string(),isDeployed:ee.boolean()});const KX=ee.object({type:ee.string(),address:ee.string()}),GX=ee.any(),ZX=ee.object({method:ee.literal("eth_accounts")}),QX=ee.object({method:ee.literal("eth_blockNumber")}),YX=ee.object({method:ee.literal("eth_call"),params:ee.array(ee.any())}),JX=ee.object({method:ee.literal("eth_chainId")}),XX=ee.object({method:ee.literal("eth_estimateGas"),params:ee.array(ee.any())}),eee=ee.object({method:ee.literal("eth_feeHistory"),params:ee.array(ee.any())}),tee=ee.object({method:ee.literal("eth_gasPrice")}),ree=ee.object({method:ee.literal("eth_getAccount"),params:ee.array(ee.any())}),iee=ee.object({method:ee.literal("eth_getBalance"),params:ee.array(ee.any())}),nee=ee.object({method:ee.literal("eth_getBlockByHash"),params:ee.array(ee.any())}),oee=ee.object({method:ee.literal("eth_getBlockByNumber"),params:ee.array(ee.any())}),see=ee.object({method:ee.literal("eth_getBlockReceipts"),params:ee.array(ee.any())}),aee=ee.object({method:ee.literal("eth_getBlockTransactionCountByHash"),params:ee.array(ee.any())}),cee=ee.object({method:ee.literal("eth_getBlockTransactionCountByNumber"),params:ee.array(ee.any())}),lee=ee.object({method:ee.literal("eth_getCode"),params:ee.array(ee.any())}),uee=ee.object({method:ee.literal("eth_getFilterChanges"),params:ee.array(ee.any())}),hee=ee.object({method:ee.literal("eth_getFilterLogs"),params:ee.array(ee.any())}),dee=ee.object({method:ee.literal("eth_getLogs"),params:ee.array(ee.any())}),fee=ee.object({method:ee.literal("eth_getProof"),params:ee.array(ee.any())}),pee=ee.object({method:ee.literal("eth_getStorageAt"),params:ee.array(ee.any())}),gee=ee.object({method:ee.literal("eth_getTransactionByBlockHashAndIndex"),params:ee.array(ee.any())}),mee=ee.object({method:ee.literal("eth_getTransactionByBlockNumberAndIndex"),params:ee.array(ee.any())}),wee=ee.object({method:ee.literal("eth_getTransactionByHash"),params:ee.array(ee.any())}),vee=ee.object({method:ee.literal("eth_getTransactionCount"),params:ee.array(ee.any())}),yee=ee.object({method:ee.literal("eth_getTransactionReceipt"),params:ee.array(ee.any())}),bee=ee.object({method:ee.literal("eth_getUncleCountByBlockHash"),params:ee.array(ee.any())}),_ee=ee.object({method:ee.literal("eth_getUncleCountByBlockNumber"),params:ee.array(ee.any())}),xee=ee.object({method:ee.literal("eth_maxPriorityFeePerGas")}),Aee=ee.object({method:ee.literal("eth_newBlockFilter")}),Eee=ee.object({method:ee.literal("eth_newFilter"),params:ee.array(ee.any())}),Cee=ee.object({method:ee.literal("eth_newPendingTransactionFilter")}),See=ee.object({method:ee.literal("eth_sendRawTransaction"),params:ee.array(ee.any())}),Iee=ee.object({method:ee.literal("eth_syncing"),params:ee.array(ee.any())}),Tee=ee.object({method:ee.literal("eth_uninstallFilter"),params:ee.array(ee.any())}),d_=ee.object({method:ee.literal("personal_sign"),params:ee.array(ee.any())}),Ree=ee.object({method:ee.literal("eth_signTypedData_v4"),params:ee.array(ee.any())}),f_=ee.object({method:ee.literal("eth_sendTransaction"),params:ee.array(ee.any())}),p_=ee.object({token:ee.string()}),c1={appEvent:ee.object({type:ht("APP_SWITCH_NETWORK"),payload:CX}).or(ee.object({type:ht("APP_CONNECT_EMAIL"),payload:SX})).or(ee.object({type:ht("APP_CONNECT_DEVICE")})).or(ee.object({type:ht("APP_CONNECT_OTP"),payload:IX})).or(ee.object({type:ht("APP_CONNECT_SOCIAL"),payload:TX})).or(ee.object({type:ht("APP_GET_USER"),payload:ee.optional(RX)})).or(ee.object({type:ht("APP_GET_SOCIAL_REDIRECT_URI"),payload:kX})).or(ee.object({type:ht("APP_SIGN_OUT")})).or(ee.object({type:ht("APP_IS_CONNECTED"),payload:ee.optional(p_)})).or(ee.object({type:ht("APP_GET_CHAIN_ID")})).or(ee.object({type:ht("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(ee.object({type:ht("APP_INIT_SMART_ACCOUNT")})).or(ee.object({type:ht("APP_SET_PREFERRED_ACCOUNT"),payload:MX})).or(ee.object({type:ht("APP_RPC_REQUEST"),payload:d_.or(f_).or(ZX).or(QX).or(YX).or(JX).or(XX).or(eee).or(tee).or(ree).or(iee).or(nee).or(oee).or(see).or(aee).or(cee).or(lee).or(uee).or(hee).or(dee).or(fee).or(pee).or(gee).or(mee).or(wee).or(vee).or(yee).or(bee).or(_ee).or(xee).or(Aee).or(Eee).or(Cee).or(See).or(Iee).or(Tee).or(d_).or(Ree).or(f_)})).or(ee.object({type:ht("APP_UPDATE_EMAIL"),payload:OX})).or(ee.object({type:ht("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:PX})).or(ee.object({type:ht("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:DX})).or(ee.object({type:ht("APP_SYNC_THEME"),payload:NX})).or(ee.object({type:ht("APP_SYNC_DAPP_DATA"),payload:$X})),frameEvent:ee.object({type:ht("FRAME_SWITCH_NETWORK_ERROR"),payload:mi}).or(ee.object({type:ht("FRAME_SWITCH_NETWORK_SUCCESS"),payload:HX})).or(ee.object({type:ht("FRAME_CONNECT_EMAIL_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_CONNECT_EMAIL_SUCCESS"),payload:BX})).or(ee.object({type:ht("FRAME_CONNECT_OTP_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_CONNECT_OTP_SUCCESS")})).or(ee.object({type:ht("FRAME_CONNECT_DEVICE_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_CONNECT_DEVICE_SUCCESS")})).or(ee.object({type:ht("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:UX})).or(ee.object({type:ht("FRAME_CONNECT_SOCIAL_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_GET_USER_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_GET_USER_SUCCESS"),payload:jX})).or(ee.object({type:ht("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:FX})).or(ee.object({type:ht("FRAME_SIGN_OUT_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_SIGN_OUT_SUCCESS")})).or(ee.object({type:ht("FRAME_IS_CONNECTED_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_IS_CONNECTED_SUCCESS"),payload:zX})).or(ee.object({type:ht("FRAME_GET_CHAIN_ID_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_GET_CHAIN_ID_SUCCESS"),payload:WX})).or(ee.object({type:ht("FRAME_RPC_REQUEST_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_RPC_REQUEST_SUCCESS"),payload:GX})).or(ee.object({type:ht("FRAME_SESSION_UPDATE"),payload:p_})).or(ee.object({type:ht("FRAME_UPDATE_EMAIL_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_UPDATE_EMAIL_SUCCESS"),payload:LX})).or(ee.object({type:ht("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(ee.object({type:ht("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:qX})).or(ee.object({type:ht("FRAME_SYNC_THEME_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_SYNC_THEME_SUCCESS")})).or(ee.object({type:ht("FRAME_SYNC_DAPP_DATA_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(ee.object({type:ht("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:VX})).or(ee.object({type:ht("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:mi})).or(ee.object({type:ht("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:KX})).or(ee.object({type:ht("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:mi}))},Ui={set(r,e){Pi.isClient&&localStorage.setItem(`${Ne.STORAGE_KEY}${r}`,e)},get(r){return Pi.isClient?localStorage.getItem(`${Ne.STORAGE_KEY}${r}`):null},delete(r,e){Pi.isClient&&(e?localStorage.removeItem(r):localStorage.removeItem(`${Ne.STORAGE_KEY}${r}`))}},g_={address:/^0x(?:[A-Fa-f0-9]{40})$/u,transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},kee=["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],l1=30*1e3,Pi={getBlockchainApiUrl(){try{const{timeZone:r}=new Intl.DateTimeFormat().resolvedOptions(),e=r.toUpperCase();return kee.includes(e)?"https://rpc.walletconnect.org":"https://rpc.walletconnect.com"}catch{return!1}},checkIfAllowedToTriggerEmail(){const r=Ui.get(Ne.LAST_EMAIL_LOGIN_TIME);if(r){const e=Date.now()-Number(r);if(e{Pi.isClient&&window.addEventListener("message",({data:n})=>{var s;if(!((s=n.type)!=null&&s.includes(Ne.FRAME_EVENT_KEY)))return;const o=c1.frameEvent.parse(n);i(o)})},onAppEvent:i=>{Pi.isClient&&window.addEventListener("message",({data:n})=>{var s;if(!((s=n.type)!=null&&s.includes(Ne.APP_EVENT_KEY)))return;const o=c1.appEvent.parse(n);i(o)})},postAppEvent:i=>{var n;if(Pi.isClient){if(!((n=this.iframe)!=null&&n.contentWindow))throw new Error("W3mFrame: iframe is not set");c1.appEvent.parse(i),window.postMessage(i),this.iframe.contentWindow.postMessage(i,"*")}},postFrameEvent:i=>{if(Pi.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");c1.frameEvent.parse(i),parent.postMessage(i,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((i,n)=>{this.frameLoadPromiseResolver={resolve:i,reject:n}}),t&&(this.frameLoadPromise=new Promise((i,n)=>{this.frameLoadPromiseResolver={resolve:i,reject:n}}),Pi.isClient)){const i=document.createElement("iframe");i.id="w3m-iframe",i.src=`${SJ}?projectId=${e}`,i.style.position="fixed",i.style.zIndex="999999",i.style.display="none",i.style.opacity="0",i.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",i.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",document.body.appendChild(i),this.iframe=i,this.iframe.onload=()=>{var n;(n=this.frameLoadPromiseResolver)==null||n.resolve(void 0)},this.iframe.onerror=()=>{var n;(n=this.frameLoadPromiseResolver)==null||n.reject("Unable to load email login dependency")}}}get networks(){const e=[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,324,280,100,8453,84531,7777777,999].map(t=>({[t]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=eip155:${t}&projectId=${this.projectId}`,chainId:t}}));return Object.assign({},...e)}}class Pee{constructor(e){this.connectEmailResolver=void 0,this.connectDeviceResolver=void 0,this.connectOtpResolver=void 0,this.connectResolver=void 0,this.connectSocialResolver=void 0,this.disconnectResolver=void 0,this.isConnectedResolver=void 0,this.getChainIdResolver=void 0,this.getSocialRedirectUriResolver=void 0,this.switchChainResolver=void 0,this.rpcRequestResolver=void 0,this.updateEmailResolver=void 0,this.updateEmailPrimaryOtpResolver=void 0,this.updateEmailSecondaryOtpResolver=void 0,this.syncThemeResolver=void 0,this.syncDappDataResolver=void 0,this.smartAccountEnabledNetworksResolver=void 0,this.setPreferredAccountResolver=void 0,this.w3mFrame=new Oee(e,!0),this.w3mFrame.events.onFrameEvent(t=>{switch(console.log("💻 received",t),t.type){case Ne.FRAME_CONNECT_EMAIL_SUCCESS:return this.onConnectEmailSuccess(t);case Ne.FRAME_CONNECT_EMAIL_ERROR:return this.onConnectEmailError(t);case Ne.FRAME_CONNECT_DEVICE_SUCCESS:return this.onConnectDeviceSuccess();case Ne.FRAME_CONNECT_DEVICE_ERROR:return this.onConnectDeviceError(t);case Ne.FRAME_CONNECT_OTP_SUCCESS:return this.onConnectOtpSuccess();case Ne.FRAME_CONNECT_OTP_ERROR:return this.onConnectOtpError(t);case Ne.FRAME_CONNECT_SOCIAL_SUCCESS:return this.onConnectSocialSuccess(t);case Ne.FRAME_CONNECT_SOCIAL_ERROR:return this.onConnectSocialError(t);case Ne.FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:return this.onGetSocialRedirectUriSuccess(t);case Ne.FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:return this.onGetSocialRedirectUriError(t);case Ne.FRAME_GET_USER_SUCCESS:return this.onConnectSuccess(t);case Ne.FRAME_GET_USER_ERROR:return this.onConnectError(t);case Ne.FRAME_IS_CONNECTED_SUCCESS:return this.onIsConnectedSuccess(t);case Ne.FRAME_IS_CONNECTED_ERROR:return this.onIsConnectedError(t);case Ne.FRAME_GET_CHAIN_ID_SUCCESS:return this.onGetChainIdSuccess(t);case Ne.FRAME_GET_CHAIN_ID_ERROR:return this.onGetChainIdError(t);case Ne.FRAME_SIGN_OUT_SUCCESS:return this.onSignOutSuccess();case Ne.FRAME_SIGN_OUT_ERROR:return this.onSignOutError(t);case Ne.FRAME_SWITCH_NETWORK_SUCCESS:return this.onSwitchChainSuccess(t);case Ne.FRAME_SWITCH_NETWORK_ERROR:return this.onSwitchChainError(t);case Ne.FRAME_RPC_REQUEST_SUCCESS:return this.onRpcRequestSuccess(t);case Ne.FRAME_RPC_REQUEST_ERROR:return this.onRpcRequestError(t);case Ne.FRAME_SESSION_UPDATE:return this.onSessionUpdate(t);case Ne.FRAME_UPDATE_EMAIL_SUCCESS:return this.onUpdateEmailSuccess(t);case Ne.FRAME_UPDATE_EMAIL_ERROR:return this.onUpdateEmailError(t);case Ne.FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:return this.onUpdateEmailPrimaryOtpSuccess();case Ne.FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:return this.onUpdateEmailPrimaryOtpError(t);case Ne.FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:return this.onUpdateEmailSecondaryOtpSuccess(t);case Ne.FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:return this.onUpdateEmailSecondaryOtpError(t);case Ne.FRAME_SYNC_THEME_SUCCESS:return this.onSyncThemeSuccess();case Ne.FRAME_SYNC_THEME_ERROR:return this.onSyncThemeError(t);case Ne.FRAME_SYNC_DAPP_DATA_SUCCESS:return this.onSyncDappDataSuccess();case Ne.FRAME_SYNC_DAPP_DATA_ERROR:return this.onSyncDappDataError(t);case Ne.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:return this.onSmartAccountEnabledNetworksSuccess(t);case Ne.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:return this.onSmartAccountEnabledNetworksError(t);case Ne.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:return this.onSetPreferredAccountSuccess();case Ne.FRAME_SET_PREFERRED_ACCOUNT_ERROR:return this.onSetPreferredAccountError();default:return null}})}getLoginEmailUsed(){return!!Ui.get(Ne.EMAIL_LOGIN_USED_KEY)}getEmail(){return Ui.get(Ne.EMAIL)}rejectRpcRequest(){var e;(e=this.rpcRequestResolver)==null||e.reject()}async connectEmail(e){return await this.w3mFrame.frameLoadPromise,Pi.checkIfAllowedToTriggerEmail(),this.w3mFrame.events.postAppEvent({type:Ne.APP_CONNECT_EMAIL,payload:e}),new Promise((t,i)=>{this.connectEmailResolver={resolve:t,reject:i}})}async connectDevice(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_CONNECT_DEVICE}),new Promise((e,t)=>{this.connectDeviceResolver={resolve:e,reject:t}})}async connectOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_CONNECT_OTP,payload:e}),new Promise((t,i)=>{this.connectOtpResolver={resolve:t,reject:i}})}async isConnected(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_IS_CONNECTED,payload:void 0}),new Promise((e,t)=>{this.isConnectedResolver={resolve:e,reject:t}})}async getChainId(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_GET_CHAIN_ID}),new Promise((e,t)=>{this.getChainIdResolver={resolve:e,reject:t}})}async getSocialRedirectUri(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_GET_SOCIAL_REDIRECT_URI,payload:e}),new Promise((t,i)=>{this.getSocialRedirectUriResolver={resolve:t,reject:i}})}async updateEmail(e){return await this.w3mFrame.frameLoadPromise,Pi.checkIfAllowedToTriggerEmail(),this.w3mFrame.events.postAppEvent({type:Ne.APP_UPDATE_EMAIL,payload:e}),new Promise((t,i)=>{this.updateEmailResolver={resolve:t,reject:i}})}async updateEmailPrimaryOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e}),new Promise((t,i)=>{this.updateEmailPrimaryOtpResolver={resolve:t,reject:i}})}async updateEmailSecondaryOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e}),new Promise((t,i)=>{this.updateEmailSecondaryOtpResolver={resolve:t,reject:i}})}async syncTheme(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_SYNC_THEME,payload:e}),new Promise((t,i)=>{this.syncThemeResolver={resolve:t,reject:i}})}async syncDappData(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_SYNC_DAPP_DATA,payload:e}),new Promise((t,i)=>{this.syncDappDataResolver={resolve:t,reject:i}})}async getSmartAccountEnabledNetworks(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS}),new Promise((e,t)=>{this.smartAccountEnabledNetworksResolver={resolve:e,reject:t}})}async setPreferredAccount(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}}),new Promise((t,i)=>{this.setPreferredAccountResolver={resolve:t,reject:i}})}async connect(e){const t=(e==null?void 0:e.chainId)??this.getLastUsedChainId()??1;return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_GET_USER,payload:{chainId:t}}),new Promise((i,n)=>{this.connectResolver={resolve:i,reject:n}})}async connectSocial(e){return this.w3mFrame.events.postAppEvent({type:Ne.APP_CONNECT_SOCIAL,payload:{uri:e}}),new Promise((t,i)=>{this.connectSocialResolver={resolve:t,reject:i}})}async switchNetwork(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_SWITCH_NETWORK,payload:{chainId:e}}),new Promise((t,i)=>{this.switchChainResolver={resolve:t,reject:i}})}async disconnect(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:Ne.APP_SIGN_OUT}),new Promise((e,t)=>{this.disconnectResolver={resolve:e,reject:t}})}async request(e){return await this.w3mFrame.frameLoadPromise,Qi.GET_CHAIN_ID===e.method?this.getLastUsedChainId():(this.w3mFrame.events.postAppEvent({type:Ne.APP_RPC_REQUEST,payload:e}),new Promise((t,i)=>{this.rpcRequestResolver={resolve:t,reject:i}}))}onRpcRequest(e){this.w3mFrame.events.onAppEvent(t=>{t.type.includes(Ne.RPC_METHOD_KEY)&&e(t)})}onRpcResponse(e){this.w3mFrame.events.onFrameEvent(t=>{t.type.includes(Ne.RPC_METHOD_KEY)&&e(t)})}onIsConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===Ne.FRAME_GET_USER_SUCCESS&&e(t.payload)})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===Ne.FRAME_IS_CONNECTED_ERROR&&e(),t.type===Ne.FRAME_IS_CONNECTED_SUCCESS&&!t.payload.isConnected&&e()})}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===Ne.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(t.payload):t.type===Ne.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:Qi.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===Ne.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?e(t.payload.smartAccountEnabledNetworks):t.type===Ne.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&e([])})}onConnectEmailSuccess(e){var t;(t=this.connectEmailResolver)==null||t.resolve(e.payload),this.setNewLastEmailLoginTime()}onConnectEmailError(e){var t;(t=this.connectEmailResolver)==null||t.reject(e.payload.message)}onConnectDeviceSuccess(){var e;(e=this.connectDeviceResolver)==null||e.resolve(void 0)}onConnectDeviceError(e){var t;(t=this.connectDeviceResolver)==null||t.reject(e.payload.message)}onConnectOtpSuccess(){var e;(e=this.connectOtpResolver)==null||e.resolve(void 0)}onConnectOtpError(e){var t;(t=this.connectOtpResolver)==null||t.reject(e.payload.message)}onConnectSuccess(e){var t;this.setEmailLoginSuccess(e.payload.email),this.setLastUsedChainId(e.payload.chainId),(t=this.connectResolver)==null||t.resolve(e.payload)}onConnectError(e){var t;(t=this.connectResolver)==null||t.reject(e.payload.message)}onConnectSocialSuccess(e){var t;e.payload.userName&&this.setSocialLoginSuccess(e.payload.userName),(t=this.connectSocialResolver)==null||t.resolve(e.payload)}onConnectSocialError(e){var t;(t=this.connectSocialResolver)==null||t.reject(e.payload.message)}onIsConnectedSuccess(e){var t;e.payload.isConnected||this.deleteAuthLoginCache(),(t=this.isConnectedResolver)==null||t.resolve(e.payload)}onIsConnectedError(e){var t;(t=this.isConnectedResolver)==null||t.reject(e.payload.message)}onGetChainIdSuccess(e){var t;this.setLastUsedChainId(e.payload.chainId),(t=this.getChainIdResolver)==null||t.resolve(e.payload)}onGetChainIdError(e){var t;(t=this.getChainIdResolver)==null||t.reject(e.payload.message)}onGetSocialRedirectUriSuccess(e){var t;(t=this.getSocialRedirectUriResolver)==null||t.resolve(e.payload)}onGetSocialRedirectUriError(e){var t;(t=this.getSocialRedirectUriResolver)==null||t.reject(e.payload.message)}onSignOutSuccess(){var e;(e=this.disconnectResolver)==null||e.resolve(void 0),this.deleteAuthLoginCache()}onSignOutError(e){var t;(t=this.disconnectResolver)==null||t.reject(e.payload.message)}onSwitchChainSuccess(e){var t;this.setLastUsedChainId(e.payload.chainId),(t=this.switchChainResolver)==null||t.resolve(e.payload)}onSwitchChainError(e){var t;(t=this.switchChainResolver)==null||t.reject(e.payload.message)}onRpcRequestSuccess(e){var t;(t=this.rpcRequestResolver)==null||t.resolve(e.payload)}onRpcRequestError(e){var t;(t=this.rpcRequestResolver)==null||t.reject(e.payload.message)}onSessionUpdate(e){}onUpdateEmailSuccess(e){var t;(t=this.updateEmailResolver)==null||t.resolve(e.payload),this.setNewLastEmailLoginTime()}onUpdateEmailError(e){var t;(t=this.updateEmailResolver)==null||t.reject(e.payload.message)}onUpdateEmailPrimaryOtpSuccess(){var e;(e=this.updateEmailPrimaryOtpResolver)==null||e.resolve(void 0)}onUpdateEmailPrimaryOtpError(e){var t;(t=this.updateEmailPrimaryOtpResolver)==null||t.reject(e.payload.message)}onUpdateEmailSecondaryOtpSuccess(e){var i;const{newEmail:t}=e.payload;this.setEmailLoginSuccess(t),(i=this.updateEmailSecondaryOtpResolver)==null||i.resolve({newEmail:t})}onUpdateEmailSecondaryOtpError(e){var t;(t=this.updateEmailSecondaryOtpResolver)==null||t.reject(e.payload.message)}onSyncThemeSuccess(){var e;(e=this.syncThemeResolver)==null||e.resolve(void 0)}onSyncThemeError(e){var t;(t=this.syncThemeResolver)==null||t.reject(e.payload.message)}onSyncDappDataSuccess(){var e;(e=this.syncDappDataResolver)==null||e.resolve(void 0)}onSyncDappDataError(e){var t;(t=this.syncDappDataResolver)==null||t.reject(e.payload.message)}onSmartAccountEnabledNetworksSuccess(e){var t;this.persistSmartAccountEnabledNetworks(e.payload.smartAccountEnabledNetworks),(t=this.smartAccountEnabledNetworksResolver)==null||t.resolve(e.payload)}onSmartAccountEnabledNetworksError(e){var t;this.persistSmartAccountEnabledNetworks([]),(t=this.smartAccountEnabledNetworksResolver)==null||t.reject(e.payload.message)}onSetPreferredAccountSuccess(){var e;(e=this.setPreferredAccountResolver)==null||e.resolve(void 0)}onSetPreferredAccountError(){var e;(e=this.setPreferredAccountResolver)==null||e.reject()}setNewLastEmailLoginTime(){Ui.set(Ne.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){Ui.set(Ne.SOCIAL_USERNAME,e)}setEmailLoginSuccess(e){Ui.set(Ne.EMAIL,e),Ui.set(Ne.EMAIL_LOGIN_USED_KEY,"true"),Ui.delete(Ne.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){Ui.delete(Ne.EMAIL_LOGIN_USED_KEY),Ui.delete(Ne.EMAIL),Ui.delete(Ne.LAST_USED_CHAIN_KEY),Ui.delete(Ne.SOCIAL_USERNAME),Ui.delete(Ne.SOCIAL,!0)}setLastUsedChainId(e){Ui.set(Ne.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){return Number(Ui.get(Ne.LAST_USED_CHAIN_KEY))}persistSmartAccountEnabledNetworks(e){Ui.set(Ne.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}}var aa=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ho=class extends Me{constructor(){super(),this.usubscribe=[],this.networkImages=Di.state.networkImages,this.address=Pe.state.address,this.profileImage=Pe.state.profileImage,this.profileName=Pe.state.profileName,this.network=Xe.state.caipNetwork,this.preferredAccountType=Pe.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(Pe.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):yt.close()}),Xe.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var t,i;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((t=this.network)==null?void 0:t.imageId)??""];return te` + + + + + + ${gt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} + + + + + + + + + + + + ${((i=this.network)==null?void 0:i.name)??"Unknown"} + + + ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()} + + Disconnect + + + + `}chooseNameButtonTemplate(){const e=Fr.getConnectedConnector(),t=dt.getAuthConnector(),i=cs.isAllowedToRegisterName();return!t||e!=="AUTH"||this.profileName||!i?null:te` + + Choose account name + + `}isAllowedNetworkSwitch(){const{requestedCaipNetworks:e}=Xe.state,t=e?e.length>1:!1,i=e==null?void 0:e.find(({id:n})=>{var o;return n===((o=this.network)==null?void 0:o.id)});return t||!i}onCopyAddress(){try{this.address&&($e.copyToClopboard(this.address),$t.showSuccess("Address copied"))}catch{$t.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){const e=Xe.checkIfSmartAccountEnabled(),t=Fr.getConnectedConnector();return!dt.getAuthConnector()||t!=="AUTH"||!e?null:(this.switched||(this.text=this.preferredAccountType===Qi.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),te` + + ${this.text} + + `)}onChooseName(){_e.push("ChooseAccountName")}async changePreferredAccountType(){const e=Xe.checkIfSmartAccountEnabled(),t=this.preferredAccountType===Qi.ACCOUNT_TYPES.SMART_ACCOUNT||!e?Qi.ACCOUNT_TYPES.EOA:Qi.ACCOUNT_TYPES.SMART_ACCOUNT,i=dt.getAuthConnector();i&&(this.loading=!0,yt.setLoading(!0),await(i==null?void 0:i.provider.setPreferredAccount(t)),await vt.reconnectExternal(i),yt.setLoading(!1),this.text=t===Qi.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,_r.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&_e.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await vt.disconnect(),bt.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),yt.close()}catch{bt.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),$t.showError("Failed to disconnect")}finally{this.disconnecting=!1}}};Ho.styles=mJ;aa([ce()],Ho.prototype,"address",void 0);aa([ce()],Ho.prototype,"profileImage",void 0);aa([ce()],Ho.prototype,"profileName",void 0);aa([ce()],Ho.prototype,"network",void 0);aa([ce()],Ho.prototype,"preferredAccountType",void 0);aa([ce()],Ho.prototype,"disconnecting",void 0);aa([ce()],Ho.prototype,"loading",void 0);aa([ce()],Ho.prototype,"switched",void 0);aa([ce()],Ho.prototype,"text",void 0);Ho=aa([me("w3m-account-settings-view")],Ho);var Dee=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let m_=class extends Me{render(){const e=Fr.getConnectedConnector();return te` + ${nt.state.enableWalletFeatures&&e==="AUTH"?this.walletFeaturesTemplate():this.defaultTemplate()} + `}walletFeaturesTemplate(){return te``}defaultTemplate(){return te``}};m_=Dee([me("w3m-account-view")],m_);var LC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let X2=class extends Me{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=$e.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return te` + + + ${this.qrButtonTemplate()} + + ${e?te``:te``} + `}onInputChange(e){this.onDebouncedSearch(e.detail)}qrButtonTemplate(){return $e.isMobile()?te` + + `:null}onWalletConnectQr(){_e.push("ConnectingWalletConnect")}};LC([ce()],X2.prototype,"search",void 0);X2=LC([me("w3m-all-wallets-view")],X2);const Nee=ct` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-thumbnail { + position: absolute; + } + + wui-visual { + width: var(--wui-wallet-image-size-lg); + height: var(--wui-wallet-image-size-lg); + border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); + position: relative; + overflow: hidden; + } + + wui-visual::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + } + + wui-icon-box { + position: absolute; + right: calc(var(--wui-spacing-3xs) * -1); + bottom: calc(var(--wui-spacing-3xs) * -1); + opacity: 0; + transform: scale(0.5); + transition: + opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), + transform var(--wui-ease-out-power-2) var(--wui-duration-lg); + will-change: opacity, transform; + } + + wui-text[align='center'] { + width: 100%; + padding: 0px var(--wui-spacing-l); + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + [data-retry='false'] wui-link { + display: none; + } + + [data-retry='true'] wui-link { + display: block; + opacity: 1; + } + + wui-link { + padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); + } +`;var bs=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ro=class extends Me{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=br.state.selectedProvider,this.uri=vt.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(br.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){var i,n;let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${(i=this.selectedOnRampProvider)==null?void 0:i.label}`);const t=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return te` + + + + + + ${this.error?null:this.loaderTemplate()} + + + + + + + ${e} + + ${t} + + + ${this.error?this.tryAgainTemplate():null} + + + + + + Copy link + + + `}watchTransactions(){if(this.selectedOnRampProvider)switch(this.selectedOnRampProvider.name){case"coinbase":this.startTime=Date.now(),this.initializeCoinbaseTransactions();break}}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{const e=Pe.state.address,t=nt.state.projectId;if(!e)throw new Error("No address found");(await li.fetchTransactions({account:e,onramp:"coinbase",projectId:t})).data.filter(o=>new Date(o.metadata.minedAt)>new Date(this.startTime)||o.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length?(clearInterval(this.intervalId),_e.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){$t.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,$e.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){var e;return(e=this.selectedOnRampProvider)!=null&&e.url?te` + + Try again + `:null}loaderTemplate(){const e=oi.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return te``}onCopyUri(){var e;if(!((e=this.selectedOnRampProvider)!=null&&e.url)){$t.showError("No link found"),_e.goBack();return}try{$e.copyToClopboard(this.selectedOnRampProvider.url),$t.showSuccess("Link copied")}catch{$t.showError("Failed to copy")}}};ro.styles=Nee;bs([ce()],ro.prototype,"intervalId",void 0);bs([ce()],ro.prototype,"selectedOnRampProvider",void 0);bs([ce()],ro.prototype,"uri",void 0);bs([ce()],ro.prototype,"ready",void 0);bs([ce()],ro.prototype,"showRetry",void 0);bs([ce()],ro.prototype,"buffering",void 0);bs([ce()],ro.prototype,"error",void 0);bs([ce()],ro.prototype,"startTime",void 0);bs([St({type:Boolean})],ro.prototype,"isMobile",void 0);bs([St()],ro.prototype,"onRetry",void 0);ro=bs([me("w3m-buy-in-progress-view")],ro);const $ee=ct` + :host > wui-flex { + max-height: clamp(360px, 540px, 80vh); + scrollbar-width: none; + overflow-y: scroll; + overflow-x: hidden; + } + + :host > wui-flex::-webkit-scrollbar { + display: none; + } + + .all-wallets { + flex-flow: column; + } +`;var jC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let vg=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` + + + + ${this.walletListTemplate()} + + + `}walletListTemplate(){const e=this.connectors.find(t=>t.type==="AUTH");return e!=null&&e.socials?e!=null&&e.showWallets?te` + + + + + + + + + + + + + `:te` `:te``}onContinueWalletClick(){_e.push("ConnectWallets")}};vg.styles=$ee;jC([ce()],vg.prototype,"connectors",void 0);vg=jC([me("w3m-connect-view")],vg);const Mee=ct` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-thumbnail { + position: absolute; + } + + wui-icon-box { + position: absolute; + right: calc(var(--wui-spacing-3xs) * -1); + bottom: calc(var(--wui-spacing-3xs) * -1); + opacity: 0; + transform: scale(0.5); + transition-property: opacity, transform; + transition-duration: var(--wui-duration-lg); + transition-timing-function: var(--wui-ease-out-power-2); + will-change: opacity, transform; + } + + wui-text[align='center'] { + width: 100%; + padding: 0px var(--wui-spacing-l); + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + [data-retry='false'] wui-link { + display: none; + } + + [data-retry='true'] wui-link { + display: block; + opacity: 1; + } +`;var Cu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class jn extends Me{constructor(){var e,t,i,n;super(),this.wallet=(e=_e.state.data)==null?void 0:e.wallet,this.connector=(t=_e.state.data)==null?void 0:t.connector,this.timeout=void 0,this.secondaryBtnLabel="Try again",this.secondaryBtnIcon="refresh",this.secondaryLabel="Accept connection request in the wallet",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=xr.getWalletImage(this.wallet)??xr.getConnectorImage(this.connector),this.name=((i=this.wallet)==null?void 0:i.name)??((n=this.connector)==null?void 0:n.name)??"Wallet",this.isRetrying=!1,this.uri=vt.state.wcUri,this.error=vt.state.wcError,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(vt.subscribeKey("wcUri",o=>{var s;this.uri=o,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(s=this.onConnect)==null||s.call(this))}),vt.subscribeKey("wcError",o=>this.error=o),vt.subscribeKey("buffering",o=>this.buffering=o))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearTimeout(this.timeout)}render(){var i;(i=this.onRender)==null||i.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let t=`Continue in ${this.name}`;return this.buffering&&(t="Connecting..."),this.error&&(t="Connection declined"),te` + + + + + ${this.error?null:this.loaderTemplate()} + + + + + + + ${t} + + ${e} + + + + + ${this.secondaryBtnLabel} + + + + ${this.isWalletConnect?te` + + + + Copy link + + + `:null} + + + `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");t==null||t.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,t;this.buffering||(vt.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(t=this.onConnect)==null||t.call(this))}loaderTemplate(){const e=oi.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return te``}onCopyUri(){try{this.uri&&($e.copyToClopboard(this.uri),$t.showSuccess("Link copied"))}catch{$t.showError("Failed to copy")}}}jn.styles=Mee;Cu([ce()],jn.prototype,"uri",void 0);Cu([ce()],jn.prototype,"error",void 0);Cu([ce()],jn.prototype,"ready",void 0);Cu([ce()],jn.prototype,"showRetry",void 0);Cu([ce()],jn.prototype,"buffering",void 0);Cu([St({type:Boolean})],jn.prototype,"isMobile",void 0);Cu([St()],jn.prototype,"onRetry",void 0);var Bee=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let w_=class extends jn{constructor(){if(super(),!this.connector)throw new Error("w3m-connecting-view: No connector provided");bt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.imageUrl&&Fr.setConnectedWalletImageUrl(this.connector.imageUrl),await vt.connectExternal(this.connector),nt.state.isSiweEnabled?_e.push("ConnectingSiwe"):yt.close(),bt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){bt.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};w_=Bee([me("w3m-connecting-external-view")],w_);var Vy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let yg=class extends Me{constructor(){var e;super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=(e=_e.state.data)==null?void 0:e.wallet,this.platform=void 0,this.platforms=[],this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),ui.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return this.wallet?(this.determinePlatforms(),te` + ${this.headerTemplate()} +
${this.platformTemplate()}
+ `):te``}async initializeConnection(e=!1){try{const{wcPairingExpiry:t}=vt.state;if(e||$e.isPairingExpired(t)){if(vt.connectWalletConnect(),this.wallet){const i=xr.getWalletImage(this.wallet);i&&Fr.setConnectedWalletImageUrl(i)}else{const n=dt.state.connectors.find(s=>s.type==="WALLET_CONNECT"),o=xr.getConnectorImage(n);o&&Fr.setConnectedWalletImageUrl(o)}if(await vt.state.wcPromise,this.finalizeConnection(),nt.state.isSiweEnabled){const{SIWEController:i}=await Bo(()=>import("./index.CaJWFNre.js"),[],import.meta.url);i.state.status==="success"?yt.close():_e.push("ConnectingSiwe")}else yt.close()}}catch(t){bt.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(t==null?void 0:t.message)??"Unknown"}}),vt.setWcError(!0),$e.isAllowedRetry(this.lastRetry)&&($t.showError("Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0))}}finalizeConnection(){var i;const{wcLinking:e,recentWallet:t}=vt.state;e&&Fr.setWalletConnectDeepLink(e),t&&Fr.setWeb3ModalRecent(t),bt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:e?"mobile":"qrcode",name:((i=this.wallet)==null?void 0:i.name)||"Unknown"}})}determinePlatforms(){if(!this.wallet)throw new Error("w3m-connecting-wc-view:determinePlatforms No wallet");if(this.platform)return;const{mobile_link:e,desktop_link:t,webapp_link:i,injected:n,rdns:o}=this.wallet,s=n==null?void 0:n.map(({injected_id:I})=>I).filter(Boolean),a=o?[o]:s??[],u=a.length,h=e,d=i,p=vt.checkInstalled(a),v=u&&p,b=t&&!$e.isMobile();v&&this.platforms.push("browser"),h&&this.platforms.push($e.isMobile()?"mobile":"qrcode"),d&&this.platforms.push("web"),b&&this.platforms.push("desktop"),!v&&u&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return te``;case"desktop":return te` + this.initializeConnection(!0)}> + + `;case"web":return te` + this.initializeConnection(!0)}> + + `;case"mobile":return te` + this.initializeConnection(!0)}> + + `;case"qrcode":return te``;default:return te``}}headerTemplate(){return this.platforms.length>1?te` + + + `:null}async onSelectPlatform(e){var i;const t=(i=this.shadowRoot)==null?void 0:i.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};Vy([ce()],yg.prototype,"platform",void 0);Vy([ce()],yg.prototype,"platforms",void 0);yg=Vy([me("w3m-connecting-wc-view")],yg);const Uee=ct` + .continue-button-container { + width: 100%; + } +`;var FC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let bg=class extends Me{constructor(){super(...arguments),this.loading=!1}render(){return te` + + ${this.onboardingTemplate()} ${this.buttonsTemplate()} + {$e.openHref(py.URLS.FAQ,"_blank")}} + > + Learn more about names + + + + `}onboardingTemplate(){return te` + + + + + + Choose your account name + + + Finally say goodbye to 0x addresses, name your account to make it easier to exchange + assets + + + `}buttonsTemplate(){return te` + _e.push("RegisterAccountName")} + >Choose name + + `}};bg.styles=Uee;FC([ce()],bg.prototype,"loading",void 0);bg=FC([me("w3m-choose-account-name-view")],bg);var Lee=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let v_=class extends Me{constructor(){var e;super(...arguments),this.wallet=(e=_e.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return te` + + ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} + ${this.homepageTemplate()} + + `}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?te` + Chrome Extension + `:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?te` + iOS App + `:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?te` + Android App + `:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?te` + + Website + + `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&$e.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&$e.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&$e.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&$e.openHref(this.wallet.homepage,"_blank")}};v_=Lee([me("w3m-downloads-view")],v_);var jee=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const Fee="https://walletconnect.com/explorer";let y_=class extends Me{render(){return te` + + ${this.recommendedWalletsTemplate()} + {$e.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} + > + + `}recommendedWalletsTemplate(){const{recommended:e,featured:t}=Tt.state,{customWallets:i}=nt.state;return[...t,...i??[],...e].slice(0,4).map(o=>te` + {$e.openHref(o.homepage??Fee,"_blank")}} + > + `)}};y_=jee([me("w3m-get-wallet-view")],y_);const zee=ct` + wui-flex { + width: 100%; + } + + .suggestion { + background: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } + + .suggestion:hover { + background-color: var(--wui-gray-glass-005); + cursor: pointer; + } + + .suggested-name { + max-width: 75%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + form { + width: 100%; + } + + wui-icon-link { + position: absolute; + right: 20px; + transform: translateY(11px); + } +`;/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Wee=r=>r.strings===void 0;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Hee={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},qee=r=>(...e)=>({_$litDirective$:r,values:e});class Vee{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const lf=(r,e)=>{var i;const t=r._$AN;if(t===void 0)return!1;for(const n of t)(i=n._$AO)==null||i.call(n,e,!1),lf(n,e);return!0},_g=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while((t==null?void 0:t.size)===0)},zC=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Zee(e)}};function Kee(r){this._$AN!==void 0?(_g(this),this._$AM=r,zC(this)):this._$AM=r}function Gee(r,e=!1,t=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(i))for(let o=t;o{r.type==Hee.CHILD&&(r._$AP??(r._$AP=Gee),r._$AQ??(r._$AQ=Kee))};class Qee extends Vee{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),zC(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,n;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),t&&(lf(this,e),_g(this))}setValue(e){if(Wee(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Xf=()=>new Yee;class Yee{}const t2=new WeakMap,e0=qee(class extends Qee{render(r){return ci}update(r,[e]){var i;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=r.options)==null?void 0:i.host,this.rt(this.ct=r.element)),ci}rt(r){if(this.isConnected||(r=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let t=t2.get(e);t===void 0&&(t=new WeakMap,t2.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,r),r!==void 0&&this.Y.call(this.ht,r)}else this.Y.value=r}get lt(){var r,e;return typeof this.Y=="function"?(r=t2.get(this.ht??globalThis))==null?void 0:r.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Su=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ka=class extends Me{constructor(){super(),this.formRef=Xf(),this.usubscribe=[],this.name="",this.error="",this.loading=cs.state.loading,this.suggestions=cs.state.suggestions,this.registered=!1,this.onDebouncedNameInputChange=$e.debounce(e=>{cs.validateName(e)?(this.error="",this.name=e,cs.getSuggestions(e),cs.isNameRegistered(e).then(t=>{this.registered=t})):e.length<4?this.error="Name must be at least 4 characters long":this.error="Can only contain letters, numbers and - characters"}),this.usubscribe.push(cs.subscribe(e=>{this.suggestions=e.suggestions,this.loading=e.loading}))}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){var e;super.disconnectedCallback(),this.usubscribe.forEach(t=>t()),(e=this.formRef.value)==null||e.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return te` + +
+ + + ${this.submitButtonTemplate()} + +
+ ${this.templateSuggestions()} +
+ `}submitButtonTemplate(){return this.isAllowedToSubmit()?te` + + + `:null}onSelectSuggestion(e){return()=>{this.name=e,this.registered=!1,this.requestUpdate()}}onNameInputChange(e){this.onDebouncedNameInputChange(e.detail)}nameSuggestionTagTemplate(){return this.loading?te``:this.registered?te`Registered`:te`Available`}templateSuggestions(){if(!this.name||this.name.length<4||this.error)return null;const e=this.registered?this.suggestions.filter(t=>t.name!==this.name):[];return te` + + + ${this.name}${this.nameSuggestionTagTemplate()} + + ${e.map(t=>this.availableNameTemplate(t.name))} + `}availableNameTemplate(e){return te` + + ${e} + + Available + `}isAllowedToSubmit(){return!this.loading&&!this.registered&&!this.error&&cs.validateName(this.name)}async onSubmitName(){try{if(!this.isAllowedToSubmit())return;await cs.registerName(this.name)}catch(e){$t.showError(e.message)}}onEnterKey(e){e.key==="Enter"&&this.isAllowedToSubmit()&&this.onSubmitName()}};Ka.styles=zee;Su([St()],Ka.prototype,"errorMessage",void 0);Su([ce()],Ka.prototype,"name",void 0);Su([ce()],Ka.prototype,"error",void 0);Su([ce()],Ka.prototype,"loading",void 0);Su([ce()],Ka.prototype,"suggestions",void 0);Su([ce()],Ka.prototype,"registered",void 0);Ka=Su([me("w3m-register-account-name-view")],Ka);const Jee=ct` + .continue-button-container { + width: 100%; + } +`;var Xee=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let e3=class extends Me{render(){return te` + + ${this.onboardingTemplate()} ${this.buttonsTemplate()} + {$e.openHref(py.URLS.FAQ,"_blank")}} + > + Learn more + + + + `}onboardingTemplate(){return te` + + + + + + Account name chosen successfully + + + You can now fund your account and trade crypto + + + `}buttonsTemplate(){return te` + Let's Go! + + `}redirectToAccount(){_e.replace("Account")}};e3.styles=Jee;e3=Xee([me("w3m-register-account-name-success-view")],e3);const ete=ct` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-hexagon { + position: absolute; + } + + wui-icon-box { + position: absolute; + right: 4px; + bottom: 0; + opacity: 0; + transform: scale(0.5); + z-index: 1; + } + + wui-button { + display: none; + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + wui-button[data-retry='true'] { + display: block; + opacity: 1; + } +`;var Ky=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let t0=class extends Me{constructor(){var e;super(),this.network=(e=_e.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),t=this.getSubLabel();return te` + + + + + ${this.error?null:te``} + + + + + + ${e} + ${t} + + + + + Try again + + + `}getSubLabel(){const e=Fr.getConnectedConnector();return dt.getAuthConnector()&&e==="AUTH"?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var i;const e=Fr.getConnectedConnector();return dt.getAuthConnector()&&e==="AUTH"?`Switching to ${((i=this.network)==null?void 0:i.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");t==null||t.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&(await Xe.switchActiveNetwork(this.network),nt.state.isSiweEnabled||nm.navigateAfterNetworkSwitch())}catch{this.error=!0}}};t0.styles=ete;Ky([ce()],t0.prototype,"showRetry",void 0);Ky([ce()],t0.prototype,"error",void 0);t0=Ky([me("w3m-network-switch-view")],t0);const tte=ct` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var WC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let xg=class extends Me{constructor(){super(),this.unsubscribe=[],this.caipNetwork=Xe.state.caipNetwork,this.unsubscribe.push(Xe.subscribeKey("caipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` + + ${this.networksTemplate()} + + + + + + + Your connected wallet may not support some of the networks available for this dApp + + + + What is a network + + + `}onNetworkHelp(){bt.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),_e.push("WhatIsANetwork")}networksTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:t,supportsAllNetworks:i}=Xe.state,n=$e.sortRequestedNetworks(e,t);return n==null?void 0:n.map(o=>{var s;return te` + this.onSwitchNetwork(o)} + .disabled=${!i&&!(e!=null&&e.includes(o.id))} + data-testid=${`w3m-network-switch-${o.name??o.id}`} + > + `})}async onSwitchNetwork(e){const{isConnected:t}=Pe.state,{approvedCaipNetworkIds:i,supportsAllNetworks:n,caipNetwork:o}=Xe.state,{data:s}=_e.state;t&&(o==null?void 0:o.id)!==e.id?i!=null&&i.includes(e.id)?(await Xe.switchActiveNetwork(e),nm.navigateAfterNetworkSwitch()):n&&_e.push("SwitchNetwork",{...s,network:e}):t||(Xe.setCaipNetwork(e),_e.push("Connect"))}};xg.styles=tte;WC([ce()],xg.prototype,"caipNetwork",void 0);xg=WC([me("w3m-networks-view")],xg);const rte=ct` + :host > wui-flex { + height: 500px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + padding: var(--wui-spacing-m); + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: flex-start; + } + + :host > wui-flex::-webkit-scrollbar { + display: none; + } + + :host > wui-flex > wui-flex { + width: 100%; + } + + wui-transaction-list-item-loader { + width: 100%; + } +`;var $0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const ite=7;let su=class extends Me{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=br.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=Zi.state.coinbaseTransactions,this.tokenImages=Di.state.tokenImages,this.unsubscribe.push(br.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e}),Di.subscribeKey("tokenImages",e=>this.tokenImages=e),()=>{clearTimeout(this.refetchTimeout)},Zi.subscribe(e=>{this.coinbaseTransactions={...e.coinbaseTransactions}})),Zi.clearCursor(),this.fetchTransactions()}render(){return te` + + ${this.loading?this.templateLoading():this.templateTransactionsByYear()} + + `}templateTransactions(e){return e==null?void 0:e.map(t=>{var a,u,h;const i=fy.formatDate((a=t==null?void 0:t.metadata)==null?void 0:a.minedAt),n=t.transfers[0],o=n==null?void 0:n.fungible_info;if(!o)return null;const s=((u=o==null?void 0:o.icon)==null?void 0:u.url)||((h=this.tokenImages)==null?void 0:h[o.symbol||""]);return te` + + `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(t=>{const i=parseInt(t,10);return new Array(12).fill(null).map((o,s)=>s).reverse().map(o=>{var u;const s=Nl.getTransactionGroupTitle(i,o),a=(u=this.coinbaseTransactions[i])==null?void 0:u[o];return a?te` + + + ${s} + + + ${this.templateTransactions(a)} + + + `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const e=Pe.state.address,t=nt.state.projectId;if(!e)throw new Error("No address found");if(!t)throw new Error("No projectId found");this.loading=!0,await Zi.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){var n;const e=new Date;if((((n=this.coinbaseTransactions[e.getFullYear()])==null?void 0:n[e.getMonth()])||[]).filter(o=>o.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length===0){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{const o=Pe.state.address;await Zi.fetchTransactions(o,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(ite).fill(te` `).map(e=>e)}};su.styles=rte;$0([ce()],su.prototype,"selectedOnRampProvider",void 0);$0([ce()],su.prototype,"loading",void 0);$0([ce()],su.prototype,"coinbaseTransactions",void 0);$0([ce()],su.prototype,"tokenImages",void 0);su=$0([me("w3m-onramp-activity-view")],su);const nte=ct` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var Sm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let zh=class extends Me{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=br.state.paymentCurrency,this.currencies=br.state.paymentCurrencies,this.currencyImages=Di.state.currencyImages,this.unsubscribe.push(br.subscribe(e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies}),Di.subscribeKey("currencyImages",e=>this.currencyImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` + + ${this.currenciesTemplate()} + + + `}currenciesTemplate(){return this.currencies.map(e=>{var t;return te` + this.selectCurrency(e)} + variant="image" + > + ${e.id} + + `})}selectCurrency(e){e&&(br.setPaymentCurrency(e),yt.close())}};zh.styles=nte;Sm([ce()],zh.prototype,"selectedCurrency",void 0);Sm([ce()],zh.prototype,"currencies",void 0);Sm([ce()],zh.prototype,"currencyImages",void 0);zh=Sm([me("w3m-onramp-fiat-select-view")],zh);var HC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let t3=class extends Me{constructor(){super(),this.unsubscribe=[],this.providers=br.state.providers,this.unsubscribe.push(br.subscribeKey("providers",e=>{this.providers=e}))}firstUpdated(){const e=this.providers.map(async t=>t.name==="coinbase"?await this.getCoinbaseOnRampURL():Promise.resolve(t==null?void 0:t.url));Promise.all(e).then(t=>{this.providers=this.providers.map((i,n)=>({...i,url:t[n]||""}))})}render(){return te` + + ${this.onRampProvidersTemplate()} + + + `}onRampProvidersTemplate(){return this.providers.map(e=>te` + {this.onClickProvider(e)}} + ?disabled=${!e.url} + > + `)}onClickProvider(e){br.setSelectedProvider(e),_e.push("BuyInProgress"),$e.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes")}async getCoinbaseOnRampURL(){const e=Pe.state.address,t=Xe.state.caipNetwork;if(!e)throw new Error("No address found");if(!(t!=null&&t.name))throw new Error("No network found");const i=ui.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[t.name]??ui.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,n=br.state.purchaseCurrency,o=n?[n.symbol]:br.state.purchaseCurrencies.map(s=>s.symbol);return await li.generateOnRampURL({defaultNetwork:i,destinationWallets:[{address:e,blockchains:ui.WC_COINBASE_PAY_SDK_CHAINS,assets:o}],partnerUserId:e,purchaseAmount:br.state.purchaseAmount})}};HC([ce()],t3.prototype,"providers",void 0);t3=HC([me("w3m-onramp-providers-view")],t3);const ote=ct` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var Im=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Wh=class extends Me{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=br.state.purchaseCurrencies,this.tokens=br.state.purchaseCurrencies,this.tokenImages=Di.state.tokenImages,this.unsubscribe.push(br.subscribe(e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies}),Di.subscribeKey("tokenImages",e=>this.tokenImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` + + ${this.currenciesTemplate()} + + + `}currenciesTemplate(){return this.tokens.map(e=>{var t;return te` + this.selectToken(e)} + variant="image" + > + + ${e.name} + ${e.symbol} + + + `})}selectToken(e){e&&(br.setPurchaseCurrency(e),yt.close())}};Wh.styles=ote;Im([ce()],Wh.prototype,"selectedCurrency",void 0);Im([ce()],Wh.prototype,"tokens",void 0);Im([ce()],Wh.prototype,"tokenImages",void 0);Wh=Im([me("w3m-onramp-token-select-view")],Wh);const ste=ct` + :host > wui-flex:first-child { + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + } + + :host > wui-flex:first-child::-webkit-scrollbar { + display: none; + } + + wui-loading-hexagon { + position: absolute; + } + + .action-button { + width: 100%; + border-radius: var(--wui-border-radius-xs); + } + + .action-button:disabled { + border-color: 1px solid var(--wui-color-gray-glass-005); + } + + .swap-inputs-container { + position: relative; + } + + .replace-tokens-button-container { + display: flex; + justify-content: center; + align-items: center; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + gap: var(--wui-spacing-1xs); + border-radius: var(--wui-border-radius-xs); + background-color: var(--wui-color-modal-bg-base); + padding: var(--wui-spacing-xxs); + } + + .replace-tokens-button-container > button { + display: flex; + justify-content: center; + align-items: center; + height: 40px; + width: 40px; + padding: var(--wui-spacing-xs); + border: none; + border-radius: var(--wui-border-radius-xxs); + background: var(--wui-color-gray-glass-002); + transition: background-color var(--wui-duration-md) var(--wui-ease-out-power-1); + will-change: background-color; + z-index: 20; + } + + .replace-tokens-button-container > button:hover { + background: var(--wui-color-gray-glass-005); + } + + .details-container > wui-flex { + background: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + width: 100%; + } + + .details-container > wui-flex > button { + border: none; + background: none; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + transition: background 0.2s linear; + } + + .details-container > wui-flex > button:hover { + background: var(--wui-color-gray-glass-002); + } + + .details-content-container { + padding: var(--wui-spacing-1xs); + display: flex; + align-items: center; + justify-content: center; + } + + .details-content-container > wui-flex { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s) var(--wui-spacing-xl); + border-radius: var(--wui-border-radius-xxs); + background: var(--wui-color-gray-glass-002); + } +`;var Wi=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let bi=class extends Me{constructor(){var e;super(),this.unsubscribe=[],this.detailsOpen=!1,this.caipNetworkId=(e=Xe.state.caipNetwork)==null?void 0:e.id,this.initialized=Ve.state.initialized,this.loading=Ve.state.loading,this.loadingPrices=Ve.state.loadingPrices,this.sourceToken=Ve.state.sourceToken,this.sourceTokenAmount=Ve.state.sourceTokenAmount,this.sourceTokenPriceInUSD=Ve.state.sourceTokenPriceInUSD,this.toToken=Ve.state.toToken,this.toTokenAmount=Ve.state.toTokenAmount,this.toTokenPriceInUSD=Ve.state.toTokenPriceInUSD,this.inputError=Ve.state.inputError,this.gasPriceInUSD=Ve.state.gasPriceInUSD,this.transactionLoading=Ve.state.transactionLoading,this.fetchError=Ve.state.fetchError,this.onDebouncedGetSwapCalldata=$e.debounce(async()=>{await Ve.swapTokens()},200),Xe.subscribeKey("caipNetwork",t=>{this.caipNetworkId!==(t==null?void 0:t.id)&&(this.caipNetworkId=t==null?void 0:t.id,Ve.resetState(),Ve.initializeState())}),this.unsubscribe.push(yt.subscribeKey("open",t=>{t||Ve.resetState()}),_e.subscribeKey("view",t=>{t.includes("Swap")||Ve.resetValues()}),Ve.subscribe(t=>{this.initialized=t.initialized,this.loading=t.loading,this.loadingPrices=t.loadingPrices,this.transactionLoading=t.transactionLoading,this.sourceToken=t.sourceToken,this.sourceTokenAmount=t.sourceTokenAmount,this.sourceTokenPriceInUSD=t.sourceTokenPriceInUSD,this.toToken=t.toToken,this.toTokenAmount=t.toTokenAmount,this.toTokenPriceInUSD=t.toTokenPriceInUSD,this.inputError=t.inputError,this.gasPriceInUSD=t.gasPriceInUSD,this.fetchError=t.fetchError}))}firstUpdated(){Ve.initializeState(),this.watchTokensAndValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return te` + + ${this.initialized?this.templateSwap():this.templateLoading()} + + `}watchTokensAndValues(){this.interval=setInterval(()=>{Ve.getNetworkTokenPrice(),Ve.getMyTokensWithBalance(),Ve.swapTokens()},1e4)}templateSwap(){return te` + + + ${this.templateTokenInput("sourceToken",this.sourceToken)} + ${this.templateTokenInput("toToken",this.toToken)} ${this.templateReplaceTokensButton()} + + ${this.templateDetails()} ${this.templateActionButton()} + + `}actionButtonLabel(){return this.fetchError?"Swap":!this.sourceToken||!this.toToken?"Select token":this.sourceTokenAmount?this.initialized?this.inputError?this.inputError:"Review swap":"Swap":"Enter amount"}templateReplaceTokensButton(){return te` + + + + `}templateLoading(){return te` + + + + + ${this.templateReplaceTokensButton()} + + ${this.templateActionButton()} + + `}templateTokenInput(e,t){var a,u;const i=(a=Ve.state.myTokensWithBalance)==null?void 0:a.find(h=>(h==null?void 0:h.address)===(t==null?void 0:t.address)),n=e==="toToken"?this.toTokenAmount:this.sourceTokenAmount,o=e==="toToken"?this.toTokenPriceInUSD:this.sourceTokenPriceInUSD;let s=parseFloat(n)*o;return e==="toToken"&&(s-=this.gasPriceInUSD||0),te``}onSetMaxValue(e,t){const i=e==="sourceToken"?this.sourceToken:this.toToken,n=(i==null?void 0:i.address)===ui.NATIVE_TOKEN_ADDRESS;let o="0";if(!t){o="0",this.handleChangeAmount(e,o);return}if(!this.gasPriceInUSD){o=t,this.handleChangeAmount(e,o);return}const s=pr.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.sourceTokenPriceInUSD),a=n?pr.bigNumber(t).minus(s):pr.bigNumber(t);this.handleChangeAmount(e,a.isGreaterThan(0)?a.toFixed(20):"0")}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:te``}handleChangeAmount(e,t){Ve.clearError(),e==="sourceToken"?Ve.setSourceTokenAmount(t):Ve.setToTokenAmount(t),this.onDebouncedGetSwapCalldata()}templateActionButton(){const e=!this.toToken||!this.sourceToken,t=!this.sourceTokenAmount,i=this.loading||this.loadingPrices||this.transactionLoading,n=i||e||t||this.inputError;return te` + + ${this.actionButtonLabel()} + + `}onSwitchTokens(){Ve.switchTokens()}onSwapPreview(){if(this.fetchError){Ve.swapTokens();return}_e.push("SwapPreview")}};bi.styles=ste;Wi([ce()],bi.prototype,"interval",void 0);Wi([ce()],bi.prototype,"detailsOpen",void 0);Wi([ce()],bi.prototype,"caipNetworkId",void 0);Wi([ce()],bi.prototype,"initialized",void 0);Wi([ce()],bi.prototype,"loading",void 0);Wi([ce()],bi.prototype,"loadingPrices",void 0);Wi([ce()],bi.prototype,"sourceToken",void 0);Wi([ce()],bi.prototype,"sourceTokenAmount",void 0);Wi([ce()],bi.prototype,"sourceTokenPriceInUSD",void 0);Wi([ce()],bi.prototype,"toToken",void 0);Wi([ce()],bi.prototype,"toTokenAmount",void 0);Wi([ce()],bi.prototype,"toTokenPriceInUSD",void 0);Wi([ce()],bi.prototype,"inputError",void 0);Wi([ce()],bi.prototype,"gasPriceInUSD",void 0);Wi([ce()],bi.prototype,"transactionLoading",void 0);Wi([ce()],bi.prototype,"fetchError",void 0);bi=Wi([me("w3m-swap-view")],bi);const ate=ct` + :host > wui-flex:first-child { + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + } + + :host > wui-flex:first-child::-webkit-scrollbar { + display: none; + } + + .preview-container, + .details-container { + width: 100%; + } + + .token-image { + width: 24px; + height: 24px; + box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); + border-radius: 12px; + } + + wui-loading-hexagon { + position: absolute; + } + + .token-item { + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-xxs); + padding: var(--wui-spacing-xs); + height: 40px; + border: none; + border-radius: 80px; + background: var(--wui-color-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); + cursor: pointer; + transition: background 0.2s linear; + } + + .token-item:hover { + background: var(--wui-color-gray-glass-005); + } + + .preview-token-details-container { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s) var(--wui-spacing-xl); + border-radius: var(--wui-border-radius-xxs); + background: var(--wui-color-gray-glass-002); + } + + .action-buttons-container { + width: 100%; + gap: var(--wui-spacing-xs); + } + + .action-buttons-container > button { + display: flex; + align-items: center; + justify-content: center; + background: transparent; + height: 48px; + border-radius: var(--wui-border-radius-xs); + border: none; + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } + + .action-buttons-container > button:disabled { + opacity: 0.8; + cursor: not-allowed; + } + + .cancel-button:hover, + .action-button:hover { + cursor: pointer; + } + + .action-buttons-container > wui-button.cancel-button { + flex: 2; + } + + .action-buttons-container > wui-button.action-button { + flex: 4; + } + + .action-buttons-container > button.action-button > wui-text { + color: white; + } + + .details-container > wui-flex { + background: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + width: 100%; + } + + .details-container > wui-flex > button { + border: none; + background: none; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + transition: background 0.2s linear; + } + + .details-container > wui-flex > button:hover { + background: var(--wui-color-gray-glass-002); + } + + .details-content-container { + padding: var(--wui-spacing-1xs); + display: flex; + align-items: center; + justify-content: center; + } + + .details-content-container > wui-flex { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s) var(--wui-spacing-xl); + border-radius: var(--wui-border-radius-xxs); + background: var(--wui-color-gray-glass-002); + } +`;var Hi=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let _i=class extends Me{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!0,this.approvalTransaction=Ve.state.approvalTransaction,this.swapTransaction=Ve.state.swapTransaction,this.sourceToken=Ve.state.sourceToken,this.sourceTokenAmount=Ve.state.sourceTokenAmount??"",this.sourceTokenPriceInUSD=Ve.state.sourceTokenPriceInUSD,this.toToken=Ve.state.toToken,this.toTokenAmount=Ve.state.toTokenAmount??"",this.toTokenPriceInUSD=Ve.state.toTokenPriceInUSD,this.caipNetwork=Xe.state.caipNetwork,this.transactionLoading=Ve.state.transactionLoading,this.balanceSymbol=Pe.state.balanceSymbol,this.gasPriceInUSD=Ve.state.gasPriceInUSD,this.inputError=Ve.state.inputError,this.loading=Ve.state.loading,this.unsubscribe.push(Pe.subscribeKey("balanceSymbol",e=>{this.balanceSymbol!==e&&_e.goBack()}),Xe.subscribeKey("caipNetwork",e=>{this.caipNetwork!==e&&(this.caipNetwork=e)}),Ve.subscribe(e=>{this.approvalTransaction=e.approvalTransaction,this.swapTransaction=e.swapTransaction,this.sourceToken=e.sourceToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toToken=e.toToken,this.transactionLoading=e.transactionLoading,this.gasPriceInUSD=e.gasPriceInUSD,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.sourceTokenAmount=e.sourceTokenAmount??"",this.toTokenAmount=e.toTokenAmount??"",this.inputError=e.inputError,this.loading=e.loading}))}firstUpdated(){Ve.getTransaction(),this.refreshTransaction()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return te` + + ${this.templateSwap()} + + `}refreshTransaction(){this.interval=setInterval(()=>{Ve.getTransaction()},1e4)}templateSwap(){var a,u,h,d;const e=`${gt.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${(a=this.sourceToken)==null?void 0:a.symbol}`,t=`${gt.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${(u=this.toToken)==null?void 0:u.symbol}`,i=parseFloat(this.sourceTokenAmount)*this.sourceTokenPriceInUSD,n=parseFloat(this.toTokenAmount)*this.toTokenPriceInUSD-(this.gasPriceInUSD||0),o=gt.formatNumberToLocalString(i),s=gt.formatNumberToLocalString(n);return te` + + + + + Send + $${o} + + + + + + + + Receive + $${s} + + + + + + + ${this.templateDetails()} + + + + Review transaction carefully + + + + + Cancel + + + ${this.transactionLoading?te``:te` + ${this.actionButtonLabel()} + `} + + + + `}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:te``}actionButtonLabel(){return this.approvalTransaction?"Approve":"Swap"}onCancelTransaction(){_e.goBack()}onSendTransaction(){this.approvalTransaction?Ve.sendTransactionForApproval(this.approvalTransaction):Ve.sendTransactionForSwap(this.swapTransaction)}};_i.styles=ate;Hi([ce()],_i.prototype,"interval",void 0);Hi([ce()],_i.prototype,"detailsOpen",void 0);Hi([ce()],_i.prototype,"approvalTransaction",void 0);Hi([ce()],_i.prototype,"swapTransaction",void 0);Hi([ce()],_i.prototype,"sourceToken",void 0);Hi([ce()],_i.prototype,"sourceTokenAmount",void 0);Hi([ce()],_i.prototype,"sourceTokenPriceInUSD",void 0);Hi([ce()],_i.prototype,"toToken",void 0);Hi([ce()],_i.prototype,"toTokenAmount",void 0);Hi([ce()],_i.prototype,"toTokenPriceInUSD",void 0);Hi([ce()],_i.prototype,"caipNetwork",void 0);Hi([ce()],_i.prototype,"transactionLoading",void 0);Hi([ce()],_i.prototype,"balanceSymbol",void 0);Hi([ce()],_i.prototype,"gasPriceInUSD",void 0);Hi([ce()],_i.prototype,"inputError",void 0);Hi([ce()],_i.prototype,"loading",void 0);_i=Hi([me("w3m-swap-preview-view")],_i);const cte=ct` + :host { + --tokens-scroll--top-opacity: 0; + --tokens-scroll--bottom-opacity: 1; + --suggested-tokens-scroll--left-opacity: 0; + --suggested-tokens-scroll--right-opacity: 1; + } + + :host > wui-flex:first-child { + overflow-y: hidden; + overflow-x: hidden; + scrollbar-width: none; + scrollbar-height: none; + } + + :host > wui-flex:first-child::-webkit-scrollbar { + display: none; + } + + wui-loading-hexagon { + position: absolute; + } + + .suggested-tokens-container { + overflow-x: auto; + mask-image: linear-gradient( + to right, + rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 0px, + rgba(200, 200, 200, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 1px, + black 50px, + black 90px, + black calc(100% - 90px), + black calc(100% - 50px), + rgba(155, 155, 155, calc(1 - var(--suggested-tokens-scroll--right-opacity))) calc(100% - 1px), + rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--right-opacity))) 100% + ); + } + + .suggested-tokens-container::-webkit-scrollbar { + display: none; + } + + .tokens-container { + border-top: 1px solid var(--wui-color-gray-glass-005); + height: 100%; + max-height: 390px; + } + + .tokens { + width: 100%; + overflow-y: auto; + mask-image: linear-gradient( + to bottom, + rgba(0, 0, 0, calc(1 - var(--tokens-scroll--top-opacity))) 0px, + rgba(200, 200, 200, calc(1 - var(--tokens-scroll--top-opacity))) 1px, + black 50px, + black 90px, + black calc(100% - 90px), + black calc(100% - 50px), + rgba(155, 155, 155, calc(1 - var(--tokens-scroll--bottom-opacity))) calc(100% - 1px), + rgba(0, 0, 0, calc(1 - var(--tokens-scroll--bottom-opacity))) 100% + ); + } + + .network-search-input, + .select-network-button { + height: 40px; + } + + .select-network-button { + border: none; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-xs); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); + background-color: transparent; + border-radius: var(--wui-border-radius-xxs); + padding: var(--wui-spacing-xs); + align-items: center; + transition: background-color 0.2s linear; + } + + .select-network-button:hover { + background-color: var(--wui-color-gray-glass-002); + } + + .select-network-button > wui-image { + width: 26px; + height: 26px; + border-radius: var(--wui-border-radius-xs); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); + } +`;var tc=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ws=class extends Me{constructor(){var e;super(),this.unsubscribe=[],this.targetToken=(e=_e.state.data)==null?void 0:e.target,this.sourceToken=Ve.state.sourceToken,this.sourceTokenAmount=Ve.state.sourceTokenAmount,this.toToken=Ve.state.toToken,this.myTokensWithBalance=Ve.state.myTokensWithBalance,this.popularTokens=Ve.state.popularTokens,this.searchValue="",this.unsubscribe.push(Ve.subscribe(t=>{this.sourceToken=t.sourceToken,this.toToken=t.toToken,this.myTokensWithBalance=t.myTokensWithBalance}))}updated(){var i,n;const e=(i=this.renderRoot)==null?void 0:i.querySelector(".suggested-tokens-container");e==null||e.addEventListener("scroll",this.handleSuggestedTokensScroll.bind(this));const t=(n=this.renderRoot)==null?void 0:n.querySelector(".tokens");t==null||t.addEventListener("scroll",this.handleTokenListScroll.bind(this))}disconnectedCallback(){var i,n;super.disconnectedCallback();const e=(i=this.renderRoot)==null?void 0:i.querySelector(".suggested-tokens-container"),t=(n=this.renderRoot)==null?void 0:n.querySelector(".tokens");e==null||e.removeEventListener("scroll",this.handleSuggestedTokensScroll.bind(this)),t==null||t.removeEventListener("scroll",this.handleTokenListScroll.bind(this)),clearInterval(this.interval)}render(){return te` + + ${this.templateSearchInput()} ${this.templateSuggestedTokens()} ${this.templateTokens()} + + `}onSelectToken(e){this.targetToken==="sourceToken"?Ve.setSourceToken(e):(Ve.setToToken(e),this.sourceToken&&this.sourceTokenAmount&&Ve.swapTokens()),_e.goBack()}templateSearchInput(){return te` + + + + `}templateTokens(){const e=this.myTokensWithBalance?Object.values(this.myTokensWithBalance):[],t=this.popularTokens?this.popularTokens:[],i=this.filterTokensWithText(e,this.searchValue),n=this.filterTokensWithText(t,this.searchValue);return te` + + + ${(i==null?void 0:i.length)>0?te` + + Your tokens + + ${i.map(o=>{var a,u,h;const s=o.symbol===((a=this.sourceToken)==null?void 0:a.symbol)||o.symbol===((u=this.toToken)==null?void 0:u.symbol);return te` + {s||this.onSelectToken(o)}} + > + + `})} + `:null} + + + Popular tokens + + ${(n==null?void 0:n.length)>0?n.map(o=>te` + this.onSelectToken(o)} + > + + `):null} + + + `}templateSuggestedTokens(){const e=Ve.state.suggestedTokens?Ve.state.suggestedTokens.slice(0,8):null;return e?te` + + ${e.map(t=>te` + this.onSelectToken(t)} + > + + `)} + + `:null}onSearchInputChange(e){this.searchValue=e.detail}handleSuggestedTokensScroll(){var t;const e=(t=this.renderRoot)==null?void 0:t.querySelector(".suggested-tokens-container");e&&(e.style.setProperty("--suggested-tokens-scroll--left-opacity",a1.interpolate([0,100],[0,1],e.scrollLeft).toString()),e.style.setProperty("--suggested-tokens-scroll--right-opacity",a1.interpolate([0,100],[0,1],e.scrollWidth-e.scrollLeft-e.offsetWidth).toString()))}handleTokenListScroll(){var t;const e=(t=this.renderRoot)==null?void 0:t.querySelector(".tokens");e&&(e.style.setProperty("--tokens-scroll--top-opacity",a1.interpolate([0,100],[0,1],e.scrollTop).toString()),e.style.setProperty("--tokens-scroll--bottom-opacity",a1.interpolate([0,100],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString()))}filterTokensWithText(e,t){return e.filter(i=>`${i.symbol} ${i.name} ${i.address}`.toLowerCase().includes(t.toLowerCase()))}};ws.styles=cte;tc([ce()],ws.prototype,"interval",void 0);tc([ce()],ws.prototype,"targetToken",void 0);tc([ce()],ws.prototype,"sourceToken",void 0);tc([ce()],ws.prototype,"sourceTokenAmount",void 0);tc([ce()],ws.prototype,"toToken",void 0);tc([ce()],ws.prototype,"myTokensWithBalance",void 0);tc([ce()],ws.prototype,"popularTokens",void 0);tc([ce()],ws.prototype,"searchValue",void 0);ws=tc([me("w3m-swap-select-token-view")],ws);const lte=ct` + :host > wui-flex:first-child { + height: 500px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + } + + :host > wui-flex:first-child::-webkit-scrollbar { + display: none; + } +`;var ute=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let r3=class extends Me{render(){return te` + + + + `}};r3.styles=lte;r3=ute([me("w3m-transactions-view")],r3);var hte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const dte=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let b_=class extends Me{render(){return te` + + + {$e.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} + > + Learn more + + + + `}};b_=hte([me("w3m-what-is-a-network-view")],b_);var fte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const pte=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let __=class extends Me{render(){return te` + + + + + Get a wallet + + + `}onGetWallet(){bt.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),_e.push("GetWallet")}};__=fte([me("w3m-what-is-a-wallet-view")],__);var gte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let x_=class extends Me{render(){return te` + + + + + Quickly and easily buy digital assets! + + + Simply select your preferred onramp provider and add digital assets to your account + using your credit card or bank transfer + + + + + Buy + + + `}};x_=gte([me("w3m-what-is-a-buy-view")],x_);const mte=ct` + wui-loading-spinner { + margin: 9px auto; + } +`;var Tm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const wte=6;let Ga=class extends Me{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var e;super(),this.loading=!1,this.timeoutTimeLeft=Pi.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(e=_e.state.data)==null?void 0:e.email,this.authConnector=dt.getAuthConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const e=!!this.timeoutTimeLeft,t=this.getFooterLabels(e);return te` + + + Enter the code we sent to + ${this.email} + + + The code expires in 20 minutes + + ${this.loading?te``:te` + + ${this.error?te` + + ${this.error}. Try Again + + `:null} + `} + + + ${t.title} + + ${t.action} + + + + `}startOTPTimeout(){this.timeoutTimeLeft=Pi.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=Pi.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(e){var t;try{this.loading||(this.otp=e.detail,this.authConnector&&this.otp.length===wte&&(this.loading=!0,await((t=this.onOtpSubmit)==null?void 0:t.call(this,this.otp))))}catch(i){this.error=$e.parseError(i),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!dt.getAuthConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),$t.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(e){$t.showError(e)}finally{this.loading=!1}}getFooterLabels(e){return this.onStartOver?{title:"Something wrong?",action:`Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};Ga.styles=mte;Tm([ce()],Ga.prototype,"loading",void 0);Tm([ce()],Ga.prototype,"timeoutTimeLeft",void 0);Tm([ce()],Ga.prototype,"error",void 0);Ga=Tm([me("w3m-email-otp-widget")],Ga);var qC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let i3=class extends Ga{constructor(){super(),this.unsubscribe=[],this.smartAccountDeployed=Pe.state.smartAccountDeployed,this.onOtpSubmit=async e=>{try{if(this.authConnector){const t=Xe.checkIfSmartAccountEnabled();await this.authConnector.provider.connectOtp({otp:e}),bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),await vt.connectExternal(this.authConnector),bt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.authConnector.name||"Unknown"}}),t&&!this.smartAccountDeployed?_e.push("UpgradeToSmartAccount"):yt.close()}}catch(t){throw bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),t}},this.onOtpResend=async e=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:e}),bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))},this.unsubscribe.push(Pe.subscribeKey("smartAccountDeployed",e=>{this.smartAccountDeployed=e}))}};qC([ce()],i3.prototype,"smartAccountDeployed",void 0);i3=qC([me("w3m-email-verify-otp-view")],i3);const vte=ct` + wui-icon-box { + height: var(--wui-icon-box-size-xl); + width: var(--wui-icon-box-size-xl); + } +`;var VC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ag=class extends Me{constructor(){var e;super(),this.email=(e=_e.state.data)==null?void 0:e.email,this.authConnector=dt.getAuthConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.authConnector)throw new Error("w3m-email-verify-device-view: No auth connector provided");return te` + + + + + + + Approve the login link we sent to + + ${this.email} + + + + The code expires in 20 minutes + + + + + Didn't receive it? + + + Resend email + + + + + `}async listenForDeviceApproval(){if(this.authConnector)try{await this.authConnector.provider.connectDevice(),bt.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),_e.replace("EmailVerifyOtp",{email:this.email})}catch{_e.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.authConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.authConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),$t.showSuccess("Code email resent")}}catch(e){$t.showError(e)}finally{this.loading=!1}}};Ag.styles=vte;VC([ce()],Ag.prototype,"loading",void 0);Ag=VC([me("w3m-email-verify-device-view")],Ag);const yte=ct` + div { + width: 100%; + height: 400px; + } + + [data-ready='false'] { + transform: scale(1.05); + } + + @media (max-width: 430px) { + [data-ready='false'] { + transform: translateY(-50px); + } + } +`;var KC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const A_=400,E_=360,bte=64;let Eg=class extends Me{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(yt.subscribeKey("open",e=>{e||(this.onHideIframe(),_e.popTransactionStack())}))}disconnectedCallback(){var e;this.onHideIframe(),this.unsubscribe.forEach(t=>t()),(e=this.bodyObserver)==null||e.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block",this.bodyObserver=new ResizeObserver(e=>{var n,o;const t=(n=e==null?void 0:e[0])==null?void 0:n.contentBoxSize,i=(o=t==null?void 0:t[0])==null?void 0:o.inlineSize;this.iframe.style.height=`${A_}px`,i&&i<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width=`${E_}px`,this.iframe.style.left=`calc(50% - ${E_/2}px)`,this.iframe.style.top=`calc(50% - ${A_/2}px + ${bte/2}px)`,this.iframe.style.bottom="unset"),this.ready=!0}),this.bodyObserver.observe(window.document.body)}render(){return this.ready&&this.onShowIframe(),te`
`}onShowIframe(){const e=window.innerWidth<=430;this.iframe.animate([{opacity:0,transform:e?"translateY(50px)":"scale(.95)"},{opacity:1,transform:e?"translateY(0)":"scale(1)"}],{duration:200,easing:"ease",fill:"forwards"})}async onHideIframe(){this.iframe.style.display="none",await this.iframe.animate([{opacity:1},{opacity:0}],{duration:200,easing:"ease",fill:"forwards"}).finished}async syncTheme(){const e=dt.getAuthConnector();if(e){const t=oi.getSnapshot().themeMode,i=oi.getSnapshot().themeVariables;await e.provider.syncTheme({themeVariables:i,w3mThemeVariables:Tc(i,t)})}}};Eg.styles=yte;KC([ce()],Eg.prototype,"ready",void 0);Eg=KC([me("w3m-approve-transaction-view")],Eg);var _te=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let C_=class extends Me{render(){return te` + + Follow the instructions on + + + + You will have to reconnect for security reasons + + + `}};C_=_te([me("w3m-upgrade-wallet-view")],C_);var Gy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Cg=class extends Me{constructor(){super(...arguments),this.authConnector=dt.getAuthConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.authConnector)try{this.loading=!0,yt.setLoading(!0),await this.authConnector.provider.setPreferredAccount(Qi.ACCOUNT_TYPES.SMART_ACCOUNT),await vt.reconnectExternal(this.authConnector),yt.setLoading(!1),this.loading=!1,nm.navigateAfterPreferredAccountTypeSelect()}catch{$t.showError("Error upgrading to smart account")}}}render(){return te` + + ${this.onboardingTemplate()} ${this.buttonsTemplate()} + {$e.openHref(py.URLS.FAQ,"_blank")}} + > + Learn more + + + + `}onboardingTemplate(){return te` + + + + + + + + Discover Smart Accounts + + + Access advanced features such as username, social login, improved security and a smoother + user experience! + + + `}buttonsTemplate(){return te` + + Do it later + + Continue + + `}redirectToAccount(){_e.push("Account")}};Gy([ce()],Cg.prototype,"authConnector",void 0);Gy([ce()],Cg.prototype,"loading",void 0);Cg=Gy([me("w3m-upgrade-to-smart-account-view")],Cg);const xte=ct` + wui-email-input { + width: 100%; + } + + form { + width: 100%; + display: block; + position: relative; + } +`;var Zy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let r0=class extends Me{constructor(){var e;super(...arguments),this.formRef=Xf(),this.initialEmail=((e=_e.state.data)==null?void 0:e.email)??"",this.email="",this.loading=!1}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",t=>{t.key==="Enter"&&this.onSubmitEmail(t)})}render(){const e=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return te` + +
+ + + +
+ + + + Cancel + + + + Save + + +
+ `}onEmailInputChange(e){this.email=e.detail}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const t=dt.getAuthConnector();if(!t)throw new Error("w3m-update-email-wallet: Auth connector not found");const i=await t.provider.updateEmail({email:this.email});bt.sendEvent({type:"track",event:"EMAIL_EDIT"}),i.action==="VERIFY_SECONDARY_OTP"?_e.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email}):_e.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(t){$t.showError(t),this.loading=!1}}};r0.styles=xte;Zy([ce()],r0.prototype,"email",void 0);Zy([ce()],r0.prototype,"loading",void 0);r0=Zy([me("w3m-update-email-wallet-view")],r0);var Ate=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let S_=class extends Ga{constructor(){var e;super(),this.email=(e=_e.state.data)==null?void 0:e.email,this.onOtpSubmit=async t=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailPrimaryOtp({otp:t}),bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),_e.replace("UpdateEmailSecondaryOtp",_e.state.data))}catch(i){throw bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),i}},this.onStartOver=()=>{_e.replace("UpdateEmailWallet",_e.state.data)}}};S_=Ate([me("w3m-update-email-primary-otp-view")],S_);var Ete=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let I_=class extends Ga{constructor(){var e;super(),this.email=(e=_e.state.data)==null?void 0:e.newEmail,this.onOtpSubmit=async t=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailSecondaryOtp({otp:t}),bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),_e.reset("Account"))}catch(i){throw bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),i}},this.onStartOver=()=>{_e.replace("UpdateEmailWallet",_e.state.data)}}};I_=Ete([me("w3m-update-email-secondary-otp-view")],I_);const Cte=ct` + :host > wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + + :host > wui-flex::-webkit-scrollbar { + display: none; + } +`;var GC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Sg=class extends Me{constructor(){var e;super(...arguments),this.swapUnsupportedChain=(e=_e.state.data)==null?void 0:e.swapUnsupportedChain,this.disconecting=!1}render(){return te` + + + ${this.descriptionTemplate()} + + + + ${this.networksTemplate()} + + + + + + Disconnect + + + + `}descriptionTemplate(){return this.swapUnsupportedChain?te` + + The swap feature doesn’t support your current network. Switch to an available option to + continue. + + `:te` + + This app doesn’t support your current network. Switch to an available option to continue. + + `}networksTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:t}=Xe.state,i=$e.sortRequestedNetworks(e,t);return(this.swapUnsupportedChain?i.filter(o=>ui.SWAP_SUPPORTED_NETWORKS.includes(o.id)):i).map(o=>te` + this.onSwitchNetwork(o)} + > + + `)}async onDisconnect(){try{this.disconecting=!0,await vt.disconnect(),bt.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),yt.close()}catch{bt.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),$t.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){const{isConnected:t}=Pe.state,{approvedCaipNetworkIds:i,supportsAllNetworks:n,caipNetwork:o}=Xe.state,{data:s}=_e.state;t&&(o==null?void 0:o.id)!==e.id?i!=null&&i.includes(e.id)?(await Xe.switchActiveNetwork(e),nm.navigateAfterNetworkSwitch()):n&&_e.push("SwitchNetwork",{...s,network:e}):t||(Xe.setCaipNetwork(e),_e.push("Connect"))}};Sg.styles=Cte;GC([ce()],Sg.prototype,"disconecting",void 0);Sg=GC([me("w3m-unsupported-chain-view")],Sg);const Ste=ct` + wui-compatible-network { + margin-top: var(--wui-spacing-l); + } +`;var M0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let au=class extends Me{constructor(){super(),this.unsubscribe=[],this.address=Pe.state.address,this.profileName=Pe.state.profileName,this.network=Xe.state.caipNetwork,this.preferredAccountType=Pe.state.preferredAccountType,this.unsubscribe.push(Pe.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):$t.showError("Account not found")}),Xe.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const e=xr.getNetworkImage(this.network);return te` + + + + + Copy your address or scan this QR code + + + ${this.networkTemplate()} + `}networkTemplate(){var s;const e=Xe.getRequestedCaipNetworks(),t=Xe.checkIfSmartAccountEnabled(),i=Xe.state.caipNetwork;if(this.preferredAccountType===Qi.ACCOUNT_TYPES.SMART_ACCOUNT&&t)return i?te``:null;const o=((s=e==null?void 0:e.filter(a=>a==null?void 0:a.imageId))==null?void 0:s.slice(0,5)).map(xr.getNetworkImage).filter(Boolean);return te``}onReceiveClick(){_e.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&($e.copyToClopboard(this.address),$t.showSuccess("Address copied"))}catch{$t.showError("Failed to copy")}}};au.styles=Ste;M0([ce()],au.prototype,"address",void 0);M0([ce()],au.prototype,"profileName",void 0);M0([ce()],au.prototype,"network",void 0);M0([ce()],au.prototype,"preferredAccountType",void 0);au=M0([me("w3m-wallet-receive-view")],au);const Ite=ct` + :host > wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + + :host > wui-flex::-webkit-scrollbar { + display: none; + } +`;var ZC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ig=class extends Me{constructor(){super(),this.unsubscribe=[],this.preferredAccountType=Pe.state.preferredAccountType,this.unsubscribe.push(Pe.subscribeKey("preferredAccountType",e=>{this.preferredAccountType=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` + + ${this.networkTemplate()} + `}networkTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:t,caipNetwork:i}=Xe.state,n=Xe.checkIfSmartAccountEnabled();let o=$e.sortRequestedNetworks(e,t);if(n&&this.preferredAccountType===Qi.ACCOUNT_TYPES.SMART_ACCOUNT){if(!i)return null;o=[i]}return o.map(s=>te` + + + `)}};Ig.styles=Ite;ZC([ce()],Ig.prototype,"preferredAccountType",void 0);Ig=ZC([me("w3m-wallet-compatible-networks-view")],Ig);const Tte=ct` + :host { + display: block; + } + + wui-flex { + position: relative; + } + + wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xs) !important; + border: 5px solid var(--wui-color-bg-125); + background: var(--wui-color-bg-175); + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 1; + } + + wui-button { + --local-border-radius: var(--wui-border-radius-xs) !important; + } + + .inputContainer { + height: fit-content; + } +`;var Xc=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ys=class extends Me{constructor(){super(),this.unsubscribe=[],this.token=_r.state.token,this.sendTokenAmount=_r.state.sendTokenAmount,this.receiverAddress=_r.state.receiverAddress,this.receiverProfileName=_r.state.receiverProfileName,this.loading=_r.state.loading,this.gasPriceInUSD=_r.state.gasPriceInUSD,this.message="Preview Send",this.fetchNetworkPrice(),this.unsubscribe.push(_r.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),te` + + + + + + + + ${this.message} + + + `}async fetchNetworkPrice(){await Ve.getNetworkTokenPrice();const e=await Ve.getInitialGasPrice();e!=null&&e.gasPrice&&(e!=null&&e.gasPriceInUSD)&&(_r.setGasPrice(e.gasPrice),_r.setGasPriceInUsd(e.gasPriceInUSD))}onButtonClick(){_e.push("WalletSendPreview")}getMessage(){var e;this.message="Preview Send",this.receiverAddress&&!$e.isAddress(this.receiverAddress)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&((e=this.token)!=null&&e.price)&&(this.sendTokenAmount*this.token.price||(this.message="Incorrect Value")),this.token||(this.message="Select Token")}};Ys.styles=Tte;Xc([ce()],Ys.prototype,"token",void 0);Xc([ce()],Ys.prototype,"sendTokenAmount",void 0);Xc([ce()],Ys.prototype,"receiverAddress",void 0);Xc([ce()],Ys.prototype,"receiverProfileName",void 0);Xc([ce()],Ys.prototype,"loading",void 0);Xc([ce()],Ys.prototype,"gasPriceInUSD",void 0);Xc([ce()],Ys.prototype,"message",void 0);Ys=Xc([me("w3m-wallet-send-view")],Ys);const Rte=ct` + .contentContainer { + height: 440px; + overflow: scroll; + scrollbar-width: none; + } + + .contentContainer::-webkit-scrollbar { + display: none; + } + + wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } +`;var B0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let cu=class extends Me{constructor(){super(),this.unsubscribe=[],this.tokenBalance=Pe.state.tokenBalance,this.search="",this.onDebouncedSearch=$e.debounce(e=>{this.search=e}),this.unsubscribe.push(Pe.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` + + ${this.templateSearchInput()} ${this.templateTokens()} + + `}templateSearchInput(){return te` + + + + `}templateTokens(){var e,t;return this.tokens=(e=this.tokenBalance)==null?void 0:e.filter(i=>{var n;return i.chainId===((n=Xe.state.caipNetwork)==null?void 0:n.id)}),this.search?this.filteredTokens=(t=this.tokenBalance)==null?void 0:t.filter(i=>i.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,te` + + + Your tokens + + + ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(i=>te``):te` + + + No tokens found + Your tokens will appear here + + Buy + `} + + + `}onBuyClick(){_e.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){_r.setToken(e),_r.setTokenAmount(void 0),_e.goBack()}};cu.styles=Rte;B0([ce()],cu.prototype,"tokenBalance",void 0);B0([ce()],cu.prototype,"tokens",void 0);B0([ce()],cu.prototype,"filteredTokens",void 0);B0([ce()],cu.prototype,"search",void 0);cu=B0([me("w3m-wallet-send-select-token-view")],cu);const kte=ct` + wui-avatar, + wui-image { + display: ruby; + width: 32px; + height: 32px; + border-radius: var(--wui-border-radius-3xl); + } + + .sendButton { + width: 70%; + --local-width: 100% !important; + --local-border-radius: var(--wui-border-radius-xs) !important; + } + + .cancelButton { + width: 30%; + --local-width: 100% !important; + --local-border-radius: var(--wui-border-radius-xs) !important; + } +`;var el=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Js=class extends Me{constructor(){super(),this.unsubscribe=[],this.token=_r.state.token,this.sendTokenAmount=_r.state.sendTokenAmount,this.receiverAddress=_r.state.receiverAddress,this.receiverProfileName=_r.state.receiverProfileName,this.receiverProfileImageUrl=_r.state.receiverProfileImageUrl,this.gasPriceInUSD=_r.state.gasPriceInUSD,this.caipNetwork=Xe.state.caipNetwork,this.unsubscribe.push(_r.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.receiverProfileImageUrl=e.receiverProfileImageUrl}),Xe.subscribeKey("caipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e,t;return te` + + + + Send + ${this.sendValueTemplate()} + + + + + + + + To + + + + + + + + Review transaction carefully + + + + Cancel + + + Send + + + `}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const t=this.token.price*this.sendTokenAmount;return te`$${t.toFixed(2)}`}return null}onSendClick(){_r.sendToken()}onCancelClick(){_e.goBack()}};Js.styles=kte;el([ce()],Js.prototype,"token",void 0);el([ce()],Js.prototype,"sendTokenAmount",void 0);el([ce()],Js.prototype,"receiverAddress",void 0);el([ce()],Js.prototype,"receiverProfileName",void 0);el([ce()],Js.prototype,"receiverProfileImageUrl",void 0);el([ce()],Js.prototype,"gasPriceInUSD",void 0);el([ce()],Js.prototype,"caipNetwork",void 0);Js=el([me("w3m-wallet-send-preview-view")],Js);const Ote=ct` + wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + wui-flex::-webkit-scrollbar { + display: none; + } +`;var Pte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let n3=class extends Me{render(){return te` + + + + + `}};n3.styles=Ote;n3=Pte([me("w3m-connect-wallets-view")],n3);const Dte=ct` + wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + wui-flex::-webkit-scrollbar { + display: none; + } +`;var Nte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let o3=class extends Me{render(){return te` + + + + + `}};o3.styles=Dte;o3=Nte([me("w3m-connect-socials-view")],o3);const $te=ct` + wui-logo { + width: 80px; + height: 80px; + border-radius: var(--wui-border-radius-m); + } + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + wui-flex:first-child:not(:only-child) { + position: relative; + } + wui-loading-thumbnail { + position: absolute; + } + wui-icon-box { + position: absolute; + right: calc(var(--wui-spacing-3xs) * -1); + bottom: calc(var(--wui-spacing-3xs) * -1); + opacity: 0; + transform: scale(0.5); + transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); + } + wui-text[align='center'] { + width: 100%; + padding: 0px var(--wui-spacing-l); + } + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + .capitalize { + text-transform: capitalize; + } +`;var Mte={};const QC={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:Mte.NEXT_PUBLIC_SECURE_SITE_ORIGIN||"https://secure.walletconnect.com"};var hd=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let qc=class extends Me{constructor(){super(),this.unsubscribe=[],this.socialProvider=Pe.state.socialProvider,this.socialWindow=Pe.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=dt.getAuthConnector(),this.handleSocialConnection=async e=>{var t;if((t=e.data)!=null&&t.resultUri)if(e.origin===QC.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),Pe.setSocialWindow(void 0)),this.connecting=!0,this.updateMessage();const i=e.data.resultUri;await this.authConnector.provider.connectSocial(i),this.socialProvider&&Fr.setConnectedSocialProvider(this.socialProvider),await vt.connectExternal(this.authConnector)}}catch{this.error=!0,this.updateMessage()}}else _e.goBack(),$t.showError("Untrusted Origin")},this.unsubscribe.push(Pe.subscribe(e=>{e.socialProvider&&(this.socialProvider=e.socialProvider),e.socialWindow&&(this.socialWindow=e.socialWindow),e.address&&yt.state.open&&yt.close()})),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),window.removeEventListener("message",this.handleSocialConnection,!1)}render(){return te` + + + + ${this.error?null:this.loaderTemplate()} + + + + Log in with + ${this.socialProvider??"Social"} + ${this.message} + + `}loaderTemplate(){const e=oi.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return te``}connectSocial(){window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};qc.styles=$te;hd([ce()],qc.prototype,"socialProvider",void 0);hd([ce()],qc.prototype,"socialWindow",void 0);hd([ce()],qc.prototype,"error",void 0);hd([ce()],qc.prototype,"connecting",void 0);hd([ce()],qc.prototype,"message",void 0);qc=hd([me("w3m-connecting-social-view")],qc);const Bte=ct` + wui-grid { + max-height: clamp(360px, 400px, 80vh); + overflow: scroll; + scrollbar-width: none; + grid-auto-rows: min-content; + grid-template-columns: repeat(auto-fill, 76px); + } + + @media (max-width: 435px) { + wui-grid { + grid-template-columns: repeat(auto-fill, 77px); + } + } + + wui-grid[data-scroll='false'] { + overflow: hidden; + } + + wui-grid::-webkit-scrollbar { + display: none; + } + + wui-loading-spinner { + padding-top: var(--wui-spacing-l); + padding-bottom: var(--wui-spacing-l); + justify-content: center; + grid-column: 1 / span 4; + } +`;function YC(r){const{connectors:e}=dt.state,t=e.filter(o=>o.type==="ANNOUNCED").reduce((o,s)=>{var a;return(a=s.info)!=null&&a.rdns&&(o[s.info.rdns]=!0),o},{});return r.map(o=>({...o,installed:!!o.rdns&&!!t[o.rdns??""]})).sort((o,s)=>Number(s.installed)-Number(o.installed))}var U0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const T_="local-paginator";let lu=class extends Me{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!Tt.state.wallets.length,this.wallets=Tt.state.wallets,this.recommended=Tt.state.recommended,this.featured=Tt.state.featured,this.unsubscribe.push(Tt.subscribeKey("wallets",e=>this.wallets=e),Tt.subscribeKey("recommended",e=>this.recommended=e),Tt.subscribeKey("featured",e=>this.featured=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(t=>t()),(e=this.paginationObserver)==null||e.disconnect()}render(){return te` + + ${this.initial?this.shimmerTemplate(16):this.walletsTemplate()} + ${this.paginationLoaderTemplate()} + + `}async initialFetch(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-grid");this.initial&&e&&(await Tt.fetchWallets({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.initial=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,t){return[...Array(e)].map(()=>te` + + `)}walletsTemplate(){const e=[...this.featured,...this.recommended,...this.wallets];return YC(e).map(i=>te` + this.onConnectWallet(i)} + .installed=${i.installed} + > + `)}paginationLoaderTemplate(){const{wallets:e,recommended:t,featured:i,count:n}=Tt.state,o=window.innerWidth<352?3:4,s=e.length+t.length;let u=Math.ceil(s/o)*o-s+o;return u-=e.length?i.length%o:0,n===0&&i.length>0?null:n===0||[...i,...e,...t].length{if(i!=null&&i.isIntersecting&&!this.initial){const{page:n,count:o,wallets:s}=Tt.state;s.length=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let i0=class extends Me{constructor(){super(...arguments),this.prevQuery="",this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?te``:this.walletsTemplate()}async onSearch(){this.query.trim()!==this.prevQuery.trim()&&(this.prevQuery=this.query,this.loading=!0,await Tt.searchWallet({search:this.query}),this.loading=!1)}walletsTemplate(){const{search:e}=Tt.state,t=YC(e);return e.length?te` + + ${t.map(i=>te` + this.onConnectWallet(i)} + .installed=${i.installed} + > + `)} + + `:te` + + + No Wallet found + + `}onConnectWallet(e){const t=dt.getConnector(e.id,e.rdns);t?_e.push("ConnectingExternal",{connector:t}):_e.push("ConnectingWalletConnect",{wallet:e})}};i0.styles=Ute;Qy([ce()],i0.prototype,"loading",void 0);Qy([St()],i0.prototype,"query",void 0);i0=Qy([me("w3m-all-wallets-search")],i0);var Rm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let n0=class extends Me{constructor(){super(),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0,this.buffering=!1,this.unsubscribe.push(vt.subscribeKey("buffering",e=>this.buffering=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return te` + + + + `}generateTabs(){const e=this.platforms.map(t=>t==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:t==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:t==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:t==="web"?{label:"Webapp",icon:"browser",platform:"web"}:t==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:t})=>t),e}onTabChange(e){var i;const t=this.platformTabs[e];t&&((i=this.onSelectPlatfrom)==null||i.call(this,t))}};Rm([St({type:Array})],n0.prototype,"platforms",void 0);Rm([St()],n0.prototype,"onSelectPlatfrom",void 0);Rm([ce()],n0.prototype,"buffering",void 0);n0=Rm([me("w3m-connecting-header")],n0);var Lte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let R_=class extends jn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),bt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){var e;try{this.error=!1;const{connectors:t}=dt.state,i=t.find(o=>{var s,a;return o.type==="ANNOUNCED"&&((s=o.info)==null?void 0:s.rdns)===((a=this.wallet)==null?void 0:a.rdns)}),n=t.find(o=>o.type==="INJECTED");i?await vt.connectExternal(i):n&&await vt.connectExternal(n),yt.close(),bt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown"}})}catch(t){bt.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(t==null?void 0:t.message)??"Unknown"}}),this.error=!0}}};R_=Lte([me("w3m-connecting-wc-browser")],R_);var jte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let k_=class extends jn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),bt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.timeout=setTimeout(()=>{var e;(e=this.onConnect)==null||e.call(this)},200))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:t,name:i}=this.wallet,{redirect:n,href:o}=$e.formatNativeUrl(t,this.uri);vt.setWcLinking({name:i,href:o}),vt.setRecentWallet(this.wallet),$e.openHref(n,"_blank")}catch{this.error=!0}}};k_=jte([me("w3m-connecting-wc-desktop")],k_);var Fte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let O_=class extends jn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),document.addEventListener("visibilitychange",this.onBuffering.bind(this)),bt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("visibilitychange",this.onBuffering.bind(this))}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:t,name:i}=this.wallet,{redirect:n,href:o}=$e.formatNativeUrl(t,this.uri);vt.setWcLinking({name:i,href:o}),vt.setRecentWallet(this.wallet),$e.openHref(n,"_self")}catch{this.error=!0}}onBuffering(){const e=$e.isIos();(document==null?void 0:document.visibilityState)==="visible"&&!this.error&&e&&(vt.setBuffering(!0),setTimeout(()=>{vt.setBuffering(!1)},5e3))}};O_=Fte([me("w3m-connecting-wc-mobile")],O_);const zte=ct` + @keyframes fadein { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + wui-shimmer { + width: 100%; + aspect-ratio: 1 / 1; + border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; + } + + wui-qr-code { + opacity: 0; + animation-duration: 200ms; + animation-timing-function: ease; + animation-name: fadein; + animation-fill-mode: forwards; + } +`;var Wte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let s3=class extends jn{constructor(){var e;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),bt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),te` + + ${this.qrCodeTemplate()} + + + Scan this QR Code with your phone + + ${this.copyTemplate()} + + + + `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,t=this.wallet?this.wallet.name:void 0;return vt.setWcLinking(void 0),vt.setRecentWallet(this.wallet),te` `}copyTemplate(){const e=!this.uri||!this.ready;return te` + + Copy link + `}};s3.styles=zte;s3=Wte([me("w3m-connecting-wc-qrcode")],s3);var Hte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let P_=class extends Me{constructor(){var e;if(super(),this.wallet=(e=_e.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");bt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return te` + + + + Not Detected + + + + `}};P_=Hte([me("w3m-connecting-wc-unsupported")],P_);var qte=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let D_=class extends jn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel="Open and continue in a new browser tab",this.secondaryBtnIcon="externalLink",bt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:t,name:i}=this.wallet,{redirect:n,href:o}=$e.formatUniversalUrl(t,this.uri);vt.setWcLinking({name:i,href:o}),vt.setRecentWallet(this.wallet),$e.openHref(n,"_blank")}catch{this.error=!0}}};D_=qte([me("w3m-connecting-wc-web")],D_);const Vte=ct` + :host { + width: 100%; + } + + .details-container > wui-flex { + background: var(--wui-color-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + width: 100%; + } + + .details-container > wui-flex > button { + border: none; + background: none; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + cursor: pointer; + } + + .details-content-container { + padding: var(--wui-spacing-1xs); + padding-top: 0px; + display: flex; + align-items: center; + justify-content: center; + } + + .details-content-container > wui-flex { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s); + padding-left: var(--wui-spacing-s); + padding-right: var(--wui-spacing-1xs); + border-radius: calc(var(--wui-border-radius-5xs) + var(--wui-border-radius-4xs)); + background: var(--wui-color-gray-glass-002); + } + + .details-row-title { + white-space: nowrap; + } + + .details-row.provider-free-row { + padding-right: var(--wui-spacing-xs); + } +`;var lo=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const Kte=ui.CONVERT_SLIPPAGE_TOLERANCE;let vn=class extends Me{constructor(){var e;super(),this.unsubscribe=[],this.networkName=(e=Xe.state.caipNetwork)==null?void 0:e.name,this.detailsOpen=!1,this.sourceToken=Ve.state.sourceToken,this.toToken=Ve.state.toToken,this.toTokenAmount=Ve.state.toTokenAmount,this.sourceTokenPriceInUSD=Ve.state.sourceTokenPriceInUSD,this.toTokenPriceInUSD=Ve.state.toTokenPriceInUSD,this.gasPriceInUSD=Ve.state.gasPriceInUSD,this.priceImpact=Ve.state.priceImpact,this.maxSlippage=Ve.state.maxSlippage,this.networkTokenSymbol=Ve.state.networkTokenSymbol,this.inputError=Ve.state.inputError,this.unsubscribe.push(Ve.subscribe(t=>{this.sourceToken=t.sourceToken,this.toToken=t.toToken,this.toTokenAmount=t.toTokenAmount,this.gasPriceInUSD=t.gasPriceInUSD,this.priceImpact=t.priceImpact,this.maxSlippage=t.maxSlippage,this.sourceTokenPriceInUSD=t.sourceTokenPriceInUSD,this.toTokenPriceInUSD=t.toTokenPriceInUSD,this.inputError=t.inputError}))}render(){const e=this.toTokenAmount&&this.maxSlippage?pr.bigNumber(this.toTokenAmount).minus(this.maxSlippage).toString():null;if(!this.sourceToken||!this.toToken||this.inputError)return null;const t=this.sourceTokenPriceInUSD&&this.toTokenPriceInUSD?1/this.toTokenPriceInUSD*this.sourceTokenPriceInUSD:0;return te` + + + + ${this.detailsOpen?te` + + + + + + Network cost + + + + + + + $${gt.formatNumberToLocalString(this.gasPriceInUSD,3)} + + + + ${this.priceImpact?te` + + + + Price impact + + + + + + + + ${gt.formatNumberToLocalString(this.priceImpact,3)}% + + + + `:null} + ${this.maxSlippage&&this.sourceToken.symbol?te` + + + + Max. slippage + + + + + + + + ${gt.formatNumberToLocalString(this.maxSlippage,6)} + ${this.toToken.symbol} ${Kte}% + + + + `:null} + + + + + Provider fee + + + + 0.85% + + + + + `:null} + + + `}toggleDetails(){this.detailsOpen=!this.detailsOpen}};vn.styles=[Vte];lo([ce()],vn.prototype,"networkName",void 0);lo([St()],vn.prototype,"detailsOpen",void 0);lo([ce()],vn.prototype,"sourceToken",void 0);lo([ce()],vn.prototype,"toToken",void 0);lo([ce()],vn.prototype,"toTokenAmount",void 0);lo([ce()],vn.prototype,"sourceTokenPriceInUSD",void 0);lo([ce()],vn.prototype,"toTokenPriceInUSD",void 0);lo([ce()],vn.prototype,"gasPriceInUSD",void 0);lo([ce()],vn.prototype,"priceImpact",void 0);lo([ce()],vn.prototype,"maxSlippage",void 0);lo([ce()],vn.prototype,"networkTokenSymbol",void 0);lo([ce()],vn.prototype,"inputError",void 0);vn=lo([me("w3m-swap-details")],vn);const Gte=ct` + :host > wui-flex { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + border-radius: var(--wui-border-radius-s); + background-color: var(--wui-color-gray-glass-002); + padding: var(--wui-spacing-xl); + padding-right: var(--wui-spacing-s); + width: 100%; + height: 100px; + box-sizing: border-box; + box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002); + position: relative; + transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + } + + :host wui-flex.focus { + box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-005); + } + + :host > wui-flex .swap-input, + :host > wui-flex .swap-token-button { + z-index: 10; + } + + :host > wui-flex .swap-input { + -webkit-mask-image: linear-gradient( + 270deg, + transparent 0px, + transparent 8px, + black 24px, + black 25px, + black 32px, + black 100% + ); + mask-image: linear-gradient( + 270deg, + transparent 0px, + transparent 8px, + black 24px, + black 25px, + black 32px, + black 100% + ); + } + + :host > wui-flex .swap-input input { + background: none; + border: none; + height: 42px; + width: 100%; + font-size: 32px; + font-style: normal; + font-weight: 400; + line-height: 130%; + letter-spacing: -1.28px; + outline: none; + caret-color: var(--wui-color-accent-100); + color: var(--wui-color-fg-100); + padding: 0px; + } + + :host > wui-flex .swap-input input:focus-visible { + outline: none; + } + + :host > wui-flex .swap-input input::-webkit-outer-spin-button, + :host > wui-flex .swap-input input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + .max-value-button { + background-color: transparent; + border: none; + cursor: pointer; + color: var(--wui-color-gray-glass-020); + padding-left: 0px; + } + + .market-value { + min-height: 18px; + } +`;var _s=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const Zte=5e-5;let io=class extends Me{constructor(){super(...arguments),this.focused=!1,this.price=0,this.target="sourceToken",this.onSetAmount=null,this.onSetMaxValue=null}render(){const e=this.marketValue||"0",t=pr.bigNumber(e).isGreaterThan("0");return te` + + + this.onFocusChange(!0)} + @focusout=${()=>this.onFocusChange(!1)} + ?disabled=${this.disabled} + .value=${this.value} + @input=${this.dispatchInputChangeEvent} + @keydown=${this.handleKeydown} + placeholder="0" + type="text" + inputmode="decimal" + /> + + ${t?`$${gt.formatNumberToLocalString(this.marketValue,3)}`:null} + + + ${this.templateTokenSelectButton()} + + `}handleKeydown(e){return ZV.numericInputKeyDown(e,this.value,t=>{var i;return(i=this.onSetAmount)==null?void 0:i.call(this,this.target,t)})}dispatchInputChangeEvent(e){if(!this.onSetAmount)return;const t=e.target.value.replace(/[^0-9.]/gu,"");t===","||t==="."?this.onSetAmount(this.target,"0."):t.endsWith(",")?this.onSetAmount(this.target,t.replace(",",".")):this.onSetAmount(this.target,t)}setMaxValueToInput(){var e;(e=this.onSetMaxValue)==null||e.call(this,this.target,this.balance)}templateTokenSelectButton(){return this.token?te` + + + + ${this.tokenBalanceTemplate()} + + `:te` + Select token + `}tokenBalanceTemplate(){const e=pr.multiply(this.balance,this.price),t=e?e==null?void 0:e.isGreaterThan(Zte):!1;return te` + ${t?te` + ${gt.formatNumberToLocalString(this.balance,3)} + `:null} + ${this.target==="sourceToken"?this.tokenActionButtonTemplate(t):null} + `}tokenActionButtonTemplate(e){return e?te` `:te` `}onFocusChange(e){this.focused=e}onSelectToken(){bt.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),_e.push("SwapSelectToken",{target:this.target})}onBuyToken(){_e.push("OnRampProviders")}};io.styles=[Gte];_s([St()],io.prototype,"focused",void 0);_s([St()],io.prototype,"balance",void 0);_s([St()],io.prototype,"value",void 0);_s([St()],io.prototype,"price",void 0);_s([St()],io.prototype,"marketValue",void 0);_s([St()],io.prototype,"disabled",void 0);_s([St()],io.prototype,"target",void 0);_s([St()],io.prototype,"token",void 0);_s([St()],io.prototype,"onSetAmount",void 0);_s([St()],io.prototype,"onSetMaxValue",void 0);io=_s([me("w3m-swap-input")],io);const Qte=ct` + :host { + width: 100%; + } + + :host > wui-flex { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + border-radius: var(--wui-border-radius-s); + padding: var(--wui-spacing-xl); + padding-right: var(--wui-spacing-s); + background-color: var(--wui-color-gray-glass-002); + box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002); + width: 100%; + height: 100px; + box-sizing: border-box; + position: relative; + } + + wui-shimmer.market-value { + opacity: 0; + } + + :host > wui-flex > svg.input_mask { + position: absolute; + inset: 0; + z-index: 5; + } + + :host wui-flex .input_mask__border, + :host wui-flex .input_mask__background { + transition: fill var(--wui-duration-md) var(--wui-ease-out-power-1); + will-change: fill; + } + + :host wui-flex .input_mask__border { + fill: var(--wui-color-gray-glass-020); + } + + :host wui-flex .input_mask__background { + fill: var(--wui-color-gray-glass-002); + } +`;var JC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Tg=class extends Me{constructor(){super(...arguments),this.target="sourceToken"}render(){return te` + + + + + ${this.templateTokenSelectButton()} + + `}templateTokenSelectButton(){return te` + + + + `}};Tg.styles=[Qte];JC([St()],Tg.prototype,"target",void 0);Tg=JC([me("w3m-swap-input-skeleton")],Tg);const Yte=ct` + :host { + height: 64px; + } + + wui-text { + text-transform: capitalize; + } + + wui-icon-link[data-hidden='true'] { + opacity: 0 !important; + pointer-events: none; + } +`;var km=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const Jte=["Swap","SwapSelectToken","SwapPreview"];function N_(){var s,a,u,h,d,p,v;const r=(a=(s=_e.state.data)==null?void 0:s.connector)==null?void 0:a.name,e=(h=(u=_e.state.data)==null?void 0:u.wallet)==null?void 0:h.name,t=(p=(d=_e.state.data)==null?void 0:d.network)==null?void 0:p.name,i=e??r,n=dt.getConnectors();return{Connect:`Connect ${n.length===1&&((v=n[0])==null?void 0:v.id)==="w3m-email"?"Email":""} Wallet`,ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,ConnectingExternal:i??"Connect Wallet",ConnectingWalletConnect:i??"WalletConnect",ConnectingSiwe:"Sign In",Networks:"Choose Network",SwitchNetwork:t??"Switch Network",AllWallets:"All Wallets",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",GetWallet:"Get a wallet",Downloads:i?`Get ${i}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",ApproveTransaction:"Approve Transaction",Transactions:"Activity",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",UnsupportedChain:"Switch Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",WhatIsABuy:"What is Buy?",BuyInProgress:"Buy",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:Pe.state.socialProvider?Pe.state.socialProvider:"Connect Social"}}let Hh=class extends Me{constructor(){super(),this.unsubscribe=[],this.heading=N_()[_e.state.view],this.buffering=!1,this.showBack=!1,this.unsubscribe.push(_e.subscribeKey("view",e=>{this.onViewChange(e),this.onHistoryChange()}),vt.subscribeKey("buffering",e=>this.buffering=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` + + ${this.dynamicButtonTemplate()} ${this.titleTemplate()} + + + `}onWalletHelp(){bt.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),_e.push("WhatIsAWallet")}async onClose(){if(nt.state.isSiweEnabled){const{SIWEController:e}=await Bo(()=>import("./index.CaJWFNre.js"),[],import.meta.url);e.state.status!=="success"&&await vt.disconnect()}yt.close()}titleTemplate(){const e=Jte.includes(_e.state.view);return te` + + ${this.heading} + ${e?te`Beta`:null} + + `}dynamicButtonTemplate(){const{view:e}=_e.state,t=e==="Connect",s=e==="ApproveTransaction"||e==="UpgradeToSmartAccount"||e==="ConnectingSiwe";return this.showBack&&!s?te``:te``}getPadding(){return this.heading?["l","2l","l","2l"]:["l","2l","0","2l"]}async onViewChange(e){var i;const t=(i=this.shadowRoot)==null?void 0:i.querySelector("wui-flex.w3m-header-title");if(t){const n=N_()[e];await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.heading=n,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})}}async onHistoryChange(){var i;const{history:e}=_e.state,t=(i=this.shadowRoot)==null?void 0:i.querySelector("#dynamic");e.length>1&&!this.showBack&&t?(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){_e.goBack()}};Hh.styles=[Yte];km([ce()],Hh.prototype,"heading",void 0);km([ce()],Hh.prototype,"buffering",void 0);km([ce()],Hh.prototype,"showBack",void 0);Hh=km([me("w3m-header")],Hh);var XC=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let a3=class extends Me{constructor(){super(...arguments),this.data=[]}render(){return te` + + ${this.data.map(e=>te` + + + ${e.images.map(t=>te``)} + + + + + ${e.title} + + ${e.text} + + `)} + + `}};XC([St({type:Array})],a3.prototype,"data",void 0);a3=XC([me("w3m-help-widget")],a3);const Xte=ct` + :host { + width: 100%; + } + + wui-loading-spinner { + position: absolute; + top: 50%; + right: 20px; + transform: translateY(-50%); + } + + .currency-container { + position: absolute; + top: 50%; + transform: translateY(-50%); + right: var(--wui-spacing-1xs); + height: 40px; + padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs) + var(--wui-spacing-xs); + min-width: 95px; + border-radius: var(--FULL, 1000px); + border: 1px solid var(--wui-color-gray-glass-002); + background: var(--wui-color-gray-glass-002); + cursor: pointer; + } + + .currency-container > wui-image { + height: 24px; + width: 24px; + border-radius: 50%; + } +`;var Iu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Za=class extends Me{constructor(){var e;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(e=this.currencies)==null?void 0:e[0],this.currencyImages=Di.state.currencyImages,this.tokenImages=Di.state.tokenImages,this.unsubscribe.push(br.subscribeKey("purchaseCurrency",t=>{!t||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(t))}),br.subscribeKey("paymentCurrency",t=>{!t||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(t))}),br.subscribe(t=>{this.type==="Fiat"?this.currencies=t.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=t.paymentCurrencies.map(this.formatPaymentCurrency)}),Di.subscribe(t=>{this.currencyImages={...t.currencyImages},this.tokenImages={...t.tokenImages}}))}firstUpdated(){br.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var i;const e=((i=this.selectedCurrency)==null?void 0:i.symbol)||"",t=this.currencyImages[e]||this.tokenImages[e];return te` + ${this.selectedCurrency?te` yt.open({view:`OnRamp${this.type}Select`})} + > + + ${this.selectedCurrency.symbol} + `:te``} + `}formatPaymentCurrency(e){return{name:e.id,symbol:e.id}}formatPurchaseCurrency(e){return{name:e.name,symbol:e.symbol}}};Za.styles=Xte;Iu([St({type:String})],Za.prototype,"type",void 0);Iu([St({type:Number})],Za.prototype,"value",void 0);Iu([ce()],Za.prototype,"currencies",void 0);Iu([ce()],Za.prototype,"selectedCurrency",void 0);Iu([ce()],Za.prototype,"currencyImages",void 0);Iu([ce()],Za.prototype,"tokenImages",void 0);Za=Iu([me("w3m-onramp-input")],Za);const ere=ct` + wui-flex { + background-color: var(--wui-color-gray-glass-005); + } + + a { + text-decoration: none; + color: var(--wui-color-fg-175); + font-weight: 500; + } +`;var tre=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let c3=class extends Me{render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=nt.state;return!e&&!t?null:te` + + + By connecting your wallet, you agree to our
+ ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} +
+
+ `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=nt.state;return e&&t?"and":""}termsTemplate(){const{termsConditionsUrl:e}=nt.state;return e?te`Terms of Service`:null}privacyTemplate(){const{privacyPolicyUrl:e}=nt.state;return e?te`Privacy Policy`:null}};c3.styles=[ere];c3=tre([me("w3m-legal-footer")],c3);const rre=ct` + :host { + display: block; + padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl); + } +`;var e9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Rg=class extends Me{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:t,play_store:i,chrome_store:n,homepage:o}=this.wallet,s=$e.isMobile(),a=$e.isIos(),u=$e.isAndroid(),h=[t,i,o,n].filter(Boolean).length>1,d=gt.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return h&&!s?te` + _e.push("Downloads",{wallet:this.wallet})} + > + `:!h&&o?te` + + `:t&&a?te` + + `:i&&u?te` + + `:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&$e.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&$e.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&$e.openHref(this.wallet.homepage,"_blank")}};Rg.styles=[rre];e9([St({type:Object})],Rg.prototype,"wallet",void 0);Rg=e9([me("w3m-mobile-download-links")],Rg);const ire=ct` + wui-flex { + border-top: 1px solid var(--wui-color-gray-glass-005); + } + + a { + text-decoration: none; + color: var(--wui-color-fg-175); + font-weight: 500; + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-3xs); + } +`;var nre=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let l3=class extends Me{render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=nt.state;return!e&&!t?null:te` + + + We work with the best providers to give you the lowest fees and best support. More options + coming soon! + + + ${this.howDoesItWorkTemplate()} + + `}howDoesItWorkTemplate(){return te` + + How does it work? + `}onWhatIsBuy(){_e.push("WhatIsABuy")}};l3.styles=[ire];l3=nre([me("w3m-onramp-providers-footer")],l3);const ore=ct` + :host { + display: block; + position: absolute; + opacity: 0; + pointer-events: none; + top: 11px; + left: 50%; + width: max-content; + } +`;var t9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const sre={success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let kg=class extends Me{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=$t.state.open,this.unsubscribe.push($t.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:t}=$t.state,i=sre[t];return te` + + `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout=setTimeout(()=>$t.hide(),2500)):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};kg.styles=ore;t9([ce()],kg.prototype,"open",void 0);kg=t9([me("w3m-snackbar")],kg);const are=ct` + wui-separator { + margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); + width: calc(100% + var(--wui-spacing-s) * 2); + } + + wui-email-input { + width: 100%; + } + + form { + width: 100%; + display: block; + position: relative; + } + + wui-icon-link, + wui-loading-spinner { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + + wui-icon-link { + right: var(--wui-spacing-xs); + } + + wui-loading-spinner { + right: var(--wui-spacing-m); + } +`;var L0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let uu=class extends Me{constructor(){super(),this.unsubscribe=[],this.formRef=Xf(),this.connectors=dt.state.connectors,this.email="",this.loading=!1,this.error="",this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",t=>{t.key==="Enter"&&this.onSubmitEmail(t)})}render(){const e=this.connectors.find(i=>i.type==="AUTH"),t=this.connectors.length>1;return e!=null&&e.email?te` +
+ + + + ${this.submitButtonTemplate()}${this.loadingTemplate()} + +
+ + ${e.socials||!t?null:te` + + `} + `:null}submitButtonTemplate(){return!this.loading&&this.email.length>3?te` + + + `:null}loadingTemplate(){return this.loading?te``:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const t=dt.getAuthConnector();if(!t)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:i}=await t.provider.connectEmail({email:this.email});bt.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),i==="VERIFY_OTP"?(bt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),_e.push("EmailVerifyOtp",{email:this.email})):i==="VERIFY_DEVICE"&&_e.push("EmailVerifyDevice",{email:this.email})}catch(t){const i=$e.parseError(t);i!=null&&i.includes("Invalid email")?this.error="Invalid email. Try again.":$t.showError(t)}finally{this.loading=!1}}onFocusEvent(){bt.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};uu.styles=are;L0([ce()],uu.prototype,"connectors",void 0);L0([ce()],uu.prototype,"email",void 0);L0([ce()],uu.prototype,"loading",void 0);L0([ce()],uu.prototype,"error",void 0);uu=L0([me("w3m-email-login-widget")],uu);const cre=ct` + wui-flex { + width: 100%; + } + + :host > wui-flex:first-child { + transform: translateY(calc(var(--wui-spacing-xxs) * -1)); + } + + wui-icon-link { + margin-right: calc(var(--wui-icon-box-size-md) * -1); + } + + wui-notice-card { + margin-bottom: var(--wui-spacing-3xs); + } + + w3m-transactions-view { + max-height: 200px; + } + + .tab-content-container { + height: 300px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + } + + .tab-content-container::-webkit-scrollbar { + display: none; + } + + .account-button { + width: auto; + border: none; + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-s); + height: 48px; + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-s); + box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); + background-color: var(--wui-color-gray-glass-002); + border-radius: 24px; + transaction: background-color 0.2s linear; + } + + .account-button:hover { + background-color: var(--wui-color-gray-glass-005); + } + + .avatar-container { + position: relative; + } + + wui-avatar.avatar { + width: 32px; + height: 32px; + box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); + } + + wui-avatar.network-avatar { + width: 16px; + height: 16px; + position: absolute; + left: 100%; + top: 100%; + transform: translate(-75%, -75%); + box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); + } + + .account-links { + display: flex; + justify-content: space-between; + align-items: center; + } + + .account-links wui-flex { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + flex: 1; + background: red; + align-items: center; + justify-content: center; + height: 48px; + padding: 10px; + flex: 1 0 0; + border-radius: var(--XS, 16px); + border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + .account-links wui-flex:hover { + background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); + } + + .account-links wui-flex wui-icon { + width: var(--S, 20px); + height: var(--S, 20px); + } + + .account-links wui-flex wui-icon svg path { + stroke: #667dff; + } +`;var tl=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Xs=class extends Me{constructor(){super(),this.unsubscribe=[],this.address=Pe.state.address,this.profileImage=Pe.state.profileImage,this.profileName=Pe.state.profileName,this.network=Xe.state.caipNetwork,this.disconnecting=!1,this.balance=Pe.state.balance,this.balanceSymbol=Pe.state.balanceSymbol,this.unsubscribe.push(Pe.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.balance=e.balance,this.balanceSymbol=e.balanceSymbol):this.disconnecting||$t.showError("Account not found")}),Xe.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var t;if(!this.address)throw new Error("w3m-account-view: No account provided");const e=xr.getNetworkImage(this.network);return te` + + + + + ${this.profileName?gt.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):gt.getTruncateString({string:this.address?this.address:"",charsStart:4,charsEnd:4,truncate:"middle"})} + + + + ${$e.formatBalance(this.balance,this.balanceSymbol)} + + ${this.explorerBtnTemplate()} + + + + ${this.emailCardTemplate()} + + + + ${((t=this.network)==null?void 0:t.name)??"Unknown"} + + + ${this.onrampTemplate()} + + Activity + + + Disconnect + + `}onrampTemplate(){const{enableOnramp:e}=nt.state;return e?te` + + Buy crypto + + `:null}emailCardTemplate(){const e=Fr.getConnectedConnector(),t=dt.getAuthConnector(),{origin:i}=location;return!t||e!=="AUTH"||i.includes(ui.SECURE_SITE)?null:te` + + `}handleClickPay(){_e.push("OnRampProviders")}explorerBtnTemplate(){const{addressExplorerUrl:e}=Pe.state;return e?te` + + + Block Explorer + + + `:null}isAllowedNetworkSwitch(){const{requestedCaipNetworks:e}=Xe.state,t=e?e.length>1:!1,i=e==null?void 0:e.find(({id:n})=>{var o;return n===((o=this.network)==null?void 0:o.id)});return t||!i}onCopyAddress(){try{this.address&&($e.copyToClopboard(this.address),$t.showSuccess("Address copied"))}catch{$t.showError("Failed to copy")}}onNetworks(){this.isAllowedNetworkSwitch()&&(bt.sendEvent({type:"track",event:"CLICK_NETWORKS"}),_e.push("Networks"))}onTransactions(){bt.sendEvent({type:"track",event:"CLICK_TRANSACTIONS"}),_e.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await vt.disconnect(),bt.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),yt.close()}catch{bt.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),$t.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const{addressExplorerUrl:e}=Pe.state;e&&$e.openHref(e,"_blank")}onGoToUpgradeView(){bt.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),_e.push("UpgradeEmailWallet")}};Xs.styles=cre;tl([ce()],Xs.prototype,"address",void 0);tl([ce()],Xs.prototype,"profileImage",void 0);tl([ce()],Xs.prototype,"profileName",void 0);tl([ce()],Xs.prototype,"network",void 0);tl([ce()],Xs.prototype,"disconnecting",void 0);tl([ce()],Xs.prototype,"balance",void 0);tl([ce()],Xs.prototype,"balanceSymbol",void 0);Xs=tl([me("w3m-account-default-widget")],Xs);const lre=ct` + wui-flex { + width: 100%; + } + + wui-promo { + position: absolute; + top: -32px; + } + + wui-profile-button { + margin-top: calc(-1 * var(--wui-spacing-2l)); + } + + wui-promo + wui-profile-button { + margin-top: var(--wui-spacing-2l); + } + + wui-tabs { + width: 100%; + } + + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } +`;var ca=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const ure=3,hre=48,dre=430;let qo=class extends Me{constructor(){super(),this.unsubscribe=[],this.address=Pe.state.address,this.profileImage=Pe.state.profileImage,this.profileName=Pe.state.profileName,this.smartAccountDeployed=Pe.state.smartAccountDeployed,this.network=Xe.state.caipNetwork,this.currentTab=Pe.state.currentTab,this.tokenBalance=Pe.state.tokenBalance,this.preferredAccountType=Pe.state.preferredAccountType,this.unsubscribe.push(Pe.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance,this.smartAccountDeployed=e.smartAccountDeployed,this.preferredAccountType=e.preferredAccountType):yt.close()}),Xe.subscribe(e=>{this.network=e.caipNetwork})),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){Pe.fetchTokenBalance()}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");const e=xr.getNetworkImage(this.network);return te` + ${this.activateAccountTemplate()} + + ${this.tokenBalanceTemplate()} + + + + + + + + + + + + + + + + + + + ${this.listContentTemplate()} + `}watchSwapValues(){this.watchTokenBalance=setInterval(()=>Pe.fetchTokenBalance(),1e4)}listContentTemplate(){return this.currentTab===0?te``:this.currentTab===1?te``:this.currentTab===2?te``:te``}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const t=$e.calculateBalance(this.tokenBalance),{dollars:i="0",pennies:n="00"}=$e.formatTokenBalance(t);return te``}return te``}activateAccountTemplate(){return!Xe.checkIfSmartAccountEnabled()||this.preferredAccountType!==Qi.ACCOUNT_TYPES.EOA||this.smartAccountDeployed?null:te` `}onTabChange(e){Pe.setCurrentTab(e)}onProfileButtonClick(){_e.push("AccountSettings")}onBuyClick(){_e.push("OnRampProviders")}onSwapClick(){var e,t;(e=this.network)!=null&&e.id&&!ui.SWAP_SUPPORTED_NETWORKS.includes((t=this.network)==null?void 0:t.id)?_e.push("UnsupportedChain",{swapUnsupportedChain:!0}):_e.push("Swap")}onReceiveClick(){_e.push("WalletReceive")}onSendClick(){_e.push("WalletSend")}onUpdateToSmartAccount(){_e.push("UpgradeToSmartAccount")}};qo.styles=lre;ca([ce()],qo.prototype,"watchTokenBalance",void 0);ca([ce()],qo.prototype,"address",void 0);ca([ce()],qo.prototype,"profileImage",void 0);ca([ce()],qo.prototype,"profileName",void 0);ca([ce()],qo.prototype,"smartAccountDeployed",void 0);ca([ce()],qo.prototype,"network",void 0);ca([ce()],qo.prototype,"currentTab",void 0);ca([ce()],qo.prototype,"tokenBalance",void 0);ca([ce()],qo.prototype,"preferredAccountType",void 0);qo=ca([me("w3m-account-wallet-features-widget")],qo);const fre=ct` + :host { + width: 100%; + max-height: 280px; + overflow: scroll; + scrollbar-width: none; + } + + :host::-webkit-scrollbar { + display: none; + } +`;var pre=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let u3=class extends Me{render(){return te``}};u3.styles=fre;u3=pre([me("w3m-account-activity-widget")],u3);const gre=ct` + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } +`;var mre=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let h3=class extends Me{render(){return te`${this.nftTemplate()}`}nftTemplate(){return te` + + + No NFTs yet + Transfer from another wallets to get started + + Receive NFTs + `}onReceiveClick(){_e.push("WalletReceive")}};h3.styles=gre;h3=mre([me("w3m-account-nfts-widget")],h3);const wre=ct` + :host { + width: 100%; + } + + wui-flex { + width: 100%; + } + + .contentContainer { + max-height: 280px; + overflow: scroll; + scrollbar-width: none; + } + + .contentContainer::-webkit-scrollbar { + display: none; + } +`;var r9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Og=class extends Me{constructor(){super(),this.unsubscribe=[],this.tokenBalance=Pe.state.tokenBalance,this.unsubscribe.push(Pe.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?te` + ${this.tokenItemTemplate()} + `:te` `}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(t=>te``)}onReceiveClick(){_e.push("WalletReceive")}onBuyClick(){_e.push("OnRampProviders")}};Og.styles=wre;r9([ce()],Og.prototype,"tokenBalance",void 0);Og=r9([me("w3m-account-tokens-widget")],Og);const vre=ct` + :host { + min-height: 100%; + } + + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } + + .emptyContainer { + height: 100%; + } +`;var Tu=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const u1="last-transaction",yre=7;let Qa=class extends Me{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.address=Pe.state.address,this.transactionsByYear=Zi.state.transactionsByYear,this.loading=Zi.state.loading,this.empty=Zi.state.empty,this.next=Zi.state.next,Zi.clearCursor(),this.unsubscribe.push(Pe.subscribe(e=>{e.isConnected&&this.address!==e.address&&(this.address=e.address,Zi.resetTransactions(),Zi.fetchTransactions(e.address))}),Zi.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){Zi.fetchTransactions(this.address),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return te` ${this.empty?null:this.templateTransactionsByYear()} + ${this.loading?this.templateLoading():null} + ${!this.loading&&this.empty?this.templateEmpty():null}`}templateTransactionsByYear(){const e=Object.keys(this.transactionsByYear).sort().reverse();return e.map((t,i)=>{const n=i===e.length-1,o=parseInt(t,10);return new Array(12).fill(null).map((a,u)=>u).reverse().map(a=>{var d;const u=Nl.getTransactionGroupTitle(o,a),h=(d=this.transactionsByYear[o])==null?void 0:d[a];return h?te` + + + ${u} + + + ${this.templateTransactions(h,n)} + + + `:null})})}templateRenderTransaction(e,t){const{date:i,descriptions:n,direction:o,isAllNFT:s,images:a,status:u,transfers:h,type:d}=this.getTransactionListItemProps(e),p=(h==null?void 0:h.length)>1;return(h==null?void 0:h.length)===2&&!s?te` + + `:p?h.map((b,I)=>{const L=Nl.getTransferDescription(b),$=t&&I===h.length-1;return te` `}):te` + + `}templateTransactions(e,t){return e.map((i,n)=>{const o=t&&n===e.length-1;return te`${this.templateRenderTransaction(i,o)}`})}emptyStateActivity(){return te` + + + No Transactions yet + Start trading on dApps
+ to grow your wallet!
+
+
`}emptyStateAccount(){return te` + + + No activity yet + Your next transactions will appear here + + Trade + `}templateEmpty(){return this.page==="account"?te`${this.emptyStateAccount()}`:te`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?Array(yre).fill(te` `).map(e=>e):null}onReceiveClick(){_e.push("WalletReceive")}createPaginationObserver(){const{projectId:e}=nt.state;this.paginationObserver=new IntersectionObserver(([t])=>{t!=null&&t.isIntersecting&&!this.loading&&(Zi.fetchTransactions(this.address),bt.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:this.address,projectId:e,cursor:this.next}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var t,i,n;(t=this.paginationObserver)==null||t.disconnect();const e=(i=this.shadowRoot)==null?void 0:i.querySelector(`#${u1}`);e&&((n=this.paginationObserver)==null||n.observe(e))}getTransactionListItemProps(e){var u,h,d,p,v;const t=fy.formatDate((u=e==null?void 0:e.metadata)==null?void 0:u.minedAt),i=Nl.getTransactionDescriptions(e),n=e==null?void 0:e.transfers,o=(h=e==null?void 0:e.transfers)==null?void 0:h[0],s=!!o&&((d=e==null?void 0:e.transfers)==null?void 0:d.every(b=>!!b.nft_info)),a=Nl.getTransactionImages(n);return{date:t,direction:o==null?void 0:o.direction,descriptions:i,isAllNFT:s,images:a,status:(p=e.metadata)==null?void 0:p.status,transfers:n,type:(v=e.metadata)==null?void 0:v.operationType}}};Qa.styles=vre;Tu([St()],Qa.prototype,"page",void 0);Tu([ce()],Qa.prototype,"address",void 0);Tu([ce()],Qa.prototype,"transactionsByYear",void 0);Tu([ce()],Qa.prototype,"loading",void 0);Tu([ce()],Qa.prototype,"empty",void 0);Tu([ce()],Qa.prototype,"next",void 0);Qa=Tu([me("w3m-activity-list")],Qa);const bre=ct` + :host { + width: 100%; + height: 100px; + border-radius: var(--wui-border-radius-s); + border: 1px solid var(--wui-color-gray-glass-002); + background-color: var(--wui-color-gray-glass-002); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + } + + :host(:hover) { + background-color: var(--wui-color-gray-glass-005); + } + + wui-flex { + width: 100%; + height: fit-content; + } + + wui-button { + width: 100%; + display: flex; + justify-content: flex-end; + } + + wui-input-amount { + mask-image: linear-gradient( + 270deg, + transparent 0px, + transparent 8px, + black 24px, + black 25px, + black 32px, + black 100% + ); + } + + .totalValue { + width: 100%; + } +`;var Om=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let qh=class extends Me{render(){return te` + + + ${this.buttonTemplate()} + + + ${this.sendValueTemplate()} + + ${this.maxAmountTemplate()} ${this.actionTemplate()} + + + `}buttonTemplate(){return this.token?te` + `:te`Select token`}handleSelectButtonClick(){_e.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const t=this.token.price*this.sendTokenAmount;return te`${t?`$${gt.formatNumberToLocalString(t,2)}`:"Incorrect value"}`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?te` + ${gt.roundNumber(Number(this.token.quantity.numeric),6,5)} + `:te` + ${gt.roundNumber(Number(this.token.quantity.numeric),6,5)} + `:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?te`Buy`:te`Max`:null}onInputChange(e){_r.setTokenAmount(e.detail)}onMaxClick(){if(this.token&&this.gasPriceInUSD){const e=pr.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.token.price),i=this.token.address===void 0?pr.bigNumber(this.token.quantity.numeric).minus(e):pr.bigNumber(this.token.quantity.numeric);_r.setTokenAmount(Number(i.toFixed(20)))}}onBuyClick(){_e.push("OnRampProviders")}};qh.styles=bre;Om([St({type:Object})],qh.prototype,"token",void 0);Om([St({type:Number})],qh.prototype,"sendTokenAmount",void 0);Om([St({type:Number})],qh.prototype,"gasPriceInUSD",void 0);qh=Om([me("w3m-input-token")],qh);const _re=ct` + :host { + width: 100%; + height: 100px; + border-radius: var(--wui-border-radius-s); + border: 1px solid var(--wui-color-gray-glass-002); + background-color: var(--wui-color-gray-glass-002); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + position: relative; + } + + :host(:hover) { + background-color: var(--wui-color-gray-glass-005); + } + + wui-flex { + width: 100%; + height: fit-content; + } + + wui-button { + display: ruby; + color: var(--wui-color-fg-100); + margin: 0 var(--wui-spacing-xs); + } + + .instruction { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + + .paste { + display: inline-flex; + } + + textarea { + background: transparent; + width: 100%; + font-family: var(--w3m-font-family); + font-size: var(--wui-font-size-medium); + font-style: normal; + font-weight: var(--wui-font-weight-light); + line-height: 130%; + letter-spacing: var(--wui-letter-spacing-medium); + color: var(--wui-color-fg-100); + caret-color: var(--wui-color-accent-100); + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + border: none; + outline: none; + appearance: none; + resize: none; + overflow: hidden; + } +`;var Pm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Vh=class extends Me{constructor(){super(...arguments),this.inputElementRef=Xf(),this.instructionElementRef=Xf(),this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=$e.debounce(async e=>{const t=await vt.getEnsAddress(e);if(_r.setLoading(!1),t){_r.setReceiverProfileName(e),_r.setReceiverAddress(t);const i=await vt.getEnsAvatar(e);i&&_r.setReceiverProfileImageUrl(i)}else _r.setReceiverAddress(e),_r.setReceiverProfileName(void 0),_r.setReceiverProfileImageUrl(void 0)})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return te` + + Type or + + + Paste + + address + + + `}async focusInput(){var e;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(e=this.inputElementRef.value)==null||e.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var e;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(e=this.inputElementRef.value)==null||e.blur())}async toggleInstructionFocus(e){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:e?0:1},{opacity:e?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.value&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.value&&this.instructionHidden&&!this.pasting&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){this.pasting=!0;const e=await navigator.clipboard.readText();_r.setReceiverAddress(e),this.focusInput()}onInputChange(e){this.pasting=!1;const t=e.target;t.value&&!this.instructionHidden&&this.focusInput(),_r.setLoading(!0),this.onDebouncedSearch(t.value)}};Vh.styles=_re;Pm([St()],Vh.prototype,"value",void 0);Pm([ce()],Vh.prototype,"instructionHidden",void 0);Pm([ce()],Vh.prototype,"pasting",void 0);Vh=Pm([me("w3m-input-address")],Vh);const xre=ct` + :host { + display: flex; + width: auto; + flex-direction: column; + gap: var(--wui-border-radius-1xs); + border-radius: var(--wui-border-radius-s); + background: var(--wui-color-gray-glass-002); + padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs) + var(--wui-spacing-1xs); + } + + wui-text { + padding: 0 var(--wui-spacing-1xs); + } + + wui-flex { + margin-top: var(--wui-spacing-1xs); + } + + .network { + cursor: pointer; + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + } + + .network:focus-visible { + border: 1px solid var(--wui-color-accent-100); + background-color: var(--wui-color-gray-glass-005); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + .network:hover { + background-color: var(--wui-color-gray-glass-005); + } + + .network:active { + background-color: var(--wui-color-gray-glass-010); + } +`;var Dm=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Kh=class extends Me{render(){return te` Details + + + + + ${this.networkTemplate()} + `}networkTemplate(){var e;return(e=this.caipNetwork)!=null&&e.name?te` this.onNetworkClick(this.caipNetwork)} + class="network" + textTitle="Network" + imageSrc=${ft(xr.getNetworkImage(this.caipNetwork))} + >`:null}onNetworkClick(e){e&&_e.push("Networks",{network:e})}};Kh.styles=xre;Dm([St()],Kh.prototype,"receiverAddress",void 0);Dm([St({type:Object})],Kh.prototype,"caipNetwork",void 0);Dm([St({type:Number})],Kh.prototype,"networkFee",void 0);Kh=Dm([me("w3m-wallet-send-details")],Kh);const Are=ct` + :host { + pointer-events: none; + } + + :host > wui-flex { + display: var(--w3m-tooltip-display); + opacity: var(--w3m-tooltip-opacity); + padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + color: var(--wui-color-bg-100); + position: fixed; + top: var(--w3m-tooltip-top); + left: var(--w3m-tooltip-left); + transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px)); + max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl)); + transition: opacity 0.2s var(--wui-ease-out-power-2); + will-change: opacity; + } + + :host([data-variant='shade']) > wui-flex { + background-color: var(--wui-color-bg-150); + border: 1px solid var(--wui-color-gray-glass-005); + } + + :host([data-variant='shade']) > wui-flex > wui-text { + color: var(--wui-color-fg-150); + } + + :host([data-variant='fill']) > wui-flex { + background-color: var(--wui-color-fg-100); + border: none; + } + + wui-icon { + position: absolute; + width: 12px !important; + height: 4px !important; + color: var(--wui-color-bg-150); + } + + wui-icon[data-placement='top'] { + bottom: 0px; + left: 50%; + transform: translate(-50%, 95%); + } + + wui-icon[data-placement='bottom'] { + top: 0; + left: 50%; + transform: translate(-50%, -95%) rotate(180deg); + } + + wui-icon[data-placement='right'] { + top: 50%; + left: 0; + transform: translate(-65%, -50%) rotate(90deg); + } + + wui-icon[data-placement='left'] { + top: 50%; + right: 0%; + transform: translate(65%, -50%) rotate(270deg); + } +`;var j0=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let hu=class extends Me{constructor(){super(),this.unsubscribe=[],this.open=Gn.state.open,this.message=Gn.state.message,this.triggerRect=Gn.state.triggerRect,this.variant=Gn.state.variant,this.unsubscribe.push(Gn.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;const e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=` + --w3m-tooltip-top: ${e}px; + --w3m-tooltip-left: ${t}px; + --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px; + --w3m-tooltip-display: ${this.open?"flex":"none"}; + --w3m-tooltip-opacity: ${this.open?1:0}; + `,te` + + ${this.message} + `}};hu.styles=[Are];j0([ce()],hu.prototype,"open",void 0);j0([ce()],hu.prototype,"message",void 0);j0([ce()],hu.prototype,"triggerRect",void 0);j0([ce()],hu.prototype,"variant",void 0);hu=j0([me("w3m-tooltip")],hu);const Ere=ct` + :host { + width: 100%; + display: block; + } +`;var Yy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let o0=class extends Me{constructor(){super(),this.unsubscribe=[],this.text="",this.open=Gn.state.open,this.unsubscribe.push(_e.subscribeKey("view",()=>{Gn.hide()}),yt.subscribeKey("open",e=>{e||Gn.hide()}),Gn.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),Gn.hide()}render(){return te` +
+ ${this.renderChildren()} +
+ `}renderChildren(){return te` `}onMouseEnter(){const e=this.getBoundingClientRect();this.open||Gn.showTooltip({message:this.text,triggerRect:{width:e.width,height:e.height,left:e.left,top:e.top},variant:"shade"})}onMouseLeave(e){this.contains(e.relatedTarget)||Gn.hide()}};o0.styles=[Ere];Yy([St()],o0.prototype,"text",void 0);Yy([ce()],o0.prototype,"open",void 0);o0=Yy([me("w3m-tooltip-trigger")],o0);const Cre=ct` + wui-flex:first-child { + margin-top: var(--wui-spacing-s); + } + wui-separator { + margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-m) + calc(var(--wui-spacing-m) * -1); + width: calc(100% + var(--wui-spacing-s) * 2); + } +`;var i9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const $_=2,M_=6;let Pg=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.connector=this.connectors.find(e=>e.type==="AUTH"),this.unsubscribe.push(dt.subscribeKey("connectors",e=>{this.connectors=e,this.connector=this.connectors.find(t=>t.type==="AUTH")}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return(e=this.connector)!=null&&e.socials?te` + + ${this.topViewTemplate()}${this.bottomViewTemplate()} + + ${this.separatorTemplate()} + `:null}topViewTemplate(){var e,t,i;return(e=this.connector)!=null&&e.socials?this.connector.socials.length===2?te` + ${this.connector.socials.slice(0,$_).map(n=>te`{this.onSocialClick(n)}} + logo=${n} + >`)} + `:te` {var n,o;this.onSocialClick((o=(n=this.connector)==null?void 0:n.socials)==null?void 0:o[0])}} + logo=${ft(this.connector.socials[0])} + align="center" + name=${`Continue with ${this.connector.socials[0]}`} + >`:null}bottomViewTemplate(){var e,t,i;return!((e=this.connector)!=null&&e.socials)||((t=this.connector)==null?void 0:t.socials.length)<=$_?null:((i=this.connector)==null?void 0:i.socials.length)>M_?te` + ${this.connector.socials.slice(1,M_-1).map(n=>te`{this.onSocialClick(n)}} + logo=${n} + >`)} + + `:te` + ${this.connector.socials.slice(1,this.connector.socials.length).map(n=>te`{this.onSocialClick(n)}} + logo=${n} + >`)} + `}separatorTemplate(){return this.connectors.find(t=>t.type==="WALLET_CONNECT")?te``:null}onMoreSocialsClick(){_e.push("ConnectSocials")}async onSocialClick(e){const t=dt.getAuthConnector();try{if(t&&e){const{uri:i}=await t.provider.getSocialRedirectUri({provider:e});Pe.setSocialProvider(e),setTimeout(()=>{const n=$e.returnOpenHref(i,"popupWindow","width=600,height=800,scrollbars=yes");n&&Pe.setSocialWindow(n)}),_e.push("ConnectingSocial")}}catch{$t.showError("Something went wrong")}}};Pg.styles=Cre;i9([ce()],Pg.prototype,"connectors",void 0);Pg=i9([me("w3m-social-login-widget")],Pg);const Sre=ct` + :host { + margin-top: var(--wui-spacing-3xs); + } + wui-separator { + margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) + calc(var(--wui-spacing-m) * -1); + width: calc(100% + var(--wui-spacing-s) * 2); + } +`;var Ire=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let d3=class extends Me{render(){return te` + + + + + + + + + + + `}};d3.styles=Sre;d3=Ire([me("w3m-wallet-login-list")],d3);const Tre=ct` + :host { + margin-top: var(--wui-spacing-3xs); + } + wui-separator { + margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) + calc(var(--wui-spacing-m) * -1); + width: calc(100% + var(--wui-spacing-s) * 2); + } +`;var n9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Dg=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.connector=this.connectors.find(e=>e.type==="AUTH"),this.unsubscribe.push(dt.subscribeKey("connectors",e=>{this.connectors=e,this.connector=this.connectors.find(t=>t.type==="AUTH")}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return(e=this.connector)!=null&&e.socials?te` + ${this.connector.socials.map(t=>te``)} + `:null}};Dg.styles=Tre;n9([ce()],Dg.prototype,"connectors",void 0);Dg=n9([me("w3m-social-login-list")],Dg);var o9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let f3=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(t=>t.type==="ANNOUNCED");return e!=null&&e.length?te` + + ${e.map(t=>te` + this.onConnector(t)} + tagVariant="success" + tagLabel="installed" + data-testid=${`wallet-selector-${t.id}`} + .installed=${!0} + > + + `)} + + `:(this.style.cssText="display: none",null)}onConnector(e){e.type==="WALLET_CONNECT"?$e.isMobile()?_e.push("AllWallets"):_e.push("ConnectingWalletConnect"):_e.push("ConnectingExternal",{connector:e})}};o9([ce()],f3.prototype,"connectors",void 0);f3=o9([me("w3m-connect-announced-widget")],f3);var s9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let p3=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{customWallets:e}=nt.state;if(!(e!=null&&e.length))return this.style.cssText="display: none",null;const t=this.filterOutDuplicateWallets(e);return te` + ${t.map(i=>te` + this.onConnectWallet(i)} + data-testid=${`wallet-selector-${i.id}`} + > + + `)} + `}filterOutDuplicateWallets(e){const t=Fr.getRecentWallets(),i=this.connectors.map(a=>{var u;return(u=a.info)==null?void 0:u.rdns}).filter(Boolean),n=t.map(a=>a.rdns).filter(Boolean),o=i.concat(n);if(o.includes("io.metamask.mobile")&&$e.isMobile()){const a=o.indexOf("io.metamask.mobile");o[a]="io.metamask"}return e.filter(a=>!o.includes(String(a==null?void 0:a.rdns)))}onConnectWallet(e){_e.push("ConnectingWalletConnect",{wallet:e})}};s9([ce()],p3.prototype,"connectors",void 0);p3=s9([me("w3m-connect-custom-widget")],p3);var a9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let g3=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(t=>!["WALLET_CONNECT","INJECTED","ANNOUNCED","AUTH"].includes(t.type));return e!=null&&e.length?te` + + ${e.map(t=>te` + this.onConnector(t)} + > + + `)} + + `:(this.style.cssText="display: none",null)}onConnector(e){_e.push("ConnectingExternal",{connector:e})}};a9([ce()],g3.prototype,"connectors",void 0);g3=a9([me("w3m-connect-external-widget")],g3);var c9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let m3=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{featured:e}=Tt.state;if(!e.length)return this.style.cssText="display: none",null;const t=this.filterOutDuplicateWallets(e);return te` + + ${t.map(i=>te` + this.onConnectWallet(i)} + > + + `)} + + `}filterOutDuplicateWallets(e){const t=Fr.getRecentWallets(),i=this.connectors.map(a=>{var u;return(u=a.info)==null?void 0:u.rdns}).filter(Boolean),n=t.map(a=>a.rdns).filter(Boolean),o=i.concat(n);if(o.includes("io.metamask.mobile")&&$e.isMobile()){const a=o.indexOf("io.metamask.mobile");o[a]="io.metamask"}return e.filter(a=>!o.includes(String(a==null?void 0:a.rdns)))}onConnectWallet(e){_e.push("ConnectingWalletConnect",{wallet:e})}};c9([ce()],m3.prototype,"connectors",void 0);m3=c9([me("w3m-connect-featured-widget")],m3);var l9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let w3=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var t;const e=this.connectors.filter(i=>i.type==="INJECTED");return!(e!=null&&e.length)||e.length===1&&((t=e[0])==null?void 0:t.name)==="Browser Wallet"&&!$e.isMobile()?(this.style.cssText="display: none",null):te` + + ${e.map(i=>!$e.isMobile()&&i.name==="Browser Wallet"||!vt.checkInstalled()?null:te` + this.onConnector(i)} + > + + `)} + + `}onConnector(e){_e.push("ConnectingExternal",{connector:e})}};l9([ce()],w3.prototype,"connectors",void 0);w3=l9([me("w3m-connect-injected-widget")],w3);var u9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let v3=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find(t=>t.id==="coinbaseWalletSDK");return e?te` + + this.onConnector(e)} + > + + + `:(this.style.cssText="display: none",null)}onConnector(e){_e.push("ConnectingExternal",{connector:e})}};u9([ce()],v3.prototype,"connectors",void 0);v3=u9([me("w3m-connect-coinbase-widget")],v3);var Rre=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let B_=class extends Me{render(){const e=Fr.getRecentWallets();return e!=null&&e.length?te` + + ${e.map(t=>te` + this.onConnectWallet(t)} + tagLabel="recent" + tagVariant="shade" + > + + `)} + + `:(this.style.cssText="display: none",null)}onConnectWallet(e){_e.push("ConnectingWalletConnect",{wallet:e})}};B_=Rre([me("w3m-connect-recent-widget")],B_);var h9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let y3=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.connectors.find(v=>v.type==="WALLET_CONNECT"))return null;const{recommended:t}=Tt.state,{customWallets:i,featuredWalletIds:n}=nt.state,{connectors:o}=dt.state,s=Fr.getRecentWallets(),u=o.filter(v=>v.type==="INJECTED"||v.type==="ANNOUNCED").filter(v=>v.name!=="Browser Wallet");if(n||i||!t.length)return this.style.cssText="display: none",null;const h=u.length+s.length,d=Math.max(0,2-h),p=this.filterOutDuplicateWallets(t).slice(0,d);return p.length?te` + + ${p.map(v=>te` + this.onConnectWallet(v)} + > + + `)} + + `:(this.style.cssText="display: none",null)}filterOutDuplicateWallets(e){const t=Fr.getRecentWallets(),i=this.connectors.map(a=>{var u;return(u=a.info)==null?void 0:u.rdns}).filter(Boolean),n=t.map(a=>a.rdns).filter(Boolean),o=i.concat(n);if(o.includes("io.metamask.mobile")&&$e.isMobile()){const a=o.indexOf("io.metamask.mobile");o[a]="io.metamask"}return e.filter(a=>!o.includes(String(a==null?void 0:a.rdns)))}onConnectWallet(e){_e.push("ConnectingWalletConnect",{wallet:e})}};h9([ce()],y3.prototype,"connectors",void 0);y3=h9([me("w3m-connect-recommended-widget")],y3);var d9=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let b3=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if($e.isMobile())return this.style.cssText="display: none",null;const e=this.connectors.find(t=>t.type==="WALLET_CONNECT");return e?te` + this.onConnector(e)} + tagLabel="qr code" + tagVariant="main" + data-testid="wallet-selector-walletconnect" + > + + `:(this.style.cssText="display: none",null)}onConnector(e){e.type==="WALLET_CONNECT"?$e.isMobile()?_e.push("AllWallets"):_e.push("ConnectingWalletConnect"):_e.push("ConnectingExternal",{connector:e})}};d9([ce()],b3.prototype,"connectors",void 0);b3=d9([me("w3m-connect-walletconnect-widget")],b3);var Jy=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Ng=class extends Me{constructor(){super(),this.unsubscribe=[],this.connectors=dt.state.connectors,this.count=Tt.state.count,this.unsubscribe.push(dt.subscribeKey("connectors",e=>this.connectors=e),Tt.subscribeKey("count",e=>this.count=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find(a=>a.type==="WALLET_CONNECT"),{allWallets:t}=nt.state;if(!e||t==="HIDE"||t==="ONLY_MOBILE"&&!$e.isMobile())return null;const i=Tt.state.featured.length,n=this.count+i,o=n<10?n:Math.floor(n/10)*10,s=o + `}onAllWallets(){bt.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),_e.push("AllWallets")}};Jy([ce()],Ng.prototype,"connectors",void 0);Jy([ce()],Ng.prototype,"count",void 0);Ng=Jy([me("w3m-all-wallets-widget")],Ng);var kre=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let U_=class extends Me{render(){const e=Fr.getConnectedConnector(),t=dt.getAuthConnector();if(!t||e!=="AUTH")return this.style.cssText="display: none",null;const i=t.provider.getEmail()??"",n=Fr.getConnectedSocialProvider(),o=Fr.getConnectedSocialUsername();return te` + {this.onGoToUpdateEmail(i,n)}} + > + ${o??i} + + `}onGoToUpdateEmail(e,t){t||_e.push("UpdateEmailWallet",{email:e})}};U_=kre([me("w3m-account-auth-button")],U_);let L_=!1;class Ore{constructor(e){this.initPromise=void 0,this.setIsConnected=t=>{Pe.setIsConnected(t)},this.getIsConnectedState=()=>Pe.state.isConnected,this.setCaipAddress=t=>{Pe.setCaipAddress(t)},this.setBalance=(t,i)=>{Pe.setBalance(t,i)},this.setProfileName=t=>{Pe.setProfileName(t)},this.setProfileImage=t=>{Pe.setProfileImage(t)},this.resetAccount=()=>{Pe.resetAccount()},this.setCaipNetwork=t=>{Xe.setCaipNetwork(t)},this.getCaipNetwork=()=>Xe.state.caipNetwork,this.setRequestedCaipNetworks=t=>{Xe.setRequestedCaipNetworks(t)},this.getApprovedCaipNetworksData=()=>Xe.getApprovedCaipNetworksData(),this.resetNetwork=()=>{Xe.resetNetwork()},this.setConnectors=t=>{dt.setConnectors(t)},this.addConnector=t=>{dt.addConnector(t)},this.getConnectors=()=>dt.getConnectors(),this.resetWcConnection=()=>{vt.resetWcConnection()},this.fetchIdentity=t=>li.fetchIdentity(t),this.setAddressExplorerUrl=t=>{Pe.setAddressExplorerUrl(t)},this.setSmartAccountDeployed=t=>{Pe.setSmartAccountDeployed(t)},this.setConnectedWalletInfo=t=>{Pe.setConnectedWalletInfo(t)},this.setSmartAccountEnabledNetworks=t=>{Xe.setSmartAccountEnabledNetworks(t)},this.setPreferredAccountType=t=>{Pe.setPreferredAccountType(t)},this.getWalletConnectName=t=>cs.getNamesForAddress(t),this.resolveWalletConnectName=async t=>{var s;const i=t.replace(Ic.WC_NAME_SUFFIX,""),n=await cs.resolveName(i);return((s=(Object.values(n==null?void 0:n.addresses)||[])[0])==null?void 0:s.address)||!1},this.initControllers(e),this.initOrContinue()}async open(e){await this.initOrContinue(),yt.open(e)}async close(){await this.initOrContinue(),yt.close()}setLoading(e){yt.setLoading(e)}getThemeMode(){return oi.state.themeMode}getThemeVariables(){return oi.state.themeVariables}setThemeMode(e){oi.setThemeMode(e),qE(oi.state.themeMode)}setThemeVariables(e){oi.setThemeVariables(e),SK(oi.state.themeVariables)}subscribeTheme(e){return oi.subscribe(e)}getWalletInfo(){return Pe.state.connectedWalletInfo}subscribeWalletInfo(e){return Pe.subscribeKey("connectedWalletInfo",e)}getState(){return Ul.state}subscribeState(e){return Ul.subscribe(e)}showErrorMessage(e){$t.showError(e)}showSuccessMessage(e){$t.showSuccess(e)}getEvent(){return{...bt.state}}subscribeEvents(e){return bt.subscribe(e)}replace(e){_e.replace(e)}redirect(e){_e.push(e)}popTransactionStack(e){_e.popTransactionStack(e)}isOpen(){return yt.state.open}isTransactionStackEmpty(){return _e.state.transactionStack.length===0}isTransactionShouldReplaceView(){var e;return(e=_e.state.transactionStack[_e.state.transactionStack.length-1])==null?void 0:e.replace}async initControllers(e){if(Xe.setClient(e.networkControllerClient),Xe.setDefaultCaipNetwork(e.defaultChain),nt.setProjectId(e.projectId),nt.setAllWallets(e.allWallets),nt.setIncludeWalletIds(e.includeWalletIds),nt.setExcludeWalletIds(e.excludeWalletIds),nt.setFeaturedWalletIds(e.featuredWalletIds),nt.setTokens(e.tokens),nt.setTermsConditionsUrl(e.termsConditionsUrl),nt.setPrivacyPolicyUrl(e.privacyPolicyUrl),nt.setCustomWallets(e.customWallets),nt.setEnableAnalytics(e.enableAnalytics),nt.setSdkVersion(e._sdkVersion),e.metadata&&nt.setMetadata(e.metadata),e.themeMode&&oi.setThemeMode(e.themeMode),e.themeVariables&&oi.setThemeVariables(e.themeVariables),e.enableOnramp&&nt.setOnrampEnabled(!!e.enableOnramp),e.enableWalletFeatures&&nt.setWalletFeaturesEnabled(!!e.enableWalletFeatures),e.allowUnsupportedChain&&Xe.setAllowUnsupportedChain(e.allowUnsupportedChain),e.siweControllerClient){const{SIWEController:t}=await Bo(()=>import("./index.CaJWFNre.js"),[],import.meta.url);t.setSIWEClient(e.siweControllerClient)}vt.setClient(e.connectionControllerClient)}async initOrContinue(){return!this.initPromise&&!L_&&$e.isClient()&&(L_=!0,this.initPromise=new Promise(async e=>{await Promise.all([Bo(()=>import("./index.CGVde19D.js"),[],import.meta.url),Bo(()=>Promise.resolve().then(()=>uJ),void 0,import.meta.url)]);const t=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",t),e()})),this.initPromise}}const jt={WALLET_CONNECT_CONNECTOR_ID:"walletConnect",INJECTED_CONNECTOR_ID:"injected",COINBASE_CONNECTOR_ID:"coinbaseWallet",COINBASE_SDK_CONNECTOR_ID:"coinbaseWalletSDK",SAFE_CONNECTOR_ID:"safe",LEDGER_CONNECTOR_ID:"ledger",EIP6963_CONNECTOR_ID:"eip6963",AUTH_CONNECTOR_ID:"w3mAuth",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet"},VERSION:"4.2.3"},Ra={ConnectorExplorerIds:{[jt.COINBASE_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[jt.SAFE_CONNECTOR_ID]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[jt.LEDGER_CONNECTOR_ID]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"},EIP155NetworkImageIds:{1:"692ed6ba-e569-459a-556a-776476829e00",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700"},ConnectorImageIds:{[jt.COINBASE_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[jt.COINBASE_SDK_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[jt.SAFE_CONNECTOR_ID]:"461db637-8616-43ce-035a-d89b8a1d5800",[jt.LEDGER_CONNECTOR_ID]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[jt.WALLET_CONNECT_CONNECTOR_ID]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[jt.INJECTED_CONNECTOR_ID]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[jt.INJECTED_CONNECTOR_ID]:"Browser Wallet",[jt.WALLET_CONNECT_CONNECTOR_ID]:"WalletConnect",[jt.COINBASE_CONNECTOR_ID]:"Coinbase",[jt.COINBASE_SDK_CONNECTOR_ID]:"Coinbase",[jt.LEDGER_CONNECTOR_ID]:"Ledger",[jt.SAFE_CONNECTOR_ID]:"Safe"},ConnectorTypesMap:{[jt.INJECTED_CONNECTOR_ID]:"INJECTED",[jt.WALLET_CONNECT_CONNECTOR_ID]:"WALLET_CONNECT",[jt.EIP6963_CONNECTOR_ID]:"ANNOUNCED",[jt.AUTH_CONNECTOR_ID]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},Pre={getCaipTokens(r){if(!r)return;const e={};return Object.entries(r).forEach(([t,i])=>{e[`${jt.EIP155}:${t}`]=i}),e}};function Dre(r){if(r)return{id:`${jt.EIP155}:${r.id}`,name:r.name,imageId:Ra.EIP155NetworkImageIds[r.id]}}async function Nre(r){var o,s,a,u;if(!r)throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");const e=await(r==null?void 0:r.getProvider()),t=(s=(o=e==null?void 0:e.signer)==null?void 0:o.session)==null?void 0:s.namespaces,i=(a=t==null?void 0:t[jt.EIP155])==null?void 0:a.methods,n=(u=t==null?void 0:t[jt.EIP155])==null?void 0:u.chains;return{supportsAllNetworks:!!(i!=null&&i.includes(jt.ADD_CHAIN_METHOD)),approvedCaipNetworkIds:n}}function $re(){return{supportsAllNetworks:!1,approvedCaipNetworkIds:Ra.WalletConnectRpcChainIds.map(r=>`${jt.EIP155}:${r}`)}}function Mre({chainId:r,projectId:e}){const t=$e.getBlockchainApiUrl();return Ra.WalletConnectRpcChainIds.includes(r)?i4(`${t}/v1/?chainId=${jt.EIP155}:${r}&projectId=${e}`):i4()}var Bre="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const j_=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),F_=4;function Ure(r){let e=0;function t(){return r[e++]<<8|r[e++]}let i=t(),n=1,o=[0,1];for(let U=1;U>--u&1}const p=31,v=2**p,b=v>>>1,I=b>>1,L=v-1;let $=0;for(let U=0;U1;){let j=F+_>>>1;U>>1|d(),x=x<<1^b,M=(M^b)<<1|b|1;P=x,q=1+M-x}let D=i-4;return K.map(U=>{switch(U-D){case 3:return D+65792+(r[a++]<<16|r[a++]<<8|r[a++]);case 2:return D+256+(r[a++]<<8|r[a++]);case 1:return D+r[a++];default:return U-1}})}function Lre(r){let e=0;return()=>r[e++]}function f9(r){return Lre(Ure(jre(r)))}function jre(r){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((n,o)=>e[n.charCodeAt(0)]=o);let t=r.length,i=new Uint8Array(6*t>>3);for(let n=0,o=0,s=0,a=0;n=8&&(i[o++]=a>>(s-=8));return i}function Fre(r){return r&1?~r>>1:r>>1}function zre(r,e){let t=Array(r);for(let i=0,n=0;i{let e=s0(r);if(e.length)return e})}function g9(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(Wre(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(Hre(t,r))}return e.flat()}function a0(r){let e=[];for(;;){let t=r(e.length);if(!t)break;e.push(t)}return e}function m9(r,e,t){let i=Array(r).fill().map(()=>[]);for(let n=0;ni[s].push(o));return i}function Wre(r,e){let t=1+e(),i=e(),n=a0(e);return m9(n.length,1+r,e).flatMap((s,a)=>{let[u,...h]=s;return Array(n[a]).fill().map((d,p)=>{let v=p*i;return[u+p*t,h.map(b=>b+v)]})})}function Hre(r,e){let t=1+e();return m9(t,1+r,e).map(n=>[n[0],n.slice(1)])}function qre(r){let e=[],t=s0(r);return n(i([]),[]),e;function i(o){let s=r(),a=a0(()=>{let u=s0(r).map(h=>t[h]);if(u.length)return i(u)});return{S:s,B:a,Q:o}}function n({S:o,B:s},a,u){if(!(o&4&&u===a[a.length-1])){o&2&&(u=a[a.length-1]),o&1&&e.push(a);for(let h of s)for(let d of h.Q)n(h,[...a,d],u)}}}function Vre(r){return r.toString(16).toUpperCase().padStart(2,"0")}function w9(r){return`{${Vre(r)}}`}function Kre(r){let e=[];for(let t=0,i=r.length;t>24&255}function b9(r){return r&16777215}let _3,z_,x3,T1;function tie(){let r=f9(Zre);_3=new Map(p9(r).flatMap((e,t)=>e.map(i=>[i,t+1<<24]))),z_=new Set(s0(r)),x3=new Map,T1=new Map;for(let[e,t]of g9(r)){if(!z_.has(e)&&t.length==2){let[i,n]=t,o=T1.get(i);o||(o=new Map,T1.set(i,o)),o.set(n,e)}x3.set(e,t.reverse())}}function _9(r){return r>=c0&&r=$g&&r=Mg&&eBg&&e0&&n(Bg+h)}else{let s=x3.get(o);s?t.push(...s):n(o)}if(!t.length)break;o=t.pop()}if(i&&e.length>1){let o=Zd(e[0]);for(let s=1;s0&&n>=s)s==0?(e.push(i,...t),t.length=0,i=a):t.push(a),n=s;else{let u=rie(i,a);u>=0?i=u:n==0&&s==0?(e.push(i),i=a):(t.push(a),n=s)}}return i>=0&&e.push(i,...t),e}function A9(r){return x9(r).map(b9)}function nie(r){return iie(x9(r))}const W_=45,E9=".",C9=65039,S9=1,ah=r=>Array.from(r);function l0(r,e){return r.P.has(e)||r.Q.has(e)}class oie extends Array{get is_emoji(){return!0}}let A3,I9,Ml,E3,T9,mh,r2,nh,R9,H_,C3;function Xy(){if(A3)return;let r=f9(Bre);const e=()=>s0(r),t=()=>new Set(e());A3=new Map(g9(r)),I9=t(),Ml=e(),E3=new Set(e().map(d=>Ml[d])),Ml=new Set(Ml),T9=t(),t();let i=p9(r),n=r();const o=()=>new Set(e().flatMap(d=>i[d]).concat(e()));mh=a0(d=>{let p=a0(r).map(v=>v+96);if(p.length){let v=d>=n;p[0]-=32,p=Gh(p),v&&(p=`Restricted[${p}]`);let b=o(),I=o(),L=!r();return{N:p,P:b,Q:I,M:L,R:v}}}),r2=t(),nh=new Map;let s=e().concat(ah(r2)).sort((d,p)=>d-p);s.forEach((d,p)=>{let v=r(),b=s[p]=v?s[p-v]:{V:[],M:new Map};b.V.push(d),r2.has(d)||nh.set(d,b)});for(let{V:d,M:p}of new Set(nh.values())){let v=[];for(let I of d){let L=mh.filter(K=>l0(K,I)),$=v.find(({G:K})=>L.some(P=>K.has(P)));$||($={G:new Set,V:[]},v.push($)),$.V.push(I),L.forEach(K=>$.G.add(K))}let b=v.flatMap(I=>ah(I.G));for(let{G:I,V:L}of v){let $=new Set(b.filter(K=>!I.has(K)));for(let K of L)p.set(K,$)}}let a=new Set,u=new Set;const h=d=>a.has(d)?u.add(d):a.add(d);for(let d of mh){for(let p of d.P)h(p);for(let p of d.Q)h(p)}for(let d of a)!nh.has(d)&&!u.has(d)&&nh.set(d,S9);R9=new Set(ah(a).concat(ah(A9(a)))),H_=qre(r).map(d=>oie.from(d)).sort(Gre),C3=new Map;for(let d of H_){let p=[C3];for(let v of d){let b=p.map(I=>{let L=I.get(v);return L||(L=new Map,I.set(v,L)),L});v===C9?p.push(...b):p=b}for(let v of p)v.V=d}}function eb(r){return(k9(r)?"":`${tb(Nm([r]))} `)+w9(r)}function tb(r){return`"${r}"‎`}function sie(r){if(r.length>=4&&r[2]==W_&&r[3]==W_)throw new Error(`invalid label extension: "${Gh(r.slice(0,4))}"`)}function aie(r){for(let t=r.lastIndexOf(95);t>0;)if(r[--t]!==95)throw new Error("underscore allowed only at start")}function cie(r){let e=r[0],t=j_.get(e);if(t)throw uf(`leading ${t}`);let i=r.length,n=-1;for(let o=1;o{let o=Kre(n),s={input:o,offset:i};i+=o.length+1;try{let a=s.tokens=mie(o,e,t),u=a.length,h;if(!u)throw new Error("empty label");let d=s.output=a.flat();if(aie(d),!(s.emoji=u>1||a[0].is_emoji)&&d.every(v=>v<128))sie(d),h="ASCII";else{let v=a.flatMap(b=>b.is_emoji?[]:b);if(!v.length)h="Emoji";else{if(Ml.has(d[0]))throw uf("leading combining mark");for(let L=1;Ls.has(a)):ah(s),!t.length)return}else i.push(n)}if(t){for(let n of t)if(i.every(o=>l0(n,o)))throw new Error(`whole-script confusable: ${r.N}/${n.N}`)}}function fie(r){let e=mh;for(let t of r){let i=e.filter(n=>l0(n,t));if(!i.length)throw mh.some(n=>l0(n,t))?P9(e[0],t):O9(t);if(e=i,i.length==1)break}return e}function pie(r){return r.map(({input:e,error:t,output:i})=>{if(t){let n=t.message;throw new Error(r.length==1?n:`Invalid label ${tb(Nm(e))}: ${n}`)}return Gh(i)}).join(E9)}function O9(r){return new Error(`disallowed character: ${eb(r)}`)}function P9(r,e){let t=eb(e),i=mh.find(n=>n.P.has(e));return i&&(t=`${i.N} ${t}`),new Error(`illegal mixture: ${r.N} + ${t}`)}function uf(r){return new Error(`illegal placement: ${r}`)}function gie(r,e){for(let t of e)if(!l0(r,t))throw P9(r,t);if(r.M){let t=A9(e);for(let i=1,n=t.length;iF_)throw new Error(`excessive non-spacing marks: ${tb(Nm(t.slice(i-1,o)))} (${o-i}/${F_})`);i=o}}}function mie(r,e,t){let i=[],n=[];for(r=r.slice().reverse();r.length;){let o=vie(r);if(o)n.length&&(i.push(e(n)),n=[]),i.push(t(o));else{let s=r.pop();if(R9.has(s))n.push(s);else{let a=A3.get(s);if(a)n.push(...a);else if(!I9.has(s))throw O9(s)}}}return n.length&&i.push(e(n)),i}function wie(r){return r.filter(e=>e!=C9)}function vie(r,e){let t=C3,i,n=r.length;for(;n&&(t=t.get(r[--n]),!!t);){let{V:o}=t;o&&(i=o,r.length=n)}return i}function q_(r){return uie(r)}class yie extends Ore{constructor(e){const{wagmiConfig:t,siweConfig:i,defaultChain:n,tokens:o,_sdkVersion:s,...a}=e;if(!t)throw new Error("web3modal:constructor - wagmiConfig is undefined");if(!a.projectId)throw new Error("web3modal:constructor - projectId is undefined");const u={switchCaipNetwork:async d=>{const p=ss.caipNetworkIdToNumber(d==null?void 0:d.id);p&&await kV(this.wagmiConfig,{chainId:p})},getApprovedCaipNetworksData:async()=>new Promise(d=>{var b,I;const v=new Map(t.state.connections).get(t.state.current||"");if(((b=v==null?void 0:v.connector)==null?void 0:b.id)===jt.AUTH_CONNECTOR_ID)d($re());else if(((I=v==null?void 0:v.connector)==null?void 0:I.id)===jt.WALLET_CONNECT_CONNECTOR_ID){const L=t.connectors.find($=>$.id===jt.WALLET_CONNECT_CONNECTOR_ID);d(Nre(L))}d({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})},h={connectWalletConnect:async d=>{var I,L,$;const p=t.connectors.find(K=>K.id===jt.WALLET_CONNECT_CONNECTOR_ID);if(!p)throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");const v=await p.getProvider();v.on("display_uri",K=>{d(K)});const b=ss.caipNetworkIdToNumber((I=this.getCaipNetwork())==null?void 0:I.id);if((L=i==null?void 0:i.options)!=null&&L.enabled&&typeof(v==null?void 0:v.authenticate)=="function"){const{SIWEController:K,getDidChainId:P,getDidAddress:q}=await Bo(()=>import("./index.CaJWFNre.js"),[],import.meta.url),D=await i.getMessageParams();await p.setRequestedChainsIds(D.chains);const U=await v.authenticate({nonce:await i.getNonce(),methods:[...uy],...D}),F=($=U==null?void 0:U.auths)==null?void 0:$[0];if(F){const{p:_,s:x}=F,M=P(_.iss)||"",j=q(_.iss);j&&M&&K.setSession({address:j,chainId:parseInt(M,10)});try{const V=v.signer.client.formatAuthMessage({request:_,iss:_.iss});await K.verifyMessage({message:V,signature:x.s,cacao:F})}catch(V){throw console.error("Error verifying message",V),await v.disconnect().catch(console.error),await K.signOut().catch(console.error),V}this.wagmiConfig.state.current=""}}await C8(this.wagmiConfig,{connector:p,chainId:b})},connectExternal:async({id:d,provider:p,info:v})=>{var L,$;const b=t.connectors.find(K=>K.id===d);if(!b)throw new Error("connectionControllerClient:connectExternal - connector is undefined");p&&v&&b.id===jt.EIP6963_CONNECTOR_ID&&((L=b.setEip6963Wallet)==null||L.call(b,{provider:p,info:v}));const I=ss.caipNetworkIdToNumber(($=this.getCaipNetwork())==null?void 0:$.id);await C8(this.wagmiConfig,{connector:b,chainId:I})},reconnectExternal:async({id:d})=>{const p=t.connectors.find(v=>v.id===d);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await RE(this.wagmiConfig,{connectors:[p]})},checkInstalled:d=>{const p=this.getConnectors().find(v=>v.type==="INJECTED");return d?p&&window!=null&&window.ethereum?d.some(v=>{var b;return!!((b=window.ethereum)!=null&&b[String(v)])}):!1:!!window.ethereum},disconnect:async()=>{var d;if(await IE(this.wagmiConfig),(d=i==null?void 0:i.options)!=null&&d.signOutOnDisconnect){const{SIWEController:p}=await Bo(()=>import("./index.CaJWFNre.js"),[],import.meta.url);await p.signOut()}},signMessage:async d=>TV(this.wagmiConfig,{message:d}),estimateGas:async d=>{try{return await yV(this.wagmiConfig,{account:d.address,to:d.to,data:d.data,type:"legacy"})}catch{return 0n}},sendTransaction:async d=>{const{chainId:p}=x0(this.wagmiConfig),v={account:d.address,to:d.to,value:d.value,gas:d.gas,gasPrice:d.gasPrice,data:d.data,chainId:p,type:"legacy"};await SV(this.wagmiConfig,v);const b=await IV(this.wagmiConfig,v);return await DV(this.wagmiConfig,{hash:b,timeout:25e3}),b},writeContract:async d=>{var b;const p=ss.caipNetworkIdToNumber((b=this.getCaipNetwork())==null?void 0:b.id);return await NV(t,{chainId:p,address:d.tokenAddress,abi:d.abi,functionName:d.method,args:[d.receiverAddress,d.tokenAmount]})},getEnsAddress:async d=>{var p;try{const v=ss.caipNetworkIdToNumber((p=this.getCaipNetwork())==null?void 0:p.id);let b=!1,I=!1;return d!=null&&d.endsWith(Ic.WC_NAME_SUFFIX)&&(I=await this.resolveWalletConnectName(d)),v===h1.id&&(b=await EV(this.wagmiConfig,{name:q_(d),chainId:v})),b||I||!1}catch{return!1}},getEnsAvatar:async d=>{var b;const p=ss.caipNetworkIdToNumber((b=this.getCaipNetwork())==null?void 0:b.id);return p!==h1.id?!1:await I8(this.wagmiConfig,{name:q_(d),chainId:p})||!1},parseUnits:tP,formatUnits:$3};super({networkControllerClient:u,connectionControllerClient:h,siweControllerClient:i,defaultChain:Dre(n),tokens:Pre.getCaipTokens(o),_sdkVersion:s??`html-wagmi-${jt.VERSION}`,...a}),this.hasSyncedConnectedAccount=!1,this.options=void 0,this.options=e,this.wagmiConfig=t,this.syncRequestedNetworks([...t.chains]),this.syncConnectors([...t.connectors]),this.initAuthConnectorListeners([...t.connectors]),PV(this.wagmiConfig,{onChange:d=>this.syncConnectors(d)}),OV(this.wagmiConfig,{onChange:d=>this.syncAccount({...d})})}getState(){const e=super.getState();return{...e,selectedNetworkId:ss.caipNetworkIdToNumber(e.selectedNetworkId)}}subscribeState(e){return super.subscribeState(t=>e({...t,selectedNetworkId:ss.caipNetworkIdToNumber(t.selectedNetworkId)}))}syncRequestedNetworks(e){const t=e==null?void 0:e.map(i=>{var n,o;return{id:`${jt.EIP155}:${i.id}`,name:i.name,imageId:Ra.EIP155NetworkImageIds[i.id],imageUrl:(o=(n=this.options)==null?void 0:n.chainImages)==null?void 0:o[i.id]}});this.setRequestedCaipNetworks(t??[])}async syncAccount({address:e,isConnected:t,chainId:i,connector:n}){if(this.resetAccount(),this.syncNetwork(e,i,t),t&&e&&i){const o=`${jt.EIP155}:${i}:${e}`;this.setIsConnected(t),this.setCaipAddress(o),await Promise.all([this.syncProfile(e,i),this.syncBalance(e,i),this.syncConnectedWalletInfo(n),this.getApprovedCaipNetworksData()]),this.hasSyncedConnectedAccount=!0}else!t&&this.hasSyncedConnectedAccount&&(this.resetWcConnection(),this.resetNetwork())}async syncNetwork(e,t,i){var o,s,a,u;const n=this.wagmiConfig.chains.find(h=>h.id===t);if(n||t){const h=(n==null?void 0:n.name)??(t==null?void 0:t.toString()),d=Number((n==null?void 0:n.id)??t),p=`${jt.EIP155}:${d}`;if(this.setCaipNetwork({id:p,name:h,imageId:Ra.EIP155NetworkImageIds[d],imageUrl:(s=(o=this.options)==null?void 0:o.chainImages)==null?void 0:s[d]}),i&&e&&t){const v=`${jt.EIP155}:${d}:${e}`;if(this.setCaipAddress(v),(u=(a=n==null?void 0:n.blockExplorers)==null?void 0:a.default)!=null&&u.url){const b=`${n.blockExplorers.default.url}/address/${e}`;this.setAddressExplorerUrl(b)}else this.setAddressExplorerUrl(void 0);this.hasSyncedConnectedAccount&&(await this.syncProfile(e,t),await this.syncBalance(e,t))}}}async syncWalletConnectName(e){try{const t=await this.getWalletConnectName(e);if(t[0]){const i=t[0];this.setProfileName(i.name)}else this.setProfileName(null)}catch{this.setProfileName(null)}}async syncProfile(e,t){try{const{name:i,avatar:n}=await this.fetchIdentity({address:e});this.setProfileName(i),this.setProfileImage(n),i||await this.syncWalletConnectName(e)}catch{if(t===h1.id){const i=await CV(this.wagmiConfig,{address:e,chainId:t});if(i){this.setProfileName(i);const n=await I8(this.wagmiConfig,{name:i,chainId:t});n&&this.setProfileImage(n)}else await this.syncWalletConnectName(e),this.setProfileImage(null)}else await this.syncWalletConnectName(e),this.setProfileImage(null)}}async syncBalance(e,t){var n,o,s;const i=this.wagmiConfig.chains.find(a=>a.id===t);if(i){const a=await AV(this.wagmiConfig,{address:e,chainId:i.id,token:(s=(o=(n=this.options)==null?void 0:n.tokens)==null?void 0:o[i.id])==null?void 0:s.address});this.setBalance(a.formatted,a.symbol);return}this.setBalance(void 0,void 0)}async syncConnectedWalletInfo(e){var t;if(!e)throw Error("syncConnectedWalletInfo - connector is undefined");if(e.id===jt.WALLET_CONNECT_CONNECTOR_ID&&e.getProvider){const i=await e.getProvider();i.session&&this.setConnectedWalletInfo({...i.session.peer.metadata,name:i.session.peer.metadata.name,icon:(t=i.session.peer.metadata.icons)==null?void 0:t[0]})}else this.setConnectedWalletInfo({name:e.name,icon:e.icon})}syncConnectors(e){const t=new Set,i=e.filter(a=>!t.has(a.id)&&t.add(a.id)),n=[],o=jt.COINBASE_SDK_CONNECTOR_ID,s=i.find(a=>a.id===o);i.forEach(({id:a,name:u,type:h,icon:d})=>{var b,I;s&&a===jt.CONNECTOR_RDNS_MAP[jt.COINBASE_CONNECTOR_ID]||jt.AUTH_CONNECTOR_ID===a||n.push({id:a,explorerId:Ra.ConnectorExplorerIds[a],imageUrl:((I=(b=this.options)==null?void 0:b.connectorImages)==null?void 0:I[a])??d,name:Ra.ConnectorNamesMap[a]??u,imageId:Ra.ConnectorImageIds[a],type:Ra.ConnectorTypesMap[h]??"EXTERNAL",info:{rdns:a}})}),this.setConnectors(n),this.syncAuthConnector(i)}async syncAuthConnector(e){const t=e.find(({id:i})=>i===jt.AUTH_CONNECTOR_ID);if(t){const i=await t.getProvider();this.addConnector({id:jt.AUTH_CONNECTOR_ID,type:"AUTH",name:"Auth",provider:i,email:t.email,socials:t.socials,showWallets:(t==null?void 0:t.showWallets)===void 0?!0:t.showWallets})}}async initAuthConnectorListeners(e){const t=e.find(({id:i})=>i===jt.AUTH_CONNECTOR_ID);t&&(await this.listenAuthConnector(t),await this.listenModal(t))}async listenAuthConnector(e){if(typeof window<"u"&&e){super.setLoading(!0);const t=await e.getProvider(),i=t.getLoginEmailUsed();super.setLoading(i),i&&this.setIsConnected(!1),t.onRpcRequest(n=>{if(Pi.checkIfRequestExists(n)){if(!Pi.checkIfRequestIsAllowed(n))if(super.isOpen()){if(super.isTransactionStackEmpty())return;super.isTransactionShouldReplaceView()?super.replace("ApproveTransaction"):super.redirect("ApproveTransaction")}else super.open({view:"ApproveTransaction"})}else{super.open();const o=Pi.getRequestMethod(n);console.error(Qi.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:o}),setTimeout(()=>{this.showErrorMessage(Qi.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),t.rejectRpcRequest()}}),t.onRpcResponse(n=>{switch(Pi.getResponseType(n)){case Ne.RPC_RESPONSE_TYPE_ERROR:{super.isOpen()&&(super.isTransactionStackEmpty()?super.close():super.popTransactionStack(!0));break}case Ne.RPC_RESPONSE_TYPE_TX:{super.isTransactionStackEmpty()?super.close():super.popTransactionStack();break}}}),t.onNotConnected(()=>{this.getIsConnectedState()||(this.setIsConnected(!1),super.setLoading(!1))}),t.onIsConnected(n=>{this.setIsConnected(!0),this.setSmartAccountDeployed(!!n.smartAccountDeployed),this.setPreferredAccountType(n.preferredAccountType),super.setLoading(!1)}),t.onGetSmartAccountEnabledNetworks(n=>{this.setSmartAccountEnabledNetworks(n)}),t.onSetPreferredAccount(({address:n,type:o})=>{var a;if(!n)return;const s=ss.caipNetworkIdToNumber((a=this.getCaipNetwork())==null?void 0:a.id);this.syncAccount({address:n,chainId:s,isConnected:!0,connector:e}).then(()=>this.setPreferredAccountType(o))})}}async listenModal(e){const t=await e.getProvider();this.subscribeState(i=>{i.open||t.rejectRpcRequest()})}}rb.type="coinbaseWallet";function rb(r){let t,i,n,o,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:rb.type,async connect({chainId:u}={}){try{const h=await this.getProvider(),d=(await h.request({method:"eth_requestAccounts"})).map(v=>Zn(v));n||(n=this.onAccountsChanged.bind(this),h.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),h.on("chainChanged",o)),s||(s=this.onDisconnect.bind(this),h.on("disconnect",s));let p=await this.getChainId();if(u&&p!==u){const v=await this.switchChain({chainId:u}).catch(b=>{if(b.code===cn.code)throw b;return{id:p}});p=(v==null?void 0:v.id)??p}return{accounts:d,chainId:p}}catch(h){throw/(user closed modal|accounts received is empty|user denied account)/i.test(h.message)?new cn(h):h}},async disconnect(){const u=await this.getProvider();n&&(u.removeListener("accountsChanged",n),n=void 0),o&&(u.removeListener("chainChanged",o),o=void 0),s&&(u.removeListener("disconnect",s),s=void 0),u.disconnect(),u.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(h=>Zn(h))},async getChainId(){const h=await(await this.getProvider()).request({method:"eth_chainId"});return Number(h)},async getProvider(){var u;if(!i){const{default:h}=await Bo(()=>import("./index.CADO_LNH.js").then(L=>L.i),[],import.meta.url);let d;typeof h!="function"&&typeof h.default=="function"?d=h.default:d=h,t=new d({reloadOnDisconnect:!1,...r});const p=(u=t.walletExtension)==null?void 0:u.getChainId(),v=a.chains.find(L=>r.chainId?L.id===r.chainId:L.id===p)||a.chains[0],b=r.chainId||(v==null?void 0:v.id),I=r.jsonRpcUrl||(v==null?void 0:v.rpcUrls.default.http[0]);i=t.makeWeb3Provider(I,b)}return i},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:h}){var v,b,I,L;const d=a.chains.find($=>$.id===h);if(!d)throw new zl(new yh);const p=await this.getProvider();try{return await p.request({method:"wallet_switchEthereumChain",params:[{chainId:$a(d.id)}]}),d}catch($){if($.code===4902)try{let K;u!=null&&u.blockExplorerUrls?K=u.blockExplorerUrls:K=(v=d.blockExplorers)!=null&&v.default.url?[(b=d.blockExplorers)==null?void 0:b.default.url]:[];let P;(I=u==null?void 0:u.rpcUrls)!=null&&I.length?P=u.rpcUrls:P=[((L=d.rpcUrls.default)==null?void 0:L.http[0])??""];const q={blockExplorerUrls:K,chainId:$a(h),chainName:(u==null?void 0:u.chainName)??d.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:(u==null?void 0:u.nativeCurrency)??d.nativeCurrency,rpcUrls:P};return await p.request({method:"wallet_addEthereumChain",params:[q]}),d}catch(K){throw new cn(K)}throw new zl($)}},onAccountsChanged(u){u.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:u.map(h=>Zn(h))})},onChainChanged(u){const h=Number(u);a.emitter.emit("change",{chainId:h})},async onDisconnect(u){a.emitter.emit("disconnect");const h=await this.getProvider();n&&(h.removeListener("accountsChanged",n),n=void 0),o&&(h.removeListener("chainChanged",o),o=void 0),s&&(h.removeListener("disconnect",s),s=void 0)}})}ib.type="walletConnect";function ib(r){const e=r.isNewChainsStale??!0;let t,i;const n="eip155";let o,s,a,u,h,d;return p=>({id:"walletConnect",name:"WalletConnect",type:ib.type,async setup(){const v=await this.getProvider().catch(()=>null);v&&(a||(a=this.onConnect.bind(this),v.on("connect",a)),h||(h=this.onSessionDelete.bind(this),v.on("session_delete",h)))},async connect({chainId:v,...b}={}){var I,L;try{const $=await this.getProvider();if(!$)throw new bc;u||(u=this.onDisplayUri,$.on("display_uri",u));let K=v;if(!K){const U=await((I=p.storage)==null?void 0:I.getItem("state"))??{};p.chains.some(_=>_.id===U.chainId)?K=U.chainId:K=(L=p.chains[0])==null?void 0:L.id}if(!K)throw new Error("No chains found on connector.");const P=await this.isChainsStale();if($.session&&P&&await $.disconnect(),!$.session||P){const U=p.chains.filter(F=>F.id!==K).map(F=>F.id);await $.connect({optionalChains:[K,...U],..."pairingTopic"in b?{pairingTopic:b.pairingTopic}:{}}),this.setRequestedChainsIds(p.chains.map(F=>F.id))}const q=(await $.enable()).map(U=>Zn(U)),D=await this.getChainId();return u&&($.removeListener("display_uri",u),u=void 0),a&&($.removeListener("connect",a),a=void 0),o||(o=this.onAccountsChanged.bind(this),$.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),$.on("chainChanged",s)),d||(d=this.onDisconnect.bind(this),$.on("disconnect",d)),h||(h=this.onSessionDelete.bind(this),$.on("session_delete",h)),{accounts:q,chainId:D}}catch($){throw/(user rejected|connection request reset)/i.test($==null?void 0:$.message)?new cn($):$}},async disconnect(){const v=await this.getProvider();try{await(v==null?void 0:v.disconnect())}catch(b){if(!/No matching key/i.test(b.message))throw b}finally{s&&(v==null||v.removeListener("chainChanged",s),s=void 0),d&&(v==null||v.removeListener("disconnect",d),d=void 0),a||(a=this.onConnect.bind(this),v==null||v.on("connect",a)),o&&(v==null||v.removeListener("accountsChanged",o),o=void 0),h&&(v==null||v.removeListener("session_delete",h),h=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(b=>Zn(b))},async getProvider({chainId:v}={}){var I;async function b(){const L=p.chains.map(K=>K.id);if(!L.length)return;const{EthereumProvider:$}=await Bo(()=>Promise.resolve().then(()=>Hq),void 0,import.meta.url);return await $.init({...r,disableProviderPing:!0,optionalChains:L,projectId:r.projectId,rpcMap:Object.fromEntries(p.chains.map(K=>[K.id,K.rpcUrls.default.http[0]])),showQrModal:r.showQrModal??!0})}return t||(i||(i=b()),t=await i,t==null||t.events.setMaxListeners(1/0)),v&&await((I=this.switchChain)==null?void 0:I.call(this,{chainId:v})),t},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[v,b]=await Promise.all([this.getAccounts(),this.getProvider()]);return v.length?await this.isChainsStale()&&b.session?(await b.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:v,chainId:b}){var $,K,P;const I=await this.getProvider();if(!I)throw new bc;const L=p.chains.find(q=>q.id===b);if(!L)throw new zl(new yh);try{await Promise.all([new Promise(D=>{const U=({chainId:F})=>{F===b&&(p.emitter.off("change",U),D())};p.emitter.on("change",U)}),I.request({method:"wallet_switchEthereumChain",params:[{chainId:$a(b)}]})]);const q=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...q,b]),L}catch(q){const D=q;if(/(user rejected)/i.test(D.message))throw new cn(D);try{let U;v!=null&&v.blockExplorerUrls?U=v.blockExplorerUrls:U=($=L.blockExplorers)!=null&&$.default.url?[(K=L.blockExplorers)==null?void 0:K.default.url]:[];let F;(P=v==null?void 0:v.rpcUrls)!=null&&P.length?F=v.rpcUrls:F=[...L.rpcUrls.default.http];const _={blockExplorerUrls:U,chainId:$a(b),chainName:(v==null?void 0:v.chainName)??L.name,iconUrls:v==null?void 0:v.iconUrls,nativeCurrency:(v==null?void 0:v.nativeCurrency)??L.nativeCurrency,rpcUrls:F};await I.request({method:"wallet_addEthereumChain",params:[_]});const x=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...x,b]),L}catch(U){throw new cn(U)}}},onAccountsChanged(v){v.length===0?this.onDisconnect():p.emitter.emit("change",{accounts:v.map(b=>Zn(b))})},onChainChanged(v){const b=Number(v);p.emitter.emit("change",{chainId:b})},async onConnect(v){const b=Number(v.chainId),I=await this.getAccounts();p.emitter.emit("connect",{accounts:I,chainId:b})},async onDisconnect(v){this.setRequestedChainsIds([]),p.emitter.emit("disconnect");const b=await this.getProvider();o&&(b.removeListener("accountsChanged",o),o=void 0),s&&(b.removeListener("chainChanged",s),s=void 0),d&&(b.removeListener("disconnect",d),d=void 0),h&&(b.removeListener("session_delete",h),h=void 0),a||(a=this.onConnect.bind(this),b.on("connect",a))},onDisplayUri(v){p.emitter.emit("message",{type:"display_uri",data:v})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var b,I,L;return t?((L=(I=(b=t.session)==null?void 0:b.namespaces[n])==null?void 0:I.chains)==null?void 0:L.map($=>parseInt($.split(":")[1]||"")))??[]:[]},async getRequestedChainsIds(){var v;return await((v=p.storage)==null?void 0:v.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!e)return!1;const v=p.chains.map(L=>L.id),b=this.getNamespaceChainsIds();if(b.length&&!b.some(L=>v.includes(L)))return!1;const I=await this.getRequestedChainsIds();return!v.every(L=>I.includes(L))},async setRequestedChainsIds(v){var b;await((b=p.storage)==null?void 0:b.setItem(this.requestedChainsStorageKey,v))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}function bie(r){return e=>({id:jt.AUTH_CONNECTOR_ID,name:"Web3Modal Auth",type:"w3mAuth",socials:r.socials,email:r.email,showWallets:r.showWallets,async connect(t={}){const i=await this.getProvider(),{address:n,chainId:o}=await i.connect({chainId:t.chainId});return await i.getSmartAccountEnabledNetworks(),{accounts:[n],account:n,chainId:o,chain:{id:o,unsuported:!1}}},async disconnect(){await(await this.getProvider()).disconnect()},async getAccounts(){const t=await this.getProvider(),{address:i}=await t.connect();return e.emitter.emit("change",{accounts:[i]}),[i]},async getProvider(){return this.provider||(this.provider=new Pee(r.options.projectId)),Promise.resolve(this.provider)},async getChainId(){const t=await this.getProvider(),{chainId:i}=await t.getChainId();return i},async isAuthorized(){const t=await this.getProvider(),{isConnected:i}=await t.isConnected();return i},async switchChain({chainId:t}){try{const i=e.chains.find(o=>o.id===t);if(!i)throw new zl(new Error("chain not found on connector."));return await(await this.getProvider()).switchNetwork(t),e.emitter.emit("change",{chainId:Number(t)}),i}catch(i){throw i instanceof Error?new zl(i):i}},onAccountsChanged(t){t.length===0?this.onDisconnect():e.emitter.emit("change",{accounts:t.map(Zn)})},onChainChanged(t){const i=Number(t);e.emitter.emit("change",{chainId:i})},async onConnect(t){const i=Number(t.chainId),n=await this.getAccounts();e.emitter.emit("connect",{accounts:n,chainId:i})},async onDisconnect(t){await(await this.getProvider()).disconnect()}})}function _ie({projectId:r,chains:e,metadata:t,enableCoinbase:i,enableEmail:n,enableInjected:o,auth:s={showWallets:!0},enableWalletConnect:a,enableEIP6963:u,...h}){const d=[],p=e.map(b=>[b.id,Mre({chainId:b.id,projectId:r})]),v=Object.fromEntries(p);return a!==!1&&d.push(ib({projectId:r,metadata:t,showQrModal:!1})),o!==!1&&d.push(im({shimDisconnect:!0})),i!==!1&&d.push(rb({version:"4",appName:(t==null?void 0:t.name)??"Unknown",appLogoUrl:(t==null?void 0:t.icons[0])??"Unknown",preference:h.coinbasePreference||"all"})),(n||s!=null&&s.socials)&&d.push(bie({chains:[...e],options:{projectId:r},socials:s==null?void 0:s.socials,email:n,showWallets:s.showWallets})),vV({chains:e,multiInjectedProviderDiscovery:u!==!1,transports:v,...h,connectors:d})}function xie(r){return new yie({...r,_sdkVersion:`html-wagmi-${jt.VERSION}`})}const Aie=r=>({}),V_=r=>({connectWallet:r[1],disconnectWallet:r[2]});function Eie(r){let e,t;const i=r[6].default,n=X_(i,r,r[5],V_);return{c(){e=Sr("div"),n&&n.c()},l(o){e=Ir(o,"DIV",{});var s=vi(e);n&&n.l(s),s.forEach(tr)},m(o,s){yi(o,e,s),n&&n.m(e,null),t=!0},p(o,[s]){n&&n.p&&(!t||s&32)&&ex(n,i,o,o[5],t?rx(i,o[5],s,Aie):tx(o[5]),V_)},i(o){t||(Da(n,o),t=!0)},o(o){Na(n,o),t=!1},d(o){o&&tr(e),n&&n.d(o)}}}function Cie(r,e,t){let i,n;Qd(r,XO,I=>t(8,n=I));let{$$slots:o={},$$scope:s}=e;const a={300:HO,324:qO,11155111:VO,31337:KO},u={name:"Nottingham",description:"",url:n.url.origin,icons:[]},h=hO();let d=_ie({chains:[a[JO]],projectId:n4,metadata:u});Qd(r,d,I=>t(4,i=I));let p;ix(async()=>{["connected","reconnecting"].includes(i==null?void 0:i.status)||RE(d),p=xie({wagmiConfig:d,projectId:n4})}),nx(async()=>{p&&(p.close(),p=void 0)});function v(){p&&p.open()}function b(){IE(d)}return r.$$set=I=>{"$$scope"in I&&t(5,s=I.$$scope)},r.$$.update=()=>{if(r.$$.dirty&16){const I=i==null?void 0:i.status;if(I==="connected"){const{connector:L,accounts:$}=i.connections.get(i.current);(async()=>{const[K,P]=await Promise.all([L.getProvider(),L.getChainId()]),q=fx(K),D=a[P]??h1;h("connected",{address:$[0],client:dP({transport:q,account:$[0],chain:D}),chain:D})})()}else I==="disconnected"?h("disconnected",{}):I==="connecting"&&h("connecting")}},[d,v,b,a,i,s,o]}class Sie extends T3{constructor(e){super(),R3(this,e,Cie,Eie,S3,{CHAIN_BY_ID:3})}get CHAIN_BY_ID(){return this.$$.ctx[3]}}function Iie(r){let e,t,i,n;return{c(){e=Sr("button"),this.h()},l(o){e=Ir(o,"BUTTON",{style:!0,title:!0,class:!0}),vi(e).forEach(tr),this.h()},h(){ar(e,"style",t=K_(r[1])),ar(e,"title",r[0]),ar(e,"class","custom icon svelte-oeolkk")},m(o,s){yi(o,e,s),i||(n=I3(e,"click",r[4]),i=!0)},p(o,[s]){s&2&&t!==(t=K_(o[1]))&&ar(e,"style",t),s&1&&ar(e,"title",o[0])},i:kc,o:kc,d(o){o&&tr(e),i=!1,n()}}}function K_(r){return Object.entries(r).filter(([e,t])=>t!==null).map(([e,t])=>`${e}: ${t};`).join(" ")}function Tie(r,e,t){let{icon:i}=e,{hoverIcon:n=null}=e,{title:o=null}=e;const s={"purse-closed":{sheet:`${Uo}/sprites.png`,row:0,col:1,rows:1,cols:4},"purse-open":{sheet:`${Uo}/sprites.png`,row:0,col:0,rows:1,cols:4}};let a={};function u(d,p){if(t(1,a={}),d)if(d in s){const{sheet:v,row:b,col:I,rows:L,cols:$}=s[d];Object.assign(a,{"--sheet-url":`url('${v}')`,"--row":b,"--col":I,"--rows":L,"--cols":$})}else Object.assign(a,{"--sheet-url":`url(${d})`});if(p)if(p in s){const{sheet:v,row:b,col:I,rows:L,cols:$}=s[p];Object.assign(a,{"--sheet-url-hover":`url('${v}')`,"--row-hover":b,"--col-hover":I,"--rows-hover":L,"--cols-hover":$})}else Object.assign(a,{"--sheet-url-hover":`url(${p})`})}function h(d){dO.call(this,r,d)}return r.$$set=d=>{"icon"in d&&t(2,i=d.icon),"hoverIcon"in d&&t(3,n=d.hoverIcon),"title"in d&&t(0,o=d.title)},r.$$.update=()=>{r.$$.dirty&12&&u(i,n)},[o,a,i,n,h]}class D9 extends T3{constructor(e){super(),R3(this,e,Tie,Iie,S3,{icon:2,hoverIcon:3,title:0})}}function Rie(r){let e,t,i,n,o,s=Oie(),a=i2&&Pie(r);const u=r[11].default,h=X_(u,r,r[17],null);return{c(){e=Sr("div"),s&&s.c(),t=On(),a&&a.c(),i=On(),n=Sr("main"),h&&h.c(),this.h()},l(d){e=Ir(d,"DIV",{class:!0});var p=vi(e);s&&s.l(p),t=Pn(p),a&&a.l(p),i=Pn(p),n=Ir(p,"MAIN",{});var v=vi(n);h&&h.l(v),v.forEach(tr),p.forEach(tr),this.h()},h(){ar(e,"class","content svelte-ui5oza")},m(d,p){yi(d,e,p),s&&s.m(e,null),mr(e,t),a&&a.m(e,null),mr(e,i),mr(e,n),h&&h.m(n,null),o=!0},p(d,p){i2&&a.p(d,p),h&&h.p&&(!o||p&131072)&&ex(h,u,d,d[17],o?rx(u,d[17],p,null):tx(d[17]),null)},i(d){o||(Da(a),Da(h,d),o=!0)},o(d){Na(a),Na(h,d),o=!1},d(d){d&&tr(e),s&&s.d(),a&&a.d(),h&&h.d(d)}}}function kie(r){let e,t='
Woe is us! We are beset by fleas!
';return{c(){e=Sr("div"),e.innerHTML=t,this.h()},l(i){e=Ir(i,"DIV",{class:!0,"data-svelte-h":!0}),Bs(e)!=="svelte-1210s9v"&&(e.innerHTML=t),this.h()},h(){ar(e,"class","content svelte-ui5oza")},m(i,n){yi(i,e,n)},p:kc,i:kc,o:kc,d(i){i&&tr(e)}}}function Oie(r){let e,t;return{c(){e=Sr("div"),t=jl(o4),this.h()},l(i){e=Ir(i,"DIV",{class:!0});var n=vi(e);t=Fl(n,o4),n.forEach(tr),this.h()},h(){ar(e,"class","announcement svelte-ui5oza")},m(i,n){yi(i,e,n),mr(e,t)},d(i){i&&tr(e)}}}function Pie(r){let e,t,i,n=`Home`,o,s,a=`Progress`,u,h,d,p,v=`Merchants`,b,I,L='Chat',$,K,P='Jobs (>|<)',q,D,U,F,_,x=!r[3]&&G_(),M=r[3]&&Z_(r);return F=new Sie({props:{$$slots:{default:[Uie,({disconnectWallet:j,connectWallet:V})=>({25:j,26:V}),({disconnectWallet:j,connectWallet:V})=>(j?33554432:0)|(V?67108864:0)]},$$scope:{ctx:r}}}),F.$on("connected",r[7]),F.$on("disconnected",r[8]),F.$on("connecting",r[9]),{c(){e=Sr("header"),t=Sr("div"),i=Sr("div"),i.innerHTML=n,o=On(),s=Sr("div"),s.innerHTML=a,u=On(),x&&x.c(),h=On(),M&&M.c(),d=On(),p=Sr("div"),p.innerHTML=v,b=On(),I=Sr("div"),I.innerHTML=L,$=On(),K=Sr("div"),K.innerHTML=P,q=On(),D=Sr("div"),U=Sr("div"),k3(F.$$.fragment),this.h()},l(j){e=Ir(j,"HEADER",{class:!0});var V=vi(e);t=Ir(V,"DIV",{class:!0});var Z=vi(t);i=Ir(Z,"DIV",{class:!0,"data-svelte-h":!0}),Bs(i)!=="svelte-oyc8sw"&&(i.innerHTML=n),o=Pn(Z),s=Ir(Z,"DIV",{class:!0,"data-svelte-h":!0}),Bs(s)!=="svelte-1j3m74o"&&(s.innerHTML=a),u=Pn(Z),x&&x.l(Z),h=Pn(Z),M&&M.l(Z),d=Pn(Z),p=Ir(Z,"DIV",{class:!0,"data-svelte-h":!0}),Bs(p)!=="svelte-1kdca1y"&&(p.innerHTML=v),b=Pn(Z),I=Ir(Z,"DIV",{class:!0,"data-svelte-h":!0}),Bs(I)!=="svelte-1jrqlug"&&(I.innerHTML=L),$=Pn(Z),K=Ir(Z,"DIV",{class:!0,"data-svelte-h":!0}),Bs(K)!=="svelte-1xzeef"&&(K.innerHTML=P),Z.forEach(tr),q=Pn(V),D=Ir(V,"DIV",{class:!0});var m=vi(D);U=Ir(m,"DIV",{class:!0});var g=vi(U);O3(F.$$.fragment,g),g.forEach(tr),m.forEach(tr),V.forEach(tr),this.h()},h(){ar(i,"class","svelte-ui5oza"),ar(s,"class","svelte-ui5oza"),ar(p,"class","svelte-ui5oza"),ar(I,"class","svelte-ui5oza"),ar(K,"class","svelte-ui5oza"),ar(t,"class","left svelte-ui5oza"),ar(U,"class","svelte-ui5oza"),ar(D,"class","right svelte-ui5oza"),ar(e,"class","svelte-ui5oza")},m(j,V){yi(j,e,V),mr(e,t),mr(t,i),mr(t,o),mr(t,s),mr(t,u),x&&x.m(t,null),mr(t,h),M&&M.m(t,null),mr(t,d),mr(t,p),mr(t,b),mr(t,I),mr(t,$),mr(t,K),mr(e,q),mr(e,D),mr(D,U),P3(F,U,null),_=!0},p(j,V){j[3]?x&&(x.d(1),x=null):x||(x=G_(),x.c(),x.m(t,h)),j[3]?M?M.p(j,V):(M=Z_(j),M.c(),M.m(t,d)):M&&(M.d(1),M=null);const Z={};V&100794379&&(Z.$$scope={dirty:V,ctx:j}),F.$set(Z)},i(j){_||(Da(F.$$.fragment,j),_=!0)},o(j){Na(F.$$.fragment,j),_=!1},d(j){j&&tr(e),x&&x.d(),M&&M.d(),D3(F)}}}function G_(r){let e,t=`Register`;return{c(){e=Sr("div"),e.innerHTML=t,this.h()},l(i){e=Ir(i,"DIV",{class:!0,"data-svelte-h":!0}),Bs(e)!=="svelte-oc795z"&&(e.innerHTML=t),this.h()},h(){ar(e,"class","svelte-ui5oza")},m(i,n){yi(i,e,n)},d(i){i&&tr(e)}}}function Z_(r){let e,t,i,n;return{c(){e=Sr("div"),t=Sr("a"),i=jl("Dashboard"),this.h()},l(o){e=Ir(o,"DIV",{class:!0});var s=vi(e);t=Ir(s,"A",{href:!0,class:!0});var a=vi(t);i=Fl(a,"Dashboard"),a.forEach(tr),s.forEach(tr),this.h()},h(){ar(t,"href",n=`${Uo}/player?name=${r[3]}`),ar(t,"class","svelte-ui5oza"),ar(e,"class","svelte-ui5oza")},m(o,s){yi(o,e,s),mr(e,t),mr(t,i)},p(o,s){s&8&&n!==(n=`${Uo}/player?name=${o[3]}`)&&ar(t,"href",n)},d(o){o&&tr(e)}}}function Die(r){let e,t,i,n,o;function s(d,p){return d[3]?Bie:Mie}let a=s(r),u=a(r);function h(){return r[16](r[25])}return n=new D9({props:{icon:"purse-open",hoverIcon:"purse-closed",title:"Disconnect wallet"}}),n.$on("click",h),{c(){e=Sr("span"),t=jl(`Hail, + `),u.c(),i=On(),k3(n.$$.fragment)},l(d){e=Ir(d,"SPAN",{});var p=vi(e);t=Fl(p,`Hail, + `),u.l(p),p.forEach(tr),i=Pn(d),O3(n.$$.fragment,d)},m(d,p){yi(d,e,p),mr(e,t),u.m(e,null),yi(d,i,p),P3(n,d,p),o=!0},p(d,p){r=d,a===(a=s(r))&&u?u.p(r,p):(u.d(1),u=a(r),u&&(u.c(),u.m(e,null)))},i(d){o||(Da(n.$$.fragment,d),o=!0)},o(d){Na(n.$$.fragment,d),o=!1},d(d){d&&(tr(e),tr(i)),u.d(),D3(n,d)}}}function Nie(r){let e,t="Unlace thy purse",i,n,o,s,a;function u(){return r[14](r[26])}function h(){return r[15](r[26])}return n=new D9({props:{icon:"purse-closed",hoverIcon:"purse-open",title:"Connect wallet"}}),n.$on("click",h),{c(){e=Sr("a"),e.textContent=t,i=On(),k3(n.$$.fragment),this.h()},l(d){e=Ir(d,"A",{href:!0,class:!0,"data-svelte-h":!0}),Bs(e)!=="svelte-mhrk26"&&(e.textContent=t),i=Pn(d),O3(n.$$.fragment,d),this.h()},h(){ar(e,"href","#"),ar(e,"class","svelte-ui5oza")},m(d,p){yi(d,e,p),yi(d,i,p),P3(n,d,p),o=!0,s||(a=I3(e,"click",ox(u)),s=!0)},p(d,p){r=d},i(d){o||(Da(n.$$.fragment,d),o=!0)},o(d){Na(n.$$.fragment,d),o=!1},d(d){d&&(tr(e),tr(i)),D3(n,d),s=!1,a()}}}function $ie(r){let e,t="Unlacing...";return{c(){e=Sr("span"),e.textContent=t},l(i){e=Ir(i,"SPAN",{"data-svelte-h":!0}),Bs(e)!=="svelte-fdx1qb"&&(e.textContent=t)},m(i,n){yi(i,e,n)},p:kc,i:kc,o:kc,d(i){i&&tr(e)}}}function Mie(r){let e,t=r[0].address+"",i,n;return{c(){e=Sr("span"),i=jl(t),n=jl("!"),this.h()},l(o){e=Ir(o,"SPAN",{class:!0});var s=vi(e);i=Fl(s,t),s.forEach(tr),n=Fl(o,"!"),this.h()},h(){ar(e,"class","wallet-address svelte-ui5oza")},m(o,s){yi(o,e,s),mr(e,i),yi(o,n,s)},p(o,s){s&1&&t!==(t=o[0].address+"")&&sx(i,t)},d(o){o&&(tr(e),tr(n))}}}function Bie(r){let e,t,i,n;return{c(){e=Sr("a"),t=jl(r[3]),n=jl("!"),this.h()},l(o){e=Ir(o,"A",{href:!0,class:!0});var s=vi(e);t=Fl(s,r[3]),s.forEach(tr),n=Fl(o,"!"),this.h()},h(){ar(e,"href",i=`${Uo}/player?name=${r[3]}`),ar(e,"class","player-name svelte-ui5oza")},m(o,s){yi(o,e,s),mr(e,t),yi(o,n,s)},p(o,s){s&8&&sx(t,o[3]),s&8&&i!==(i=`${Uo}/player?name=${o[3]}`)&&ar(e,"href",i)},d(o){o&&(tr(e),tr(n))}}}function Uie(r){let e,t,i,n,o;const s=[$ie,Nie,Die],a=[];function u(h,d){return h[1]?0:h[0]?2:1}return i=u(r),n=a[i]=s[i](r),{c(){e=Sr("div"),t=Sr("div"),n.c(),this.h()},l(h){e=Ir(h,"DIV",{slot:!0});var d=vi(e);t=Ir(d,"DIV",{class:!0});var p=vi(t);n.l(p),p.forEach(tr),d.forEach(tr),this.h()},h(){ar(t,"class","wallet-status svelte-ui5oza"),ar(e,"slot","default")},m(h,d){yi(h,e,d),mr(e,t),a[i].m(t,null),o=!0},p(h,d){let p=i;i=u(h),i===p?a[i].p(h,d):(mO(),Na(a[p],1,1,()=>{a[p]=null}),wO(),n=a[i],n?n.p(h,d):(n=a[i]=s[i](h),n.c()),Da(n,1),n.m(t,null))},i(h){o||(Da(n),o=!0)},o(h){Na(n),o=!1},d(h){h&&tr(e),a[i].d()}}}function Lie(r){let e,t,i,n,o,s,a=``,u,h,d,p,v,b,I,L;const $=[kie,Rie],K=[];function P(q,D){return 1}return p=P(),v=K[p]=$[p](r),{c(){e=Sr("div"),t=Sr("img"),n=On(),o=Sr("div"),s=Sr("audio"),s.innerHTML=a,u=On(),h=Sr("a"),d=On(),v.c(),this.h()},l(q){e=Ir(q,"DIV",{class:!0});var D=vi(e);t=Ir(D,"IMG",{class:!0,src:!0,alt:!0}),n=Pn(D),o=Ir(D,"DIV",{class:!0});var U=vi(o);s=Ir(U,"AUDIO",{"data-svelte-h":!0}),Bs(s)!=="svelte-14wm9iw"&&(s.innerHTML=a),U.forEach(tr),u=Pn(D),h=Ir(D,"A",{class:!0}),vi(h).forEach(tr),d=Pn(D),v.l(D),D.forEach(tr),this.h()},h(){ar(t,"class","ghost svelte-ui5oza"),fO(t.src,i=`${Uo}/fair.png`)||ar(t,"src",i),ar(t,"alt",""),ar(o,"class","bg svelte-ui5oza"),ar(h,"class","music-toggle svelte-ui5oza"),ar(e,"class","tome svelte-ui5oza")},m(q,D){yi(q,e,D),mr(e,t),mr(e,n),mr(e,o),mr(o,s),r[12](s),mr(e,u),mr(e,h),mr(e,d),K[p].m(e,null),b=!0,I||(L=I3(h,"click",ox(r[13])),I=!0)},p(q,[D]){v.p(q,D)},i(q){b||(Da(v),b=!0)},o(q){Na(v),b=!1},d(q){q&&tr(e),r[12](null),K[p].d(),I=!1,L()}}}function jie(r,e,t){let i,n,o,{$$slots:s={},$$scope:a}=e;const u=GO(),[h,d]=qw(null);Qd(r,h,Z=>t(0,n=Z));const[p,v]=qw(null);Qd(r,p,Z=>t(3,o=Z));const[b,I]=qw([]);Qd(r,b,Z=>t(19,i=Z));let L=!1,$,K=null;pO(ZO,{wallet:h,playerName:p,publicClient:u,seasons:b}),ix(()=>{i2&&(U(),K=setInterval(U,6e4))}),nx(()=>{K&&(clearInterval(K),K=null)});function P(Z){console.debug("wallet connected"),t(1,L=!1),d({address:Z.detail.address,client:Z.detail.client,chain:Z.detail.chain})}function q(){console.debug("wallet disconnected"),t(1,L=!1),d(null),v(null)}function D(){console.debug("wallet connecting"),t(1,L=!0)}async function U(){const Z=await s4(u);let m=!1;if(i.length===Z.length)e:for(let g=0;g{$=Z,t(2,$)})}const x=()=>F(),M=Z=>Z(),j=Z=>Z(),V=Z=>Z();return r.$$set=Z=>{"$$scope"in Z&&t(17,a=Z.$$scope)},r.$$.update=()=>{r.$$.dirty&1&&n&&(async()=>{v(null);const Z=await fetch(`${QO}/whois?${new URLSearchParams({address:n.address})}`);if(!Z.ok){if(Z.status!==404){const{error:m}=await Z.json();throw new Error(`Failed to fetch players: ${m}`)}return}v((await Z.json()).name)})()},[n,L,$,o,h,p,b,P,q,D,F,s,_,x,M,j,V,a]}class Wae extends T3{constructor(e){super(),R3(this,e,jie,Lie,S3,{})}}export{Tf as $,J1 as A,Sh as B,Zl as C,ps as D,Ql as E,eg as F,Sf as G,gs as H,If as I,zo as J,Xn as K,W2 as L,a1 as M,eo as N,Rf as O,tg as P,Ih as Q,Gl as R,Th as S,Nl as T,gt as U,za as V,L2 as W,G2 as X,Yl as Y,qs as Z,Of as _,hy as a,Dh as a0,Uc as a1,Fa as a2,Nh as a3,Ua as a4,$h as a5,Pf as a6,Mh as a7,Jl as a8,Lc as a9,Hl as aA,nt as aB,yt as aC,bt as aD,Qi as aE,$t as aF,I0 as aG,iV as aH,cN as aI,ln as aJ,jg as aK,RC as aL,no as aM,ea as aN,Wae as aO,mn as aa,Vs as ab,ng as ac,Df as ad,jc as ae,Wa as af,Nf as ag,$f as ah,Ha as ai,Ks as aj,Bh as ak,Xl as al,Mf as am,Bf as an,eu as ao,gn as ap,Bn as aq,og as ar,Pe as as,ss as at,Xe as au,Fr as av,_e as aw,vt as ax,nm as ay,yn as az,De as b,qE as c,SK as d,me as e,_h as f,xh as g,j2 as h,CK as i,Af as j,Z1 as k,Kl as l,Ah as m,Ef as n,jo as o,xi as p,Q1 as q,Eh as r,pn as s,Fo as t,Y1 as u,La as v,ja as w,Cf as x,Ch as y,F2 as z}; diff --git a/_app/immutable/chunks/bytes.BO06K83n.js b/_app/immutable/chunks/bytes.BO06K83n.js new file mode 100644 index 0000000..0bb6edd --- /dev/null +++ b/_app/immutable/chunks/bytes.BO06K83n.js @@ -0,0 +1 @@ +const o="0x0000000000000000000000000000000000000000000000000000000000000000";export{o as z}; diff --git a/_app/immutable/chunks/ccip.B3nTU6BT.js b/_app/immutable/chunks/ccip.B3nTU6BT.js new file mode 100644 index 0000000..de1cd0c --- /dev/null +++ b/_app/immutable/chunks/ccip.B3nTU6BT.js @@ -0,0 +1 @@ +import{B as p,l as m,m as y,n as g,o as k,p as O,q as E,t as L,H as h,u as x}from"./kit.CACir_b1.js";class M extends p{constructor({callbackSelector:s,cause:e,data:n,extraData:c,sender:u,urls:t}){var i;super(e.shortMessage||"An error occurred while fetching for an offchain result.",{cause:e,metaMessages:[...e.metaMessages||[],(i=e.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(f=>` ${m(f)}`)],` Sender: ${u}`,` Data: ${n}`,` Callback selector: ${s}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class R extends p{constructor({result:s,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(e)}`,`Response: ${y(s)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class $ extends p{constructor({sender:s,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${s}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const j="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function v(o,{blockNumber:s,blockTag:e,data:n,to:c}){const{args:u}=g({data:n,abi:[S]}),[t,i,f,a,r]=u,{ccipRead:l}=o,b=l&&typeof(l==null?void 0:l.request)=="function"?l.request:q;try{if(!k(c,t))throw new $({sender:t,to:c});const d=await b({data:f,sender:t,urls:i}),{data:w}=await O(o,{blockNumber:s,blockTag:e,data:E([a,L([{type:"bytes"},{type:"bytes"}],[d,r])]),to:c});return w}catch(d){throw new M({callbackSelector:a,cause:d,data:n,extraData:r,sender:t,urls:i})}}async function q({data:o,sender:s,urls:e}){var c;let n=new Error("An unknown error occurred.");for(let u=0;u{const o=K(e,t);return o instanceof L?e:o})();return new O(s,{docsPath:a,...t})}async function ae(e,a){var g,h,E,N;const{account:t=e.account,chain:s=e.chain,accessList:o,blobs:n,data:r,gas:d,gasPrice:y,maxFeePerBlobGas:i,maxFeePerGas:p,maxPriorityFeePerGas:T,nonce:v,to:w,value:C,...x}=a;if(!t)throw new ee({docsPath:"/docs/actions/wallet/sendTransaction"});const l=G(t);try{H(a);let c;if(s!==null&&(c=await b(e,F,"getChainId")({}),te({currentChainId:c,chain:s})),l.type==="local"){const A=await b(e,q,"prepareTransactionRequest")({account:l,accessList:o,blobs:n,chain:s,chainId:c,data:r,gas:d,gasPrice:y,maxFeePerBlobGas:i,maxFeePerGas:p,maxPriorityFeePerGas:T,nonce:v,parameters:[...W,"sidecars"],to:w,value:C,...x}),R=(g=s==null?void 0:s.serializers)==null?void 0:g.transaction,_=await l.signTransaction(A,{serializer:R});return await b(e,U,"sendRawTransaction")({serializedTransaction:_})}const I=(N=(E=(h=e.chain)==null?void 0:h.formatters)==null?void 0:E.transactionRequest)==null?void 0:N.format,M=(I||j)({...$(x,{format:I}),accessList:o,blobs:n,data:r,from:l.address,gas:d,gasPrice:y,maxFeePerBlobGas:i,maxFeePerGas:p,maxPriorityFeePerGas:T,nonce:v,to:w,value:C});return await e.request({method:"eth_sendTransaction",params:[M]},{retryCount:0})}catch(c){throw ne(c,{...a,account:l,chain:a.chain||void 0})}}async function S(e,a){const{abi:t,address:s,args:o,dataSuffix:n,functionName:r,...d}=a,y=f({abi:t,args:o,functionName:r});return b(e,ae,"sendTransaction")({data:`${y}${n?n.replace("0x",""):""}`,to:s,...d})}const se=[{type:"constructor",inputs:[{name:"host_",type:"address",internalType:"address"},{name:"admin_",type:"address",internalType:"address"},{name:"registrar_",type:"address",internalType:"address"},{name:"recoveryAddress_",type:"address",internalType:"address payable"}],stateMutability:"nonpayable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"admin",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"allowClaim",inputs:[{name:"player",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"canPlayerClaim",inputs:[{name:"player",type:"address",internalType:"address"}],outputs:[{name:"canClaim",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"claim",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"recipient",type:"address",internalType:"address payable"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"closeSeason",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"confirmationConsumedBlock",inputs:[{name:"confirmationNonce",type:"uint256",internalType:"uint256"}],outputs:[{name:"block",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"currentSeasonIdx",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"currentSeasonPrize",inputs:[],outputs:[{name:"prize",type:"uint96",internalType:"uint96"}],stateMutability:"view"},{type:"function",name:"host",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"isValidPlayer",inputs:[{name:"player",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"multicall",inputs:[{name:"data",type:"bytes[]",internalType:"bytes[]"}],outputs:[{name:"results",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"nonpayable"},{type:"function",name:"operators",inputs:[{name:"player",type:"address",internalType:"address"},{name:"operator",type:"address",internalType:"address"}],outputs:[{name:"isPermitted",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"playerCodeCount",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[{name:"playerCount_",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"playerCodeHash",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"player",type:"address",internalType:"address"}],outputs:[{name:"codeHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"playerCount",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"playerRegisteredBlock",inputs:[{name:"player",type:"address",internalType:"address"}],outputs:[{name:"block",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"recoveryAddress",inputs:[],outputs:[{name:"",type:"address",internalType:"address payable"}],stateMutability:"view"},{type:"function",name:"refund",inputs:[{name:"amount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"register",inputs:[{name:"player",type:"address",internalType:"address"},{name:"confirmation",type:"tuple",internalType:"struct Confirmation",components:[{name:"expiry",type:"uint256",internalType:"uint256"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"metadata",type:"bytes",internalType:"bytes"},{name:"r",type:"bytes32",internalType:"bytes32"},{name:"s",type:"bytes32",internalType:"bytes32"},{name:"v",type:"uint8",internalType:"uint8"}]}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"registrar",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"replaceAdmin",inputs:[{name:"newAdmin",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"replaceHost",inputs:[{name:"newHost",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"replaceRegistrar",inputs:[{name:"newRegistrar",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"restore",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"retire",inputs:[{name:"player",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"revealSeasonKey",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"seasonPrivKey",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"seasonState",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[{name:"",type:"uint8",internalType:"enum SeasonState"}],stateMutability:"view"},{type:"function",name:"setOperator",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"permitted",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"startSeason",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"seasonPubKey",type:"bytes",internalType:"bytes"},{name:"prevWinner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"staticMulticall",inputs:[{name:"data",type:"bytes[]",internalType:"bytes[]"}],outputs:[{name:"results",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"view"},{type:"function",name:"submitCode",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"},{name:"player",type:"address",internalType:"address"},{name:"codeHash",type:"bytes32",internalType:"bytes32"},{name:"submission",type:"tuple",internalType:"struct EncryptedCodeSubmission",components:[{name:"encryptedAesKey",type:"bytes",internalType:"bytes"},{name:"encryptedCode",type:"bytes",internalType:"bytes"},{name:"iv",type:"bytes12",internalType:"bytes12"}]}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"totalUnclaimedPrize",inputs:[],outputs:[{name:"",type:"uint96",internalType:"uint96"}],stateMutability:"view"},{type:"function",name:"winner",inputs:[{name:"seasonIdx",type:"uint32",internalType:"uint32"}],outputs:[{name:"winner_",type:"address",internalType:"address"},{name:"prize_",type:"uint96",internalType:"uint96"},{name:"unclaimedPrize_",type:"uint96",internalType:"uint96"}],stateMutability:"view"},{type:"event",name:"AdminReplaced",inputs:[{name:"oldAdmin",type:"address",indexed:!0,internalType:"address"},{name:"newAdmin",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"CodeCommitted",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"player",type:"address",indexed:!0,internalType:"address"},{name:"codeHash",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"submission",type:"tuple",indexed:!1,internalType:"struct EncryptedCodeSubmission",components:[{name:"encryptedAesKey",type:"bytes",internalType:"bytes"},{name:"encryptedCode",type:"bytes",internalType:"bytes"},{name:"iv",type:"bytes12",internalType:"bytes12"}]}],anonymous:!1},{type:"event",name:"HostReplaced",inputs:[{name:"oldHost",type:"address",indexed:!0,internalType:"address"},{name:"newHost",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"OperatorSet",inputs:[{name:"player",type:"address",indexed:!0,internalType:"address"},{name:"operator",type:"address",indexed:!0,internalType:"address"},{name:"permitted",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"PlayerAllowedToClaim",inputs:[{name:"player",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"PrizeClaimed",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"winner",type:"address",indexed:!0,internalType:"address"},{name:"prize",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"PrizeRestored",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"prize",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Registered",inputs:[{name:"player",type:"address",indexed:!0,internalType:"address"},{name:"metadata",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"RegistrarReplaced",inputs:[{name:"oldRegistrar",type:"address",indexed:!0,internalType:"address"},{name:"newRegistrar",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"Retired",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"player",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"SeasonClosed",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"}],anonymous:!1},{type:"event",name:"SeasonRevealed",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"privateKey",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"SeasonStarted",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"publicKey",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"WinnerDeclared",inputs:[{name:"season",type:"uint32",indexed:!0,internalType:"uint32"},{name:"winner",type:"address",indexed:!0,internalType:"address"},{name:"prize",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AccessError",inputs:[]},{type:"error",name:"AlreadyClaimedError",inputs:[]},{type:"error",name:"AlreadyRegisteredError",inputs:[]},{type:"error",name:"ConfirmationConsumedError",inputs:[]},{type:"error",name:"InsufficientBalanceError",inputs:[]},{type:"error",name:"InvalidCodeHashError",inputs:[]},{type:"error",name:"InvalidConfirmationError",inputs:[]},{type:"error",name:"InvalidKeyError",inputs:[]},{type:"error",name:"InvalidPlayerError",inputs:[]},{type:"error",name:"NotAllowedToClaimError",inputs:[]},{type:"error",name:"NotRegisteredError",inputs:[]},{type:"error",name:"NotSeasonError",inputs:[]},{type:"error",name:"NotWinnerError",inputs:[]},{type:"error",name:"PlayerSubmissionError",inputs:[]},{type:"error",name:"PreviousSeasonNotRevealedError",inputs:[]},{type:"error",name:"SeasonNotActiveError",inputs:[]},{type:"error",name:"SeasonNotClosedError",inputs:[]},{type:"error",name:"TooSoonError",inputs:[]}],ve=Number(Z),m=V,ie=X,u=se,re=u.filter(e=>e.type==="event");async function oe(e){return P(e.client,{address:m,abi:u,functionName:e.fn,account:e.from,args:e.args})}async function we(e){return S(e.client,{account:e.client.account,chain:e.client.chain,address:m,abi:u,functionName:e.fn,args:e.args})}async function pe(e){const a=await P(e.client,{address:m,abi:u,functionName:"multicall",args:[e.calls.map(t=>f({abi:u,functionName:t.fn,args:t.args}))]});return[...e.calls.entries()].map(([t,{fn:s}])=>{const o=u.find(r=>r.type==="function"&&r.name===s),n=Y(o.outputs,a[t]);return o.outputs.length===1?n[0]:n})}async function Ce(e){const a=await S(e.client,{account:e.client.account,chain:e.client.chain,address:m,abi:u,functionName:"multicall",args:[e.calls.map(s=>f({abi:u,functionName:s.fn,args:s.args}))]});if((await B(e.client,{hash:a})).status!=="success")throw new Error("Transaction reverted")}async function ue(e,a,t){const s=BigInt(t||ie),o=a.map(n=>typeof n=="string"?{name:n}:n);return(await Promise.all(o.map(n=>e.getLogs({address:m,event:re.find(r=>r.name===n.name),args:n.args??void 0,fromBlock:s})))).flat(1)}async function xe(e,a){const t=await B(e,{hash:a});if(t.status!=="success")throw new Error("Transaction failed");return t}var ye=(e=>(e[e.Inactive=0]="Inactive",e[e.Started=1]="Started",e[e.Closed=2]="Closed",e[e.Revealed=3]="Revealed",e))(ye||{});async function ge(e){var y;const{blockNumber:a,events:t}=await le(),[s,o]=await Promise.all([ce(e,a+1),oe({client:e,fn:"currentSeasonPrize"})]),n=de([...t,...s]),r=[];for(const i of n)if(i.eventName==="SeasonStarted")r.push({idx:i.season,startBlock:i.eventBlockNumber,closedBlock:null,startTime:new Date,closedTime:null,prize:0n,state:1,winner:null,unclaimedPrize:0n,privateKey:null,publicKey:i.publicKey,isTerminal:((y=r[r.length-1])==null?void 0:y.publicKey)===i.publicKey,submissionsCount:0});else if(i.eventName==="SeasonClosed"){const p=r[i.season];p.state=2,p.closedBlock=i.eventBlockNumber,p.closedTime=new Date}else if(i.eventName==="SeasonRevealed"){const p=r[i.season];p.state=3,p.privateKey=i.privateKey}else if(i.eventName==="WinnerDeclared"){const p=r[i.season];p.winner=i.winner,p.prize=p.unclaimedPrize=i.prize}else if(i.eventName==="PrizeClaimed"){const p=r[i.season];p.prize=i.prize,p.unclaimedPrize=0n}{const i=r[r.length-1];(i==null?void 0:i.state)===1&&(i.unclaimedPrize=i.prize=o)}const[d]=await Promise.all([pe({client:e,calls:r.map((i,p)=>({fn:"playerCodeCount",args:[p]}))}),me(e,r)]);for(let i=0;iBigInt(t.eventBlockNumber)<<64n|BigInt(t.eventTransactionIndex)<<32n|BigInt(t.eventLogIndex));return e.map((t,s)=>s).sort((t,s)=>J(a[t],a[s])).map(t=>e[t])}async function le(){const e=await fetch(`${Q}/indexed/seasons?`);if(!e.ok)throw new Error("Failed to fetch indexed data");return e.json()}async function ce(e,a){return(await ue(e,["SeasonStarted","SeasonClosed","SeasonRevealed","WinnerDeclared","PrizeClaimed"],a)).map(s=>({eventId:"",eventBlockNumber:Number(s.blockNumber),eventTransactionIndex:s.transactionIndex,eventLogIndex:s.logIndex,eventName:s.eventName,...s.args}))}async function me(e,a){const t=Object.values(Object.assign({},...a.map(n=>[n.startBlock,n.closedBlock]).flat(1).filter(n=>typeof n=="number").map(n=>({[n]:n})))),s=await be(e,t),o=Object.assign({},...t.map((n,r)=>({[n]:s[r]})));for(const n of a)n.startTime=o[n.startBlock],n.closedBlock&&(n.closedTime=o[n.closedBlock]);return a}async function be(e,a){return Promise.all(a.map(async t=>{const s=`${e.chain.id}/blockTime/${t}`,o=await localStorage.getItem(s);if(o)return new Date(Number(o));const n=await e.getBlock({blockNumber:BigInt(t)}),r=Number(n.timestamp)*1e3;return await localStorage.setItem(s,r.toString()),new Date(r)}))}export{ee as A,m as C,ye as S,xe as a,Ce as b,te as c,S as d,ve as e,ge as f,pe as m,oe as r,ae as s,we as w}; diff --git a/_app/immutable/chunks/each.Bmx-BImQ.js b/_app/immutable/chunks/each.Bmx-BImQ.js new file mode 100644 index 0000000..621ec30 --- /dev/null +++ b/_app/immutable/chunks/each.Bmx-BImQ.js @@ -0,0 +1 @@ +import{a as q,t as z}from"./index.DFmxPlw4.js";import{r as B}from"./scheduler.C1FoT2GD.js";function F(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function G(n,f){n.d(1),f.delete(n.key)}function H(n,f){q(n,1,1,()=>{f.delete(n.key)})}function I(n,f,k,C,x,g,h,A,p,_,w,j){let i=n.length,d=g.length,c=i;const a={};for(;c--;)a[n[c].key]=c;const l=[],u=new Map,m=new Map,M=[];for(c=d;c--;){const e=j(x,g,c),s=k(e);let t=h.get(s);t?M.push(()=>t.p(e,f)):(t=_(s,e),t.c()),u.set(s,l[c]=t),s in a&&m.set(s,Math.abs(c-a[s]))}const v=new Set,S=new Set;function y(e){z(e,1),e.m(A,w),h.set(e.key,e),w=e.first,d--}for(;i&&d;){const e=l[d-1],s=n[i-1],t=e.key,o=s.key;e===s?(w=e.first,i--,d--):u.has(o)?!h.has(t)||v.has(t)?y(e):S.has(o)?i--:m.get(t)>m.get(o)?(S.add(t),y(e)):(v.add(o),i--):(p(s,h),i--)}for(;i--;){const e=n[i];u.has(e.key)||p(e,h)}for(;d;)y(l[d-1]);return B(M),l}export{G as d,F as e,H as o,I as u}; diff --git a/_app/immutable/chunks/entry.CTvLC5-Q.js b/_app/immutable/chunks/entry.CTvLC5-Q.js new file mode 100644 index 0000000..7387498 --- /dev/null +++ b/_app/immutable/chunks/entry.CTvLC5-Q.js @@ -0,0 +1,3 @@ +import{K as se}from"./scheduler.C1FoT2GD.js";import{w as gt,a as ie,b as P}from"./paths.2ZvcQRjx.js";new URL("sveltekit-internal://");function ce(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function le(t){return t.split("%25").map(decodeURI).join("%25")}function fe(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function lt({href:t}){return t.split("#")[0]}const ue=["href","pathname","search","toString","toJSON"];function de(t,n,e){const a=new URL(t);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(r,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),r[o](s));n();const i=Reflect.get(r,o);return typeof i=="function"?i.bind(r):i}}),enumerable:!0,configurable:!0});for(const r of ue)Object.defineProperty(a,r,{get(){return n(),t[r]},enumerable:!0,configurable:!0});return a}const he="/__data.json",pe=".html__data.json";function ge(t){return t.endsWith(".html")?t.replace(/\.html$/,pe):t.replace(/\/$/,"")+he}function me(...t){let n=5381;for(const e of t)if(typeof e=="string"){let a=e.length;for(;a;)n=n*33^e.charCodeAt(--a)}else if(ArrayBuffer.isView(e)){const a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let r=a.length;for(;r;)n=n*33^a[--r]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function _e(t){const n=atob(t),e=new Uint8Array(n.length);for(let a=0;a((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&M.delete(mt(t)),Dt(t,n));const M=new Map;function ye(t,n){const e=mt(t,n),a=document.querySelector(e);if(a!=null&&a.textContent){let{body:r,...o}=JSON.parse(a.textContent);const i=a.getAttribute("data-ttl");return i&&M.set(e,{body:r,init:o,ttl:1e3*Number(i)}),a.getAttribute("data-b64")!==null&&(r=_e(r)),Promise.resolve(new Response(r,o))}return window.fetch(t,n)}function we(t,n,e){if(M.size>0){const a=mt(t,e),r=M.get(a);if(r){if(performance.now(){const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(a);if(r)return n.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(a);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!a)return;const i=a.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return ft(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return ft(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=ve.exec(c),[,h,g,d,_]=u;return n.push({name:d,matcher:_,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return ft(c)}).join("")}).join("")}/?$`),params:n}}function Ee(t){return!/^\([^)]+\)$/.test(t)}function ke(t){return t.slice(1).split("/").filter(Ee)}function Se(t,n,e){const a={},r=t.slice(1),o=r.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(a[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){a[c.name]=f;const u=n[s+1],h=r[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(a).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return a}function ft(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ae({nodes:t,server_loads:n,dictionary:e,matchers:a}){const r=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=be(s),d={id:s,exec:_=>{const l=h.exec(_);if(l)return Se(l,g,a)},errors:[1,...u||[]].map(_=>t[_]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[r.has(s),t[s]]}}function Ct(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function Pt(t,n,e=JSON.stringify){const a=e(n);try{sessionStorage[t]=a}catch{}}const Re="1719417690221",Vt="sveltekit:snapshot",Ft="sveltekit:scroll",_t="sveltekit:states",Gt="sveltekit:pageurl",N="sveltekit:history",C="sveltekit:navigation",J={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},B=location.origin;function yt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function wt(){return{x:pageXOffset,y:pageYOffset}}function j(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Ut={...J,"":J.hover};function Mt(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function qt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Mt(t)}}function dt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,r=!e||!!a||nt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===B&&t.hasAttribute("download");return{url:e,external:r,target:a,download:o}}function W(t){let n=null,e=null,a=null,r=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)a===null&&(a=j(s,"preload-code")),r===null&&(r=j(s,"preload-data")),n===null&&(n=j(s,"keepfocus")),e===null&&(e=j(s,"noscroll")),o===null&&(o=j(s,"reload")),i===null&&(i=j(s,"replacestate")),s=Mt(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ut[a??"off"],preload_data:Ut[r??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function xt(t){const n=gt(t);let e=!0;function a(){e=!0,n.update(i=>i)}function r(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:a,set:r,subscribe:o}}function Ie(){const{set:t,subscribe:n}=gt(!1);let e;async function a(){clearTimeout(e);try{const r=await fetch(`${ie}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const i=(await r.json()).version!==Re;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:a}}function nt(t,n){return t.origin!==B||!t.pathname.startsWith(n)}const Le=-1,Pe=-2,Ue=-3,xe=-4,Te=-5,Ne=-6;function Oe(t,n){if(typeof t=="number")return r(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,a=Array(e.length);function r(o,i=!1){if(o===Le)return;if(o===Ue)return NaN;if(o===xe)return 1/0;if(o===Te)return-1/0;if(o===Ne)return-0;if(i)throw new Error("Invalid input");if(o in a)return a[o];const s=e[o];if(!s||typeof s!="object")a[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return a[o]=f(r(s[1]));switch(c){case"Date":a[o]=new Date(s[1]);break;case"Set":const u=new Set;a[o]=u;for(let d=1;dn!=null)}class at{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class Kt{constructor(n,e){this.status=n,this.location=e}}class vt extends Error{constructor(n,e,a){super(a),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",Ce="x-sveltekit-trailing-slash";function z(t){return t instanceof at||t instanceof vt?t.status:500}function Ve(t){return t instanceof vt?t.text:"Internal Error"}const O=Ct(Ft)??{},H=Ct(Vt)??{},x={url:xt({}),page:xt({}),navigating:gt(null),updated:Ie()};function bt(t){O[t]=wt()}function Fe(t,n){let e=t+1;for(;O[e];)delete O[e],e+=1;for(e=n+1;H[e];)delete H[e],e+=1}function V(t){return location.href=t.href,new Promise(()=>{})}function Tt(){}let rt,ht,X,U,pt,F;const Bt=[],Z=[];let L=null;const Yt=[],Ge=[];let $=[],y={branch:[],error:null,url:null},Et=!1,Q=!1,Nt=!0,K=!1,G=!1,Jt=!1,kt=!1,ot,S,I,A,tt;const q=new Set;async function Qe(t,n,e){var r,o;document.URL!==location.href&&(location.href=location.href),F=t,rt=Ae(t),U=document.documentElement,pt=n,ht=t.nodes[0],X=t.nodes[1],ht(),X(),S=(r=history.state)==null?void 0:r[N],I=(o=history.state)==null?void 0:o[C],S||(S=I=Date.now(),history.replaceState({...history.state,[N]:S,[C]:I},""));const a=O[S];a&&(history.scrollRestoration="manual",scrollTo(a.x,a.y)),e?await We(pt,e):Ye(location.href,{replaceState:!0}),Je()}function Me(){Bt.length=0,kt=!1}function Wt(t){Z.some(n=>n==null?void 0:n.snapshot)&&(H[t]=Z.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function zt(t){var n;(n=H[t])==null||n.forEach((e,a)=>{var r,o;(o=(r=Z[a])==null?void 0:r.snapshot)==null||o.restore(e)})}function Ot(){bt(S),Pt(Ft,O),Wt(I),Pt(Vt,H)}async function Xt(t,n,e,a){return Y({type:"goto",url:yt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:a,accept:()=>{n.invalidateAll&&(kt=!0)}})}async function qe(t){if(t.id!==(L==null?void 0:L.id)){const n={};q.add(n),L={id:t.id,token:n,promise:Qt({...t,preload:n}).then(e=>(q.delete(n),e.type==="loaded"&&e.state.error&&(L=null),e))}}return L.promise}async function ut(t){const n=rt.find(e=>e.exec(te(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function Zt(t,n,e){var o;y=t.state;const a=document.querySelector("style[data-sveltekit]");a&&a.remove(),A=t.props.page,ot=new F.root({target:n,props:{...t.props,stores:x,components:Z},hydrate:e}),zt(I);const r={from:null,to:{params:y.params,route:{id:((o=y.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};$.forEach(i=>i(r)),Q=!0}async function et({url:t,params:n,branch:e,status:a,error:r,route:o,form:i}){let s="never";if(P&&(t.pathname===P||t.pathname===P+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=ce(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:r,route:o},props:{constructors:$e(e).map(d=>d.node.component),page:A}};i!==void 0&&(c.props.form=i);let f={},u=!A,h=0;for(let d=0;d(s&&(c.route=!0),l[m])}),params:new Proxy(a,{get:(l,m)=>(s&&c.params.add(m),l[m])}),data:(o==null?void 0:o.data)??null,url:de(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,m){let b;l instanceof Request?(b=l.url,m={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,...m}):b=l;const R=new URL(b,e);return s&&d(R.href),R.origin===e.origin&&(b=R.href.slice(e.origin.length)),Q?we(b,R.href,m):ye(b,m)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,_)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function jt(t,n,e,a,r,o){if(kt)return!0;if(!r)return!1;if(r.parent&&t||r.route&&n||r.url&&e)return!0;for(const i of r.search_params)if(a.has(i))return!0;for(const i of r.params)if(o[i]!==y.params[i])return!0;for(const i of r.dependencies)if(Bt.some(s=>s(new URL(i))))return!0;return!1}function At(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function He(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const a of e){const r=t.searchParams.getAll(a),o=n.searchParams.getAll(a);r.every(i=>o.includes(i))&&o.every(i=>r.includes(i))&&e.delete(a)}return e}function $t({error:t,url:n,route:e,params:a}){return{type:"loaded",state:{error:t,url:n,route:e,params:a,branch:[]},props:{page:A,constructors:[]}}}async function Qt({id:t,invalidating:n,url:e,params:a,route:r,preload:o}){if((L==null?void 0:L.id)===t)return q.delete(L.token),L.promise;const{errors:i,layouts:s,leaf:c}=r,f=[...s,c];i.forEach(p=>p==null?void 0:p().catch(()=>{})),f.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let u=null;const h=y.url?t!==y.url.pathname+y.url.search:!1,g=y.route?r.id!==y.route.id:!1,d=He(y.url,e);let _=!1;const l=f.map((p,v)=>{var T;const E=y.branch[v],k=!!(p!=null&&p[0])&&((E==null?void 0:E.loader)!==p[1]||jt(_,g,h,d,(T=E.server)==null?void 0:T.uses,a));return k&&(_=!0),k});if(l.some(Boolean)){try{u=await ae(e,l)}catch(p){const v=await D(p,{url:e,params:a,route:{id:t}});return q.has(o)?$t({error:v,url:e,params:a,route:r}):st({status:z(p),error:v,url:e,route:r})}if(u.type==="redirect")return u}const m=u==null?void 0:u.nodes;let b=!1;const R=f.map(async(p,v)=>{var it;if(!p)return;const E=y.branch[v],k=m==null?void 0:m[v];if((!k||k.type==="skip")&&p[1]===(E==null?void 0:E.loader)&&!jt(b,g,h,d,(it=E.universal)==null?void 0:it.uses,a))return E;if(b=!0,(k==null?void 0:k.type)==="error")throw k;return St({loader:p[1],url:e,params:a,route:r,parent:async()=>{var Lt;const It={};for(let ct=0;ct{});const w=[];for(let p=0;pPromise.resolve({}),server_data_node:At(o)}),c={node:await X(),loader:X,universal:null,server:null,data:null};return await et({url:e,params:r,branch:[s,c],status:t,error:n,route:null})}function Rt(t,n){if(!t||nt(t,P))return;let e;try{e=F.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const a=te(e);for(const r of rt){const o=r.exec(a);if(o)return{id:t.pathname+t.search,invalidating:n,route:r,params:fe(o),url:t}}}function te(t){return le(t.slice(P.length)||"/")}function ee({url:t,type:n,intent:e,delta:a}){let r=!1;const o=oe(y,e,t,n);a!==void 0&&(o.navigation.delta=a);const i={...o.navigation,cancel:()=>{r=!0,o.reject(new Error("navigation cancelled"))}};return K||Yt.forEach(s=>s(i)),r?null:o}async function Y({type:t,url:n,popped:e,keepfocus:a,noscroll:r,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Tt,block:u=Tt}){const h=Rt(n,!1),g=ee({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=S,_=I;f(),K=!0,Q&&x.navigating.set(g.navigation),tt=c;let l=h&&await Qt(h);if(!l){if(nt(n,P))return await V(n);l=await ne(n,{id:null},await D(new vt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,tt!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await st({status:500,error:await D(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Xt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await x.updated.check()&&await V(n);if(Me(),bt(d),Wt(_),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const w=o?0:1,p={[N]:S+=w,[C]:I+=w,[_t]:i};(o?history.replaceState:history.pushState).call(history,p,"",n),o||Fe(S,I)}if(L=null,l.props.page.state=i,Q){y=l.state,l.props.page&&(l.props.page.url=n);const w=(await Promise.all(Ge.map(p=>p(g.navigation)))).filter(p=>typeof p=="function");if(w.length>0){let p=function(){$=$.filter(v=>!w.includes(v))};w.push(p),$.push(...w)}ot.$set(l.props),Jt=!0}else Zt(l,pt,!1);const{activeElement:m}=document;await se();const b=e?e.scroll:r?wt():null;if(Nt){const w=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));b?scrollTo(b.x,b.y):w?w.scrollIntoView():scrollTo(0,0)}const R=document.activeElement!==m&&document.activeElement!==document.body;!a&&!R&&ze(),Nt=!0,l.props.page&&(A=l.props.page),K=!1,t==="popstate"&&zt(I),g.fulfil(void 0),$.forEach(w=>w(g.navigation)),x.navigating.set(null)}async function ne(t,n,e,a){return t.origin===B&&t.pathname===location.pathname&&!Et?await st({status:a,error:e,url:t,route:n}):await V(t)}function Be(){let t;U.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{a(i,2)},20)});function n(o){a(o.composedPath()[0],1)}U.addEventListener("mousedown",n),U.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ut(i.target.href),e.unobserve(i.target))},{threshold:0});function a(o,i){const s=qt(o,U);if(!s)return;const{url:c,external:f,download:u}=dt(s,P);if(f||u)return;const h=W(s);if(!h.reload)if(i<=h.preload_data){const g=Rt(c,!1);g&&qe(g)}else i<=h.preload_code&&ut(c.pathname)}function r(){e.disconnect();for(const o of U.querySelectorAll("a")){const{url:i,external:s,download:c}=dt(o,P);if(s||c)continue;const f=W(o);f.reload||(f.preload_code===J.viewport&&e.observe(o),f.preload_code===J.eager&&ut(i.pathname))}}$.push(r),r()}function D(t,n){if(t instanceof at)return t.body;const e=z(t),a=Ve(t);return F.hooks.handleError({error:t,event:n,status:e,message:a})??{message:a}}function Ye(t,n={}){return t=yt(t),t.origin!==B?Promise.reject(new Error("goto: invalid URL")):Xt(t,n,0)}function tn(t,n){const e={[N]:S,[C]:I,[Gt]:A.url.href,[_t]:n};history.replaceState(e,"",yt(t)),A={...A,state:n},ot.$set({page:A})}function Je(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let a=!1;if(Ot(),!K){const r=oe(y,void 0,null,"leave"),o={...r.navigation,cancel:()=>{a=!0,r.reject(new Error("navigation cancelled"))}};Yt.forEach(i=>i(o))}a?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ot()}),(n=navigator.connection)!=null&&n.saveData||Be(),U.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const a=qt(e.composedPath()[0],U);if(!a)return;const{url:r,external:o,target:i,download:s}=dt(a,P);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=W(a);if(!(a instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;if(o||c.reload){ee({url:r,type:"link"})?K=!0:e.preventDefault();return}const[u,h]=r.href.split("#");if(h!==void 0&&u===lt(location)){const[,d]=y.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&a.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=a.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(G=!0,bt(S),t(r),!c.replace_state)return;G=!1}e.preventDefault(),Y({type:"link",url:r,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??r.href===location.href})}),U.addEventListener("submit",e=>{if(e.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(e.target),r=e.submitter;if(((r==null?void 0:r.formMethod)||a.method)!=="get")return;const i=new URL((r==null?void 0:r.hasAttribute("formaction"))&&(r==null?void 0:r.formAction)||a.action);if(nt(i,P))return;const s=e.target,c=W(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=r==null?void 0:r.getAttribute("name");u&&f.append(u,(r==null?void 0:r.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),Y({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var a;if((a=e.state)!=null&&a[N]){const r=e.state[N];if(tt={},r===S)return;const o=O[r],i=e.state[_t]??{},s=new URL(e.state[Gt]??location.href),c=e.state[C],f=lt(location)===lt(y.url);if(c===I&&(Jt||f)){t(s),O[S]=wt(),o&&scrollTo(o.x,o.y),i!==A.state&&(A={...A,state:i},ot.$set({page:A})),S=r;return}const h=r-S;await Y({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{S=r,I=c},block:()=>{history.go(-h)},nav_token:tt})}else if(!G){const r=new URL(location.href);t(r)}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[N]:++S,[C]:I},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&x.navigating.set(null)});function t(e){y.url=e,x.page.set({...A,url:e}),x.page.notify()}}async function We(t,{status:n=200,error:e,node_ids:a,params:r,route:o,data:i,form:s}){Et=!0;const c=new URL(location.href);({params:r={},route:o={id:null}}=Rt(c,!1)||{});let f;try{const u=a.map(async(d,_)=>{const l=i[_];return l!=null&&l.uses&&(l.uses=re(l.uses)),St({loader:F.nodes[d],url:c,params:r,route:o,parent:async()=>{const m={};for(let b=0;b<_;b+=1)Object.assign(m,(await u[b]).data);return m},server_data_node:At(l)})}),h=await Promise.all(u),g=rt.find(({id:d})=>d===o.id);if(g){const d=g.layouts;for(let _=0;_o?"1":"0").join(""));const a=await Dt(e.href);if(!a.ok){let o;throw(r=a.headers.get("content-type"))!=null&&r.includes("application/json")?o=await a.json():a.status===404?o="Not Found":a.status===500&&(o="Internal Error"),new at(a.status,o)}return new Promise(async o=>{var h;const i=new Map,s=a.body.getReader(),c=new TextDecoder;function f(g){return Oe(g,{Promise:d=>new Promise((_,l)=>{i.set(d,{fulfil:_,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` +`:c.decode(d,{stream:!0});;){const _=u.indexOf(` +`);if(_===-1)break;const l=JSON.parse(u.slice(0,_));if(u=u.slice(_+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(m=>{(m==null?void 0:m.type)==="data"&&(m.uses=re(m.uses),m.data=f(m.data))}),o(l);else if(l.type==="chunk"){const{id:m,data:b,error:R}=l,w=i.get(m);i.delete(m),R?w.reject(f(R)):w.fulfil(f(b))}}}})}function re(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function ze(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const a=getSelection();if(a&&a.type!=="None"){const r=[];for(let o=0;o{if(a.rangeCount===r.length){for(let o=0;o{r=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:a,complete:i},fulfil:r,reject:o}}export{Qe as a,Ye as g,tn as r,x as s}; diff --git a/_app/immutable/chunks/index.Bw9ky5pK.js b/_app/immutable/chunks/index.Bw9ky5pK.js new file mode 100644 index 0000000..e1b9d10 --- /dev/null +++ b/_app/immutable/chunks/index.Bw9ky5pK.js @@ -0,0 +1,47 @@ +import{n as fe,s as Ke,T as k,t as P,a as g,o as Q,R as Dr,p as H,y as ae}from"./index.hW7Iu6gF.js";import{aG as Ur}from"./2.CpRWH4-H.js";/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ge=window,jt=Ge.ShadowRoot&&(Ge.ShadyCSS===void 0||Ge.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ht=Symbol(),Vt=new WeakMap;let br=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(jt&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=Vt.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Vt.set(r,e))}return e}toString(){return this.cssText}};const jr=t=>new br(typeof t=="string"?t:t+"",void 0,Ht),C=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,o,n)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+t[n+1],t[0]);return new br(r,t,Ht)},Hr=(t,e)=>{jt?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),o=Ge.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=r.cssText,t.appendChild(i)})},Ft=jt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return jr(r)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var rt;const Qe=window,qt=Qe.trustedTypes,Br=qt?qt.emptyScript:"",Kt=Qe.reactiveElementPolyfillSupport,Lt={toAttribute(t,e){switch(e){case Boolean:t=t?Br:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},yr=(t,e)=>e!==t&&(e==e||t==t),ot={attribute:!0,type:String,converter:Lt,reflect:!1,hasChanged:yr},Pt="finalized";let ue=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const o=this._$Ep(i,r);o!==void 0&&(this._$Ev.set(o,i),e.push(o))}),e}static createProperty(e,r=ot){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,i,r);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(o){const n=this[e];this[r]=o,this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ot}static finalize(){if(this.hasOwnProperty(Pt))return!1;this[Pt]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const o of i)this.createProperty(o,r[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)r.unshift(Ft(o))}else e!==void 0&&r.push(Ft(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Hr(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=ot){var o;const n=this.constructor._$Ep(e,i);if(n!==void 0&&i.reflect===!0){const a=(((o=i.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?i.converter:Lt).toAttribute(r,i.type);this._$El=e,a==null?this.removeAttribute(n):this.setAttribute(n,a),this._$El=null}}_$AK(e,r){var i;const o=this.constructor,n=o._$Ev.get(e);if(n!==void 0&&this._$El!==n){const a=o.getPropertyOptions(n),s=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:Lt;this._$El=n,this[n]=s.fromAttribute(r,a.type),this._$El=null}}requestUpdate(e,r,i){let o=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||yr)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((o,n)=>this[n]=o),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(o=>{var n;return(n=o.hostUpdate)===null||n===void 0?void 0:n.call(o)}),this.update(i)):this._$Ek()}catch(o){throw r=!1,this._$Ek(),o}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var o;return(o=i.hostUpdated)===null||o===void 0?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};ue[Pt]=!0,ue.elementProperties=new Map,ue.elementStyles=[],ue.shadowRootOptions={mode:"open"},Kt==null||Kt({ReactiveElement:ue}),((rt=Qe.reactiveElementVersions)!==null&&rt!==void 0?rt:Qe.reactiveElementVersions=[]).push("1.6.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var it;const Ye=window,be=Ye.trustedTypes,Gt=be?be.createPolicy("lit-html",{createHTML:t=>t}):void 0,Wt="$lit$",G=`lit$${(Math.random()+"").slice(9)}$`,xr="?"+G,Zr=`<${xr}>`,se=document,Se=()=>se.createComment(""),Le=t=>t===null||typeof t!="object"&&typeof t!="function",$r=Array.isArray,zr=t=>$r(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",nt=`[ +\f\r]`,Ce=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qt=/-->/g,Yt=/>/g,ee=RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Xt=/'/g,Jt=/"/g,Cr=/^(?:script|style|textarea|title)$/i,Ar=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),l=Ar(1),E=Ar(2),le=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),er=new WeakMap,ie=se.createTreeWalker(se,129,null,!1);function _r(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Gt!==void 0?Gt.createHTML(e):e}const Vr=(t,e)=>{const r=t.length-1,i=[];let o,n=e===2?"":"",a=Ce;for(let s=0;s"?(a=o??Ce,$=-1):x[1]===void 0?$=-2:($=a.lastIndex-x[2].length,d=x[1],a=x[3]===void 0?ee:x[3]==='"'?Jt:Xt):a===Jt||a===Xt?a=ee:a===Qt||a===Yt?a=Ce:(a=ee,o=void 0);const _=a===ee&&t[s+1].startsWith("/>")?" ":"";n+=a===Ce?c+Zr:$>=0?(i.push(d),c.slice(0,$)+Wt+c.slice($)+G+_):c+G+($===-2?(i.push(void 0),s):_)}return[_r(t,n+(t[r]||"")+(e===2?"":"")),i]};class Pe{constructor({strings:e,_$litType$:r},i){let o;this.parts=[];let n=0,a=0;const s=e.length-1,c=this.parts,[d,x]=Vr(e,r);if(this.el=Pe.createElement(d,i),ie.currentNode=this.el.content,r===2){const $=this.el.content,m=$.firstChild;m.remove(),$.append(...m.childNodes)}for(;(o=ie.nextNode())!==null&&c.length0){o.textContent=be?be.emptyScript:"";for(let _=0;_2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=M}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,o){const n=this.strings;let a=!1;if(n===void 0)e=ye(this,e,r,0),a=!Le(e)||e!==this._$AH&&e!==le,a&&(this._$AH=e);else{const s=e;let c,d;for(e=n[0],c=0;c{var i,o;const n=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:e;let a=n._$litPart$;if(a===void 0){const s=(o=r==null?void 0:r.renderBefore)!==null&&o!==void 0?o:null;n._$litPart$=a=new Ne(e.insertBefore(Se(),s),s,void 0,r??{})}return a._$AI(t),a};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var at,st;class w extends ue{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Xr(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return le}}w.finalized=!0,w._$litElement$=!0,(at=globalThis.litElementHydrateSupport)===null||at===void 0||at.call(globalThis,{LitElement:w});const rr=globalThis.litElementPolyfillSupport;rr==null||rr({LitElement:w});((st=globalThis.litElementVersions)!==null&&st!==void 0?st:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const y=t=>e=>typeof e=="function"?((r,i)=>(customElements.define(r,i),i))(t,e):((r,i)=>{const{kind:o,elements:n}=i;return{kind:o,elements:n,finisher(a){customElements.define(r,a)}}})(t,e);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Jr=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},eo=(t,e,r)=>{e.constructor.createProperty(r,t)};function p(t){return(e,r)=>r!==void 0?eo(t,e,r):Jr(t,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function W(t){return p({...t,state:!0})}/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var lt;((lt=window.HTMLSlotElement)===null||lt===void 0?void 0:lt.prototype.assignedElements)!=null;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const to={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ro=t=>(...e)=>({_$litDirective$:t,values:e});class oo{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Z=ro(class extends oo{constructor(t){var e;if(super(t),t.type!==to.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,i;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in e)e[n]&&!(!((r=this.nt)===null||r===void 0)&&r.has(n))&&this.it.add(n);return this.render(e)}const o=t.element.classList;this.it.forEach(n=>{n in e||(o.remove(n),this.it.delete(n))});for(const n in e){const a=!!e[n];a===this.it.has(n)||!((i=this.nt)===null||i===void 0)&&i.has(n)||(a?(o.add(n),this.it.add(n)):(o.remove(n),this.it.delete(n)))}return le}});function io(t,e){t.indexOf(e)===-1&&t.push(e)}const Er=(t,e,r)=>Math.min(Math.max(r,t),e),D={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Xe=t=>typeof t=="number",we=t=>Array.isArray(t)&&!Xe(t[0]),no=(t,e,r)=>{const i=e-t;return((r-t)%i+i)%i+t};function ao(t,e){return we(t)?t[no(0,t.length,e)]:t}const kr=(t,e,r)=>-r*t+r*e+t,Or=()=>{},Y=t=>t,Bt=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function Ir(t,e){const r=t[t.length-1];for(let i=1;i<=e;i++){const o=Bt(0,e,i);t.push(kr(r,1,o))}}function so(t){const e=[0];return Ir(e,t-1),e}function lo(t,e=so(t.length),r=Y){const i=t.length,o=i-e.length;return o>0&&Ir(e,o),n=>{let a=0;for(;aArray.isArray(t)&&Xe(t[0]),Nt=t=>typeof t=="object"&&!!t.createAnimation,xe=t=>typeof t=="function",co=t=>typeof t=="string",Re={ms:t=>t*1e3,s:t=>t/1e3},Mr=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,ho=1e-7,mo=12;function po(t,e,r,i,o){let n,a,s=0;do a=e+(r-e)/2,n=Mr(a,i,o)-t,n>0?r=a:e=a;while(Math.abs(n)>ho&&++spo(n,0,1,t,r);return n=>n===0||n===1?n:Mr(o(n),e,i)}const uo=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const i=r*t,o=e==="end"?Math.floor(i):Math.ceil(i);return Er(0,1,o/t)},go={ease:Me(.25,.1,.25,1),"ease-in":Me(.42,0,1,1),"ease-in-out":Me(.42,0,.58,1),"ease-out":Me(0,0,.58,1)},wo=/\((.*?)\)/;function or(t){if(xe(t))return t;if(Tr(t))return Me(...t);const e=go[t];if(e)return e;if(t.startsWith("steps")){const r=wo.exec(t);if(r){const i=r[1].split(",");return uo(parseFloat(i[0]),i[1].trim())}}return Y}class Rr{constructor(e,r=[0,1],{easing:i,duration:o=D.duration,delay:n=D.delay,endDelay:a=D.endDelay,repeat:s=D.repeat,offset:c,direction:d="normal",autoplay:x=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Y,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((m,_)=>{this.resolve=m,this.reject=_}),i=i||D.easing,Nt(i)){const m=i.createAnimation(r);i=m.easing,r=m.keyframes||r,o=m.duration||o}this.repeat=s,this.easing=we(i)?Y:or(i),this.updateDuration(o);const $=lo(r,c,we(i)?i.map(or):Y);this.tick=m=>{var _;n=n;let f=0;this.pauseTime!==void 0?f=this.pauseTime:f=(m-this.startTime)*this.rate,this.t=f,f/=1e3,f=Math.max(f-n,0),this.playState==="finished"&&this.pauseTime===void 0&&(f=this.totalDuration);const u=f/this.duration;let I=Math.floor(u),b=u%1;!b&&u>=1&&(b=1),b===1&&I--;const R=I%2;(d==="reverse"||d==="alternate"&&R||d==="alternate-reverse"&&!R)&&(b=1-b);const S=f>=this.totalDuration?1:Math.min(b,1),N=$(this.easing(S));e(N),this.pauseTime===void 0&&(this.playState==="finished"||f>=this.totalDuration+a)?(this.playState="finished",(_=this.resolve)===null||_===void 0||_.call(this,N)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},x&&this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}class vo{setAnimation(e){this.animation=e,e==null||e.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const ct=new WeakMap;function Sr(t){return ct.has(t)||ct.set(t,{transforms:[],values:new Map}),ct.get(t)}function fo(t,e){return t.has(e)||t.set(e,new vo),t.get(e)}const bo=["","X","Y","Z"],yo=["translate","scale","rotate","skew"],Je={x:"translateX",y:"translateY",z:"translateZ"},ir={syntax:"",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},xo={translate:{syntax:"",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:ir,scale:{syntax:"",initialValue:1,toDefaultUnit:Y},skew:ir},We=new Map,Zt=t=>`--motion-${t}`,et=["x","y","z"];yo.forEach(t=>{bo.forEach(e=>{et.push(t+e),We.set(Zt(t+e),xo[t])})});const $o=(t,e)=>et.indexOf(t)-et.indexOf(e),Co=new Set(et),Lr=t=>Co.has(t),Ao=(t,e)=>{Je[e]&&(e=Je[e]);const{transforms:r}=Sr(t);io(r,e),t.style.transform=_o(r)},_o=t=>t.sort($o).reduce(Eo,"").trim(),Eo=(t,e)=>`${t} ${e}(var(${Zt(e)}))`,Dt=t=>t.startsWith("--"),nr=new Set;function ko(t){if(!nr.has(t)){nr.add(t);try{const{syntax:e,initialValue:r}=We.has(t)?We.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const dt=(t,e)=>document.createElement("div").animate(t,e),ar={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{dt({opacity:[1]})}catch{return!1}return!0},finished:()=>!!dt({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{dt({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},ht={},ge={};for(const t in ar)ge[t]=()=>(ht[t]===void 0&&(ht[t]=ar[t]()),ht[t]);const Oo=.015,Io=(t,e)=>{let r="";const i=Math.round(e/Oo);for(let o=0;oxe(t)?ge.linearEasing()?`linear(${Io(t,e)})`:D.easing:Tr(t)?To(t):t,To=([t,e,r,i])=>`cubic-bezier(${t}, ${e}, ${r}, ${i})`;function Mo(t,e){for(let r=0;rArray.isArray(t)?t:[t];function Ut(t){return Je[t]&&(t=Je[t]),Lr(t)?Zt(t):t}const je={get:(t,e)=>{e=Ut(e);let r=Dt(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const i=We.get(e);i&&(r=i.initialValue)}return r},set:(t,e,r)=>{e=Ut(e),Dt(e)?t.style.setProperty(e,r):t.style[e]=r}};function Pr(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function So(t,e){var r;let i=(e==null?void 0:e.toDefaultUnit)||Y;const o=t[t.length-1];if(co(o)){const n=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";n&&(i=a=>a+n)}return i}function Lo(){return window.__MOTION_DEV_TOOLS_RECORD}function Po(t,e,r,i={},o){const n=Lo(),a=i.record!==!1&&n;let s,{duration:c=D.duration,delay:d=D.delay,endDelay:x=D.endDelay,repeat:$=D.repeat,easing:m=D.easing,persist:_=!1,direction:f,offset:u,allowWebkitAcceleration:I=!1,autoplay:b=!0}=i;const R=Sr(t),S=Lr(e);let N=ge.waapi();S&&Ao(t,e);const U=Ut(e),De=fo(R.values,U),z=We.get(U);return Pr(De.animation,!(Nt(m)&&De.generator)&&i.record!==!1),()=>{const Ue=()=>{var O,$e;return($e=(O=je.get(t,U))!==null&&O!==void 0?O:z==null?void 0:z.initialValue)!==null&&$e!==void 0?$e:0};let T=Mo(Ro(r),Ue);const zt=So(T,z);if(Nt(m)){const O=m.createAnimation(T,e!=="opacity",Ue,U,De);m=O.easing,T=O.keyframes||T,c=O.duration||c}if(Dt(U)&&(ge.cssRegisterProperty()?ko(U):N=!1),S&&!ge.linearEasing()&&(xe(m)||we(m)&&m.some(xe))&&(N=!1),N){z&&(T=T.map(J=>Xe(J)?z.toDefaultUnit(J):J)),T.length===1&&(!ge.partialKeyframes()||a)&&T.unshift(Ue());const O={delay:Re.ms(d),duration:Re.ms(c),endDelay:Re.ms(x),easing:we(m)?void 0:sr(m,c),direction:f,iterations:$+1,fill:"both"};s=t.animate({[U]:T,offset:u,easing:we(m)?m.map(J=>sr(J,c)):void 0},O),s.finished||(s.finished=new Promise((J,Nr)=>{s.onfinish=J,s.oncancel=Nr}));const $e=T[T.length-1];s.finished.then(()=>{_||(je.set(t,U,$e),s.cancel())}).catch(Or),I||(s.playbackRate=1.000001)}else if(o&&S)T=T.map(O=>typeof O=="string"?parseFloat(O):O),T.length===1&&T.unshift(parseFloat(Ue())),s=new o(O=>{je.set(t,U,zt?zt(O):O)},T,Object.assign(Object.assign({},i),{duration:c,easing:m}));else{const O=T[T.length-1];je.set(t,U,z&&Xe(O)?z.toDefaultUnit(O):O)}return a&&n(t,e,T,{duration:c,delay:d,easing:m,repeat:$,offset:u},"motion-one"),De.setAnimation(s),s&&!b&&s.pause(),s}}const Wo=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function No(t,e){return typeof t=="string"?t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Do=t=>t(),Wr=(t,e,r=D.duration)=>new Proxy({animations:t.map(Do).filter(Boolean),duration:r,options:e},jo),Uo=t=>t.animations[0],jo={get:(t,e)=>{const r=Uo(t);switch(e){case"duration":return t.duration;case"currentTime":return Re.s((r==null?void 0:r[e])||0);case"playbackRate":case"playState":return r==null?void 0:r[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Ho)).catch(Or)),t.finished;case"stop":return()=>{t.animations.forEach(i=>Pr(i))};case"forEachNative":return i=>{t.animations.forEach(o=>i(o,t))};default:return typeof(r==null?void 0:r[e])>"u"?void 0:()=>t.animations.forEach(i=>i[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=Re.ms(r);case"playbackRate":for(let i=0;it.finished;function Bo(t,e,r){return xe(t)?t(e,r):t}function Zo(t){return function(r,i,o={}){r=No(r);const n=r.length,a=[];for(let s=0;s{const r=new Rr(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ne(t,e,r){return(xe(t)?Vo:zo)(t,e,r)}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const L=t=>t??M;var Fo=Object.defineProperty,lr=Object.getOwnPropertySymbols,qo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,cr=(t,e,r)=>e in t?Fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mt=(t,e)=>{for(var r in e||(e={}))qo.call(e,r)&&cr(t,r,e[r]);if(lr)for(var r of lr(e))Ko.call(e,r)&&cr(t,r,e[r]);return t};function Go(){var t;const e=(t=fe.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function dr(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const v={getPreset(t){return dr()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=fe.state;if(t){const r=mt(mt(mt({},Go()),dr()),e);Object.entries(r).forEach(([i,o])=>t.style.setProperty(i,o))}},globalCss:C`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},Qo=C`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var Yo=Object.defineProperty,Xo=Object.getOwnPropertyDescriptor,ce=(t,e,r,i)=>{for(var o=i>1?void 0:i?Xo(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Yo(e,r,o),o};let V=class extends w{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),l``}};V.styles=[v.globalCss,Qo],ce([p({type:Boolean})],V.prototype,"disabled",2),ce([p()],V.prototype,"iconLeft",2),ce([p()],V.prototype,"iconRight",2),ce([p()],V.prototype,"onClick",2),ce([p()],V.prototype,"variant",2),V=ce([y("wcm-button")],V);const Jo=C`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var ei=Object.defineProperty,ti=Object.getOwnPropertyDescriptor,pt=(t,e,r,i)=>{for(var o=i>1?void 0:i?ti(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ei(e,r,o),o};let Ae=class extends w{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"wcm-secondary":this.variant==="secondary"};return l``}};Ae.styles=[v.globalCss,Jo],pt([p({type:Boolean})],Ae.prototype,"disabled",2),pt([p()],Ae.prototype,"variant",2),Ae=pt([y("wcm-button-big")],Ae);const ri=C`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var oi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let ut=class extends w{render(){return l`
`}};ut.styles=[v.globalCss,ri],ut=oi([y("wcm-info-footer")],ut);const A={CROSS_ICON:E``,WALLET_CONNECT_LOGO:E``,WALLET_CONNECT_ICON:E``,WALLET_CONNECT_ICON_COLORED:E``,BACK_ICON:E``,COPY_ICON:E``,RETRY_ICON:E``,DESKTOP_ICON:E``,MOBILE_ICON:E``,ARROW_DOWN_ICON:E``,ARROW_UP_RIGHT_ICON:E``,ARROW_RIGHT_ICON:E``,QRCODE_ICON:E``,SCAN_ICON:E``,CHECKMARK_ICON:E``,SEARCH_ICON:E``,WALLET_PLACEHOLDER:E``,GLOBE_ICON:E``},ii=C`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var ni=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let gt=class extends w{render(){return l`
${A.WALLET_CONNECT_LOGO}
`}};gt.styles=[v.globalCss,ii],gt=ni([y("wcm-modal-backcard")],gt);const ai=C`main{padding:20px;padding-top:0;width:100%}`;var si=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let wt=class extends w{render(){return l`
`}};wt.styles=[v.globalCss,ai],wt=si([y("wcm-modal-content")],wt);const li=C`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var ci=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let vt=class extends w{render(){return l`
`}};vt.styles=[v.globalCss,li],vt=ci([y("wcm-modal-footer")],vt);const di=C`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var hi=Object.defineProperty,mi=Object.getOwnPropertyDescriptor,_e=(t,e,r,i)=>{for(var o=i>1?void 0:i?mi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&hi(e,r,o),o};let te=class extends w{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return l``}actionBtnTemplate(){return l``}render(){const t={"wcm-border":this.border},e=k.state.history.length>1,r=this.title?l`${this.title}`:l``;return l`
${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};te.styles=[v.globalCss,di],_e([p()],te.prototype,"title",2),_e([p()],te.prototype,"onAction",2),_e([p()],te.prototype,"actionIcon",2),_e([p({type:Boolean})],te.prototype,"border",2),te=_e([y("wcm-modal-header")],te);const h={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=ae.state;return r!=null&&r[t]?r[t]:e?P.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},isMobileAnimation(){return window.innerWidth<=h.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,i)=>{const o=new Image;o.onload=r,o.onerror=i,o.crossOrigin="anonymous",o.src=t});return Promise.race([e,g.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...i)=>{function o(){t(...i)}r&&clearTimeout(r),r=setTimeout(o,e)}},handleMobileLinking(t){const{walletConnectUri:e}=H.state,{mobile:r,name:i}=t,o=r==null?void 0:r.native,n=r==null?void 0:r.universal;h.setRecentWallet(t);function a(s){let c="";o?c=g.formatUniversalUrl(o,s,i):n&&(c=g.formatNativeUrl(n,s,i)),g.openHref(c,"_self")}e&&a(e)},handleAndroidLinking(){const{walletConnectUri:t}=H.state;t&&(g.setWalletConnectAndroidDeepLink(t),g.openHref(t,"_self"))},async handleUriCopy(){const{walletConnectUri:t}=H.state;if(t)try{await navigator.clipboard.writeText(t),Q.openToast("Link copied","success")}catch{Q.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:t}=ae.state,e=Object.values(t??{});return Object.values(e)},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},setRecentWallet(t){try{localStorage.setItem(h.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(h.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){g.openHref(h.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:t,mobile:e}=g.getWalletRouterData(),r=!!(t!=null&&t.native),i=!!(t!=null&&t.universal),o=!!(e!=null&&e.native)||!!(e!=null&&e.universal);return{isDesktop:r,isMobile:o,isWeb:i}},goToConnectingView(t){k.setData({Wallet:t});const e=g.isMobile(),{isDesktop:r,isWeb:i,isMobile:o}=h.getCachedRouterWalletPlatforms();e?o?k.push("MobileConnecting"):i?k.push("WebConnecting"):k.push("InstallWallet"):r?k.push("DesktopConnecting"):i?k.push("WebConnecting"):o?k.push("MobileQrcodeConnecting"):k.push("InstallWallet")}},pi=C`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var ui=Object.defineProperty,gi=Object.getOwnPropertyDescriptor,ft=(t,e,r,i)=>{for(var o=i>1?void 0:i?gi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ui(e,r,o),o};let Ee=class extends w{constructor(){super(),this.view=k.state.view,this.prevView=k.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=k.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&ne(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return h.getShadowRootElement(this,".wcm-router")}get contentEl(){return h.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return l``;case"DesktopConnecting":return l``;case"MobileConnecting":return l``;case"WebConnecting":return l``;case"MobileQrcodeConnecting":return l``;case"WalletExplorer":return l``;case"Qrcode":return l``;case"InstallWallet":return l``;default:return l`
Not Found
`}}async onChangeRoute(){await ne(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=k.state.view,ne(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return l`
${this.viewTemplate()}
`}};Ee.styles=[v.globalCss,pi],ft([W()],Ee.prototype,"view",2),ft([W()],Ee.prototype,"prevView",2),Ee=ft([y("wcm-modal-router")],Ee);const wi=C`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var vi=Object.defineProperty,fi=Object.getOwnPropertyDescriptor,hr=(t,e,r,i)=>{for(var o=i>1?void 0:i?fi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&vi(e,r,o),o};let He=class extends w{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Q.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Q.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Q.closeToast()}render(){const{message:t,variant:e}=Q.state,r={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?l`
${e==="success"?A.CHECKMARK_ICON:null} ${e==="error"?A.CROSS_ICON:null}${t}
`:null}};He.styles=[v.globalCss,wi],hr([W()],He.prototype,"open",2),He=hr([y("wcm-modal-toast")],He);const bi=.1,mr=2.5,B=7;function bt(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+bi}function yi(t,e){const r=Array.prototype.slice.call(Ur.create(t,{errorCorrectionLevel:e}).modules.data,0),i=Math.sqrt(r.length);return r.reduce((o,n,a)=>(a%i===0?o.push([n]):o[o.length-1].push(n))&&o,[])}const xi={generate(t,e,r){const i="#141414",o="#ffffff",n=[],a=yi(t,"Q"),s=e/a.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:f,y:u})=>{const I=(a.length-B)*s*f,b=(a.length-B)*s*u,R=.45;for(let S=0;S`)}});const d=Math.floor((r+25)/s),x=a.length/2-d/2,$=a.length/2+d/2-1,m=[];a.forEach((f,u)=>{f.forEach((I,b)=>{if(a[u][b]&&!(ua.length-(B+1)&&ba.length-(B+1))&&!(u>x&&u<$&&b>x&&b<$)){const R=u*s+s/2,S=b*s+s/2;m.push([R,S])}})});const _={};return m.forEach(([f,u])=>{_[f]?_[f].push(u):_[f]=[u]}),Object.entries(_).map(([f,u])=>{const I=u.filter(b=>u.every(R=>!bt(b,R,s)));return[Number(f),I]}).forEach(([f,u])=>{u.forEach(I=>{n.push(E``)})}),Object.entries(_).filter(([f,u])=>u.length>1).map(([f,u])=>{const I=u.filter(b=>u.some(R=>bt(b,R,s)));return[Number(f),I]}).map(([f,u])=>{u.sort((b,R)=>bS.some(N=>bt(b,N,s)));R?R.push(b):I.push([b])}return[f,I.map(b=>[b[0],b[b.length-1]])]}).forEach(([f,u])=>{u.forEach(([I,b])=>{n.push(E``)})}),n}},$i=C`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var Ci=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,de=(t,e,r,i)=>{for(var o=i>1?void 0:i?Ai(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ci(e,r,o),o};let F=class extends w{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=fe.state.themeMode==="light"?this.size:this.size-36;return E`${xi.generate(this.uri,t,t/4)}`}render(){const t={"wcm-dark":fe.state.themeMode==="dark"};return l`
${this.walletId||this.imageUrl?l``:A.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};F.styles=[v.globalCss,$i],de([p()],F.prototype,"uri",2),de([p({type:Number})],F.prototype,"size",2),de([p()],F.prototype,"imageId",2),de([p()],F.prototype,"walletId",2),de([p()],F.prototype,"imageUrl",2),F=de([y("wcm-qrcode")],F);const _i=C`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var Ei=Object.defineProperty,ki=Object.getOwnPropertyDescriptor,pr=(t,e,r,i)=>{for(var o=i>1?void 0:i?ki(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ei(e,r,o),o};let Be=class extends w{constructor(){super(...arguments),this.onChange=()=>null}render(){return l` ${A.SEARCH_ICON}`}};Be.styles=[v.globalCss,_i],pr([p()],Be.prototype,"onChange",2),Be=pr([y("wcm-search-input")],Be);const Oi=C`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var Ii=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let yt=class extends w{render(){return l``}};yt.styles=[v.globalCss,Oi],yt=Ii([y("wcm-spinner")],yt);const Ti=C`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var Mi=Object.defineProperty,Ri=Object.getOwnPropertyDescriptor,xt=(t,e,r,i)=>{for(var o=i>1?void 0:i?Ri(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Mi(e,r,o),o};let ke=class extends w{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return l``}};ke.styles=[v.globalCss,Ti],xt([p()],ke.prototype,"variant",2),xt([p()],ke.prototype,"color",2),ke=xt([y("wcm-text")],ke);const Si=C`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var Li=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,q=(t,e,r,i)=>{for(var o=i>1?void 0:i?Pi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Li(e,r,o),o};let j=class extends w{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?l`RECENT`:this.installed?l`INSTALLED`:null}handleClick(){Dr.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return l``}};j.styles=[v.globalCss,Si],q([p()],j.prototype,"onClick",2),q([p()],j.prototype,"name",2),q([p()],j.prototype,"walletId",2),q([p()],j.prototype,"label",2),q([p()],j.prototype,"imageId",2),q([p({type:Boolean})],j.prototype,"installed",2),q([p({type:Boolean})],j.prototype,"recent",2),j=q([y("wcm-wallet-button")],j);const Wi=C`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Ni=Object.defineProperty,Di=Object.getOwnPropertyDescriptor,Ze=(t,e,r,i)=>{for(var o=i>1?void 0:i?Di(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ni(e,r,o),o};let he=class extends w{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:h.getWalletIcon({id:this.walletId,image_id:this.imageId});return l`${e.length?l`
${this.id}
`:A.WALLET_PLACEHOLDER}`}};he.styles=[v.globalCss,Wi],Ze([p()],he.prototype,"walletId",2),Ze([p()],he.prototype,"imageId",2),Ze([p()],he.prototype,"imageUrl",2),he=Ze([y("wcm-wallet-image")],he);var Ui=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,ur=(t,e,r,i)=>{for(var o=i>1?void 0:i?ji(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ui(e,r,o),o};let $t=class extends w{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>h.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(ae.state.enableExplorer){await P.getRecomendedWallets(),H.setIsDataLoaded(!0);const{recomendedWallets:t}=P.state,e=t.map(r=>h.getWalletIcon(r));await this.loadImages(e)}else H.setIsDataLoaded(!0)}async preloadCustomImages(){const t=h.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),Q.openToast("Failed preloading","error")}}};ur([W()],$t.prototype,"preload",2),$t=ur([y("wcm-explorer-context")],$t);var Hi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let gr=class extends w{constructor(){super(),this.unsubscribeTheme=void 0,v.setTheme(),this.unsubscribeTheme=fe.subscribe(v.setTheme)}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}};gr=Hi([y("wcm-theme-context")],gr);const Bi=C`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Zi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Ct=class extends w{onGoToQrcode(){k.push("Qrcode")}render(){const{recomendedWallets:t}=P.state,e=[...t,...t],r=g.RECOMMENDED_WALLET_AMOUNT*2;return l`
${A.MOBILE_ICON}WalletConnect
${[...Array(r)].map((i,o)=>{const n=e[o%e.length];return n?l``:A.WALLET_PLACEHOLDER})}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};Ct.styles=[v.globalCss,Bi],Ct=Zi([y("wcm-android-wallet-selection")],Ct);const zi=C`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var Vi=Object.defineProperty,Fi=Object.getOwnPropertyDescriptor,me=(t,e,r,i)=>{for(var o=i>1?void 0:i?Fi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Vi(e,r,o),o};let K=class extends w{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=fe.state.themeVariables)==null?void 0:t["--wcm-wallet-icon-large-border-radius"])!=null?e:v.getPreset("--wcm-wallet-icon-large-border-radius");let i=0;r.includes("%")?i=88/100*parseInt(r,10):i=parseInt(r,10),i*=1.17;const o=317-i*1.57,n=425-i*1.8;return l``}render(){const t={"wcm-error":this.isError,"wcm-stale":this.isStale};return l`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};K.styles=[v.globalCss,zi],me([p()],K.prototype,"walletId",2),me([p()],K.prototype,"imageId",2),me([p({type:Boolean})],K.prototype,"isError",2),me([p({type:Boolean})],K.prototype,"isStale",2),me([p()],K.prototype,"label",2),K=me([y("wcm-connector-waiting")],K);const ve={manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:i}=ae.state,o=(t=ve.recentWallet())==null?void 0:t.id,n=g.isMobile()?r:i,a=n==null?void 0:n.filter(s=>o!==s.id);return(e=g.isMobile()?a==null?void 0:a.map(({id:s,name:c,links:d})=>({id:s,name:c,mobile:d,links:d})):a==null?void 0:a.map(({id:s,name:c,links:d})=>({id:s,name:c,desktop:d,links:d})))!=null?e:[]},recentWallet(){return h.getRecentWallet()},recomendedWallets(t=!1){var e;const r=t||(e=ve.recentWallet())==null?void 0:e.id,{recomendedWallets:i}=P.state;return i.filter(o=>r!==o.id)}},X={onConnecting(t){h.goToConnectingView(t)},manualWalletsTemplate(){return ve.manualWallets().map(t=>l``)},recomendedWalletsTemplate(t=!1){return ve.recomendedWallets(t).map(e=>l``)},recentWalletTemplate(){const t=ve.recentWallet();if(t)return l``}},qi=C`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var Ki=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let At=class extends w{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=ae.state,r=t!=="ALL"&&e,i=X.manualWalletsTemplate(),o=X.recomendedWalletsTemplate();let n=[X.recentWalletTemplate(),...i,...o];n=n.filter(Boolean);const a=n.length>4||r;let s=[];a?s=n.slice(0,3):s=n;const c=!!s.length;return l`
${A.MOBILE_ICON}Mobile
${A.SCAN_ICON}Scan with your wallet
${c?l`
${A.DESKTOP_ICON}Desktop
${s} ${a?l``:null}
`:null}`}};At.styles=[v.globalCss,qi],At=Ki([y("wcm-desktop-wallet-selection")],At);const Gi=C`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var Qi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let _t=class extends w{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=ae.state;return t??e?l`
By connecting your wallet to this app, you agree to the app's ${t?l`Terms of Service`:null} ${t&&e?"and":null} ${e?l`Privacy Policy`:null}
`:null}};_t.styles=[v.globalCss,Gi],_t=Qi([y("wcm-legal-notice")],_t);const Yi=C`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var Xi=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Et=class extends w{onQrcode(){k.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=ae.state,r=t!=="ALL"&&e,i=X.manualWalletsTemplate(),o=X.recomendedWalletsTemplate();let n=[X.recentWalletTemplate(),...i,...o];n=n.filter(Boolean);const a=n.length>8||r;let s=[];a?s=n.slice(0,7):s=n;const c=!!s.length;return l`${c?l`
${s} ${a?l``:null}
`:null}`}};Et.styles=[v.globalCss,Yi],Et=Xi([y("wcm-mobile-wallet-selection")],Et);const Ji=C`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,kt=(t,e,r,i)=>{for(var o=i>1?void 0:i?tn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&en(e,r,o),o};let Oe=class extends w{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Ke.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return h.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return h.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){if(document.querySelector("body"))if(t){const e=document.getElementById("wcm-styles");e==null||e.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(t){t.target===t.currentTarget&&Ke.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=h.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([ne(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,ne(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=h.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([ne(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,ne(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Ke.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"wcm-overlay":!0,"wcm-active":this.active};return l`
${this.open?l`
`:null}
`}};Oe.styles=[v.globalCss,Ji],kt([W()],Oe.prototype,"open",2),kt([W()],Oe.prototype,"active",2),Oe=kt([y("wcm-modal")],Oe);const rn=C`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var on=Object.defineProperty,nn=Object.getOwnPropertyDescriptor,Ie=(t,e,r,i)=>{for(var o=i>1?void 0:i?nn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&on(e,r,o),o};let re=class extends w{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){g.isMobile()?k.replace("MobileConnecting"):k.replace("MobileQrcodeConnecting")}onDesktop(){k.replace("DesktopConnecting")}onWeb(){k.replace("WebConnecting")}render(){return l`
${this.isRetry?l``:null} ${this.isMobile?l`Mobile`:null} ${this.isDesktop?l`Desktop`:null} ${this.isWeb?l`Web`:null}
`}};re.styles=[v.globalCss,rn],Ie([p({type:Boolean})],re.prototype,"isMobile",2),Ie([p({type:Boolean})],re.prototype,"isDesktop",2),Ie([p({type:Boolean})],re.prototype,"isWeb",2),Ie([p({type:Boolean})],re.prototype,"isRetry",2),re=Ie([y("wcm-platform-selection")],re);const an=C`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var sn=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Ot=class extends w{onClick(){k.push("WalletExplorer")}render(){const{recomendedWallets:t}=P.state,e=ve.manualWallets(),r=[...t,...e].reverse().slice(0,4);return l``}};Ot.styles=[v.globalCss,an],Ot=sn([y("wcm-view-all-wallets-button")],Ot);const ln=C`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var cn=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,ze=(t,e,r,i)=>{for(var o=i>1?void 0:i?dn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&cn(e,r,o),o};let pe=class extends w{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:t}=H.state;this.uri=t},0)}get overlayEl(){return h.getShadowRootElement(this,".wcm-qr-container")}render(){return l`
${this.uri?l``:l``}
`}};pe.styles=[v.globalCss,ln],ze([p()],pe.prototype,"walletId",2),ze([p()],pe.prototype,"imageId",2),ze([W()],pe.prototype,"uri",2),pe=ze([y("wcm-walletconnect-qr")],pe);var hn=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let It=class extends w{viewTemplate(){return g.isAndroid()?l``:g.isMobile()?l``:l``}render(){return l`${this.viewTemplate()}`}};It.styles=[v.globalCss],It=hn([y("wcm-connect-wallet-view")],It);const mn=C`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var pn=Object.defineProperty,un=Object.getOwnPropertyDescriptor,wr=(t,e,r,i)=>{for(var o=i>1?void 0:i?un(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&pn(e,r,o),o};let Ve=class extends w{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){const{desktop:e,name:r}=g.getWalletRouterData(),i=e==null?void 0:e.native;if(i){const o=g.formatNativeUrl(i,t,r);g.openHref(o,"_self")}}openDesktopApp(){const{walletConnectUri:t}=H.state,e=g.getWalletRouterData();h.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=g.getWalletRouterData(),{isMobile:i,isWeb:o}=h.getCachedRouterWalletPlatforms();return l`${`Connection can continue loading if ${t} is not installed on your device`}Retry`}};Ve.styles=[v.globalCss,mn],wr([W()],Ve.prototype,"isError",2),Ve=wr([y("wcm-desktop-connecting-view")],Ve);const gn=C`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var wn=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Tt=class extends w{onInstall(t){t&&g.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:i}=g.getWalletRouterData();return l`${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}Download`}};Tt.styles=[v.globalCss,gn],Tt=wn([y("wcm-install-wallet-view")],Tt);const vn=C`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var fn=Object.defineProperty,bn=Object.getOwnPropertyDescriptor,vr=(t,e,r,i)=>{for(var o=i>1?void 0:i?bn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&fn(e,r,o),o};let Fe=class extends w{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){const{mobile:r,name:i}=g.getWalletRouterData(),o=r==null?void 0:r.native,n=r==null?void 0:r.universal;if(o&&!e){const a=g.formatNativeUrl(o,t,i);g.openHref(a,"_self")}else if(n){const a=g.formatUniversalUrl(n,t,i);g.openHref(a,"_self")}}openMobileApp(t=!1){const{walletConnectUri:e}=H.state,r=g.getWalletRouterData();h.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&g.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:i,mobile:o}=g.getWalletRouterData(),{isWeb:n}=h.getCachedRouterWalletPlatforms(),a=i==null?void 0:i.ios,s=o==null?void 0:o.universal;return l`Retry${s?l`Still doesn't work? Try this alternate link`:null}
${`Get ${t}`}
App Store
`}};Fe.styles=[v.globalCss,vn],vr([W()],Fe.prototype,"isError",2),Fe=vr([y("wcm-mobile-connecting-view")],Fe);const yn=C`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var xn=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Mt=class extends w{render(){const{name:t,id:e,image_id:r}=g.getWalletRouterData(),{isDesktop:i,isWeb:o}=h.getCachedRouterWalletPlatforms();return l`${`Scan this QR Code with your phone's camera or inside ${t} app`}`}};Mt.styles=[v.globalCss,yn],Mt=xn([y("wcm-mobile-qr-connecting-view")],Mt);var $n=(t,e,r,i)=>{for(var o=e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=a(o)||o);return o};let Rt=class extends w{render(){return l``}};Rt.styles=[v.globalCss],Rt=$n([y("wcm-qrcode-view")],Rt);const Cn=C`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var An=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,Te=(t,e,r,i)=>{for(var o=i>1?void 0:i?_n(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&An(e,r,o),o};const St=40;let oe=class extends w{constructor(){super(...arguments),this.loading=!P.state.wallets.listings.length,this.firstFetch=!P.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=h.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,P.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),P.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return h.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=P.state,{listings:r,total:i}=this.search?e:t;return i<=St||r.length>=i}async fetchWallets(){var t;const{wallets:e,search:r}=P.state,{listings:i,total:o,page:n}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>St&&i.lengthh.getWalletIcon(d));await Promise.all([...c.map(async d=>h.preloadImage(d)),g.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),Q.openToast(h.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){g.isAndroid()?h.handleMobileLinking(t):h.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=P.state,{listings:r}=this.search?e:t,i=this.loading&&!r.length,o=this.search.length>=3;let n=X.manualWalletsTemplate(),a=X.recomendedWalletsTemplate(!0);o&&(n=n.filter(({values:d})=>h.caseSafeIncludes(d[0],this.search)),a=a.filter(({values:d})=>h.caseSafeIncludes(d[0],this.search)));const s=!this.loading&&!r.length&&!a.length,c={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":s};return l`
${i?null:n} ${i?null:a} ${i?null:r.map(d=>l`${d?l``:null}`)}
${s?l`No results found`:null} ${!s&&this.loading?l``:null}
`}};oe.styles=[v.globalCss,Cn],Te([W()],oe.prototype,"loading",2),Te([W()],oe.prototype,"firstFetch",2),Te([W()],oe.prototype,"search",2),Te([W()],oe.prototype,"endReached",2),oe=Te([y("wcm-wallet-explorer-view")],oe);const En=C`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var kn=Object.defineProperty,On=Object.getOwnPropertyDescriptor,fr=(t,e,r,i)=>{for(var o=i>1?void 0:i?On(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&kn(e,r,o),o};let qe=class extends w{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){const{desktop:e,name:r}=g.getWalletRouterData(),i=e==null?void 0:e.universal;if(i){const o=g.formatUniversalUrl(i,t,r);g.openHref(o,"_blank")}}openWebWallet(){const{walletConnectUri:t}=H.state,e=g.getWalletRouterData();h.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=g.getWalletRouterData(),{isMobile:i,isDesktop:o}=h.getCachedRouterWalletPlatforms(),n=g.isMobile();return l`${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};qe.styles=[v.globalCss,En],fr([W()],qe.prototype,"isError",2),qe=fr([y("wcm-web-connecting-view")],qe);export{Oe as WcmModal,F as WcmQrCode}; diff --git a/_app/immutable/chunks/index.CADO_LNH.js b/_app/immutable/chunks/index.CADO_LNH.js new file mode 100644 index 0000000..4e66b8a --- /dev/null +++ b/_app/immutable/chunks/index.CADO_LNH.js @@ -0,0 +1,7 @@ +import{aH as La,aI as Ho,aJ as J,aK as gn,aL as Fn,aM as Fi,aN as dd}from"./2.CpRWH4-H.js";function fd(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const pd=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:La,default:La},Symbol.toStringTag,{value:"Module"}));var Uo={},On={},ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.walletLogo=void 0;const gd=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};ji.walletLogo=gd;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.LINK_API_URL=void 0;Hi.LINK_API_URL="https://www.walletlink.org";var z={},Wo={exports:{}};Wo.exports;(function(e){(function(t,r){function n(v,a){if(!v)throw new Error(a||"Assertion failed")}function i(v,a){v.super_=a;var d=function(){};d.prototype=a.prototype,v.prototype=new d,v.prototype.constructor=v}function s(v,a,d){if(s.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((a==="le"||a==="be")&&(d=a,a=10),this._init(v||0,a||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ho.Buffer}catch{}s.isBN=function(a){return a instanceof s?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,d){return a.cmp(d)>0?a:d},s.min=function(a,d){return a.cmp(d)<0?a:d},s.prototype._init=function(a,d,g){if(typeof a=="number")return this._initNumber(a,d,g);if(typeof a=="object")return this._initArray(a,d,g);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),a=a.toString().replace(/\s+/g,"");var m=0;a[0]==="-"&&(m++,this.negative=1),m=0;m-=3)M=a[m]|a[m-1]<<8|a[m-2]<<16,this.words[y]|=M<>>26-A&67108863,A+=24,A>=26&&(A-=26,y++);else if(g==="le")for(m=0,y=0;m>>26-A&67108863,A+=24,A>=26&&(A-=26,y++);return this._strip()};function c(v,a){var d=v.charCodeAt(a);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+v)}function u(v,a,d){var g=c(v,d);return d-1>=a&&(g|=c(v,d-1)<<4),g}s.prototype._parseHex=function(a,d,g){this.length=Math.ceil((a.length-d)/6),this.words=new Array(this.length);for(var m=0;m=d;m-=2)A=u(a,d,m)<=18?(y-=18,M+=1,this.words[M]|=A>>>26):y+=8;else{var b=a.length-d;for(m=b%2===0?d+1:d;m=18?(y-=18,M+=1,this.words[M]|=A>>>26):y+=8}this._strip()};function l(v,a,d,g){for(var m=0,y=0,M=Math.min(v.length,d),A=a;A=49?y=b-49+10:b>=17?y=b-17+10:y=b,n(b>=0&&y1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],R=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(a,d){a=a||10,d=d|0||1;var g;if(a===16||a==="hex"){g="";for(var m=0,y=0,M=0;M>>24-m&16777215,m+=2,m>=26&&(m-=26,M--),y!==0||M!==this.length-1?g=_[6-b.length]+b+g:g=b+g}for(y!==0&&(g=y.toString(16)+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(a===(a|0)&&a>=2&&a<=36){var h=R[a],S=x[a];g="";var W=this.clone();for(W.negative=0;!W.isZero();){var q=W.modrn(S).toString(a);W=W.idivn(S),W.isZero()?g=q+g:g=_[h-q.length]+q+g}for(this.isZero()&&(g="0"+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(a,d){return this.toArrayLike(o,a,d)}),s.prototype.toArray=function(a,d){return this.toArrayLike(Array,a,d)};var P=function(a,d){return a.allocUnsafe?a.allocUnsafe(d):new a(d)};s.prototype.toArrayLike=function(a,d,g){this._strip();var m=this.byteLength(),y=g||Math.max(1,m);n(m<=y,"byte array longer than desired length"),n(y>0,"Requested array length <= 0");var M=P(a,y),A=d==="le"?"LE":"BE";return this["_toArrayLike"+A](M,m),M},s.prototype._toArrayLikeLE=function(a,d){for(var g=0,m=0,y=0,M=0;y>8&255),g>16&255),M===6?(g>24&255),m=0,M=0):(m=A>>>24,M+=2)}if(g=0&&(a[g--]=A>>8&255),g>=0&&(a[g--]=A>>16&255),M===6?(g>=0&&(a[g--]=A>>24&255),m=0,M=0):(m=A>>>24,M+=2)}if(g>=0)for(a[g--]=m;g>=0;)a[g--]=0},Math.clz32?s.prototype._countBits=function(a){return 32-Math.clz32(a)}:s.prototype._countBits=function(a){var d=a,g=0;return d>=4096&&(g+=13,d>>>=13),d>=64&&(g+=7,d>>>=7),d>=8&&(g+=4,d>>>=4),d>=2&&(g+=2,d>>>=2),g+d},s.prototype._zeroBits=function(a){if(a===0)return 26;var d=a,g=0;return d&8191||(g+=13,d>>>=13),d&127||(g+=7,d>>>=7),d&15||(g+=4,d>>>=4),d&3||(g+=2,d>>>=2),d&1||g++,g},s.prototype.bitLength=function(){var a=this.words[this.length-1],d=this._countBits(a);return(this.length-1)*26+d};function L(v){for(var a=new Array(v.bitLength()),d=0;d>>m&1}return a}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,d=0;da.length?this.clone().ior(a):a.clone().ior(this)},s.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},s.prototype.iuand=function(a){var d;this.length>a.length?d=a:d=this;for(var g=0;ga.length?this.clone().iand(a):a.clone().iand(this)},s.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},s.prototype.iuxor=function(a){var d,g;this.length>a.length?(d=this,g=a):(d=a,g=this);for(var m=0;ma.length?this.clone().ixor(a):a.clone().ixor(this)},s.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a=="number"&&a>=0);var d=Math.ceil(a/26)|0,g=a%26;this._expand(d),g>0&&d--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-g),this._strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,d){n(typeof a=="number"&&a>=0);var g=a/26|0,m=a%26;return this._expand(g+1),d?this.words[g]=this.words[g]|1<a.length?(g=this,m=a):(g=a,m=this);for(var y=0,M=0;M>>26;for(;y!==0&&M>>26;if(this.length=g.length,y!==0)this.words[this.length]=y,this.length++;else if(g!==this)for(;Ma.length?this.clone().iadd(a):a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var d=this.iadd(a);return a.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var g=this.cmp(a);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;g>0?(m=this,y=a):(m=a,y=this);for(var M=0,A=0;A>26,this.words[A]=d&67108863;for(;M!==0&&A>26,this.words[A]=d&67108863;if(M===0&&A>>26,W=b&67108863,q=Math.min(h,a.length-1),I=Math.max(0,h-v.length+1);I<=q;I++){var T=h-I|0;m=v.words[T]|0,y=a.words[I]|0,M=m*y+W,S+=M/67108864|0,W=M&67108863}d.words[h]=W|0,b=S|0}return b!==0?d.words[h]=b|0:d.length--,d._strip()}var k=function(a,d,g){var m=a.words,y=d.words,M=g.words,A=0,b,h,S,W=m[0]|0,q=W&8191,I=W>>>13,T=m[1]|0,B=T&8191,U=T>>>13,te=m[2]|0,w=te&8191,E=te>>>13,F=m[3]|0,j=F&8191,K=F>>>13,ee=m[4]|0,Z=ee&8191,le=ee>>>13,Ct=m[5]|0,ge=Ct&8191,_e=Ct>>>13,Vt=m[6]|0,de=Vt&8191,fe=Vt>>>13,Pt=m[7]|0,he=Pt&8191,ue=Pt>>>13,ct=m[8]|0,me=ct&8191,ve=ct>>>13,Or=m[9]|0,be=Or&8191,ye=Or>>>13,Pr=y[0]|0,we=Pr&8191,Ee=Pr>>>13,$r=y[1]|0,Se=$r&8191,Re=$r>>>13,Br=y[2]|0,Ce=Br&8191,Me=Br>>>13,Dr=y[3]|0,ke=Dr&8191,Ie=Dr>>>13,Fr=y[4]|0,xe=Fr&8191,Ae=Fr>>>13,jr=y[5]|0,Te=jr&8191,Ne=jr>>>13,Hr=y[6]|0,Le=Hr&8191,Oe=Hr>>>13,Ur=y[7]|0,Pe=Ur&8191,$e=Ur>>>13,Wr=y[8]|0,Be=Wr&8191,De=Wr>>>13,Vr=y[9]|0,Fe=Vr&8191,je=Vr>>>13;g.negative=a.negative^d.negative,g.length=19,b=Math.imul(q,we),h=Math.imul(q,Ee),h=h+Math.imul(I,we)|0,S=Math.imul(I,Ee);var Qt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul(B,we),h=Math.imul(B,Ee),h=h+Math.imul(U,we)|0,S=Math.imul(U,Ee),b=b+Math.imul(q,Se)|0,h=h+Math.imul(q,Re)|0,h=h+Math.imul(I,Se)|0,S=S+Math.imul(I,Re)|0;var Yt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b=Math.imul(w,we),h=Math.imul(w,Ee),h=h+Math.imul(E,we)|0,S=Math.imul(E,Ee),b=b+Math.imul(B,Se)|0,h=h+Math.imul(B,Re)|0,h=h+Math.imul(U,Se)|0,S=S+Math.imul(U,Re)|0,b=b+Math.imul(q,Ce)|0,h=h+Math.imul(q,Me)|0,h=h+Math.imul(I,Ce)|0,S=S+Math.imul(I,Me)|0;var Xt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,b=Math.imul(j,we),h=Math.imul(j,Ee),h=h+Math.imul(K,we)|0,S=Math.imul(K,Ee),b=b+Math.imul(w,Se)|0,h=h+Math.imul(w,Re)|0,h=h+Math.imul(E,Se)|0,S=S+Math.imul(E,Re)|0,b=b+Math.imul(B,Ce)|0,h=h+Math.imul(B,Me)|0,h=h+Math.imul(U,Ce)|0,S=S+Math.imul(U,Me)|0,b=b+Math.imul(q,ke)|0,h=h+Math.imul(q,Ie)|0,h=h+Math.imul(I,ke)|0,S=S+Math.imul(I,Ie)|0;var er=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(er>>>26)|0,er&=67108863,b=Math.imul(Z,we),h=Math.imul(Z,Ee),h=h+Math.imul(le,we)|0,S=Math.imul(le,Ee),b=b+Math.imul(j,Se)|0,h=h+Math.imul(j,Re)|0,h=h+Math.imul(K,Se)|0,S=S+Math.imul(K,Re)|0,b=b+Math.imul(w,Ce)|0,h=h+Math.imul(w,Me)|0,h=h+Math.imul(E,Ce)|0,S=S+Math.imul(E,Me)|0,b=b+Math.imul(B,ke)|0,h=h+Math.imul(B,Ie)|0,h=h+Math.imul(U,ke)|0,S=S+Math.imul(U,Ie)|0,b=b+Math.imul(q,xe)|0,h=h+Math.imul(q,Ae)|0,h=h+Math.imul(I,xe)|0,S=S+Math.imul(I,Ae)|0;var tr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(ge,we),h=Math.imul(ge,Ee),h=h+Math.imul(_e,we)|0,S=Math.imul(_e,Ee),b=b+Math.imul(Z,Se)|0,h=h+Math.imul(Z,Re)|0,h=h+Math.imul(le,Se)|0,S=S+Math.imul(le,Re)|0,b=b+Math.imul(j,Ce)|0,h=h+Math.imul(j,Me)|0,h=h+Math.imul(K,Ce)|0,S=S+Math.imul(K,Me)|0,b=b+Math.imul(w,ke)|0,h=h+Math.imul(w,Ie)|0,h=h+Math.imul(E,ke)|0,S=S+Math.imul(E,Ie)|0,b=b+Math.imul(B,xe)|0,h=h+Math.imul(B,Ae)|0,h=h+Math.imul(U,xe)|0,S=S+Math.imul(U,Ae)|0,b=b+Math.imul(q,Te)|0,h=h+Math.imul(q,Ne)|0,h=h+Math.imul(I,Te)|0,S=S+Math.imul(I,Ne)|0;var rr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(rr>>>26)|0,rr&=67108863,b=Math.imul(de,we),h=Math.imul(de,Ee),h=h+Math.imul(fe,we)|0,S=Math.imul(fe,Ee),b=b+Math.imul(ge,Se)|0,h=h+Math.imul(ge,Re)|0,h=h+Math.imul(_e,Se)|0,S=S+Math.imul(_e,Re)|0,b=b+Math.imul(Z,Ce)|0,h=h+Math.imul(Z,Me)|0,h=h+Math.imul(le,Ce)|0,S=S+Math.imul(le,Me)|0,b=b+Math.imul(j,ke)|0,h=h+Math.imul(j,Ie)|0,h=h+Math.imul(K,ke)|0,S=S+Math.imul(K,Ie)|0,b=b+Math.imul(w,xe)|0,h=h+Math.imul(w,Ae)|0,h=h+Math.imul(E,xe)|0,S=S+Math.imul(E,Ae)|0,b=b+Math.imul(B,Te)|0,h=h+Math.imul(B,Ne)|0,h=h+Math.imul(U,Te)|0,S=S+Math.imul(U,Ne)|0,b=b+Math.imul(q,Le)|0,h=h+Math.imul(q,Oe)|0,h=h+Math.imul(I,Le)|0,S=S+Math.imul(I,Oe)|0;var nr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(nr>>>26)|0,nr&=67108863,b=Math.imul(he,we),h=Math.imul(he,Ee),h=h+Math.imul(ue,we)|0,S=Math.imul(ue,Ee),b=b+Math.imul(de,Se)|0,h=h+Math.imul(de,Re)|0,h=h+Math.imul(fe,Se)|0,S=S+Math.imul(fe,Re)|0,b=b+Math.imul(ge,Ce)|0,h=h+Math.imul(ge,Me)|0,h=h+Math.imul(_e,Ce)|0,S=S+Math.imul(_e,Me)|0,b=b+Math.imul(Z,ke)|0,h=h+Math.imul(Z,Ie)|0,h=h+Math.imul(le,ke)|0,S=S+Math.imul(le,Ie)|0,b=b+Math.imul(j,xe)|0,h=h+Math.imul(j,Ae)|0,h=h+Math.imul(K,xe)|0,S=S+Math.imul(K,Ae)|0,b=b+Math.imul(w,Te)|0,h=h+Math.imul(w,Ne)|0,h=h+Math.imul(E,Te)|0,S=S+Math.imul(E,Ne)|0,b=b+Math.imul(B,Le)|0,h=h+Math.imul(B,Oe)|0,h=h+Math.imul(U,Le)|0,S=S+Math.imul(U,Oe)|0,b=b+Math.imul(q,Pe)|0,h=h+Math.imul(q,$e)|0,h=h+Math.imul(I,Pe)|0,S=S+Math.imul(I,$e)|0;var ir=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ir>>>26)|0,ir&=67108863,b=Math.imul(me,we),h=Math.imul(me,Ee),h=h+Math.imul(ve,we)|0,S=Math.imul(ve,Ee),b=b+Math.imul(he,Se)|0,h=h+Math.imul(he,Re)|0,h=h+Math.imul(ue,Se)|0,S=S+Math.imul(ue,Re)|0,b=b+Math.imul(de,Ce)|0,h=h+Math.imul(de,Me)|0,h=h+Math.imul(fe,Ce)|0,S=S+Math.imul(fe,Me)|0,b=b+Math.imul(ge,ke)|0,h=h+Math.imul(ge,Ie)|0,h=h+Math.imul(_e,ke)|0,S=S+Math.imul(_e,Ie)|0,b=b+Math.imul(Z,xe)|0,h=h+Math.imul(Z,Ae)|0,h=h+Math.imul(le,xe)|0,S=S+Math.imul(le,Ae)|0,b=b+Math.imul(j,Te)|0,h=h+Math.imul(j,Ne)|0,h=h+Math.imul(K,Te)|0,S=S+Math.imul(K,Ne)|0,b=b+Math.imul(w,Le)|0,h=h+Math.imul(w,Oe)|0,h=h+Math.imul(E,Le)|0,S=S+Math.imul(E,Oe)|0,b=b+Math.imul(B,Pe)|0,h=h+Math.imul(B,$e)|0,h=h+Math.imul(U,Pe)|0,S=S+Math.imul(U,$e)|0,b=b+Math.imul(q,Be)|0,h=h+Math.imul(q,De)|0,h=h+Math.imul(I,Be)|0,S=S+Math.imul(I,De)|0;var sr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul(be,we),h=Math.imul(be,Ee),h=h+Math.imul(ye,we)|0,S=Math.imul(ye,Ee),b=b+Math.imul(me,Se)|0,h=h+Math.imul(me,Re)|0,h=h+Math.imul(ve,Se)|0,S=S+Math.imul(ve,Re)|0,b=b+Math.imul(he,Ce)|0,h=h+Math.imul(he,Me)|0,h=h+Math.imul(ue,Ce)|0,S=S+Math.imul(ue,Me)|0,b=b+Math.imul(de,ke)|0,h=h+Math.imul(de,Ie)|0,h=h+Math.imul(fe,ke)|0,S=S+Math.imul(fe,Ie)|0,b=b+Math.imul(ge,xe)|0,h=h+Math.imul(ge,Ae)|0,h=h+Math.imul(_e,xe)|0,S=S+Math.imul(_e,Ae)|0,b=b+Math.imul(Z,Te)|0,h=h+Math.imul(Z,Ne)|0,h=h+Math.imul(le,Te)|0,S=S+Math.imul(le,Ne)|0,b=b+Math.imul(j,Le)|0,h=h+Math.imul(j,Oe)|0,h=h+Math.imul(K,Le)|0,S=S+Math.imul(K,Oe)|0,b=b+Math.imul(w,Pe)|0,h=h+Math.imul(w,$e)|0,h=h+Math.imul(E,Pe)|0,S=S+Math.imul(E,$e)|0,b=b+Math.imul(B,Be)|0,h=h+Math.imul(B,De)|0,h=h+Math.imul(U,Be)|0,S=S+Math.imul(U,De)|0,b=b+Math.imul(q,Fe)|0,h=h+Math.imul(q,je)|0,h=h+Math.imul(I,Fe)|0,S=S+Math.imul(I,je)|0;var or=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(or>>>26)|0,or&=67108863,b=Math.imul(be,Se),h=Math.imul(be,Re),h=h+Math.imul(ye,Se)|0,S=Math.imul(ye,Re),b=b+Math.imul(me,Ce)|0,h=h+Math.imul(me,Me)|0,h=h+Math.imul(ve,Ce)|0,S=S+Math.imul(ve,Me)|0,b=b+Math.imul(he,ke)|0,h=h+Math.imul(he,Ie)|0,h=h+Math.imul(ue,ke)|0,S=S+Math.imul(ue,Ie)|0,b=b+Math.imul(de,xe)|0,h=h+Math.imul(de,Ae)|0,h=h+Math.imul(fe,xe)|0,S=S+Math.imul(fe,Ae)|0,b=b+Math.imul(ge,Te)|0,h=h+Math.imul(ge,Ne)|0,h=h+Math.imul(_e,Te)|0,S=S+Math.imul(_e,Ne)|0,b=b+Math.imul(Z,Le)|0,h=h+Math.imul(Z,Oe)|0,h=h+Math.imul(le,Le)|0,S=S+Math.imul(le,Oe)|0,b=b+Math.imul(j,Pe)|0,h=h+Math.imul(j,$e)|0,h=h+Math.imul(K,Pe)|0,S=S+Math.imul(K,$e)|0,b=b+Math.imul(w,Be)|0,h=h+Math.imul(w,De)|0,h=h+Math.imul(E,Be)|0,S=S+Math.imul(E,De)|0,b=b+Math.imul(B,Fe)|0,h=h+Math.imul(B,je)|0,h=h+Math.imul(U,Fe)|0,S=S+Math.imul(U,je)|0;var ar=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ar>>>26)|0,ar&=67108863,b=Math.imul(be,Ce),h=Math.imul(be,Me),h=h+Math.imul(ye,Ce)|0,S=Math.imul(ye,Me),b=b+Math.imul(me,ke)|0,h=h+Math.imul(me,Ie)|0,h=h+Math.imul(ve,ke)|0,S=S+Math.imul(ve,Ie)|0,b=b+Math.imul(he,xe)|0,h=h+Math.imul(he,Ae)|0,h=h+Math.imul(ue,xe)|0,S=S+Math.imul(ue,Ae)|0,b=b+Math.imul(de,Te)|0,h=h+Math.imul(de,Ne)|0,h=h+Math.imul(fe,Te)|0,S=S+Math.imul(fe,Ne)|0,b=b+Math.imul(ge,Le)|0,h=h+Math.imul(ge,Oe)|0,h=h+Math.imul(_e,Le)|0,S=S+Math.imul(_e,Oe)|0,b=b+Math.imul(Z,Pe)|0,h=h+Math.imul(Z,$e)|0,h=h+Math.imul(le,Pe)|0,S=S+Math.imul(le,$e)|0,b=b+Math.imul(j,Be)|0,h=h+Math.imul(j,De)|0,h=h+Math.imul(K,Be)|0,S=S+Math.imul(K,De)|0,b=b+Math.imul(w,Fe)|0,h=h+Math.imul(w,je)|0,h=h+Math.imul(E,Fe)|0,S=S+Math.imul(E,je)|0;var cr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(cr>>>26)|0,cr&=67108863,b=Math.imul(be,ke),h=Math.imul(be,Ie),h=h+Math.imul(ye,ke)|0,S=Math.imul(ye,Ie),b=b+Math.imul(me,xe)|0,h=h+Math.imul(me,Ae)|0,h=h+Math.imul(ve,xe)|0,S=S+Math.imul(ve,Ae)|0,b=b+Math.imul(he,Te)|0,h=h+Math.imul(he,Ne)|0,h=h+Math.imul(ue,Te)|0,S=S+Math.imul(ue,Ne)|0,b=b+Math.imul(de,Le)|0,h=h+Math.imul(de,Oe)|0,h=h+Math.imul(fe,Le)|0,S=S+Math.imul(fe,Oe)|0,b=b+Math.imul(ge,Pe)|0,h=h+Math.imul(ge,$e)|0,h=h+Math.imul(_e,Pe)|0,S=S+Math.imul(_e,$e)|0,b=b+Math.imul(Z,Be)|0,h=h+Math.imul(Z,De)|0,h=h+Math.imul(le,Be)|0,S=S+Math.imul(le,De)|0,b=b+Math.imul(j,Fe)|0,h=h+Math.imul(j,je)|0,h=h+Math.imul(K,Fe)|0,S=S+Math.imul(K,je)|0;var lr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(lr>>>26)|0,lr&=67108863,b=Math.imul(be,xe),h=Math.imul(be,Ae),h=h+Math.imul(ye,xe)|0,S=Math.imul(ye,Ae),b=b+Math.imul(me,Te)|0,h=h+Math.imul(me,Ne)|0,h=h+Math.imul(ve,Te)|0,S=S+Math.imul(ve,Ne)|0,b=b+Math.imul(he,Le)|0,h=h+Math.imul(he,Oe)|0,h=h+Math.imul(ue,Le)|0,S=S+Math.imul(ue,Oe)|0,b=b+Math.imul(de,Pe)|0,h=h+Math.imul(de,$e)|0,h=h+Math.imul(fe,Pe)|0,S=S+Math.imul(fe,$e)|0,b=b+Math.imul(ge,Be)|0,h=h+Math.imul(ge,De)|0,h=h+Math.imul(_e,Be)|0,S=S+Math.imul(_e,De)|0,b=b+Math.imul(Z,Fe)|0,h=h+Math.imul(Z,je)|0,h=h+Math.imul(le,Fe)|0,S=S+Math.imul(le,je)|0;var ur=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ur>>>26)|0,ur&=67108863,b=Math.imul(be,Te),h=Math.imul(be,Ne),h=h+Math.imul(ye,Te)|0,S=Math.imul(ye,Ne),b=b+Math.imul(me,Le)|0,h=h+Math.imul(me,Oe)|0,h=h+Math.imul(ve,Le)|0,S=S+Math.imul(ve,Oe)|0,b=b+Math.imul(he,Pe)|0,h=h+Math.imul(he,$e)|0,h=h+Math.imul(ue,Pe)|0,S=S+Math.imul(ue,$e)|0,b=b+Math.imul(de,Be)|0,h=h+Math.imul(de,De)|0,h=h+Math.imul(fe,Be)|0,S=S+Math.imul(fe,De)|0,b=b+Math.imul(ge,Fe)|0,h=h+Math.imul(ge,je)|0,h=h+Math.imul(_e,Fe)|0,S=S+Math.imul(_e,je)|0;var Ds=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Ds>>>26)|0,Ds&=67108863,b=Math.imul(be,Le),h=Math.imul(be,Oe),h=h+Math.imul(ye,Le)|0,S=Math.imul(ye,Oe),b=b+Math.imul(me,Pe)|0,h=h+Math.imul(me,$e)|0,h=h+Math.imul(ve,Pe)|0,S=S+Math.imul(ve,$e)|0,b=b+Math.imul(he,Be)|0,h=h+Math.imul(he,De)|0,h=h+Math.imul(ue,Be)|0,S=S+Math.imul(ue,De)|0,b=b+Math.imul(de,Fe)|0,h=h+Math.imul(de,je)|0,h=h+Math.imul(fe,Fe)|0,S=S+Math.imul(fe,je)|0;var Fs=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Fs>>>26)|0,Fs&=67108863,b=Math.imul(be,Pe),h=Math.imul(be,$e),h=h+Math.imul(ye,Pe)|0,S=Math.imul(ye,$e),b=b+Math.imul(me,Be)|0,h=h+Math.imul(me,De)|0,h=h+Math.imul(ve,Be)|0,S=S+Math.imul(ve,De)|0,b=b+Math.imul(he,Fe)|0,h=h+Math.imul(he,je)|0,h=h+Math.imul(ue,Fe)|0,S=S+Math.imul(ue,je)|0;var js=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(js>>>26)|0,js&=67108863,b=Math.imul(be,Be),h=Math.imul(be,De),h=h+Math.imul(ye,Be)|0,S=Math.imul(ye,De),b=b+Math.imul(me,Fe)|0,h=h+Math.imul(me,je)|0,h=h+Math.imul(ve,Fe)|0,S=S+Math.imul(ve,je)|0;var Hs=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Hs>>>26)|0,Hs&=67108863,b=Math.imul(be,Fe),h=Math.imul(be,je),h=h+Math.imul(ye,Fe)|0,S=Math.imul(ye,je);var Us=(A+b|0)+((h&8191)<<13)|0;return A=(S+(h>>>13)|0)+(Us>>>26)|0,Us&=67108863,M[0]=Qt,M[1]=Yt,M[2]=Xt,M[3]=er,M[4]=tr,M[5]=rr,M[6]=nr,M[7]=ir,M[8]=sr,M[9]=or,M[10]=ar,M[11]=cr,M[12]=lr,M[13]=ur,M[14]=Ds,M[15]=Fs,M[16]=js,M[17]=Hs,M[18]=Us,A!==0&&(M[19]=A,g.length++),g};Math.imul||(k=C);function N(v,a,d){d.negative=a.negative^v.negative,d.length=v.length+a.length;for(var g=0,m=0,y=0;y>>26)|0,m+=M>>>26,M&=67108863}d.words[y]=A,g=M,M=m}return g!==0?d.words[y]=g:d.length--,d._strip()}function $(v,a,d){return N(v,a,d)}s.prototype.mulTo=function(a,d){var g,m=this.length+a.length;return this.length===10&&a.length===10?g=k(this,a,d):m<63?g=C(this,a,d):m<1024?g=N(this,a,d):g=$(this,a,d),g},s.prototype.mul=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),this.mulTo(a,d)},s.prototype.mulf=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),$(this,a,d)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){var d=a<0;d&&(a=-a),n(typeof a=="number"),n(a<67108864);for(var g=0,m=0;m>=26,g+=y/67108864|0,g+=M>>>26,this.words[m]=M&67108863}return g!==0&&(this.words[m]=g,this.length++),d?this.ineg():this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var d=L(a);if(d.length===0)return new s(1);for(var g=this,m=0;m=0);var d=a%26,g=(a-d)/26,m=67108863>>>26-d<<26-d,y;if(d!==0){var M=0;for(y=0;y>>26-d}M&&(this.words[y]=M,this.length++)}if(g!==0){for(y=this.length-1;y>=0;y--)this.words[y+g]=this.words[y];for(y=0;y=0);var m;d?m=(d-d%26)/26:m=0;var y=a%26,M=Math.min((a-y)/26,this.length),A=67108863^67108863>>>y<M)for(this.length-=M,h=0;h=0&&(S!==0||h>=m);h--){var W=this.words[h]|0;this.words[h]=S<<26-y|W>>>y,S=W&A}return b&&S!==0&&(b.words[b.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(a,d,g){return n(this.negative===0),this.iushrn(a,d,g)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a=="number"&&a>=0);var d=a%26,g=(a-d)/26,m=1<=0);var d=a%26,g=(a-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(d!==0&&g++,this.length=Math.min(g,this.length),d!==0){var m=67108863^67108863>>>d<=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(a){if(n(typeof a=="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d>26)-(b/67108864|0),this.words[y+g]=M&67108863}for(;y>26,this.words[y+g]=M&67108863;if(A===0)return this._strip();for(n(A===-1),A=0,y=0;y>26,this.words[y]=M&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(a,d){var g=this.length-a.length,m=this.clone(),y=a,M=y.words[y.length-1]|0,A=this._countBits(M);g=26-A,g!==0&&(y=y.ushln(g),m.iushln(g),M=y.words[y.length-1]|0);var b=m.length-y.length,h;if(d!=="mod"){h=new s(null),h.length=b+1,h.words=new Array(h.length);for(var S=0;S=0;q--){var I=(m.words[y.length+q]|0)*67108864+(m.words[y.length+q-1]|0);for(I=Math.min(I/M|0,67108863),m._ishlnsubmul(y,I,q);m.negative!==0;)I--,m.negative=0,m._ishlnsubmul(y,1,q),m.isZero()||(m.negative^=1);h&&(h.words[q]=I)}return h&&h._strip(),m._strip(),d!=="div"&&g!==0&&m.iushrn(g),{div:h||null,mod:m}},s.prototype.divmod=function(a,d,g){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,y,M;return this.negative!==0&&a.negative===0?(M=this.neg().divmod(a,d),d!=="mod"&&(m=M.div.neg()),d!=="div"&&(y=M.mod.neg(),g&&y.negative!==0&&y.iadd(a)),{div:m,mod:y}):this.negative===0&&a.negative!==0?(M=this.divmod(a.neg(),d),d!=="mod"&&(m=M.div.neg()),{div:m,mod:M.mod}):this.negative&a.negative?(M=this.neg().divmod(a.neg(),d),d!=="div"&&(y=M.mod.neg(),g&&y.negative!==0&&y.isub(a)),{div:M.div,mod:y}):a.length>this.length||this.cmp(a)<0?{div:new s(0),mod:this}:a.length===1?d==="div"?{div:this.divn(a.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new s(this.modrn(a.words[0]))}:this._wordDiv(a,d)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var d=this.divmod(a);if(d.mod.isZero())return d.div;var g=d.div.negative!==0?d.mod.isub(a):d.mod,m=a.ushrn(1),y=a.andln(1),M=g.cmp(m);return M<0||y===1&&M===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var g=(1<<26)%a,m=0,y=this.length-1;y>=0;y--)m=(g*m+(this.words[y]|0))%a;return d?-m:m},s.prototype.modn=function(a){return this.modrn(a)},s.prototype.idivn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var g=0,m=this.length-1;m>=0;m--){var y=(this.words[m]|0)+g*67108864;this.words[m]=y/a|0,g=y%a}return this._strip(),d?this.ineg():this},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var d=this,g=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var m=new s(1),y=new s(0),M=new s(0),A=new s(1),b=0;d.isEven()&&g.isEven();)d.iushrn(1),g.iushrn(1),++b;for(var h=g.clone(),S=d.clone();!d.isZero();){for(var W=0,q=1;!(d.words[0]&q)&&W<26;++W,q<<=1);if(W>0)for(d.iushrn(W);W-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(h),y.isub(S)),m.iushrn(1),y.iushrn(1);for(var I=0,T=1;!(g.words[0]&T)&&I<26;++I,T<<=1);if(I>0)for(g.iushrn(I);I-- >0;)(M.isOdd()||A.isOdd())&&(M.iadd(h),A.isub(S)),M.iushrn(1),A.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(M),y.isub(A)):(g.isub(d),M.isub(m),A.isub(y))}return{a:M,b:A,gcd:g.iushln(b)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var d=this,g=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var m=new s(1),y=new s(0),M=g.clone();d.cmpn(1)>0&&g.cmpn(1)>0;){for(var A=0,b=1;!(d.words[0]&b)&&A<26;++A,b<<=1);if(A>0)for(d.iushrn(A);A-- >0;)m.isOdd()&&m.iadd(M),m.iushrn(1);for(var h=0,S=1;!(g.words[0]&S)&&h<26;++h,S<<=1);if(h>0)for(g.iushrn(h);h-- >0;)y.isOdd()&&y.iadd(M),y.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(y)):(g.isub(d),y.isub(m))}var W;return d.cmpn(1)===0?W=m:W=y,W.cmpn(0)<0&&W.iadd(a),W},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var d=this.clone(),g=a.clone();d.negative=0,g.negative=0;for(var m=0;d.isEven()&&g.isEven();m++)d.iushrn(1),g.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;g.isEven();)g.iushrn(1);var y=d.cmp(g);if(y<0){var M=d;d=g,g=M}else if(y===0||g.cmpn(1)===0)break;d.isub(g)}while(!0);return g.iushln(m)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a=="number");var d=a%26,g=(a-d)/26,m=1<>>26,A&=67108863,this.words[M]=A}return y!==0&&(this.words[M]=y,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var d=a<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var g;if(this.length>1)g=1;else{d&&(a=-a),n(a<=67108863,"Number is too big");var m=this.words[0]|0;g=m===a?0:ma.length)return 1;if(this.length=0;g--){var m=this.words[g]|0,y=a.words[g]|0;if(m!==y){my&&(d=1);break}}return d},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new Q(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var O={k256:null,p224:null,p192:null,p25519:null};function D(v,a){this.name=v,this.p=new s(a,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var a=new s(null);return a.words=new Array(Math.ceil(this.n/13)),a},D.prototype.ireduce=function(a){var d=a,g;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),g=d.bitLength();while(g>this.n);var m=g0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},D.prototype.split=function(a,d){a.iushrn(this.n,0,d)},D.prototype.imulK=function(a){return a.imul(this.k)};function G(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(G,D),G.prototype.split=function(a,d){for(var g=4194303,m=Math.min(a.length,9),y=0;y>>22,M=A}M>>>=22,a.words[y-10]=M,M===0&&a.length>10?a.length-=10:a.length-=9},G.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var d=0,g=0;g>>=26,a.words[g]=y,d=m}return d!==0&&(a.words[a.length++]=d),a},s._prime=function(a){if(O[a])return O[a];var d;if(a==="k256")d=new G;else if(a==="p224")d=new V;else if(a==="p192")d=new H;else if(a==="p25519")d=new X;else throw new Error("Unknown prime "+a);return O[a]=d,d};function Q(v){if(typeof v=="string"){var a=s._prime(v);this.m=a.p,this.prime=a}else n(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}Q.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},Q.prototype._verify2=function(a,d){n((a.negative|d.negative)===0,"red works only with positives"),n(a.red&&a.red===d.red,"red works only with red numbers")},Q.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):(p(a,a.umod(this.m)._forceRed(this)),a)},Q.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Q.prototype.add=function(a,d){this._verify2(a,d);var g=a.add(d);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},Q.prototype.iadd=function(a,d){this._verify2(a,d);var g=a.iadd(d);return g.cmp(this.m)>=0&&g.isub(this.m),g},Q.prototype.sub=function(a,d){this._verify2(a,d);var g=a.sub(d);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},Q.prototype.isub=function(a,d){this._verify2(a,d);var g=a.isub(d);return g.cmpn(0)<0&&g.iadd(this.m),g},Q.prototype.shl=function(a,d){return this._verify1(a),this.imod(a.ushln(d))},Q.prototype.imul=function(a,d){return this._verify2(a,d),this.imod(a.imul(d))},Q.prototype.mul=function(a,d){return this._verify2(a,d),this.imod(a.mul(d))},Q.prototype.isqr=function(a){return this.imul(a,a.clone())},Q.prototype.sqr=function(a){return this.mul(a,a)},Q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var g=this.m.add(new s(1)).iushrn(2);return this.pow(a,g)}for(var m=this.m.subn(1),y=0;!m.isZero()&&m.andln(1)===0;)y++,m.iushrn(1);n(!m.isZero());var M=new s(1).toRed(this),A=M.redNeg(),b=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new s(2*h*h).toRed(this);this.pow(h,b).cmp(A)!==0;)h.redIAdd(A);for(var S=this.pow(h,m),W=this.pow(a,m.addn(1).iushrn(1)),q=this.pow(a,m),I=y;q.cmp(M)!==0;){for(var T=q,B=0;T.cmp(M)!==0;B++)T=T.redSqr();n(B=0;y--){for(var S=d.words[y],W=h-1;W>=0;W--){var q=S>>W&1;if(M!==m[0]&&(M=this.sqr(M)),q===0&&A===0){b=0;continue}A<<=1,A|=q,b++,!(b!==g&&(y!==0||W!==0))&&(M=this.mul(M,m[A]),b=0,A=0)}h=26}return M},Q.prototype.convertTo=function(a){var d=a.umod(this.m);return d===a?d.clone():d},Q.prototype.convertFrom=function(a){var d=a.clone();return d.red=null,d},s.mont=function(a){return new ie(a)};function ie(v){Q.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ie,Q),ie.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ie.prototype.convertFrom=function(a){var d=this.imod(a.mul(this.rinv));return d.red=null,d},ie.prototype.imul=function(a,d){if(a.isZero()||d.isZero())return a.words[0]=0,a.length=1,a;var g=a.imul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=g.isub(m).iushrn(this.shift),M=y;return y.cmp(this.m)>=0?M=y.isub(this.m):y.cmpn(0)<0&&(M=y.iadd(this.m)),M._forceRed(this)},ie.prototype.mul=function(a,d){if(a.isZero()||d.isZero())return new s(0)._forceRed(this);var g=a.mul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=g.isub(m).iushrn(this.shift),M=y;return y.cmp(this.m)>=0?M=y.isub(this.m):y.cmpn(0)<0&&(M=y.iadd(this.m)),M._forceRed(this)},ie.prototype.invm=function(a){var d=this.imod(a._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,J)})(Wo);var Ui=Wo.exports,jn={},Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.errorValues=Ht.standardErrorCodes=void 0;Ht.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Ht.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Wi={},Vi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ht,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,R=r){if(_&&Number.isInteger(_)){const x=_.toString();if(p(t.errorValues,x))return t.errorValues[x].message;if(u(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return R}e.getMessageFromCode=n;function i(_){if(!Number.isInteger(_))return!1;const R=_.toString();return!!(t.errorValues[R]||u(_))}e.isValidCode=i;function s(_){var R;if(typeof _=="number")return _;if(o(_))return(R=_.code)!==null&&R!==void 0?R:_.errorCode}e.getErrorCode=s;function o(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function c(_,{shouldIncludeStack:R=!1}={}){const x={};if(_&&typeof _=="object"&&!Array.isArray(_)&&p(_,"code")&&i(_.code)){const P=_;x.code=P.code,P.message&&typeof P.message=="string"?(x.message=P.message,p(P,"data")&&(x.data=P.data)):(x.message=n(x.code),x.data={originalError:l(_)})}else x.code=t.standardErrorCodes.rpc.internal,x.message=f(_,"message")?_.message:r,x.data={originalError:l(_)};return R&&(x.stack=f(_,"stack")?_.stack:void 0),x}e.serialize=c;function u(_){return _>=-32099&&_<=-32e3}function l(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function p(_,R){return Object.prototype.hasOwnProperty.call(_,R)}function f(_,R){return typeof _=="object"&&_!==null&&R in _&&typeof _[R]=="string"}})(Vi);Object.defineProperty(Wi,"__esModule",{value:!0});Wi.standardErrors=void 0;const Xe=Ht,Il=Vi;Wi.standardErrors={rpc:{parse:e=>dt(Xe.standardErrorCodes.rpc.parse,e),invalidRequest:e=>dt(Xe.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>dt(Xe.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>dt(Xe.standardErrorCodes.rpc.methodNotFound,e),internal:e=>dt(Xe.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return dt(t,e)},invalidInput:e=>dt(Xe.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>dt(Xe.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>dt(Xe.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>dt(Xe.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>dt(Xe.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>dt(Xe.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>qr(Xe.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>qr(Xe.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>qr(Xe.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>qr(Xe.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>qr(Xe.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>qr(Xe.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Tl(t,r,n)}}};function dt(e,t){const[r,n]=xl(t);return new Al(e,r||(0,Il.getMessageFromCode)(e),n)}function qr(e,t){const[r,n]=xl(t);return new Tl(e,r||(0,Il.getMessageFromCode)(e),n)}function xl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let Al=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},Tl=class extends Al{constructor(t,r,n){if(!_d(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function _d(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var qi={},_n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.isErrorResponse=void 0;function md(e){return e.errorMessage!==void 0}_n.isErrorResponse=md;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.LIB_VERSION=void 0;mn.LIB_VERSION="3.9.1";Object.defineProperty(qi,"__esModule",{value:!0});qi.serializeError=void 0;const vd=_n,bd=mn,yd=Ht,wd=Vi;function Ed(e,t){const r=(0,wd.serialize)(Sd(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",bd.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Rd(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}qi.serializeError=Ed;function Sd(e){return typeof e=="string"?{message:e,code:yd.standardErrorCodes.rpc.internal}:(0,vd.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Rd(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Ht;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Wi;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=qi;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Vi;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(jn);var Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.ProviderType=Je.RegExpString=Je.IntNumber=Je.BigIntString=Je.AddressString=Je.HexString=Je.OpaqueType=void 0;function Hn(){return e=>e}Je.OpaqueType=Hn;Je.HexString=Hn();Je.AddressString=Hn();Je.BigIntString=Hn();function Cd(e){return Math.floor(e)}Je.IntNumber=Cd;Je.RegExpString=Hn();var Oa;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Oa||(Je.ProviderType=Oa={}));var Md=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(z,"__esModule",{value:!0});z.isMobileWeb=z.getLocation=z.isInIFrame=z.createQrUrl=z.getFavicon=z.range=z.isBigNumber=z.ensureParsedJSONObject=z.ensureBN=z.ensureRegExpString=z.ensureIntNumber=z.ensureBuffer=z.ensureAddressString=z.ensureEvenLengthHexString=z.ensureHexString=z.isHexString=z.prepend0x=z.strip0x=z.has0xPrefix=z.hexStringFromIntNumber=z.intNumberFromHexString=z.bigIntStringFromBN=z.hexStringFromBuffer=z.hexStringToUint8Array=z.uint8ArrayToHex=z.randomBytesHex=void 0;const Gt=Md(Ui),kr=jn,_t=Je,Nl=/^[0-9]*$/,Ll=/^[a-f0-9]*$/;function kd(e){return Ol(crypto.getRandomValues(new Uint8Array(e)))}z.randomBytesHex=kd;function Ol(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}z.uint8ArrayToHex=Ol;function Id(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}z.hexStringToUint8Array=Id;function xd(e,t=!1){const r=e.toString("hex");return(0,_t.HexString)(t?`0x${r}`:r)}z.hexStringFromBuffer=xd;function Ad(e){return(0,_t.BigIntString)(e.toString(10))}z.bigIntStringFromBN=Ad;function Td(e){return(0,_t.IntNumber)(new Gt.default(Wn(e,!1),16).toNumber())}z.intNumberFromHexString=Td;function Nd(e){return(0,_t.HexString)(`0x${new Gt.default(e).toString(16)}`)}z.hexStringFromIntNumber=Nd;function Vo(e){return e.startsWith("0x")||e.startsWith("0X")}z.has0xPrefix=Vo;function zi(e){return Vo(e)?e.slice(2):e}z.strip0x=zi;function Pl(e){return Vo(e)?`0x${e.slice(2)}`:`0x${e}`}z.prepend0x=Pl;function Un(e){if(typeof e!="string")return!1;const t=zi(e).toLowerCase();return Ll.test(t)}z.isHexString=Un;function $l(e,t=!1){if(typeof e=="string"){const r=zi(e).toLowerCase();if(Ll.test(r))return(0,_t.HexString)(t?`0x${r}`:r)}throw kr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}z.ensureHexString=$l;function Wn(e,t=!1){let r=$l(e,!1);return r.length%2===1&&(r=(0,_t.HexString)(`0${r}`)),t?(0,_t.HexString)(`0x${r}`):r}z.ensureEvenLengthHexString=Wn;function Ld(e){if(typeof e=="string"){const t=zi(e).toLowerCase();if(Un(t)&&t.length===40)return(0,_t.AddressString)(Pl(t))}throw kr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}z.ensureAddressString=Ld;function Od(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(Un(e)){const t=Wn(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw kr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}z.ensureBuffer=Od;function Bl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,_t.IntNumber)(e);if(typeof e=="string"){if(Nl.test(e))return(0,_t.IntNumber)(Number(e));if(Un(e))return(0,_t.IntNumber)(new Gt.default(Wn(e,!1),16).toNumber())}throw kr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}z.ensureIntNumber=Bl;function Pd(e){if(e instanceof RegExp)return(0,_t.RegExpString)(e.toString());throw kr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}z.ensureRegExpString=Pd;function $d(e){if(e!==null&&(Gt.default.isBN(e)||Dl(e)))return new Gt.default(e.toString(10),10);if(typeof e=="number")return new Gt.default(Bl(e));if(typeof e=="string"){if(Nl.test(e))return new Gt.default(e,10);if(Un(e))return new Gt.default(Wn(e,!1),16)}throw kr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}z.ensureBN=$d;function Bd(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw kr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}z.ensureParsedJSONObject=Bd;function Dl(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}z.isBigNumber=Dl;function Dd(e,t){return Array.from({length:t-e},(r,n)=>e+n)}z.range=Dd;function Fd(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}z.getFavicon=Fd;function jd(e,t,r,n,i,s){const o=n?"parent-id":"id",c=new URLSearchParams({[o]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${c}`}z.createQrUrl=jd;function Fl(){try{return window.frameElement!==null}catch{return!1}}z.isInIFrame=Fl;function Hd(){try{return Fl()&&window.top?window.top.location:window.location}catch{return window.location}}z.getLocation=Hd;function Ud(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}z.isMobileWeb=Ud;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.ScopedLocalStorage=void 0;class Wd{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Gi.ScopedLocalStorage=Wd;var on={};const Vd=gn(pd);var Vn={},qn={},vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.EVENTS=void 0;vn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.RelayAbstract=gt.APP_VERSION_KEY=gt.LOCAL_STORAGE_ADDRESSES_KEY=gt.WALLET_USER_NAME_KEY=void 0;const Pa=jn;gt.WALLET_USER_NAME_KEY="walletUsername";gt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";gt.APP_VERSION_KEY="AppVersion";class qd{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Pa.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Pa.serializeError)(s,t.method);return i})}}gt.RelayAbstract=qd;var bn={},jl={exports:{}},So={exports:{}};typeof Object.create=="function"?So.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:So.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var Et=So.exports,Ro={exports:{}};(function(e,t){var r=Fn,n=r.Buffer;function i(o,c){for(var u in o)c[u]=o[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(o,c,u){return n(o,c,u)}i(n,s),s.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,c,u)},s.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return c!==void 0?typeof u=="string"?l.fill(c,u):l.fill(c):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(Ro,Ro.exports);var Ir=Ro.exports,Hl=Ir.Buffer;function Ji(e,t){this._block=Hl.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Ji.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Hl.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};Ji.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var yn=Ji,zd=Et,Ul=yn,Gd=Ir.Buffer,Jd=[1518500249,1859775393,-1894007588,-899497514],Zd=new Array(80);function zn(){this.init(),this._w=Zd,Ul.call(this,64,56)}zd(zn,Ul);zn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Kd(e){return e<<5|e>>>27}function Qd(e){return e<<30|e>>>2}function Yd(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}zn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var u=0;u<80;++u){var l=~~(u/20),p=Kd(r)+Yd(l,n,i,s)+o+t[u]+Jd[l]|0;o=s,s=i,i=Qd(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};zn.prototype._hash=function(){var e=Gd.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Xd=zn,ef=Et,Wl=yn,tf=Ir.Buffer,rf=[1518500249,1859775393,-1894007588,-899497514],nf=new Array(80);function Gn(){this.init(),this._w=nf,Wl.call(this,64,56)}ef(Gn,Wl);Gn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function sf(e){return e<<1|e>>>31}function of(e){return e<<5|e>>>27}function af(e){return e<<30|e>>>2}function cf(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Gn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=sf(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var u=0;u<80;++u){var l=~~(u/20),p=of(r)+cf(l,n,i,s)+o+t[u]+rf[l]|0;o=s,s=i,i=af(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Gn.prototype._hash=function(){var e=tf.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var lf=Gn,uf=Et,Vl=yn,hf=Ir.Buffer,df=[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],ff=new Array(64);function Jn(){this.init(),this._w=ff,Vl.call(this,64,56)}uf(Jn,Vl);Jn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function pf(e,t,r){return r^e&(t^r)}function gf(e,t,r){return e&t|r&(e|t)}function _f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function mf(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function vf(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function bf(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Jn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=this._f|0,u=this._g|0,l=this._h|0,p=0;p<16;++p)t[p]=e.readInt32BE(p*4);for(;p<64;++p)t[p]=bf(t[p-2])+t[p-7]+vf(t[p-15])+t[p-16]|0;for(var f=0;f<64;++f){var _=l+mf(o)+pf(o,c,u)+df[f]+t[f]|0,R=_f(r)+gf(r,n,i)|0;l=u,u=c,c=o,o=s+_|0,s=i,i=n,n=r,r=_+R|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=c+this._f|0,this._g=u+this._g|0,this._h=l+this._h|0};Jn.prototype._hash=function(){var e=hf.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var ql=Jn,yf=Et,wf=ql,Ef=yn,Sf=Ir.Buffer,Rf=new Array(64);function Zi(){this.init(),this._w=Rf,Ef.call(this,64,56)}yf(Zi,wf);Zi.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Zi.prototype._hash=function(){var e=Sf.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Cf=Zi,Mf=Et,zl=yn,kf=Ir.Buffer,$a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],If=new Array(160);function Zn(){this.init(),this._w=If,zl.call(this,128,112)}Mf(Zn,zl);Zn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ba(e,t,r){return r^e&(t^r)}function Da(e,t,r){return e&t|r&(e|t)}function Fa(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ja(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function xf(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Af(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Tf(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Nf(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ke(e,t){return e>>>0>>0?1:0}Zn.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,c=this._fh|0,u=this._gh|0,l=this._hh|0,p=this._al|0,f=this._bl|0,_=this._cl|0,R=this._dl|0,x=this._el|0,P=this._fl|0,L=this._gl|0,C=this._hl|0,k=0;k<32;k+=2)t[k]=e.readInt32BE(k*4),t[k+1]=e.readInt32BE(k*4+4);for(;k<160;k+=2){var N=t[k-30],$=t[k-15*2+1],O=xf(N,$),D=Af($,N);N=t[k-2*2],$=t[k-2*2+1];var G=Tf(N,$),V=Nf($,N),H=t[k-7*2],X=t[k-7*2+1],Q=t[k-16*2],ie=t[k-16*2+1],v=D+X|0,a=O+H+Ke(v,D)|0;v=v+V|0,a=a+G+Ke(v,V)|0,v=v+ie|0,a=a+Q+Ke(v,ie)|0,t[k]=a,t[k+1]=v}for(var d=0;d<160;d+=2){a=t[d],v=t[d+1];var g=Da(r,n,i),m=Da(p,f,_),y=Fa(r,p),M=Fa(p,r),A=ja(o,x),b=ja(x,o),h=$a[d],S=$a[d+1],W=Ba(o,c,u),q=Ba(x,P,L),I=C+b|0,T=l+A+Ke(I,C)|0;I=I+q|0,T=T+W+Ke(I,q)|0,I=I+S|0,T=T+h+Ke(I,S)|0,I=I+v|0,T=T+a+Ke(I,v)|0;var B=M+m|0,U=y+g+Ke(B,M)|0;l=u,C=L,u=c,L=P,c=o,P=x,x=R+I|0,o=s+T+Ke(x,R)|0,s=i,R=_,i=n,_=f,n=r,f=p,p=I+B|0,r=T+U+Ke(p,I)|0}this._al=this._al+p|0,this._bl=this._bl+f|0,this._cl=this._cl+_|0,this._dl=this._dl+R|0,this._el=this._el+x|0,this._fl=this._fl+P|0,this._gl=this._gl+L|0,this._hl=this._hl+C|0,this._ah=this._ah+r+Ke(this._al,p)|0,this._bh=this._bh+n+Ke(this._bl,f)|0,this._ch=this._ch+i+Ke(this._cl,_)|0,this._dh=this._dh+s+Ke(this._dl,R)|0,this._eh=this._eh+o+Ke(this._el,x)|0,this._fh=this._fh+c+Ke(this._fl,P)|0,this._gh=this._gh+u+Ke(this._gl,L)|0,this._hh=this._hh+l+Ke(this._hl,C)|0};Zn.prototype._hash=function(){var e=kf.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Gl=Zn,Lf=Et,Of=Gl,Pf=yn,$f=Ir.Buffer,Bf=new Array(160);function Ki(){this.init(),this._w=Bf,Pf.call(this,128,112)}Lf(Ki,Of);Ki.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ki.prototype._hash=function(){var e=$f.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Df=Ki,xr=jl.exports=function(t){t=t.toLowerCase();var r=xr[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};xr.sha=Xd;xr.sha1=lf;xr.sha224=Cf;xr.sha256=ql;xr.sha384=Df;xr.sha512=Gl;var Ff=jl.exports;Object.defineProperty(bn,"__esModule",{value:!0});bn.Session=void 0;const Ha=Ff,Ua=z,Wa="session:id",Va="session:secret",qa="session:linked";class qo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Ua.randomBytesHex)(16),this._secret=n||(0,Ua.randomBytesHex)(32),this._key=new Ha.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Wa),n=t.getItem(qa),i=t.getItem(Va);return r&&i?new qo(t,r,i,n==="1"):null}static hash(t){return new Ha.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Wa,this._id),this._storage.setItem(Va,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(qa,this._linked?"1":"0")}}bn.Session=qo;var Qi={},Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.Cipher=void 0;const fi=z;class jf{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,fi.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),c=16,u=o.slice(o.byteLength-c),l=o.slice(0,o.byteLength-c),p=new Uint8Array(u),f=new Uint8Array(l),_=new Uint8Array([...n,...p,...f]);return(0,fi.uint8ArrayToHex)(_)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,fi.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,fi.hexStringToUint8Array)(t),c=o.slice(0,12),u=o.slice(12,28),l=o.slice(28),p=new Uint8Array([...l,...u]),f={name:"AES-GCM",iv:new Uint8Array(c)};try{const _=await window.crypto.subtle.decrypt(f,s,p),R=new TextDecoder;n(R.decode(_))}catch(_){i(_)}})()})}}Yi.Cipher=jf;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.WalletLinkHTTP=void 0;class Hf{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Xi.WalletLinkHTTP=Hf;var an={};Object.defineProperty(an,"__esModule",{value:!0});an.WalletLinkWebSocket=an.ConnectionState=void 0;var Xr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Xr||(an.ConnectionState=Xr={}));class Uf{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Xr.CONNECTING),i.onclose=s=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Xr.DISCONNECTED)},i.onopen=s=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Xr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(u=>this.sendData(u)),this.pendingData=[])},i.onmessage=s=>{var o,c;if(s.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const u=JSON.parse(s.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,u)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Xr.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}an.WalletLinkWebSocket=Uf;Object.defineProperty(Qi,"__esModule",{value:!0});Qi.WalletLinkConnection=void 0;const zr=Je,Wf=Yi,Mt=vn,za=gt,Gr=bn,Vf=Xi,pi=an,Ga=1e4,qf=6e4;class zf{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,zr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>c.JsonRpcUrl&&this.handleChainUpdated(l,c.JsonRpcUrl)]]).forEach((l,p)=>{const f=c[p];f!==void 0&&l(f)})},this.handleDestroyed=c=>{var u,l;c==="1"&&((u=this.listener)===null||u===void 0||u.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(Mt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Gr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var u,l;try{const p=await this.cipher.decrypt(c);(u=this.listener)===null||u===void 0||u.accountUpdated(p)}catch{(l=this.diagnostic)===null||l===void 0||l.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,u)=>{var l,p;try{const f=await this.cipher.decrypt(u);(l=this.listener)===null||l===void 0||l.metadataUpdated(c,f)}catch{(p=this.diagnostic)===null||p===void 0||p.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(za.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(za.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,u)=>{var l,p;try{const f=await this.cipher.decrypt(c),_=await this.cipher.decrypt(u);(l=this.listener)===null||l===void 0||l.chainUpdated(f,_)}catch{(p=this.diagnostic)===null||p===void 0||p.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Wf.Cipher(t.secret),this.diagnostic=i,this.listener=n;const o=new pi.WalletLinkWebSocket(`${r}/rpc`,s);o.setConnectionStateListener(async c=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(Mt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:Gr.Session.hash(t.id)});let l=!1;switch(c){case pi.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(f=>setTimeout(f,5e3)),this.destroyed||o.connect().catch(()=>{p()})};p()}break;case pi.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ga),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case pi.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(c=>{var u,l,p;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const f=c.type==="IsLinkedOK"?c.linked:void 0;(u=this.diagnostic)===null||u===void 0||u.log(Mt.EVENTS.LINKED,{sessionIdHash:Gr.Session.hash(t.id),linked:f,type:c.type,onlineGuests:c.onlineGuests}),this.linked=f||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(Mt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Gr.Session.hash(t.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((p=this.requestResolutions.get(c.id))===null||p===void 0||p(c))}),this.ws=o,this.http=new Vf.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Mt.EVENTS.STARTED_CONNECTING,{sessionIdHash:Gr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Mt.EVENTS.DISCONNECTED,{sessionIdHash:Gr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ga*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=qf){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,o)=>{i=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,o=>{clearTimeout(i),s(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Qi.WalletLinkConnection=zf;var Kn={},Qn={},zo={};Object.defineProperty(zo,"__esModule",{value:!0});zo.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Gf=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.injectCssReset=void 0;const Jf=Gf(zo);function Zf(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Jf.default)),document.documentElement.appendChild(e)}Qn.injectCssReset=Zf;var es={},Yn,He,Jl,Zl,gr,Ja,Kl,Co,Go,Mo,ko,Ql,Pn={},Yl=[],Kf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ts=Array.isArray;function jt(e,t){for(var r in t)e[r]=t[r];return e}function Xl(e){var t=e.parentNode;t&&t.removeChild(e)}function Io(e,t,r){var n,i,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Yn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return An(e,o,n,i,null)}function An(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Jl,__i:-1,__u:0};return i==null&&He.vnode!=null&&He.vnode(s),s}function Qf(){return{current:null}}function Xn(e){return e.children}function Tn(e,t){this.props=e,this.context=t}function Sr(e,t){if(t==null)return e.__?Sr(e.__,e.__i+1):null;for(var r;tt&&gr.sort(Co));Ni.__r=0}function tu(e,t,r,n,i,s,o,c,u,l,p){var f,_,R,x,P,L=n&&n.__k||Yl,C=t.length;for(r.__d=u,Yf(r,t,L),u=r.__d,f=0;f0?An(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,c=Xf(i,r,o,p),i.__i=c,s=null,c!==-1&&(p--,(s=r[c])&&(s.__u|=131072)),s==null||s.__v===null?(c==-1&&f--,typeof i.type!="function"&&(i.__u|=65536)):c!==o&&(c===o+1?f++:c>o?p>u-o?f+=c-o:f--:c(u!=null&&!(131072&u.__u)?1:0))for(;o>=0||c=0){if((u=t[o])&&!(131072&u.__u)&&i==u.key&&s===u.type)return o;o--}if(c2&&(c.children=arguments.length>3?Yn.call(arguments,2):r),An(e.type,c,n||e.key,i||e.ref,null)}function n0(e,t){var r={__c:t="__cC"+Ql++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(c){c.__e=!0,xo(c)})},this.sub=function(o){i.push(o);var c=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),c&&c.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Yn=Yl.slice,He={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(c){e=c}throw e}},Jl=0,Zl=function(e){return e!=null&&e.constructor==null},Tn.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=jt({},this.state),typeof e=="function"&&(e=e(jt({},r),this.props)),e&&jt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),xo(this))},Tn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),xo(this))},Tn.prototype.render=Xn,gr=[],Kl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Co=function(e,t){return e.__v.__b-t.__v.__b},Ni.__r=0,Go=0,Mo=Ka(!1),ko=Ka(!0),Ql=0;const i0=Object.freeze(Object.defineProperty({__proto__:null,Component:Tn,Fragment:Xn,cloneElement:r0,createContext:n0,createElement:Io,createRef:Qf,h:Io,hydrate:ou,get isValidElement(){return Zl},get options(){return He},render:su,toChildArray:nu},Symbol.toStringTag,{value:"Module"})),ot=gn(i0);var rs={};function au(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t=r.__.length&&r.__.push({__V:Ii}),r.__[e]}function lu(e){return cn=1,uu(du,e)}function uu(e,t,r){var n=Ar(Ut++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):du(void 0,t),function(c){var u=n.__N?n.__N[0]:n.__[0],l=n.t(u,c);u!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=pe,!pe.u)){var i=function(c,u,l){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(_){return!!_.__c});if(p.every(function(_){return!_.__N}))return!s||s.call(this,c,u,l);var f=!1;return p.forEach(function(_){if(_.__N){var R=_.__[0];_.__=_.__N,_.__N=void 0,R!==_.__[0]&&(f=!0)}}),!(!f&&n.__c.props===c)&&(!s||s.call(this,c,u,l))};pe.u=!0;var s=pe.shouldComponentUpdate,o=pe.componentWillUpdate;pe.componentWillUpdate=function(c,u,l){if(this.__e){var p=s;s=void 0,i(c,u,l),s=p}o&&o.call(this,c,u,l)},pe.shouldComponentUpdate=i}return n.__N||n.__}function o0(e,t){var r=Ar(Ut++,3);!Ve.__s&&Qo(r.__H,t)&&(r.__=e,r.i=t,pe.__H.__h.push(r))}function hu(e,t){var r=Ar(Ut++,4);!Ve.__s&&Qo(r.__H,t)&&(r.__=e,r.i=t,pe.__h.push(r))}function a0(e){return cn=5,Ko(function(){return{current:e}},[])}function c0(e,t,r){cn=6,hu(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Ko(e,t){var r=Ar(Ut++,7);return Qo(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function l0(e,t){return cn=8,Ko(function(){return e},t)}function u0(e){var t=pe.context[e.__c],r=Ar(Ut++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(pe)),t.props.value):e.__}function h0(e,t){Ve.useDebugValue&&Ve.useDebugValue(t?t(e):e)}function d0(e){var t=Ar(Ut++,10),r=lu();return t.__=e,pe.componentDidCatch||(pe.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function f0(){var e=Ar(Ut++,11);if(!e.__){for(var t=pe.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function p0(){for(var e;e=cu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xi),e.__H.__h.forEach(To),e.__H.__h=[]}catch(t){e.__H.__h=[],Ve.__e(t,e.__v)}}Ve.__b=function(e){pe=null,Xa&&Xa(e)},Ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ic&&ic(e,t)},Ve.__r=function(e){ec&&ec(e),Ut=0;var t=(pe=e.__c).__H;t&&(Ws===pe?(t.__h=[],pe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Ii,r.__N=r.i=void 0})):(t.__h.forEach(xi),t.__h.forEach(To),t.__h=[],Ut=0)),Ws=pe},Ve.diffed=function(e){tc&&tc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(cu.push(t)!==1&&Ya===Ve.requestAnimationFrame||((Ya=Ve.requestAnimationFrame)||g0)(p0)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Ii&&(r.__=r.__V),r.i=void 0,r.__V=Ii})),Ws=pe=null},Ve.__c=function(e,t){t.some(function(r){try{r.__h.forEach(xi),r.__h=r.__h.filter(function(n){return!n.__||To(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ve.__e(n,r.__v)}}),rc&&rc(e,t)},Ve.unmount=function(e){nc&&nc(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{xi(n)}catch(i){t=i}}),r.__H=void 0,t&&Ve.__e(t,r.__v))};var sc=typeof requestAnimationFrame=="function";function g0(e){var t,r=function(){clearTimeout(n),sc&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);sc&&(t=requestAnimationFrame(r))}function xi(e){var t=pe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),pe=t}function To(e){var t=pe;e.__c=e.__(),pe=t}function Qo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function du(e,t){return typeof t=="function"?t(e):t}const _0=Object.freeze(Object.defineProperty({__proto__:null,useCallback:l0,useContext:u0,useDebugValue:h0,useEffect:o0,useErrorBoundary:d0,useId:f0,useImperativeHandle:c0,useLayoutEffect:hu,useMemo:Ko,useReducer:uu,useRef:a0,useState:lu},Symbol.toStringTag,{value:"Module"})),ns=gn(_0);var ln={},is={};Object.defineProperty(is,"__esModule",{value:!0});is.CloseIcon=void 0;const oc=ot;function m0(e){return(0,oc.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,oc.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}is.CloseIcon=m0;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.CoinbaseWalletRound=void 0;const _i=ot;function v0(e){return(0,_i.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,_i.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,_i.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,_i.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}ss.CoinbaseWalletRound=v0;var os={};Object.defineProperty(os,"__esModule",{value:!0});os.QRCodeIcon=void 0;const Cn=ot;function b0(e){return(0,Cn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Cn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Cn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Cn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Cn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}os.QRCodeIcon=b0;var as={};function fu(e){this.mode=ut.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}fu.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Nt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=We.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=We.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var c=0;c<2;c++)if(this.modules[n][o-c]==null){var u=!1;s>>i&1)==1);var l=We.getMask(t,n,o-c);l&&(u=!u),this.modules[n][o-c]=u,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Nt.PAD0=236;Nt.PAD1=17;Nt.createData=function(e,t,r){for(var n=Tt.getRSBlocks(e,t),i=new pu,s=0;sc*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(Nt.PAD0,8),i.getLengthInBits()>=c*8));)i.put(Nt.PAD1,8);return Nt.createBytes(i,n)};Nt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),o=new Array(t.length),c=0;c=0?R.get(x):0}}for(var P=0,p=0;p=0;)t^=We.G15<=0;)t^=We.G18<>>=1;return t},getPatternPosition:function(e){return We.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case qt.PATTERN000:return(t+r)%2==0;case qt.PATTERN001:return t%2==0;case qt.PATTERN010:return r%3==0;case qt.PATTERN011:return(t+r)%3==0;case qt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case qt.PATTERN101:return t*r%2+t*r%3==0;case qt.PATTERN110:return(t*r%2+t*r%3)%2==0;case qt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new en([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)e-=255;return Ye.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var et=0;et<8;et++)Ye.EXP_TABLE[et]=1<>>7-e%8&1)==1},put:function(e,t){for(var r=0;r>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Vs=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function gu(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(u){switch(u){case"L":return Jt.L;case"M":return Jt.M;case"Q":return Jt.Q;case"H":return Jt.H;default:throw new Error("Unknwon error correction level: "+u)}}function n(u,l){for(var p=i(u),f=1,_=0,R=0,x=Vs.length;R<=x;R++){var P=Vs[R];if(!P)throw new Error("Content too long: expected "+_+" but got "+p);switch(l){case"L":_=P[0];break;case"M":_=P[1];break;case"Q":_=P[2];break;case"H":_=P[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(p<=_)break;f++}if(f>Vs.length)throw new Error("Content too long");return f}function i(u){var l=encodeURI(u).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=u?3:0)}var s=this.options.content,o=n(s,this.options.ecl),c=r(this.options.ecl);this.qrcode=new Nt(o,c),this.qrcode.addData(s),this.qrcode.make()}gu.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r +`:"",o=t.width,c=t.height,u=r.length,l=o/(u+2*t.padding),p=c/(u+2*t.padding),f=typeof t.join<"u"?!!t.join:!1,_=typeof t.swap<"u"?!!t.swap:!1,R=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,x=typeof t.predefined<"u"?!!t.predefined:!1,P=x?i+''+s:"",L=i+''+s,C="",k="",N=0;N'+s:C+=i+''+s}}f&&(C=i+'');let Q="";if(this.options.image!==void 0&&this.options.image.svg){const v=o*this.options.image.width/100,a=c*this.options.image.height/100,d=o/2-v/2,g=c/2-a/2;Q+=``,Q+=this.options.image.svg+s,Q+=""}var ie="";switch(e.container){case"svg":R&&(ie+=''+s),ie+=''+s,ie+=P+L+C,ie+=Q,ie+="";break;case"svg-viewbox":R&&(ie+=''+s),ie+=''+s,ie+=P+L+C,ie+=Q,ie+="";break;case"g":ie+=''+s,ie+=P+L+C,ie+=Q,ie+="";break;default:ie+=(P+L+C+Q).replace(/^\s+/,"");break}return ie};var y0=gu,w0=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(as,"__esModule",{value:!0});as.QRCode=void 0;const E0=ot,ac=ns,S0=w0(y0),R0=e=>{const[t,r]=(0,ac.useState)("");return(0,ac.useEffect)(()=>{var n,i;const s=new S0.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,E0.h)("img",{src:t,alt:"QR Code"}):null};as.QRCode=R0;var cs={},Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var C0=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.Spinner=void 0;const mi=ot,M0=C0(Yo),k0=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,mi.h)("div",{class:"-cbwsdk-spinner"},(0,mi.h)("style",null,M0.default),(0,mi.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,mi.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};cs.Spinner=k0;var Xo={};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var _u=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ln,"__esModule",{value:!0});ln.CoinbaseWalletSteps=ln.ConnectContent=void 0;const Er=_u(ei),oe=ot,I0=z,x0=mn,A0=is,T0=ss,N0=os,L0=as,O0=cs,P0=_u(Xo),qs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:mu},$0=e=>e==="light"?"#FFFFFF":"#0A0B0D";function B0(e){const{theme:t}=e,r=(0,I0.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=qs.steps;return(0,oe.h)("div",{"data-testid":"connect-content",className:(0,Er.default)("-cbwsdk-connect-content",t)},(0,oe.h)("style",null,P0.default),(0,oe.h)("div",{className:"-cbwsdk-connect-content-header"},(0,oe.h)("h2",{className:(0,Er.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,oe.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,oe.h)(A0.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,oe.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,oe.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,oe.h)(D0,{title:qs.title,description:qs.description,theme:t})),(0,oe.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,oe.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,oe.h)(L0.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,oe.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:x0.LIB_VERSION}),(0,oe.h)("input",{type:"hidden",value:r})),(0,oe.h)(n,{theme:t}),!e.isConnected&&(0,oe.h)("div",{"data-testid":"connecting-spinner",className:(0,Er.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,oe.h)(O0.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,oe.h)("p",null,"Connecting...")))))}ln.ConnectContent=B0;function D0({title:e,description:t,theme:r}){return(0,oe.h)("div",{className:(0,Er.default)("-cbwsdk-connect-item",r)},(0,oe.h)("div",null,(0,oe.h)(T0.CoinbaseWalletRound,null)),(0,oe.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,oe.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,oe.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function mu({theme:e}){return(0,oe.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,oe.h)("li",{className:(0,Er.default)("-cbwsdk-wallet-steps-item",e)},(0,oe.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,oe.h)("li",{className:(0,Er.default)("-cbwsdk-wallet-steps-item",e)},(0,oe.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,oe.h)("span",null,"Tap ",(0,oe.h)("strong",null,"Scan")," "),(0,oe.h)("span",{className:(0,Er.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,oe.h)(N0.QRCodeIcon,{fill:$0(e)})))))}ln.CoinbaseWalletSteps=mu;var ls={},us={};Object.defineProperty(us,"__esModule",{value:!0});us.ArrowLeftIcon=void 0;const cc=ot;function F0(e){return(0,cc.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,cc.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}us.ArrowLeftIcon=F0;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.LaptopIcon=void 0;const zs=ot;function j0(e){return(0,zs.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,zs.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,zs.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}hs.LaptopIcon=j0;var ds={};Object.defineProperty(ds,"__esModule",{value:!0});ds.SafeIcon=void 0;const lc=ot;function H0(e){return(0,lc.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,lc.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}ds.SafeIcon=H0;var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var vu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ls,"__esModule",{value:!0});ls.TryExtensionContent=void 0;const hr=vu(ei),Ge=ot,Gs=ns,U0=us,W0=hs,V0=ds,q0=vu(ea);function z0({theme:e}){const[t,r]=(0,Gs.useState)(!1),n=(0,Gs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Gs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension",e)},(0,Ge.h)("style",null,q0.default),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("h3",{class:(0,hr.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ge.h)("button",{class:(0,hr.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Ge.h)("div",null,!t&&(0,Ge.h)(U0.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(W0.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(V0.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ls.TryExtensionContent=z0;var ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var bu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rs,"__esModule",{value:!0});rs.ConnectDialog=void 0;const Js=bu(ei),dr=ot,Zs=ns,G0=ln,J0=ls,Z0=bu(ta),K0=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,Zs.useState)(!t),[s,o]=(0,Zs.useState)(!t);(0,Zs.useEffect)(()=>{const u=[window.setTimeout(()=>{o(!t)},10)];return t?i(!1):u.push(window.setTimeout(()=>{i(!0)},360)),()=>{u.forEach(window.clearTimeout)}},[t]);const c=r?"dark":"light";return(0,dr.h)("div",{class:(0,Js.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,dr.h)("style",null,Z0.default),(0,dr.h)("div",{class:(0,Js.default)("-cbwsdk-connect-dialog-backdrop",c,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,dr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,dr.h)("div",{class:(0,Js.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,dr.h)(G0.ConnectContent,{theme:c,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,dr.h)(J0.TryExtensionContent,{theme:c}))))};rs.ConnectDialog=K0;Object.defineProperty(es,"__esModule",{value:!0});es.LinkFlow=void 0;const Ks=ot,Q0=rs;class Y0{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Ks.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Ks.render)((0,Ks.h)(Q0.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}es.LinkFlow=Y0;var ra={},na={};Object.defineProperty(na,"__esModule",{value:!0});na.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=J&&J.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(ei),n=ot,i=ns,s=t(na),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class u{constructor(_){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=_.darkMode}attach(_){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",_.appendChild(this.root),this.render()}presentItem(_){const R=this.nextItemKey++;return this.items.set(R,_),this.render(),()=>{this.items.delete(R),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([_,R])=>(0,n.h)(e.SnackbarInstance,Object.assign({},R,{key:_}))))),this.root)}}e.Snackbar=u;const l=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));e.SnackbarContainer=l;const p=({autoExpand:f,message:_,menuItems:R})=>{const[x,P]=(0,i.useState)(!0),[L,C]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const N=[window.setTimeout(()=>{P(!1)},1),window.setTimeout(()=>{C(!0)},1e4)];return()=>{N.forEach(window.clearTimeout)}});const k=()=>{C(!L)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",x&&"-cbwsdk-snackbar-instance-hidden",L&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:k},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},_),(0,n.h)("div",{class:"-gear-container"},!L&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),R&&R.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},R.map((N,$)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",N.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:N.onClick,key:$},(0,n.h)("svg",{width:N.svgWidth,height:N.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":N.defaultFillRule,"clip-rule":N.defaultClipRule,d:N.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",N.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},N.info)))))};e.SnackbarInstance=p})(ra);Object.defineProperty(Kn,"__esModule",{value:!0});Kn.WalletLinkRelayUI=void 0;const X0=Qn,ep=es,tp=ra;class rp{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new tp.Snackbar({darkMode:t.darkMode}),this.linkFlow=new ep.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,X0.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Kn.WalletLinkRelayUI=rp;Object.defineProperty(qn,"__esModule",{value:!0});qn.WalletLinkRelay=void 0;const Jr=jn,np=Je,Ue=z,fr=vn,uc=gt,zt=bn,ip=Qi,pr=_n,sp=Kn;class Dt extends uc.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var c;this.isLinked=o;const u=this.storage.getItem(uc.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,u){const l=u.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(l[0]!==""&&!o&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const f=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(fr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:f})}}},this.metadataUpdated=(o,c)=>{this.storage.setItem(o,c)},this.chainUpdated=(o,c)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:o,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(o,c))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),Dt.accountRequestCallbackIds.size>0&&(Array.from(Dt.accountRequestCallbackIds.values()).forEach(c=>{const u={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},u),{id:c}))}),Dt.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=zt.Session.load(this.storage)||new zt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new ip.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:o}=this.options,c=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:o,session:t});return i.connect(),{session:t,ui:c,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(fr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=zt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:zt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:o,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Ue.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Ue.hexStringFromBuffer)(t,!0),signature:(0,Ue.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ue.bigIntStringFromBN)(t.weiValue),data:(0,Ue.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Ue.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ue.bigIntStringFromBN)(t.weiValue),data:(0,Ue.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Ue.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Ue.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Ue.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Ue.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Ue.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Ue.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,u=>{if(r==null||r(),(0,pr.isErrorResponse)(u))return c(new Error(u.errorMessage));o(u)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof sp.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=zt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(fr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?zt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(o=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(fr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?zt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Dt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Dt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Jr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Ue.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,o)=>{if(this.relayEventManager.callbacks.set(r,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,pr.isErrorResponse)(c))return o(new Error(c.errorMessage));s(c)}),this.ui.inlineAccountsResponse()){const c=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:u}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:c})}else{const c=Jr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(c)})}Dt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Ue.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,c)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,pr.isErrorResponse)(p))return c(new Error(p.errorMessage));o(p)});const u=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:np.ProviderType.Unselected}})},l=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:u,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,o){const c={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let u=null;const l=(0,Ue.randomBytesHex)(8),p=_=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,c.method,_),u==null||u()};this.ui.inlineWatchAsset()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const f=new Promise((_,R)=>{this.relayEventManager.callbacks.set(l,L=>{if(u==null||u(),(0,pr.isErrorResponse)(L))return R(new Error(L.errorMessage));_(L)});const x=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},P=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:P,onCancel:x,type:t,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,c)});return{cancel:p,promise:f}}addEthereumChain(t,r,n,i,s,o){const c={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let u=null;const l=(0,Ue.randomBytesHex)(8),p=_=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,c.method,_),u==null||u()};return this.ui.inlineAddEthereumChain(t)||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((_,R)=>{this.relayEventManager.callbacks.set(l,L=>{if(u==null||u(),(0,pr.isErrorResponse)(L))return R(new Error(L.errorMessage));_(L)});const x=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},P=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:L}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:x,onApprove:P,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,c)}),cancel:p}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,Ue.randomBytesHex)(8),s=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,u)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,pr.isErrorResponse)(f)&&f.errorCode)return u(Jr.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,pr.isErrorResponse)(f))return u(new Error(f.errorMessage));c(f)});const l=f=>{var _;if(f){const R=(_=(0,Jr.getErrorCode)(f))!==null&&_!==void 0?_:Jr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",f instanceof Error?f:Jr.standardErrors.provider.unsupportedChain(t),R)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:f}}})};this.ui.switchEthereumChain({onCancel:l,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return zt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}qn.WalletLinkRelay=Dt;Dt.accountRequestCallbackIds=new Set;var ti={},fs={},yu={};(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,c)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(ra,e)})(yu);var ia={};Object.defineProperty(ia,"__esModule",{value:!0});ia.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var wu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fs,"__esModule",{value:!0});fs.RedirectDialog=void 0;const op=wu(ei),At=ot,ap=Qn,cp=yu,lp=wu(ia);class up{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,ap.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,At.render)(null,this.root),t&&(0,At.render)((0,At.h)(hp,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}fs.RedirectDialog=up;const hp=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,At.h)(cp.SnackbarContainer,{darkMode:r},(0,At.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,At.h)("style",null,lp.default),(0,At.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,At.h)("div",{class:(0,op.default)("-cbwsdk-redirect-dialog-box",s)},(0,At.h)("p",null,e),(0,At.h)("button",{onClick:n},t))))};Object.defineProperty(ti,"__esModule",{value:!0});ti.MobileRelayUI=void 0;const dp=fs;class fp{constructor(t){this.attached=!1,this.darkMode=!1,this.openedWindow=null,this.redirectDialog=new dp.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}closeOpenedWindow(){var t;(t=this.openedWindow)===null||t===void 0||t.close(),this.openedWindow=null}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t),this.openedWindow=window.open(r.href,"cbw-opener"),this.openedWindow&&setTimeout(()=>this.closeOpenedWindow(),5e3)}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.closeOpenedWindow(),this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.closeOpenedWindow(),this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}ti.MobileRelayUI=fp;Object.defineProperty(Vn,"__esModule",{value:!0});Vn.MobileRelay=void 0;const pp=z,gp=qn,hc=ti;class _p extends gp.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,pp.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof hc.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t),this._enableMobileWalletLink&&this.ui instanceof hc.MobileRelayUI&&this.ui.closeOpenedWindow()}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}Vn.MobileRelay=_p;var No={exports:{}},Eu=Fi.EventEmitter,Qs,dc;function mp(){if(dc)return Qs;dc=1;function e(x,P){var L=Object.keys(x);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(x);P&&(C=C.filter(function(k){return Object.getOwnPropertyDescriptor(x,k).enumerable})),L.push.apply(L,C)}return L}function t(x){for(var P=1;P0?this.tail.next=C:this.head=C,this.tail=C,++this.length}},{key:"unshift",value:function(L){var C={data:L,next:this.head};this.length===0&&(this.tail=C),this.head=C,++this.length}},{key:"shift",value:function(){if(this.length!==0){var L=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,L}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(L){if(this.length===0)return"";for(var C=this.head,k=""+C.data;C=C.next;)k+=L+C.data;return k}},{key:"concat",value:function(L){if(this.length===0)return l.alloc(0);for(var C=l.allocUnsafe(L>>>0),k=this.head,N=0;k;)R(k.data,C,N),N+=k.data.length,k=k.next;return C}},{key:"consume",value:function(L,C){var k;return L$.length?$.length:L;if(O===$.length?N+=$:N+=$.slice(0,L),L-=O,L===0){O===$.length?(++k,C.next?this.head=C.next:this.head=this.tail=null):(this.head=C,C.data=$.slice(O));break}++k}return this.length-=k,N}},{key:"_getBuffer",value:function(L){var C=l.allocUnsafe(L),k=this.head,N=1;for(k.data.copy(C),L-=k.data.length;k=k.next;){var $=k.data,O=L>$.length?$.length:L;if($.copy(C,C.length-L,0,O),L-=O,L===0){O===$.length?(++N,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=$.slice(O));break}++N}return this.length-=N,C}},{key:_,value:function(L,C){return f(this,t(t({},C),{},{depth:0,customInspect:!1}))}}]),x}(),Qs}function vp(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Lo,this,e)):process.nextTick(Lo,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Ai,r):(r._writableState.errorEmitted=!0,process.nextTick(fc,r,s)):process.nextTick(fc,r,s):t?(process.nextTick(Ai,r),t(s)):process.nextTick(Ai,r)}),this)}function fc(e,t){Lo(e,t),Ai(e)}function Ai(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function bp(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Lo(e,t){e.emit("error",t)}function yp(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Su={destroy:vp,undestroy:bp,errorOrDestroy:yp},Tr={};function wp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Ru={};function vt(e,t,r){r||(r=Error);function n(s,o,c){return typeof t=="string"?t:t(s,o,c)}var i=function(s){wp(o,s);function o(c,u,l){return s.call(this,n(c,u,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=e,Ru[e]=i}function pc(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Ep(e,t,r){return e.substr(0,t.length)===t}function Sp(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Rp(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}vt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);vt("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&Ep(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Sp(e," argument"))i="The ".concat(e," ").concat(n," ").concat(pc(t,"type"));else{var s=Rp(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(pc(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);vt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");vt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});vt("ERR_STREAM_PREMATURE_CLOSE","Premature close");vt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});vt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");vt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");vt("ERR_STREAM_WRITE_AFTER_END","write after end");vt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);vt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);vt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Tr.codes=Ru;var Cp=Tr.codes.ERR_INVALID_OPT_VALUE;function Mp(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function kp(e,t,r,n){var i=Mp(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Cp(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Cu={getHighWaterMark:kp},Ip=xp;function xp(e,t){if(Ys("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Ys("throwDeprecation"))throw new Error(t);Ys("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Ys(e){try{if(!J.localStorage)return!1}catch{return!1}var t=J.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Xs,gc;function Mu(){if(gc)return Xs;gc=1,Xs=V;function e(I){var T=this;this.next=null,this.entry=null,this.finish=function(){q(T,I)}}var t;V.WritableState=D;var r={deprecate:Ip},n=Eu,i=Fn.Buffer,s=(typeof J<"u"?J:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(I){return i.from(I)}function c(I){return i.isBuffer(I)||I instanceof s}var u=Su,l=Cu,p=l.getHighWaterMark,f=Tr.codes,_=f.ERR_INVALID_ARG_TYPE,R=f.ERR_METHOD_NOT_IMPLEMENTED,x=f.ERR_MULTIPLE_CALLBACK,P=f.ERR_STREAM_CANNOT_PIPE,L=f.ERR_STREAM_DESTROYED,C=f.ERR_STREAM_NULL_VALUES,k=f.ERR_STREAM_WRITE_AFTER_END,N=f.ERR_UNKNOWN_ENCODING,$=u.errorOrDestroy;Et(V,n);function O(){}function D(I,T,B){t=t||un(),I=I||{},typeof B!="boolean"&&(B=T instanceof t),this.objectMode=!!I.objectMode,B&&(this.objectMode=this.objectMode||!!I.writableObjectMode),this.highWaterMark=p(this,I,"writableHighWaterMark",B),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=I.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(te){g(T,te)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=I.emitClose!==!1,this.autoDestroy=!!I.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}D.prototype.getBuffer=function(){for(var T=this.bufferedRequest,B=[];T;)B.push(T),T=T.next;return B},function(){try{Object.defineProperty(D.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var G;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(G=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(T){return G.call(this,T)?!0:this!==V?!1:T&&T._writableState instanceof D}})):G=function(T){return T instanceof this};function V(I){t=t||un();var T=this instanceof t;if(!T&&!G.call(V,this))return new V(I);this._writableState=new D(I,this,T),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),n.call(this)}V.prototype.pipe=function(){$(this,new P)};function H(I,T){var B=new k;$(I,B),process.nextTick(T,B)}function X(I,T,B,U){var te;return B===null?te=new C:typeof B!="string"&&!T.objectMode&&(te=new _("chunk",["string","Buffer"],B)),te?($(I,te),process.nextTick(U,te),!1):!0}V.prototype.write=function(I,T,B){var U=this._writableState,te=!1,w=!U.objectMode&&c(I);return w&&!i.isBuffer(I)&&(I=o(I)),typeof T=="function"&&(B=T,T=null),w?T="buffer":T||(T=U.defaultEncoding),typeof B!="function"&&(B=O),U.ending?H(this,B):(w||X(this,U,I,B))&&(U.pendingcb++,te=ie(this,U,w,I,T,B)),te},V.prototype.cork=function(){this._writableState.corked++},V.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&M(this,I))},V.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new N(T);return this._writableState.defaultEncoding=T,this},Object.defineProperty(V.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(I,T,B){return!I.objectMode&&I.decodeStrings!==!1&&typeof T=="string"&&(T=i.from(T,B)),T}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ie(I,T,B,U,te,w){if(!B){var E=Q(T,U,te);U!==E&&(B=!0,te="buffer",U=E)}var F=T.objectMode?1:U.length;T.length+=F;var j=T.length */var mc;function Ap(){return mc||(mc=1,function(e,t){var r=Fn,n=r.Buffer;function i(o,c){for(var u in o)c[u]=o[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(o,c,u){return n(o,c,u)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,c,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,c,u)},s.alloc=function(o,c,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return c!==void 0?typeof u=="string"?l.fill(c,u):l.fill(c):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}}(vi,vi.exports)),vi.exports}var vc;function bc(){if(vc)return to;vc=1;var e=Ap().Buffer,t=e.isEncoding||function(C){switch(C=""+C,C&&C.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(C){if(!C)return"utf8";for(var k;;)switch(C){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return C;default:if(k)return;C=(""+C).toLowerCase(),k=!0}}function n(C){var k=r(C);if(typeof k!="string"&&(e.isEncoding===t||!t(C)))throw new Error("Unknown encoding: "+C);return k||C}to.StringDecoder=i;function i(C){this.encoding=n(C);var k;switch(this.encoding){case"utf16le":this.text=f,this.end=_,k=4;break;case"utf8":this.fillLast=u,k=4;break;case"base64":this.text=R,this.end=x,k=3;break;default:this.write=P,this.end=L;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(k)}i.prototype.write=function(C){if(C.length===0)return"";var k,N;if(this.lastNeed){if(k=this.fillLast(C),k===void 0)return"";N=this.lastNeed,this.lastNeed=0}else N=0;return N>5===6?2:C>>4===14?3:C>>3===30?4:C>>6===2?-1:-2}function o(C,k,N){var $=k.length-1;if($=0?(O>0&&(C.lastNeed=O-1),O):--$=0?(O>0&&(C.lastNeed=O-2),O):--$=0?(O>0&&(O===2?O=0:C.lastNeed=O-3),O):0))}function c(C,k,N){if((k[0]&192)!==128)return C.lastNeed=0,"�";if(C.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return C.lastNeed=1,"�";if(C.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return C.lastNeed=2,"�"}}function u(C){var k=this.lastTotal-this.lastNeed,N=c(this,C);if(N!==void 0)return N;if(this.lastNeed<=C.length)return C.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);C.copy(this.lastChar,k,0,C.length),this.lastNeed-=C.length}function l(C,k){var N=o(this,C,k);if(!this.lastNeed)return C.toString("utf8",k);this.lastTotal=N;var $=C.length-(N-this.lastNeed);return C.copy(this.lastChar,0,$),C.toString("utf8",k,$)}function p(C){var k=C&&C.length?this.write(C):"";return this.lastNeed?k+"�":k}function f(C,k){if((C.length-k)%2===0){var N=C.toString("utf16le",k);if(N){var $=N.charCodeAt(N.length-1);if($>=55296&&$<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=C[C.length-2],this.lastChar[1]=C[C.length-1],N.slice(0,-1)}return N}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=C[C.length-1],C.toString("utf16le",k,C.length-1)}function _(C){var k=C&&C.length?this.write(C):"";if(this.lastNeed){var N=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,N)}return k}function R(C,k){var N=(C.length-k)%3;return N===0?C.toString("base64",k):(this.lastNeed=3-N,this.lastTotal=3,N===1?this.lastChar[0]=C[C.length-1]:(this.lastChar[0]=C[C.length-2],this.lastChar[1]=C[C.length-1]),C.toString("base64",k,C.length-N))}function x(C){var k=C&&C.length?this.write(C):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function P(C){return C.toString(this.encoding)}function L(C){return C&&C.length?this.write(C):""}return to}var yc=Tr.codes.ERR_STREAM_PREMATURE_CLOSE;function Tp(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof E!="string"&&!ee.objectMode&&Object.getPrototypeOf(E)!==n.prototype&&(E=s(E)),j)ee.endEmitted?O(w,new C):Q(w,ee,E,!0);else if(ee.ended)O(w,new P);else{if(ee.destroyed)return!1;ee.reading=!1,ee.decoder&&!F?(E=ee.decoder.write(E),ee.objectMode||E.length!==0?Q(w,ee,E,!1):M(w,ee)):Q(w,ee,E,!1)}else j||(ee.reading=!1,M(w,ee))}return!ee.ended&&(ee.length=v?w=v:(w--,w|=w>>>1,w|=w>>>2,w|=w>>>4,w|=w>>>8,w|=w>>>16,w++),w}function d(w,E){return w<=0||E.length===0&&E.ended?0:E.objectMode?1:w!==w?E.flowing&&E.length?E.buffer.head.data.length:E.length:(w>E.highWaterMark&&(E.highWaterMark=a(w)),w<=E.length?w:E.ended?E.length:(E.needReadable=!0,0))}H.prototype.read=function(w){u("read",w),w=parseInt(w,10);var E=this._readableState,F=w;if(w!==0&&(E.emittedReadable=!1),w===0&&E.needReadable&&((E.highWaterMark!==0?E.length>=E.highWaterMark:E.length>0)||E.ended))return u("read: emitReadable",E.length,E.ended),E.length===0&&E.ended?B(this):m(this),null;if(w=d(w,E),w===0&&E.ended)return E.length===0&&B(this),null;var j=E.needReadable;u("need readable",j),(E.length===0||E.length-w0?K=T(w,E):K=null,K===null?(E.needReadable=E.length<=E.highWaterMark,w=0):(E.length-=w,E.awaitDrain=0),E.length===0&&(E.ended||(E.needReadable=!0),F!==w&&E.ended&&B(this)),K!==null&&this.emit("data",K),K};function g(w,E){if(u("onEofChunk"),!E.ended){if(E.decoder){var F=E.decoder.end();F&&F.length&&(E.buffer.push(F),E.length+=E.objectMode?1:F.length)}E.ended=!0,E.sync?m(w):(E.needReadable=!1,E.emittedReadable||(E.emittedReadable=!0,y(w)))}}function m(w){var E=w._readableState;u("emitReadable",E.needReadable,E.emittedReadable),E.needReadable=!1,E.emittedReadable||(u("emitReadable",E.flowing),E.emittedReadable=!0,process.nextTick(y,w))}function y(w){var E=w._readableState;u("emitReadable_",E.destroyed,E.length,E.ended),!E.destroyed&&(E.length||E.ended)&&(w.emit("readable"),E.emittedReadable=!1),E.needReadable=!E.flowing&&!E.ended&&E.length<=E.highWaterMark,I(w)}function M(w,E){E.readingMore||(E.readingMore=!0,process.nextTick(A,w,E))}function A(w,E){for(;!E.reading&&!E.ended&&(E.length1&&te(j.pipes,w)!==-1)&&!ge&&(u("false write response, pause",j.awaitDrain),j.awaitDrain++),F.pause())}function de(ue){u("onerror",ue),he(),w.removeListener("error",de),t(w,"error")===0&&O(w,ue)}G(w,"error",de);function fe(){w.removeListener("finish",Pt),he()}w.once("close",fe);function Pt(){u("onfinish"),w.removeListener("close",fe),he()}w.once("finish",Pt);function he(){u("unpipe"),F.unpipe(w)}return w.emit("pipe",F),j.flowing||(u("pipe resume"),F.resume()),w};function b(w){return function(){var F=w._readableState;u("pipeOnDrain",F.awaitDrain),F.awaitDrain&&F.awaitDrain--,F.awaitDrain===0&&t(w,"data")&&(F.flowing=!0,I(w))}}H.prototype.unpipe=function(w){var E=this._readableState,F={hasUnpiped:!1};if(E.pipesCount===0)return this;if(E.pipesCount===1)return w&&w!==E.pipes?this:(w||(w=E.pipes),E.pipes=null,E.pipesCount=0,E.flowing=!1,w&&w.emit("unpipe",this,F),this);if(!w){var j=E.pipes,K=E.pipesCount;E.pipes=null,E.pipesCount=0,E.flowing=!1;for(var ee=0;ee0,j.flowing!==!1&&this.resume()):w==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,u("on readable",j.length,j.reading),j.length?m(this):j.reading||process.nextTick(S,this)),F},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(w,E){var F=r.prototype.removeListener.call(this,w,E);return w==="readable"&&process.nextTick(h,this),F},H.prototype.removeAllListeners=function(w){var E=r.prototype.removeAllListeners.apply(this,arguments);return(w==="readable"||w===void 0)&&process.nextTick(h,this),E};function h(w){var E=w._readableState;E.readableListening=w.listenerCount("readable")>0,E.resumeScheduled&&!E.paused?E.flowing=!0:w.listenerCount("data")>0&&w.resume()}function S(w){u("readable nexttick read 0"),w.read(0)}H.prototype.resume=function(){var w=this._readableState;return w.flowing||(u("resume"),w.flowing=!w.readableListening,W(this,w)),w.paused=!1,this};function W(w,E){E.resumeScheduled||(E.resumeScheduled=!0,process.nextTick(q,w,E))}function q(w,E){u("resume",E.reading),E.reading||w.read(0),E.resumeScheduled=!1,w.emit("resume"),I(w),E.flowing&&!E.reading&&w.read(0)}H.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function I(w){var E=w._readableState;for(u("flow",E.flowing);E.flowing&&w.read()!==null;);}H.prototype.wrap=function(w){var E=this,F=this._readableState,j=!1;w.on("end",function(){if(u("wrapped end"),F.decoder&&!F.ended){var Z=F.decoder.end();Z&&Z.length&&E.push(Z)}E.push(null)}),w.on("data",function(Z){if(u("wrapped data"),F.decoder&&(Z=F.decoder.write(Z)),!(F.objectMode&&Z==null)&&!(!F.objectMode&&(!Z||!Z.length))){var le=E.push(Z);le||(j=!0,w.pause())}});for(var K in w)this[K]===void 0&&typeof w[K]=="function"&&(this[K]=function(le){return function(){return w[le].apply(w,arguments)}}(K));for(var ee=0;ee=E.length?(E.decoder?F=E.buffer.join(""):E.buffer.length===1?F=E.buffer.first():F=E.buffer.concat(E.length),E.buffer.clear()):F=E.buffer.consume(w,E.decoder),F}function B(w){var E=w._readableState;u("endReadable",E.endEmitted),E.endEmitted||(E.ended=!0,process.nextTick(U,E,w))}function U(w,E){if(u("endReadableNT",w.endEmitted,w.length),!w.endEmitted&&w.length===0&&(w.endEmitted=!0,E.readable=!1,E.emit("end"),w.autoDestroy)){var F=E._writableState;(!F||F.autoDestroy&&F.finished)&&E.destroy()}}typeof Symbol=="function"&&(H.from=function(w,E){return $===void 0&&($=Pp()),$(H,w,E)});function te(w,E){for(var F=0,j=w.length;F0;return Gp(o,u,l,function(p){i||(i=p),p&&s.forEach(Mc),!u&&(s.forEach(Mc),n(i))})});return t.reduce(Jp)}var Qp=Kp;(function(e,t){t=e.exports=Iu(),t.Stream=t,t.Readable=t,t.Writable=Mu(),t.Duplex=un(),t.Transform=xu,t.PassThrough=Up,t.finished=sa,t.pipeline=Qp})(No,No.exports);var Nu=No.exports;const{Transform:Yp}=Nu;var Xp=e=>class Lu extends Yp{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Lu(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:e1}=Nu;var t1=e=>class Ou extends e1{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Ou(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const r1=Xp,n1=t1;var i1=function(e){const t=r1(e),r=n1(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Pu={};const kc=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Pu.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],p=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49];let _=p^(i<<1|s>>>31),R=f^(s<<1|i>>>31);const x=e[0]^_,P=e[1]^R,L=e[10]^_,C=e[11]^R,k=e[20]^_,N=e[21]^R,$=e[30]^_,O=e[31]^R,D=e[40]^_,G=e[41]^R;_=r^(o<<1|c>>>31),R=n^(c<<1|o>>>31);const V=e[2]^_,H=e[3]^R,X=e[12]^_,Q=e[13]^R,ie=e[22]^_,v=e[23]^R,a=e[32]^_,d=e[33]^R,g=e[42]^_,m=e[43]^R;_=i^(u<<1|l>>>31),R=s^(l<<1|u>>>31);const y=e[4]^_,M=e[5]^R,A=e[14]^_,b=e[15]^R,h=e[24]^_,S=e[25]^R,W=e[34]^_,q=e[35]^R,I=e[44]^_,T=e[45]^R;_=o^(p<<1|f>>>31),R=c^(f<<1|p>>>31);const B=e[6]^_,U=e[7]^R,te=e[16]^_,w=e[17]^R,E=e[26]^_,F=e[27]^R,j=e[36]^_,K=e[37]^R,ee=e[46]^_,Z=e[47]^R;_=u^(r<<1|n>>>31),R=l^(n<<1|r>>>31);const le=e[8]^_,Ct=e[9]^R,ge=e[18]^_,_e=e[19]^R,Vt=e[28]^_,de=e[29]^R,fe=e[38]^_,Pt=e[39]^R,he=e[48]^_,ue=e[49]^R,ct=x,me=P,ve=C<<4|L>>>28,Or=L<<4|C>>>28,be=k<<3|N>>>29,ye=N<<3|k>>>29,Pr=O<<9|$>>>23,we=$<<9|O>>>23,Ee=D<<18|G>>>14,$r=G<<18|D>>>14,Se=V<<1|H>>>31,Re=H<<1|V>>>31,Br=Q<<12|X>>>20,Ce=X<<12|Q>>>20,Me=ie<<10|v>>>22,Dr=v<<10|ie>>>22,ke=d<<13|a>>>19,Ie=a<<13|d>>>19,Fr=g<<2|m>>>30,xe=m<<2|g>>>30,Ae=M<<30|y>>>2,jr=y<<30|M>>>2,Te=A<<6|b>>>26,Ne=b<<6|A>>>26,Hr=S<<11|h>>>21,Le=h<<11|S>>>21,Oe=W<<15|q>>>17,Ur=q<<15|W>>>17,Pe=T<<29|I>>>3,$e=I<<29|T>>>3,Wr=B<<28|U>>>4,Be=U<<28|B>>>4,De=w<<23|te>>>9,Vr=te<<23|w>>>9,Fe=E<<25|F>>>7,je=F<<25|E>>>7,Qt=j<<21|K>>>11,Yt=K<<21|j>>>11,Xt=Z<<24|ee>>>8,er=ee<<24|Z>>>8,tr=le<<27|Ct>>>5,rr=Ct<<27|le>>>5,nr=ge<<20|_e>>>12,ir=_e<<20|ge>>>12,sr=de<<7|Vt>>>25,or=Vt<<7|de>>>25,ar=fe<<8|Pt>>>24,cr=Pt<<8|fe>>>24,lr=he<<14|ue>>>18,ur=ue<<14|he>>>18;e[0]=ct^~Br&Hr,e[1]=me^~Ce&Le,e[10]=Wr^~nr&be,e[11]=Be^~ir&ye,e[20]=Se^~Te&Fe,e[21]=Re^~Ne&je,e[30]=tr^~ve&Me,e[31]=rr^~Or&Dr,e[40]=Ae^~De&sr,e[41]=jr^~Vr&or,e[2]=Br^~Hr&Qt,e[3]=Ce^~Le&Yt,e[12]=nr^~be&ke,e[13]=ir^~ye&Ie,e[22]=Te^~Fe&ar,e[23]=Ne^~je&cr,e[32]=ve^~Me&Oe,e[33]=Or^~Dr&Ur,e[42]=De^~sr&Pr,e[43]=Vr^~or&we,e[4]=Hr^~Qt&lr,e[5]=Le^~Yt&ur,e[14]=be^~ke&Pe,e[15]=ye^~Ie&$e,e[24]=Fe^~ar&Ee,e[25]=je^~cr&$r,e[34]=Me^~Oe&Xt,e[35]=Dr^~Ur&er,e[44]=sr^~Pr&Fr,e[45]=or^~we&xe,e[6]=Qt^~lr&ct,e[7]=Yt^~ur&me,e[16]=ke^~Pe&Wr,e[17]=Ie^~$e&Be,e[26]=ar^~Ee&Se,e[27]=cr^~$r&Re,e[36]=Oe^~Xt&tr,e[37]=Ur^~er&rr,e[46]=Pr^~Fr&Ae,e[47]=we^~xe&jr,e[8]=lr^~ct&Br,e[9]=ur^~me&Ce,e[18]=Pe^~Wr&nr,e[19]=$e^~Be&ir,e[28]=Ee^~Se&Te,e[29]=$r^~Re&Ne,e[38]=Xt^~tr&ve,e[39]=er^~rr&Or,e[48]=Fr^~Ae&De,e[49]=xe^~jr&Vr,e[0]^=kc[t*2],e[1]^=kc[t*2+1]}};const Li=Pu;function wn(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}wn.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};wn.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Li.p1600(this.state),this.count=0);return t};wn.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var s1=wn,o1=i1(s1);const a1=o1,c1=Ui;function $u(e){return Buffer.allocUnsafe(e).fill(0)}function Bu(e,t,r){const n=$u(t);return e=_s(e),r?e.length"u")throw new Error("Not an array?");if(r=Uu(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(xt(e,t[s]));if(r==="dynamic"){var o=xt("uint256",t.length);i.unshift(o)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([xt("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,Rr.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=tn(e),r<1||r>32)throw new Error("Invalid bytes width: "+r);return Rr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=tn(e),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=_r(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=tn(e),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=_r(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=Ic(e),n=_r(t),n<0)throw new Error("Supplied ufixed is negative");return xt("uint256",n.mul(new br(2).pow(new br(r[1]))))}else if(e.startsWith("fixed"))return r=Ic(e),xt("int256",_r(t).mul(new br(2).pow(new br(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function f1(e){return e==="string"||e==="bytes"||Uu(e)==="dynamic"}function p1(e){return e.lastIndexOf("]")===e.length-1}function g1(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var o=Hu(e[s]),c=t[s],u=xt(o,c);f1(o)?(r.push(xt("uint256",i)),n.push(u),i+=u.length):r.push(u)}return Buffer.concat(r.concat(n))}function Wu(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(Rr.setLengthRight(c,r))}else if(o.startsWith("uint")){if(r=tn(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=_r(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=tn(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=_r(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function _1(e,t){return Rr.keccak(Wu(e,t))}var m1={rawEncode:g1,solidityPack:Wu,soliditySHA3:_1};const yt=ju,Nn=m1,Vu={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},oo={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const o=(c,u,l)=>{if(r[u]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":yt.keccak(this.encodeData(u,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${c} of type ${u}`);if(u==="bytes")return["bytes32",yt.keccak(l)];if(u==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",yt.keccak(l)];if(u.lastIndexOf("]")===u.length-1){const p=u.slice(0,u.lastIndexOf("[")),f=l.map(_=>o(c,p,_));return["bytes32",yt.keccak(Nn.rawEncode(f.map(([_])=>_),f.map(([,_])=>_)))]}return[u,l]};for(const c of r[e]){const[u,l]=o(c.name,c.type,t[c.name]);i.push(u),s.push(l)}}else for(const o of r[e]){let c=t[o.name];if(c!==void 0)if(o.type==="bytes")i.push("bytes32"),c=yt.keccak(c),s.push(c);else if(o.type==="string")i.push("bytes32"),typeof c=="string"&&(c=Buffer.from(c,"utf8")),c=yt.keccak(c),s.push(c);else if(r[o.type]!==void 0)i.push("bytes32"),c=yt.keccak(this.encodeData(o.type,c,r,n)),s.push(c);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(c)}}return Nn.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:o,type:c})=>c+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return yt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return yt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Vu.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),yt.keccak(Buffer.concat(n))}};var v1={TYPED_MESSAGE_SCHEMA:Vu,TypedDataUtils:oo,hashForSignTypedDataLegacy:function(e){return b1(e.data)},hashForSignTypedData_v3:function(e){return oo.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return oo.hash(e.data)}};function b1(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?yt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return Nn.soliditySHA3(["bytes32","bytes32"],[Nn.soliditySHA3(new Array(e.length).fill("string"),i),Nn.soliditySHA3(n,r)])}var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.filterFromParam=hn.FilterPolyfill=void 0;const Yr=Je,nt=z,y1=5*60*1e3,mr={jsonrpc:"2.0",id:0};class w1{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Yr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=qu(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,nt.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,nt.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,nt.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,nt.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,nt.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(bi())}async getFilterLogs(t){const r=(0,nt.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getLogs",params:[xc(n)]})):bi()}makeFilterId(){return(0,Yr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return bi();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return yi();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getLogs",params:[xc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const c=o.result.map(l=>(0,nt.intNumberFromHexString)(l.blockNumber||"0x0")),u=Math.max(...c);if(u&&u>n){const l=(0,Yr.IntNumber)(u+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${l}`),this.cursors.set(t,l)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return bi();const n=await this.getCurrentBlockHeight();if(r>n)return yi();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,nt.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Yr.IntNumber)(o))))).filter(o=>!!o),s=(0,Yr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},mr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(yi())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},y1);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_blockNumber",params:[]}));return(0,nt.intNumberFromHexString)((0,nt.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getBlockByNumber",params:[(0,nt.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,nt.ensureHexString)(r.result.hash):null}}hn.FilterPolyfill=w1;function qu(e){return{fromBlock:Ac(e.fromBlock),toBlock:Ac(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}hn.filterFromParam=qu;function xc(e){const t={fromBlock:Tc(e.fromBlock),toBlock:Tc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Ac(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Yr.IntNumber)(0);if((0,nt.isHexString)(e))return(0,nt.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Tc(e){return e==="latest"?e:(0,nt.hexStringFromIntNumber)(e)}function bi(){return Object.assign(Object.assign({},mr),{error:{code:-32e3,message:"filter not found"}})}function yi(){return Object.assign(Object.assign({},mr),{result:[]})}var ms={},zu={},vs={},oa=E1;function E1(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const Nc=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i{t.errorFirst?n.push(function(o,c){if(t.multiArgs){const u=new Array(arguments.length-1);for(let l=1;l{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):Nc(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?Nc(s,t):s}return n},ri={},ni={};Object.defineProperty(ni,"__esModule",{value:!0});const R1=Fi;function Lc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function C1(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const c=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw c.context=o,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Lc(s,this,r);else{const o=s.length,c=C1(s);for(let u=0;ue+t,Oc=["sync","latest"];class T1 extends I1.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*x1,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){Oc.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Oc.map(t=>this.listenerCount(t)).reduce(A1)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Pc(t),i=Pc(r);return this._usePastBlocks&&ni}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}ri.BaseBlockTracker=T1;function Pc(e){return Number.parseInt(e,16)}var Gu={},Ju={},tt={};class Zu extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:c}=t,u=c.length===0?i:`At path: ${c.join(".")} -- ${i}`;super(s??u),s!=null&&(this.cause=u),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function N1(e){return mt(e)&&typeof e[Symbol.iterator]=="function"}function mt(e){return typeof e=="object"&&e!=null}function $c(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ze(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function L1(e){const{done:t,value:r}=e.next();return t?void 0:r}function O1(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:c,message:u=`Expected a value of type \`${o}\`${c?` with refinement \`${c}\``:""}, but received: \`${Ze(n)}\``}=e;return{value:n,type:o,refinement:c,key:i[i.length-1],path:i,branch:s,...e,message:u}}function*Oo(e,t,r,n){N1(e)||(e=[e]);for(const i of e){const s=O1(i,t,r,n);s&&(yield s)}}function*aa(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,c={path:n,branch:i};if(s&&(e=t.coercer(e,c),o&&t.type!=="type"&&mt(t.schema)&&mt(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let u="valid";for(const l of t.validator(e,c))l.explanation=r.message,u="not_valid",yield[l,void 0];for(let[l,p,f]of t.entries(e,c)){const _=aa(p,f,{path:l===void 0?n:[...n,l],branch:l===void 0?i:[...i,p],coerce:s,mask:o,message:r.message});for(const R of _)R[0]?(u=R[0].refinement!=null?"not_refined":"not_valid",yield[R[0],void 0]):s&&(p=R[1],l===void 0?e=p:e instanceof Map?e.set(l,p):e instanceof Set?e.add(p):mt(e)&&(p!==void 0||l in e)&&(e[l]=p))}if(u!=="not_valid")for(const l of t.refiner(e,c))l.explanation=r.message,u="not_refined",yield[l,void 0];u==="valid"&&(yield[void 0,e])}class ze{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=u=>u,entries:c=function*(){}}=t;this.type=r,this.schema=n,this.entries=c,this.coercer=o,i?this.validator=(u,l)=>{const p=i(u,l);return Oo(p,l,this,u)}:this.validator=()=>[],s?this.refiner=(u,l)=>{const p=s(u,l);return Oo(p,l,this,u)}:this.refiner=()=>[]}assert(t,r){return Ku(t,this,r)}create(t,r){return Qu(t,this,r)}is(t){return ca(t,this)}mask(t,r){return Yu(t,this,r)}validate(t,r={}){return En(t,this,r)}}function Ku(e,t,r){const n=En(e,t,{message:r});if(n[0])throw n[0]}function Qu(e,t,r){const n=En(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Yu(e,t,r){const n=En(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ca(e,t){return!En(e,t)[0]}function En(e,t,r={}){const n=aa(e,t,r),i=L1(n);return i[0]?[new Zu(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function P1(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?si(n):ii(n)}function at(e,t){return new ze({type:e,schema:null,validator:t})}function $1(e,t){return new ze({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function B1(e){return new ze({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function D1(e){let t;return new ze({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function F1(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return si(n);default:return ii(n)}}function j1(e){const t=e instanceof ze,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Xu(r[n]);return t&&e.type==="type"?si(r):ii(r)}function H1(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return si(n);default:return ii(n)}}function U1(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),at(e,t)}function W1(){return at("any",()=>!0)}function V1(e){return new ze({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Ze(t)}`}})}function q1(){return at("bigint",e=>typeof e=="bigint")}function z1(){return at("boolean",e=>typeof e=="boolean")}function G1(){return at("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ze(e)}`)}function J1(e){const t={},r=e.map(n=>Ze(n)).join();for(const n of e)t[n]=n;return new ze({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ze(n)}`}})}function Z1(){return at("func",e=>typeof e=="function"||`Expected a function, but received: ${Ze(e)}`)}function K1(e){return at("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ze(t)}`)}function Q1(){return at("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ze(e)}`)}function Y1(e){return new ze({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function X1(e){const t=Ze(e),r=typeof e;return new ze({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ze(n)}`}})}function eg(e,t){return new ze({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Ze(r)}`}})}function la(){return at("never",()=>!1)}function tg(e){return new ze({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function rg(){return at("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ze(e)}`)}function ii(e){const t=e?Object.keys(e):[],r=la();return new ze({type:"object",schema:e||null,*entries(n){if(e&&mt(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return mt(n)||`Expected an object, but received: ${Ze(n)}`},coercer(n){return mt(n)?{...n}:n}})}function Xu(e){return new ze({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function ng(e,t){return new ze({type:"record",schema:null,*entries(r){if(mt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return mt(r)||`Expected an object, but received: ${Ze(r)}`}})}function ig(){return at("regexp",e=>e instanceof RegExp)}function sg(e){return new ze({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Ze(t)}`}})}function eh(){return at("string",e=>typeof e=="string"||`Expected a string, but received: ${Ze(e)}`)}function og(e){const t=la();return new ze({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;ir.type).join(" | ");return new ze({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...o]=aa(r,s,n),[c]=o;if(c[0])for(const[u]of o)u&&i.push(u);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ze(r)}`,...i]}})}function th(){return at("unknown",()=>!0)}function ua(e,t,r){return new ze({...e,coercer:(n,i)=>ca(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function cg(e,t,r={}){return ua(e,th(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&$c(n)&&$c(i)){const s={...n};let o=!1;for(const c in i)s[c]===void 0&&(s[c]=i[c],o=!0);if(o)return s}return n})}function lg(e){return ua(e,eh(),t=>t.trim())}function ug(e){return Nr(e,"empty",t=>{const r=rh(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function rh(e){return e instanceof Map||e instanceof Set?e.size:e.length}function hg(e,t,r={}){const{exclusive:n}=r;return Nr(e,"max",i=>n?in?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function fg(e){return Nr(e,"nonempty",t=>rh(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function pg(e,t){return Nr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function gg(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Nr(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function Nr(e,t,r){return new ze({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),o=Oo(s,i,e,n);for(const c of o)yield{...c,refinement:t}}})}const _g=Object.freeze(Object.defineProperty({__proto__:null,Struct:ze,StructError:Zu,any:W1,array:V1,assert:Ku,assign:P1,bigint:q1,boolean:z1,coerce:ua,create:Qu,date:G1,defaulted:cg,define:at,deprecated:$1,dynamic:B1,empty:ug,enums:J1,func:Z1,instance:K1,integer:Q1,intersection:Y1,is:ca,lazy:D1,literal:X1,map:eg,mask:Yu,max:hg,min:dg,never:la,nonempty:fg,nullable:tg,number:rg,object:ii,omit:F1,optional:Xu,partial:j1,pattern:pg,pick:H1,record:ng,refine:Nr,regexp:ig,set:sg,size:gg,string:eh,struct:U1,trimmed:lg,tuple:og,type:si,union:ag,unknown:th,validate:En},Symbol.toStringTag,{value:"Module"})),Lr=gn(_g);Object.defineProperty(tt,"__esModule",{value:!0});tt.assertExhaustive=tt.assertStruct=tt.assert=tt.AssertionError=void 0;const mg=Lr;function vg(e){return typeof e=="object"&&e!==null&&"message"in e}function bg(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function yg(e){const t=vg(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function nh(e,t){return bg(e)?new e({message:t}):e({message:t})}class ha extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}tt.AssertionError=ha;function wg(e,t="Assertion failed.",r=ha){if(!e)throw t instanceof Error?t:nh(r,t)}tt.assert=wg;function Eg(e,t,r="Assertion failed",n=ha){try{(0,mg.assert)(e,t)}catch(i){throw nh(n,`${r}: ${yg(i)}.`)}}tt.assertStruct=Eg;function Sg(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}tt.assertExhaustive=Sg;var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.base64=void 0;const Rg=Lr,Cg=tt,Mg=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,Cg.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let c;return i?c=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):c=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,Rg.pattern)(e,c)};oi.base64=Mg;var ae={},ai={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Lr,r=tt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,t.is)(l,e.HexStruct)}e.isHexString=n;function i(l){return(0,t.is)(l,e.StrictHexStruct)}e.isStrictHexString=i;function s(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function o(l){(0,r.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function c(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}e.add0x=c;function u(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}e.remove0x=u})(ai);Object.defineProperty(ae,"__esModule",{value:!0});ae.createDataView=ae.concatBytes=ae.valueToBytes=ae.stringToBytes=ae.numberToBytes=ae.signedBigIntToBytes=ae.bigIntToBytes=ae.hexToBytes=ae.bytesToString=ae.bytesToNumber=ae.bytesToSignedBigInt=ae.bytesToBigInt=ae.bytesToHex=ae.assertIsBytes=ae.isBytes=void 0;const ht=tt,Po=ai,Bc=48,Dc=58,Fc=87;function kg(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const Ig=kg();function da(e){return e instanceof Uint8Array}ae.isBytes=da;function Sn(e){(0,ht.assert)(da(e),"Value must be a Uint8Array.")}ae.assertIsBytes=Sn;function ih(e){if(Sn(e),e.length===0)return"0x";const t=Ig(),r=new Array(e.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return bs(t)}ae.bigIntToBytes=oh;function Ng(e,t){(0,ht.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function Lg(e,t){(0,ht.assert)(typeof e=="bigint","Value must be a bigint."),(0,ht.assert)(typeof t=="number","Byte length must be a number."),(0,ht.assert)(t>0,"Byte length must be greater than 0."),(0,ht.assert)(Ng(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i>=BigInt(8);return n.reverse()}ae.signedBigIntToBytes=Lg;function ah(e){(0,ht.assert)(typeof e=="number","Value must be a number."),(0,ht.assert)(e>=0,"Value must be a non-negative number."),(0,ht.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return bs(t)}ae.numberToBytes=ah;function ch(e){return(0,ht.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ae.stringToBytes=ch;function lh(e){if(typeof e=="bigint")return oh(e);if(typeof e=="number")return ah(e);if(typeof e=="string")return e.startsWith("0x")?bs(e):ch(e);if(da(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ae.valueToBytes=lh;function Og(e){const t=new Array(e.length);let r=0;for(let i=0;it.call(r,n,i,this))}get(t){return it(this,bt,"f").get(t)}has(t){return it(this,bt,"f").has(t)}keys(){return it(this,bt,"f").keys()}values(){return it(this,bt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}dn.FrozenMap=fa;class pa{constructor(t){kt.set(this,void 0),dh(this,kt,new Set(t),"f"),Object.freeze(this)}get size(){return it(this,kt,"f").size}[(kt=new WeakMap,Symbol.iterator)](){return it(this,kt,"f")[Symbol.iterator]()}entries(){return it(this,kt,"f").entries()}forEach(t,r){return it(this,kt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return it(this,kt,"f").has(t)}keys(){return it(this,kt,"f").keys()}values(){return it(this,kt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}dn.FrozenSet=pa;Object.freeze(fa);Object.freeze(fa.prototype);Object.freeze(pa);Object.freeze(pa.prototype);var fh={};Object.defineProperty(fh,"__esModule",{value:!0});var ph={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Lr,r=tt,n=()=>(0,t.define)("finite number",O=>(0,t.is)(O,(0,t.number)())&&Number.isFinite(O));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(O,D)=>{function G(V,H){const Q=[...H.validator(V,D)];return Q.length>0?Q:!0}try{const V=G(O,e.UnsafeJsonStruct);return V!==!0?V:G(JSON.parse(JSON.stringify(O)),e.UnsafeJsonStruct)}catch(V){return V instanceof RangeError?"Circular reference detected":!1}});function i(O){return(0,t.is)(O,e.JsonStruct)}e.isValidJson=i;function s(O){(0,r.assertStruct)(O,e.JsonStruct,"Invalid JSON value");const D=JSON.stringify(O);return new TextEncoder().encode(D).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(O){return(0,t.is)(O,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function c(O,D){(0,r.assertStruct)(O,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",D)}e.assertIsJsonRpcNotification=c;function u(O){return(0,t.is)(O,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=u;function l(O,D){(0,r.assertStruct)(O,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",D)}e.assertIsJsonRpcRequest=l,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function p(O){return(0,t.is)(O,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=p;function f(O,D){(0,r.assertStruct)(O,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",D)}e.assertIsPendingJsonRpcResponse=f;function _(O){return(0,t.is)(O,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=_;function R(O,D){(0,r.assertStruct)(O,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",D)}e.assertIsJsonRpcResponse=R;function x(O){return(0,t.is)(O,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=x;function P(O,D){(0,r.assertStruct)(O,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",D)}e.assertIsJsonRpcSuccess=P;function L(O){return(0,t.is)(O,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=L;function C(O,D){(0,r.assertStruct)(O,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",D)}e.assertIsJsonRpcFailure=C;function k(O){return(0,t.is)(O,e.JsonRpcErrorStruct)}e.isJsonRpcError=k;function N(O,D){(0,r.assertStruct)(O,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",D)}e.assertIsJsonRpcError=N;function $(O){const{permitEmptyString:D,permitFractions:G,permitNull:V}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},O);return X=>!!(typeof X=="number"&&(G||Number.isInteger(X))||typeof X=="string"&&(D||X.length>0)||V&&X===null)}e.getJsonRpcIdValidator=$})(ph);var gh={};Object.defineProperty(gh,"__esModule",{value:!0});var fn={},$o={exports:{}},ao,Hc;function zg(){if(Hc)return ao;Hc=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;ao=function(p,f){f=f||{};var _=typeof p;if(_==="string"&&p.length>0)return o(p);if(_==="number"&&isFinite(p))return f.long?u(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function o(p){if(p=String(p),!(p.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(f){var _=parseFloat(f[1]),R=(f[2]||"ms").toLowerCase();switch(R){case"years":case"year":case"yrs":case"yr":case"y":return _*s;case"weeks":case"week":case"w":return _*i;case"days":case"day":case"d":return _*n;case"hours":case"hour":case"hrs":case"hr":case"h":return _*r;case"minutes":case"minute":case"mins":case"min":case"m":return _*t;case"seconds":case"second":case"secs":case"sec":case"s":return _*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return _;default:return}}}}function c(p){var f=Math.abs(p);return f>=n?Math.round(p/n)+"d":f>=r?Math.round(p/r)+"h":f>=t?Math.round(p/t)+"m":f>=e?Math.round(p/e)+"s":p+"ms"}function u(p){var f=Math.abs(p);return f>=n?l(p,f,n,"day"):f>=r?l(p,f,r,"hour"):f>=t?l(p,f,t,"minute"):f>=e?l(p,f,e,"second"):p+" ms"}function l(p,f,_,R){var x=f>=_*1.5;return Math.round(p/_)+" "+R+(x?"s":"")}return ao}function Gg(e){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=o,r.humanize=zg(),r.destroy=l,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let f=0;for(let _=0;_{if(D==="%%")return"%";$++;const V=r.formatters[G];if(typeof V=="function"){const H=L[$];D=V.call(C,H),L.splice($,1),$--}return D}),r.formatArgs.call(C,L),(C.log||r.log).apply(C,L)}return P.namespace=p,P.useColors=r.useColors(),P.color=r.selectColor(p),P.extend=n,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(R!==r.namespaces&&(R=r.namespaces,x=r.enabled(p)),x),set:L=>{_=L}}),typeof r.init=="function"&&r.init(P),P}function n(p,f){const _=r(this.namespace+(typeof f>"u"?":":f)+p);return _.log=this.log,_}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let f;const _=(typeof p=="string"?p:"").split(/[\s,]+/),R=_.length;for(f=0;f"-"+f)].join(",");return r.enable(""),p}function o(p){if(p[p.length-1]==="*")return!0;let f,_;for(f=0,_=r.skips.length;f<_;f++)if(r.skips[f].test(p))return!1;for(f=0,_=r.names.length;f<_;f++)if(r.names[f].test(p))return!0;return!1}function c(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function u(p){return p instanceof Error?p.stack||p.message:p}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Jg=Gg;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=o,t.useColors=n,t.storage=c(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;l.splice(1,0,p,"color: inherit");let f=0,_=0;l[0].replace(/%[a-zA-Z%]/g,R=>{R!=="%%"&&(f++,R==="%c"&&(_=f))}),l.splice(_,0,p)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=r.DEBUG),l}function c(){try{return localStorage}catch{}}e.exports=Jg(t);const{formatters:u}=e.exports;u.j=function(l){try{return JSON.stringify(l)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})($o,$o.exports);var Zg=$o.exports,Kg=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fn,"__esModule",{value:!0});fn.createModuleLogger=fn.createProjectLogger=void 0;const Qg=Kg(Zg),Yg=(0,Qg.default)("metamask");function Xg(e){return Yg.extend(e)}fn.createProjectLogger=Xg;function e_(e,t){return e.extend(t)}fn.createModuleLogger=e_;var _h={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(l){return Array.isArray(l)&&l.length>0}e.isNonEmptyArray=t;function r(l){return l==null}e.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}e.isObject=n;const i=(l,p)=>Object.hasOwnProperty.call(l,p);e.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let p=l;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(l)===p}catch{return!1}}e.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}e.isASCII=o;function c(l){var p;return l.split("").reduce((_,R)=>o(R)?_+1:_+2,0)+((p=l.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}e.calculateStringSize=c;function u(l){return l.toString().length}e.calculateNumberSize=u})(_h);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.hexToBigInt=Ot.hexToNumber=Ot.bigIntToHex=Ot.numberToHex=void 0;const rn=tt,Bn=ai,t_=e=>((0,rn.assert)(typeof e=="number","Value must be a number."),(0,rn.assert)(e>=0,"Value must be a non-negative number."),(0,rn.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Bn.add0x)(e.toString(16)));Ot.numberToHex=t_;const r_=e=>((0,rn.assert)(typeof e=="bigint","Value must be a bigint."),(0,rn.assert)(e>=0,"Value must be a non-negative bigint."),(0,Bn.add0x)(e.toString(16)));Ot.bigIntToHex=r_;const n_=e=>{(0,Bn.assertIsHexString)(e);const t=parseInt(e,16);return(0,rn.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ot.hexToNumber=n_;const i_=e=>((0,Bn.assertIsHexString)(e),BigInt((0,Bn.add0x)(e)));Ot.hexToBigInt=i_;var mh={};Object.defineProperty(mh,"__esModule",{value:!0});var vh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!t(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(vh);var bh={};Object.defineProperty(bh,"__esModule",{value:!0});var yh={},Bo={exports:{}};const s_="2.0.0",wh=256,o_=Number.MAX_SAFE_INTEGER||9007199254740991,a_=16,c_=wh-6,l_=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Es={MAX_LENGTH:wh,MAX_SAFE_COMPONENT_LENGTH:a_,MAX_SAFE_BUILD_LENGTH:c_,MAX_SAFE_INTEGER:o_,RELEASE_TYPES:l_,SEMVER_SPEC_VERSION:s_,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},co={};const u_=typeof process=="object"&&co&&co.NODE_DEBUG&&/\bsemver\b/i.test(co.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Ss=u_;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Es,s=Ss;t=e.exports={};const o=t.re=[],c=t.safeRe=[],u=t.src=[],l=t.t={};let p=0;const f="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",i],[f,n]],R=P=>{for(const[L,C]of _)P=P.split(`${L}*`).join(`${L}{0,${C}}`).split(`${L}+`).join(`${L}{1,${C}}`);return P},x=(P,L,C)=>{const k=R(L),N=p++;s(P,N,L),l[P]=N,u[N]=L,o[N]=new RegExp(L,C?"g":void 0),c[N]=new RegExp(k,C?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*"),x("NUMERICIDENTIFIERLOOSE","\\d+"),x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),x("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),x("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),x("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),x("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),x("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),x("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),x("BUILDIDENTIFIER",`${f}+`),x("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),x("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),x("FULL",`^${u[l.FULLPLAIN]}$`),x("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),x("LOOSE",`^${u[l.LOOSEPLAIN]}$`),x("GTLT","((?:<|>)?=?)"),x("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),x("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),x("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),x("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),x("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),x("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),x("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),x("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),x("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),x("COERCERTL",u[l.COERCE],!0),x("COERCERTLFULL",u[l.COERCEFULL],!0),x("LONETILDE","(?:~>?)"),x("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",x("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),x("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),x("LONECARET","(?:\\^)"),x("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",x("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),x("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),x("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),x("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),x("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",x("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),x("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),x("STAR","(<|>)?=?\\s*\\*"),x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Bo,Bo.exports);var ci=Bo.exports;const h_=Object.freeze({loose:!0}),d_=Object.freeze({}),f_=e=>e?typeof e!="object"?h_:e:d_;var ga=f_;const Uc=/^[0-9]+$/,Eh=(e,t)=>{const r=Uc.test(e),n=Uc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:eEh(t,e);var Sh={compareIdentifiers:Eh,rcompareIdentifiers:p_};const wi=Ss,{MAX_LENGTH:Wc,MAX_SAFE_INTEGER:Ei}=Es,{safeRe:Vc,t:qc}=ci,g_=ga,{compareIdentifiers:Zr}=Sh;let __=class It{constructor(t,r){if(r=g_(r),t instanceof It){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Wc)throw new TypeError(`version is longer than ${Wc} characters`);wi("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Vc[qc.LOOSE]:Vc[qc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ei||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ei||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ei||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Zr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var st=__;const zc=st,m_=(e,t,r=!1)=>{if(e instanceof zc)return e;try{return new zc(e,t)}catch(n){if(!r)return null;throw n}};var Rn=m_;const v_=Rn,b_=(e,t)=>{const r=v_(e,t);return r?r.version:null};var y_=b_;const w_=Rn,E_=(e,t)=>{const r=w_(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var S_=E_;const Gc=st,R_=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Gc(e instanceof Gc?e.version:e,r).inc(t,n,i).version}catch{return null}};var C_=R_;const Jc=Rn,M_=(e,t)=>{const r=Jc(e,null,!0),n=Jc(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,c=s?n:r,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u)return!c.patch&&!c.minor?"major":o.patch?"patch":o.minor?"minor":"major";const p=u?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var k_=M_;const I_=st,x_=(e,t)=>new I_(e,t).major;var A_=x_;const T_=st,N_=(e,t)=>new T_(e,t).minor;var L_=N_;const O_=st,P_=(e,t)=>new O_(e,t).patch;var $_=P_;const B_=Rn,D_=(e,t)=>{const r=B_(e,t);return r&&r.prerelease.length?r.prerelease:null};var F_=D_;const Zc=st,j_=(e,t,r)=>new Zc(e,r).compare(new Zc(t,r));var St=j_;const H_=St,U_=(e,t,r)=>H_(t,e,r);var W_=U_;const V_=St,q_=(e,t)=>V_(e,t,!0);var z_=q_;const Kc=st,G_=(e,t,r)=>{const n=new Kc(e,r),i=new Kc(t,r);return n.compare(i)||n.compareBuild(i)};var _a=G_;const J_=_a,Z_=(e,t)=>e.sort((r,n)=>J_(r,n,t));var K_=Z_;const Q_=_a,Y_=(e,t)=>e.sort((r,n)=>Q_(n,r,t));var X_=Y_;const em=St,tm=(e,t,r)=>em(e,t,r)>0;var Rs=tm;const rm=St,nm=(e,t,r)=>rm(e,t,r)<0;var ma=nm;const im=St,sm=(e,t,r)=>im(e,t,r)===0;var Rh=sm;const om=St,am=(e,t,r)=>om(e,t,r)!==0;var Ch=am;const cm=St,lm=(e,t,r)=>cm(e,t,r)>=0;var va=lm;const um=St,hm=(e,t,r)=>um(e,t,r)<=0;var ba=hm;const dm=Rh,fm=Ch,pm=Rs,gm=va,_m=ma,mm=ba,vm=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return dm(e,r,n);case"!=":return fm(e,r,n);case">":return pm(e,r,n);case">=":return gm(e,r,n);case"<":return _m(e,r,n);case"<=":return mm(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Mh=vm;const bm=st,ym=Rn,{safeRe:Si,t:Ri}=ci,wm=(e,t)=>{if(e instanceof bm)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Si[Ri.COERCEFULL]:Si[Ri.COERCE]);else{const u=t.includePrerelease?Si[Ri.COERCERTLFULL]:Si[Ri.COERCERTL];let l;for(;(l=u.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return ym(`${n}.${i}.${s}${o}${c}`,t)};var Em=wm,lo,Qc;function Sm(){return Qc||(Qc=1,lo=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),lo}var Rm=ce;ce.Node=Cr;ce.create=ce;function ce(e){var t=this;if(t instanceof ce||(t=new ce),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};ce.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};ce.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};ce.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};ce.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new ce;if(tthis.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&nthis.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};ce.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n1;class xm{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[vr]=t.max||1/0;const r=t.length||uo;if(this[Kr]=typeof r!="function"?uo:r,this[Ln]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[yr]=t.maxAge||0,this[$t]=t.dispose,this[Yc]=t.noDisposeOnSet||!1,this[kh]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[vr]=t||1/0,Mn(this)}get max(){return this[vr]}set allowStale(t){this[Ln]=!!t}get allowStale(){return this[Ln]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[yr]=t,Mn(this)}get maxAge(){return this[yr]}set lengthCalculator(t){typeof t!="function"&&(t=uo),t!==this[Kr]&&(this[Kr]=t,this[Ft]=0,this[Qe].forEach(r=>{r.length=this[Kr](r.value,r.key),this[Ft]+=r.length})),Mn(this)}get lengthCalculator(){return this[Kr]}get length(){return this[Ft]}get itemCount(){return this[Qe].length}rforEach(t,r){r=r||this;for(let n=this[Qe].tail;n!==null;){const i=n.prev;Xc(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[Qe].head;n!==null;){const i=n.next;Xc(this,t,n,r),n=i}}keys(){return this[Qe].toArray().map(t=>t.key)}values(){return this[Qe].toArray().map(t=>t.value)}reset(){this[$t]&&this[Qe]&&this[Qe].length&&this[Qe].forEach(t=>this[$t](t.key,t.value)),this[wt]=new Map,this[Qe]=new Im,this[Ft]=0}dump(){return this[Qe].map(t=>Oi(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Qe]}set(t,r,n){if(n=n||this[yr],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Kr](r,t);if(this[wt].has(t)){if(s>this[vr])return nn(this,this[wt].get(t)),!1;const u=this[wt].get(t).value;return this[$t]&&(this[Yc]||this[$t](t,u.value)),u.now=i,u.maxAge=n,u.value=r,this[Ft]+=s-u.length,u.length=s,this.get(t),Mn(this),!0}const o=new Am(t,r,s,i,n);return o.length>this[vr]?(this[$t]&&this[$t](t,r),!1):(this[Ft]+=o.length,this[Qe].unshift(o),this[wt].set(t,this[Qe].head),Mn(this),!0)}has(t){if(!this[wt].has(t))return!1;const r=this[wt].get(t).value;return!Oi(this,r)}get(t){return ho(this,t,!0)}peek(t){return ho(this,t,!1)}pop(){const t=this[Qe].tail;return t?(nn(this,t),t.value):null}del(t){nn(this,this[wt].get(t))}load(t){this.reset();const r=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[wt].forEach((t,r)=>ho(this,r,!1))}}const ho=(e,t,r)=>{const n=e[wt].get(t);if(n){const i=n.value;if(Oi(e,i)){if(nn(e,n),!e[Ln])return}else r&&(e[kh]&&(n.value.now=Date.now()),e[Qe].unshiftNode(n));return i.value}},Oi=(e,t)=>{if(!t||!t.maxAge&&!e[yr])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[yr]&&r>e[yr]},Mn=e=>{if(e[Ft]>e[vr])for(let t=e[Qe].tail;e[Ft]>e[vr]&&t!==null;){const r=t.prev;nn(e,t),t=r}},nn=(e,t)=>{if(t){const r=t.value;e[$t]&&e[$t](r.key,r.value),e[Ft]-=r.length,e[wt].delete(r.key),e[Qe].removeNode(t)}};class Am{constructor(t,r,n,i,s){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const Xc=(e,t,r,n)=>{let i=r.value;Oi(e,i)&&(nn(e,r),e[Ln]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};var Tm=xm,fo,el;function Rt(){if(el)return fo;el=1;class e{constructor(a,d){if(d=n(d),a instanceof e)return a.loose===!!d.loose&&a.includePrerelease===!!d.includePrerelease?a:new e(a.raw,d);if(a instanceof i)return this.raw=a.value,this.set=[[a]],this.format(),this;if(this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease,this.raw=a.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(m=>!x(m[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const m of this.set)if(m.length===1&&P(m[0])){this.set=[m];break}}}this.format()}format(){return this.range=this.set.map(a=>a.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(a){const g=((this.options.includePrerelease&&_)|(this.options.loose&&R))+":"+a,m=r.get(g);if(m)return m;const y=this.options.loose,M=y?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];a=a.replace(M,Q(this.options.includePrerelease)),s("hyphen replace",a),a=a.replace(c[u.COMPARATORTRIM],l),s("comparator trim",a),a=a.replace(c[u.TILDETRIM],p),s("tilde trim",a),a=a.replace(c[u.CARETTRIM],f),s("caret trim",a);let A=a.split(" ").map(W=>C(W,this.options)).join(" ").split(/\s+/).map(W=>X(W,this.options));y&&(A=A.filter(W=>(s("loose invalid filter",W,this.options),!!W.match(c[u.COMPARATORLOOSE])))),s("range list",A);const b=new Map,h=A.map(W=>new i(W,this.options));for(const W of h){if(x(W))return[W];b.set(W.value,W)}b.size>1&&b.has("")&&b.delete("");const S=[...b.values()];return r.set(g,S),S}intersects(a,d){if(!(a instanceof e))throw new TypeError("a Range is required");return this.set.some(g=>L(g,d)&&a.set.some(m=>L(m,d)&&g.every(y=>m.every(M=>y.intersects(M,d)))))}test(a){if(!a)return!1;if(typeof a=="string")try{a=new o(a,this.options)}catch{return!1}for(let d=0;dv.value==="<0.0.0-0",P=v=>v.value==="",L=(v,a)=>{let d=!0;const g=v.slice();let m=g.pop();for(;d&&g.length;)d=g.every(y=>m.intersects(y,a)),m=g.pop();return d},C=(v,a)=>(s("comp",v,a),v=O(v,a),s("caret",v),v=N(v,a),s("tildes",v),v=G(v,a),s("xrange",v),v=H(v,a),s("stars",v),v),k=v=>!v||v.toLowerCase()==="x"||v==="*",N=(v,a)=>v.trim().split(/\s+/).map(d=>$(d,a)).join(" "),$=(v,a)=>{const d=a.loose?c[u.TILDELOOSE]:c[u.TILDE];return v.replace(d,(g,m,y,M,A)=>{s("tilde",v,g,m,y,M,A);let b;return k(m)?b="":k(y)?b=`>=${m}.0.0 <${+m+1}.0.0-0`:k(M)?b=`>=${m}.${y}.0 <${m}.${+y+1}.0-0`:A?(s("replaceTilde pr",A),b=`>=${m}.${y}.${M}-${A} <${m}.${+y+1}.0-0`):b=`>=${m}.${y}.${M} <${m}.${+y+1}.0-0`,s("tilde return",b),b})},O=(v,a)=>v.trim().split(/\s+/).map(d=>D(d,a)).join(" "),D=(v,a)=>{s("caret",v,a);const d=a.loose?c[u.CARETLOOSE]:c[u.CARET],g=a.includePrerelease?"-0":"";return v.replace(d,(m,y,M,A,b)=>{s("caret",v,m,y,M,A,b);let h;return k(y)?h="":k(M)?h=`>=${y}.0.0${g} <${+y+1}.0.0-0`:k(A)?y==="0"?h=`>=${y}.${M}.0${g} <${y}.${+M+1}.0-0`:h=`>=${y}.${M}.0${g} <${+y+1}.0.0-0`:b?(s("replaceCaret pr",b),y==="0"?M==="0"?h=`>=${y}.${M}.${A}-${b} <${y}.${M}.${+A+1}-0`:h=`>=${y}.${M}.${A}-${b} <${y}.${+M+1}.0-0`:h=`>=${y}.${M}.${A}-${b} <${+y+1}.0.0-0`):(s("no pr"),y==="0"?M==="0"?h=`>=${y}.${M}.${A}${g} <${y}.${M}.${+A+1}-0`:h=`>=${y}.${M}.${A}${g} <${y}.${+M+1}.0-0`:h=`>=${y}.${M}.${A} <${+y+1}.0.0-0`),s("caret return",h),h})},G=(v,a)=>(s("replaceXRanges",v,a),v.split(/\s+/).map(d=>V(d,a)).join(" ")),V=(v,a)=>{v=v.trim();const d=a.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return v.replace(d,(g,m,y,M,A,b)=>{s("xRange",v,g,m,y,M,A,b);const h=k(y),S=h||k(M),W=S||k(A),q=W;return m==="="&&q&&(m=""),b=a.includePrerelease?"-0":"",h?m===">"||m==="<"?g="<0.0.0-0":g="*":m&&q?(S&&(M=0),A=0,m===">"?(m=">=",S?(y=+y+1,M=0,A=0):(M=+M+1,A=0)):m==="<="&&(m="<",S?y=+y+1:M=+M+1),m==="<"&&(b="-0"),g=`${m+y}.${M}.${A}${b}`):S?g=`>=${y}.0.0${b} <${+y+1}.0.0-0`:W&&(g=`>=${y}.${M}.0${b} <${y}.${+M+1}.0-0`),s("xRange return",g),g})},H=(v,a)=>(s("replaceStars",v,a),v.trim().replace(c[u.STAR],"")),X=(v,a)=>(s("replaceGTE0",v,a),v.trim().replace(c[a.includePrerelease?u.GTE0PRE:u.GTE0],"")),Q=v=>(a,d,g,m,y,M,A,b,h,S,W,q,I)=>(k(g)?d="":k(m)?d=`>=${g}.0.0${v?"-0":""}`:k(y)?d=`>=${g}.${m}.0${v?"-0":""}`:M?d=`>=${d}`:d=`>=${d}${v?"-0":""}`,k(h)?b="":k(S)?b=`<${+h+1}.0.0-0`:k(W)?b=`<${h}.${+S+1}.0-0`:q?b=`<=${h}.${S}.${W}-${q}`:v?b=`<${h}.${S}.${+W+1}-0`:b=`<=${b}`,`${d} ${b}`.trim()),ie=(v,a,d)=>{for(let g=0;g0){const m=v[g].semver;if(m.major===a.major&&m.minor===a.minor&&m.patch===a.patch)return!0}return!1}return!0};return fo}var po,tl;function Cs(){if(tl)return po;tl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(p,f){if(f=r(f),p instanceof t){if(p.loose===!!f.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),o("comparator",p,f),this.options=f,this.loose=!!f.loose,this.parse(p),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(p){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],_=p.match(f);if(!_)throw new TypeError(`Invalid comparator: ${p}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new c(_[2],this.options.loose):this.semver=e}toString(){return this.value}test(p){if(o("Comparator.test",p,this.options.loose),this.semver===e||p===e)return!0;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,f){if(!(p instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(p.value,f).test(this.value):p.operator===""?p.value===""?!0:new u(this.value,f).test(p.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,f)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,f)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}po=t;const r=ga,{safeRe:n,t:i}=ci,s=Mh,o=Ss,c=st,u=Rt();return po}const Nm=Rt(),Lm=(e,t,r)=>{try{t=new Nm(t,r)}catch{return!1}return t.test(e)};var Ms=Lm;const Om=Rt(),Pm=(e,t)=>new Om(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var $m=Pm;const Bm=st,Dm=Rt(),Fm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Dm(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Bm(n,r))}),n};var jm=Fm;const Hm=st,Um=Rt(),Wm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Um(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Hm(n,r))}),n};var Vm=Wm;const go=st,qm=Rt(),rl=Rs,zm=(e,t)=>{e=new qm(e,t);let r=new go("0.0.0");if(e.test(r)||(r=new go("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{const c=new go(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||rl(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||rl(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Gm=zm;const Jm=Rt(),Zm=(e,t)=>{try{return new Jm(e,t).range||"*"}catch{return null}};var Km=Zm;const Qm=st,Ih=Cs(),{ANY:Ym}=Ih,Xm=Rt(),ev=Ms,nl=Rs,il=ma,tv=ba,rv=va,nv=(e,t,r,n)=>{e=new Qm(e,n),t=new Xm(t,n);let i,s,o,c,u;switch(r){case">":i=nl,s=tv,o=il,c=">",u=">=";break;case"<":i=il,s=rv,o=nl,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ev(e,t,n))return!1;for(let l=0;l{R.semver===Ym&&(R=new Ih(">=0.0.0")),f=f||R,_=_||R,i(R.semver,f.semver,n)?f=R:o(R.semver,_.semver,n)&&(_=R)}),f.operator===c||f.operator===u||(!_.operator||_.operator===c)&&s(e,_.semver))return!1;if(_.operator===u&&o(e,_.semver))return!1}return!0};var ya=nv;const iv=ya,sv=(e,t,r)=>iv(e,t,">",r);var ov=sv;const av=ya,cv=(e,t,r)=>av(e,t,"<",r);var lv=cv;const sl=Rt(),uv=(e,t,r)=>(e=new sl(e,r),t=new sl(t,r),e.intersects(t,r));var hv=uv;const dv=Ms,fv=St;var pv=(e,t,r)=>{const n=[];let i=null,s=null;const o=e.sort((p,f)=>fv(p,f,r));for(const p of o)dv(p,t,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const c=[];for(const[p,f]of n)p===f?c.push(p):!f&&p===o[0]?c.push("*"):f?p===o[0]?c.push(`<=${f}`):c.push(`${p} - ${f}`):c.push(`>=${p}`);const u=c.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return u.length{if(e===t)return!0;e=new ol(e,r),t=new ol(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const o=mv(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},_v=[new wa(">=0.0.0-0")],al=[new wa(">=0.0.0")],mv=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===_o){if(t.length===1&&t[0].semver===_o)return!0;r.includePrerelease?e=_v:e=al}if(t.length===1&&t[0].semver===_o){if(r.includePrerelease)return!0;t=al}const n=new Set;let i,s;for(const R of e)R.operator===">"||R.operator===">="?i=cl(i,R,r):R.operator==="<"||R.operator==="<="?s=ll(s,R,r):n.add(R.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Ea(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const R of n){if(i&&!kn(R,String(i),r)||s&&!kn(R,String(s),r))return null;for(const x of t)if(!kn(R,String(x),r))return!1;return!0}let c,u,l,p,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const R of t){if(p=p||R.operator===">"||R.operator===">=",l=l||R.operator==="<"||R.operator==="<=",i){if(_&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===_.major&&R.semver.minor===_.minor&&R.semver.patch===_.patch&&(_=!1),R.operator===">"||R.operator===">="){if(c=cl(i,R,r),c===R&&c!==i)return!1}else if(i.operator===">="&&!kn(i.semver,String(R),r))return!1}if(s){if(f&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===f.major&&R.semver.minor===f.minor&&R.semver.patch===f.patch&&(f=!1),R.operator==="<"||R.operator==="<="){if(u=ll(s,R,r),u===R&&u!==s)return!1}else if(s.operator==="<="&&!kn(s.semver,String(R),r))return!1}if(!R.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&p&&!i&&o!==0||_||f)},cl=(e,t,r)=>{if(!e)return t;const n=Ea(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},ll=(e,t,r)=>{if(!e)return t;const n=Ea(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var vv=gv;const mo=ci,ul=Es,bv=st,hl=Sh,yv=Rn,wv=y_,Ev=S_,Sv=C_,Rv=k_,Cv=A_,Mv=L_,kv=$_,Iv=F_,xv=St,Av=W_,Tv=z_,Nv=_a,Lv=K_,Ov=X_,Pv=Rs,$v=ma,Bv=Rh,Dv=Ch,Fv=va,jv=ba,Hv=Mh,Uv=Em,Wv=Cs(),Vv=Rt(),qv=Ms,zv=$m,Gv=jm,Jv=Vm,Zv=Gm,Kv=Km,Qv=ya,Yv=ov,Xv=lv,eb=hv,tb=pv,rb=vv;var nb={parse:yv,valid:wv,clean:Ev,inc:Sv,diff:Rv,major:Cv,minor:Mv,patch:kv,prerelease:Iv,compare:xv,rcompare:Av,compareLoose:Tv,compareBuild:Nv,sort:Lv,rsort:Ov,gt:Pv,lt:$v,eq:Bv,neq:Dv,gte:Fv,lte:jv,cmp:Hv,coerce:Uv,Comparator:Wv,Range:Vv,satisfies:qv,toComparators:zv,maxSatisfying:Gv,minSatisfying:Jv,minVersion:Zv,validRange:Kv,outside:Qv,gtr:Yv,ltr:Xv,intersects:eb,simplifyRange:tb,subset:rb,SemVer:bv,re:mo.re,src:mo.src,tokens:mo.t,SEMVER_SPEC_VERSION:ul.SEMVER_SPEC_VERSION,RELEASE_TYPES:ul.RELEASE_TYPES,compareIdentifiers:hl.compareIdentifiers,rcompareIdentifiers:hl.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=nb,r=Lr,n=tt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,t.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,t.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,e.VersionStruct)}e.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,e.VersionRangeStruct)}e.isValidSemVerRange=s;function o(f){(0,n.assertStruct)(f,e.VersionStruct)}e.assertIsSemVerVersion=o;function c(f){(0,n.assertStruct)(f,e.VersionRangeStruct)}e.assertIsSemVerRange=c;function u(f,_){return(0,t.gt)(f,_)}e.gtVersion=u;function l(f,_){return(0,t.gtr)(f,_)}e.gtRange=l;function p(f,_){return(0,t.satisfies)(f,_,{includePrerelease:!0})}e.satisfiesVersionRange=p})(yh);(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,c)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(tt,e),r(oi,e),r(ae,e),r(ys,e),r(Lt,e),r(dn,e),r(fh,e),r(ai,e),r(ph,e),r(gh,e),r(fn,e),r(_h,e),r(Ot,e),r(mh,e),r(vh,e),r(bh,e),r(yh,e)})(Ju);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Ju;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Gu);var xh=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vs,"__esModule",{value:!0});vs.PollingBlockTracker=void 0;const ib=xh(oa),sb=xh(S1),ob=ri,dl=Gu,fl=(0,dl.createModuleLogger)(dl.projectLogger,"polling-block-tracker"),ab=(0,ib.default)(),cb=1e3;class lb extends ob.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*cb,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=pl(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: +${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=pl(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:ab(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),fl("Making request",t);const r=await(0,sb.default)(n=>this._provider.sendAsync(t,n))();if(fl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: +${r.error.message}`);return r.result}}vs.PollingBlockTracker=lb;function pl(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var ks={},ub=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ks,"__esModule",{value:!0});ks.SubscribeBlockTracker=void 0;const hb=ub(oa),db=ri,fb=(0,hb.default)();class pb extends db.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:fb(),method:t,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}ks.SubscribeBlockTracker=pb;(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(vs,e),r(ks,e)})(zu);var Sa={},Is={},li={};Object.defineProperty(li,"__esModule",{value:!0});li.getUniqueId=void 0;const Ah=4294967295;let vo=Math.floor(Math.random()*Ah);function gb(){return vo=(vo+1)%Ah,vo}li.getUniqueId=gb;Object.defineProperty(Is,"__esModule",{value:!0});Is.createIdRemapMiddleware=void 0;const _b=li;function mb(){return(e,t,r,n)=>{const i=e.id,s=_b.getUniqueId();e.id=s,t.id=s,r(o=>{e.id=i,t.id=i,o()})}}Is.createIdRemapMiddleware=mb;var xs={};Object.defineProperty(xs,"__esModule",{value:!0});xs.createAsyncMiddleware=void 0;function vb(e){return async(t,r,n,i)=>{let s;const o=new Promise(p=>{s=p});let c=null,u=!1;const l=async()=>{u=!0,n(p=>{c=p,s()}),await o};try{await e(t,r,l),u?(await o,c(null)):i(null)}catch(p){c?c(p):i(p)}}}xs.createAsyncMiddleware=vb;var As={};Object.defineProperty(As,"__esModule",{value:!0});As.createScaffoldMiddleware=void 0;function bb(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}As.createScaffoldMiddleware=bb;var ui={},Ra={};Object.defineProperty(Ra,"__esModule",{value:!0});const yb=Fi;function gl(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function wb(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const c=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw c.context=o,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")gl(s,this,r);else{const o=s.length,c=wb(s);for(let u=0;u"u"&&(n=Lh()),Do(e,"",0,[],void 0,0,n);var i;try{wr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Ph(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Mr.length!==0;){var s=Mr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function sn(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Mr.push([n,r,t,i])):wr.push([t,r,e]):(n[r]=e,Mr.push([n,r,t]))}function Do(e,t,r,n,i,s,o){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;co.depthLimit){sn(Pi,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){sn(Pi,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;ct?1:0}function Oh(e,t,r,n){typeof n>"u"&&(n=Lh());var i=Fo(e,"",0,[],void 0,0,n)||e,s;try{wr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,Ph(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Mr.length!==0;){var o=Mr.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Fo(e,t,r,n,i,s,o){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;co.depthLimit){sn(Pi,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){sn(Pi,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c0)for(var n=0;n=1e3&&e<=4999}function Ib(e,t){if(t!=="[Circular]")return t}var Ca={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.errorValues=Kt.errorCodes=void 0;Kt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Kt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Kt,r=Zt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(_,R=i){if(Number.isInteger(_)){const x=_.toString();if(f(t.errorValues,x))return t.errorValues[x].message;if(l(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return R}e.getMessageFromCode=o;function c(_){if(!Number.isInteger(_))return!1;const R=_.toString();return!!(t.errorValues[R]||l(_))}e.isValidCode=c;function u(_,{fallbackError:R=s,shouldIncludeStack:x=!1}={}){var P,L;if(!R||!Number.isInteger(R.code)||typeof R.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(_ instanceof r.EthereumRpcError)return _.serialize();const C={};if(_&&typeof _=="object"&&!Array.isArray(_)&&f(_,"code")&&c(_.code)){const N=_;C.code=N.code,N.message&&typeof N.message=="string"?(C.message=N.message,f(N,"data")&&(C.data=N.data)):(C.message=o(C.code),C.data={originalError:p(_)})}else{C.code=R.code;const N=(P=_)===null||P===void 0?void 0:P.message;C.message=N&&typeof N=="string"?N:R.message,C.data={originalError:p(_)}}const k=(L=_)===null||L===void 0?void 0:L.stack;return x&&_&&k&&typeof k=="string"&&(C.stack=k),C}e.serializeError=u;function l(_){return _>=-32099&&_<=-32e3}function p(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function f(_,R){return Object.prototype.hasOwnProperty.call(_,R)}})(Ca);var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.ethErrors=void 0;const Ma=Zt,Bh=Ca,rt=Kt;Ts.ethErrors={rpc:{parse:e=>ft(rt.errorCodes.rpc.parse,e),invalidRequest:e=>ft(rt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>ft(rt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>ft(rt.errorCodes.rpc.methodNotFound,e),internal:e=>ft(rt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ft(t,e)},invalidInput:e=>ft(rt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>ft(rt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ft(rt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ft(rt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ft(rt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ft(rt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>In(rt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>In(rt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>In(rt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>In(rt.errorCodes.provider.disconnected,e),chainDisconnected:e=>In(rt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Ma.EthereumProviderError(t,r,n)}}};function ft(e,t){const[r,n]=Dh(t);return new Ma.EthereumRpcError(e,r||Bh.getMessageFromCode(e),n)}function In(e,t){const[r,n]=Dh(t);return new Ma.EthereumProviderError(e,r||Bh.getMessageFromCode(e),n)}function Dh(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Zt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Ca;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ts;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Kt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Th);var xb=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ui,"__esModule",{value:!0});ui.JsonRpcEngine=void 0;const Ab=xb(Ra),pt=Th;class Bt extends Ab.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,o,c]=await Bt._runAllMiddleware(t,r,this._middleware);return o?(await Bt._runReturnHandlers(c),i(s)):n(async u=>{try{await Bt._runReturnHandlers(c)}catch(l){return u(l)}return u()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new pt.EthereumRpcError(pt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new pt.EthereumRpcError(pt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=pt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await Bt._runAllMiddleware(t,r,this._middleware);if(Bt._checkForCompletion(t,r,i),await Bt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,o=!1;for(const c of n)if([s,o]=await Bt._runMiddleware(t,r,c,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const o=u=>{const l=u||r.error;l&&(r.error=pt.serializeError(l)),s([l,!0])},c=u=>{r.error?o(r.error):(u&&(typeof u!="function"&&o(new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof u}" for request: +${bo(t)}`,{request:t})),i.push(u)),s([null,!1]))};try{n(t,r,c,o)}catch(u){o(u)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: +${bo(t)}`,{request:t});if(!n)throw new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: +${bo(t)}`,{request:t})}}ui.JsonRpcEngine=Bt;function bo(e){return JSON.stringify(e,null,2)}var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.mergeMiddleware=void 0;const Tb=ui;function Nb(e){const t=new Tb.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Ns.mergeMiddleware=Nb;(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Is,e),r(xs,e),r(As,e),r(li,e),r(ui,e),r(Ns,e)})(Sa);var Fh={},ka={},jo=function(e,t){return jo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},jo(e,t)};function jh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");jo(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var $i=function(){return $i=Object.assign||function(t){for(var r,n=1,i=arguments.length;n=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function Wh(e,t){return function(r,n){t(r,n,e)}}function Lb(e,t,r,n,i,s){function o(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var c=n.kind,u=c==="getter"?"get":c==="setter"?"set":"value",l=!t&&e?n.static?e:e.prototype:null,p=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,_=!1,R=r.length-1;R>=0;R--){var x={};for(var P in n)x[P]=P==="access"?{}:n[P];for(var P in n.access)x.access[P]=n.access[P];x.addInitializer=function(C){if(_)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(C||null))};var L=(0,r[R])(c==="accessor"?{get:p.get,set:p.set}:p[u],x);if(c==="accessor"){if(L===void 0)continue;if(L===null||typeof L!="object")throw new TypeError("Object expected");(f=o(L.get))&&(p.get=f),(f=o(L.set))&&(p.set=f),(f=o(L.init))&&i.unshift(f)}else(f=o(L))&&(c==="field"?i.unshift(f):p[u]=f)}l&&Object.defineProperty(l,n.name,p),_=!0}function Ob(e,t,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ia(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Jh(){for(var e=[],t=0;t1||c(_,R)})})}function c(_,R){try{u(n[_](R))}catch(x){f(s[0][3],x)}}function u(_){_.value instanceof pn?Promise.resolve(_.value.v).then(l,p):f(s[0][2],_)}function l(_){c("next",_)}function p(_){c("throw",_)}function f(_,R){_(R),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Yh(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=e[i]?function(o){return(r=!r)?{value:pn(e[i](o)),done:!1}:s?s(o):o}:s}}function Xh(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Bi=="function"?Bi(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(c,u){o=e[s](o),i(c,u,o.done,o.value)})}}function i(s,o,c,u){Promise.resolve(u).then(function(l){s({value:l,done:c})},o)}}function ed(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Bb=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function td(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ls(t,e,r);return Bb(t,e),t}function rd(e){return e&&e.__esModule?e:{default:e}}function nd(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function id(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function sd(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function od(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var Db=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function ad(e){function t(n){e.error=e.hasError?new Db(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}function r(){for(;e.stack.length;){var n=e.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return t(s),r()})}catch(s){t(s)}}if(e.hasError)throw e.error}return r()}const Fb={__extends:jh,__assign:$i,__rest:Hh,__decorate:Uh,__param:Wh,__metadata:Vh,__awaiter:qh,__generator:zh,__createBinding:Ls,__exportStar:Gh,__values:Bi,__read:Ia,__spread:Jh,__spreadArrays:Zh,__spreadArray:Kh,__await:pn,__asyncGenerator:Qh,__asyncDelegator:Yh,__asyncValues:Xh,__makeTemplateObject:ed,__importStar:td,__importDefault:rd,__classPrivateFieldGet:nd,__classPrivateFieldSet:id,__classPrivateFieldIn:sd,__addDisposableResource:od,__disposeResources:ad},jb=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:od,get __assign(){return $i},__asyncDelegator:Yh,__asyncGenerator:Qh,__asyncValues:Xh,__await:pn,__awaiter:qh,__classPrivateFieldGet:nd,__classPrivateFieldIn:sd,__classPrivateFieldSet:id,__createBinding:Ls,__decorate:Uh,__disposeResources:ad,__esDecorate:Lb,__exportStar:Gh,__extends:jh,__generator:zh,__importDefault:rd,__importStar:td,__makeTemplateObject:ed,__metadata:Vh,__param:Wh,__propKey:Pb,__read:Ia,__rest:Hh,__runInitializers:Ob,__setFunctionName:$b,__spread:Jh,__spreadArray:Kh,__spreadArrays:Zh,__values:Bi,default:Fb},Symbol.toStringTag,{value:"Module"})),xa=gn(jb);var Os={};Object.defineProperty(Os,"__esModule",{value:!0});var _l=xa,Hb=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return _l.__awaiter(this,void 0,void 0,function(){var r,n,i;return _l.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Os.default=Hb;Object.defineProperty(ka,"__esModule",{value:!0});var ml=xa,Ub=Os,Wb=function(){function e(){this._semaphore=new Ub.default(1)}return e.prototype.acquire=function(){return ml.__awaiter(this,void 0,void 0,function(){var t,r;return ml.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();ka.default=Wb;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.withTimeout=void 0;var Ci=xa;function Vb(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Ci.__awaiter(n,void 0,void 0,function(){var o,c,u;return Ci.__generator(this,function(l){switch(l.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},t),[4,e.acquire()];case 1:return c=l.sent(),o?(u=Array.isArray(c)?c[1]:c,u()):i(c),[2]}})})})},runExclusive:function(i){return Ci.__awaiter(this,void 0,void 0,function(){var s,o;return Ci.__generator(this,function(c){switch(c.label){case 0:s=function(){},c.label=1;case 1:return c.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=c.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,c.sent()];case 4:return s=o,[4,i()];case 5:return[2,c.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Ps.withTimeout=Vb;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=ka;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Os;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Ps;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Fh);var qb=Gb,zb=Object.prototype.hasOwnProperty;function Gb(){for(var e={},t=0;tfunction(...i){const s=t.promiseModule;return new s((o,c)=>{t.multiArgs?i.push((...l)=>{t.errorFirst?l[0]?c(l):(l.shift(),o(l)):o(l)}):t.errorFirst?i.push((l,p)=>{l?c(l):o(p)}):i.push(o),Reflect.apply(e,this===r?n:this,i)})},bl=new WeakMap;var Yb=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(o,c)=>{let u=bl.get(o);if(u||(u={},bl.set(o,u)),c in u)return u[c];const l=x=>typeof x=="string"||typeof c=="symbol"?c===x:x.test(c),p=Reflect.getOwnPropertyDescriptor(o,c),f=p===void 0||p.writable||p.configurable,R=(t.include?t.include.some(l):!t.exclude.some(l))&&f;return u[c]=R,R},i=new WeakMap,s=new Proxy(e,{apply(o,c,u){const l=i.get(o);if(l)return Reflect.apply(l,c,u);const p=t.excludeMain?o:vl(o,t,s,o);return i.set(o,p),Reflect.apply(p,c,u)},get(o,c){const u=o[c];if(!n(o,c)||u===Function.prototype[c])return u;const l=i.get(u);if(l)return l;if(typeof u=="function"){const p=vl(u,t,s,o);return i.set(u,p),p}return u}});return s};const Xb=ni.default;let ey=class extends Xb{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var Aa=ey;const ty=Aa;let ry=class extends ty{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var ny=ry,di={minBlockRef:iy,maxBlockRef:sy,sortBlockRefs:Ta,bnToHex:oy,blockRefIsNumber:ay,hexToInt:Di,incrementHexInt:cy,intToHex:cd,unsafeRandomBytes:ly};function iy(...e){return Ta(e)[0]}function sy(...e){const t=Ta(e);return t[t.length-1]}function Ta(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Di(t)-Di(r))}function oy(e){return"0x"+e.toString(16)}function ay(e){return e&&!["earliest","latest","pending"].includes(e)}function Di(e){return e==null?e:Number.parseInt(e,16)}function cy(e){if(e==null)return e;const t=Di(e);return cd(t+1)}function cd(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function ly(e){let t="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=py(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=fy(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),c=(await this._fetchLogs(s)).filter(u=>this.matchLog(u));this.addResults(c)}async _fetchLogs(t){return await hy(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Mi(this.params.fromBlock)>=Mi(t.blockNumber)||gy(this.params.toBlock)&&Mi(this.params.toBlock)<=Mi(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=t.topics[s];if(!o)return!1;o=o.toLowerCase();let c=Array.isArray(i)?i:[i];return c.includes(null)?!0:(c=c.map(p=>p.toLowerCase()),c.includes(o))})}};var my=_y,Na=vy;async function vy({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=wl(t),s=wl(r)-n+1,o=Array(s).fill().map((u,l)=>n+l).map(by);let c=await Promise.all(o.map(u=>wy(e,"eth_getBlockByNumber",[u,!1])));return c=c.filter(u=>u!==null),c}function wl(e){return e==null?e:Number.parseInt(e,16)}function by(e){return e==null?e:"0x"+e.toString(16)}function yy(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function wy(e,t,r){for(let n=0;n<3;n++)try{return await yy(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const Ey=Aa,Sy=Na,{incrementHexInt:Ry}=di;let Cy=class extends Ey{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=Ry(t),o=(await Sy({provider:this.provider,fromBlock:i,toBlock:n})).map(c=>c.hash);this.addResults(o)}};var My=Cy;const ky=Aa,Iy=Na,{incrementHexInt:xy}=di;let Ay=class extends ky{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=xy(t),i=await Iy({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Ty=Ay;const Ny=Fh.Mutex,{createAsyncMiddleware:Ly,createScaffoldMiddleware:Oy}=Sa,Py=my,$y=My,By=Ty,{intToHex:ld,hexToInt:yo}=di;var Dy=Fy;function Fy({blockTracker:e,provider:t}){let r=0,n={};const i=new Ny,s=jy({mutex:i}),o=Oy({eth_newFilter:s(wo(u)),eth_newBlockFilter:s(wo(l)),eth_newPendingTransactionFilter:s(wo(p)),eth_uninstallFilter:s(Ti(R)),eth_getFilterChanges:s(Ti(f)),eth_getFilterLogs:s(Ti(_))}),c=async({oldBlock:k,newBlock:N})=>{if(n.length===0)return;const $=await i.acquire();try{await Promise.all(Qr(n).map(async O=>{try{await O.update({oldBlock:k,newBlock:N})}catch(D){console.error(D)}}))}catch(O){console.error(O)}$()};return o.newLogFilter=u,o.newBlockFilter=l,o.newPendingTransactionFilter=p,o.uninstallFilter=R,o.getFilterChanges=f,o.getFilterLogs=_,o.destroy=()=>{L()},o;async function u(k){const N=new Py({provider:t,params:k});return await x(N),N}async function l(){const k=new $y({provider:t});return await x(k),k}async function p(){const k=new By({provider:t});return await x(k),k}async function f(k){const N=yo(k),$=n[N];if(!$)throw new Error(`No filter for index "${N}"`);return $.getChangesAndClear()}async function _(k){const N=yo(k),$=n[N];if(!$)throw new Error(`No filter for index "${N}"`);let O=[];return $.type==="log"&&(O=$.getAllResults()),O}async function R(k){const N=yo(k),O=!!n[N];return O&&await P(N),O}async function x(k){const N=Qr(n).length,$=await e.getLatestBlock();await k.initialize({currentBlock:$}),r++,n[r]=k,k.id=r,k.idHex=ld(r);const O=Qr(n).length;return C({prevFilterCount:N,newFilterCount:O}),r}async function P(k){const N=Qr(n).length;delete n[k];const $=Qr(n).length;C({prevFilterCount:N,newFilterCount:$})}async function L(){const k=Qr(n).length;n={},C({prevFilterCount:k,newFilterCount:0})}function C({prevFilterCount:k,newFilterCount:N}){if(k===0&&N>0){e.on("sync",c);return}if(k>0&&N===0){e.removeListener("sync",c);return}}}function wo(e){return Ti(async(...t)=>{const r=await e(...t);return ld(r.id)})}function Ti(e){return Ly(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function jy({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Qr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const Hy=ni.default,{createAsyncMiddleware:El,createScaffoldMiddleware:Uy}=Sa,Wy=Dy,{unsafeRandomBytes:Vy,incrementHexInt:qy}=di,zy=Na;var Gy=Jy;function Jy({blockTracker:e,provider:t}){const r={},n=Wy({blockTracker:e,provider:t});let i=!1;const s=new Hy,o=Uy({eth_subscribe:El(c),eth_unsubscribe:El(u)});return o.destroy=p,{events:s,middleware:o};async function c(f,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const R=f.params[0],x=Vy(16);let P;switch(R){case"newHeads":P=L({subId:x});break;case"logs":const k=f.params[1],N=await n.newLogFilter(k);P=C({subId:x,filter:N});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${R}"`)}r[x]=P,_.result=x;return;function L({subId:k}){const N={type:R,destroy:async()=>{e.removeListener("sync",N.update)},update:async({oldBlock:$,newBlock:O})=>{const D=O,G=qy($);(await zy({provider:t,fromBlock:G,toBlock:D})).map(Zy).filter(X=>X!==null).forEach(X=>{l(k,X)})}};return e.on("sync",N.update),N}function C({subId:k,filter:N}){return N.on("update",O=>l(k,O)),{type:R,destroy:async()=>await n.uninstallFilter(N.idHex)}}}async function u(f,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const R=f.params[0],x=r[R];if(!x){_.result=!1;return}delete r[R],await x.destroy(),_.result=!0}function l(f,_){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:_}})}function p(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function Zy(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(ms,"__esModule",{value:!0});ms.SubscriptionManager=void 0;const Ky=zu,Qy=Gy,Sl=()=>{};class Yy{constructor(t){const r=new Ky.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Qy({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,Sl,Sl),r}destroy(){this.subscriptionMiddleware.destroy()}}ms.SubscriptionManager=Yy;var ud=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(on,"__esModule",{value:!0});on.CoinbaseWalletProvider=void 0;const Xy=ud(Ui),ew=Vd,se=jn,re=z,tw=Vn,Rl=gt,ki=bn,lt=_n,Eo=ud(v1),xn=vn,rw=hn,nw=ms,Cl="DefaultChainId",Ml="DefaultJsonRpcUrl";class iw extends ew.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new rw.FilterPolyfill(this),this._subscriptionManager=new nw.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,re.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(Rl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const c=o.split(" ");c[0]!==""&&(this._addresses=c.map(u=>(0,re.ensureAddressString)(u)),this.emit("accountsChanged",c))}this._subscriptionManager.events.on("notification",c=>{this.emit("message",{type:c.method,data:c.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",c=>{var u;if(!(c.origin!==location.origin||c.source!==window)&&c.data.type==="walletLinkMessage"&&c.data.data.action==="dappChainSwitched"){const l=c.data.data.chainId,p=(u=c.data.data.jsonRpcUrl)!==null&&u!==void 0?u:this.jsonRpcUrl;this.updateProviderInfo(p,Number(l))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,re.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(Ml))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Ml,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(Cl,r.toString(10)),((0,re.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,o){const u=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,o==null?void 0:o.toString()).promise;return(0,lt.isErrorResponse)(u)?!1:!!u.result}async addEthereumChain(t,r,n,i,s,o){var c,u;if((0,re.ensureIntNumber)(t)===this.getChainId())return!1;const l=await this.initializeRelay(),p=l.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!p&&await l.requestEthereumAccounts().promise;const f=await l.addEthereumChain(t.toString(),r,s,n,i,o).promise;return(0,lt.isErrorResponse)(f)?!1:(((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0&&this.updateProviderInfo(r[0],t),((u=f.result)===null||u===void 0?void 0:u.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,lt.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===se.standardErrorCodes.provider.unsupportedChain?se.standardErrors.provider.unsupportedChain():se.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?ki.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,se.serializeError)(i,t)})}catch(n){throw(0,se.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(c=>c.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,se.serializeError)(n,t)})}catch(n){return Promise.reject((0,se.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,se.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,se.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw se.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw se.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw se.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,re.ensureRegExpString)(t)).promise;if((0,lt.isErrorResponse)(n))throw(0,se.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,se.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,lt.isErrorResponse)(i))throw(0,se.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,se.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?ki.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof tw.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,lt.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,lt.isErrorResponse)(n))throw(0,se.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,se.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,re.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Rl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(c=>r(Object.assign(Object.assign({},c),{id:t.id}))).catch(c=>n(c));return}const o=this._handleSubscriptionMethods(t);if(o!==void 0){o.then(c=>r({jsonrpc:"2.0",id:t.id,result:c.result})).catch(c=>n(c));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var o;throw(s.code===se.standardErrorCodes.rpc.methodNotFound||s.code===se.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log(xn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?ki.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,re.ensureAddressString)(t);return this._addresses.map(i=>(0,re.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(xn.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,re.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,re.ensureAddressString)(t.to):null,i=t.value!=null?(0,re.ensureBN)(t.value):new Xy.default(0),s=t.data?(0,re.ensureBuffer)(t.data):Buffer.alloc(0),o=t.nonce!=null?(0,re.ensureIntNumber)(t.nonce):null,c=t.gasPrice!=null?(0,re.ensureBN)(t.gasPrice):null,u=t.maxFeePerGas!=null?(0,re.ensureBN)(t.maxFeePerGas):null,l=t.maxPriorityFeePerGas!=null?(0,re.ensureBN)(t.maxPriorityFeePerGas):null,p=t.gas!=null?(0,re.ensureBN)(t.gas):null,f=t.chainId?(0,re.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:c,maxFeePerGas:u,maxPriorityFeePerGas:l,gasLimit:p,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw se.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw se.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,lt.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,lt.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,re.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Cl);if(!t)return(0,re.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,re.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?ki.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,lt.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,re.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,re.ensureParsedJSONObject)(t[0]),n=(0,re.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=Eo.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Eo.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Eo.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const o=t[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw se.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw se.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const c=parseInt(o.chainId,16);return await this.addEthereumChain(c,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw se.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw se.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw se.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw se.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:c}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,c,o,n)}}_eth_uninstallFilter(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}on.CoinbaseWalletProvider=iw;var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.RelayEventManager=void 0;const sw=z;class ow{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,sw.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}$s.RelayEventManager=ow;Object.defineProperty(On,"__esModule",{value:!0});On.CoinbaseWalletSDK=void 0;const aw=ji,cw=Hi,kl=z,lw=Gi,uw=on,hw=Vn,dw=ti,fw=$s,pw=Kn,gw=qn,hd=mn;class Bs{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||cw.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const o=new URL(s),c=`${o.protocol}//${o.host}`;if(this._storage=new lw.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Bs.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new fw.RelayEventManager;const u=(0,kl.isMobileWeb)(),l=t.uiConstructor||(f=>u?new dw.MobileRelayUI(f):new pw.WalletLinkRelayUI(f)),p={linkAPIUrl:s,version:hd.LIB_VERSION,darkMode:!!t.darkMode,uiConstructor:l,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=u?new hw.MobileRelay(p):new gw.WalletLinkRelay(p),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new uw.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,kl.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,aw.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}On.CoinbaseWalletSDK=Bs;Bs.VERSION=hd.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=On,r=on;var n=On;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=on;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Uo);const _w=dd(Uo),Iw=fd({__proto__:null,default:_w},[Uo]);export{Iw as i}; diff --git a/_app/immutable/chunks/index.CGVde19D.js b/_app/immutable/chunks/index.CGVde19D.js new file mode 100644 index 0000000..4ebfb1f --- /dev/null +++ b/_app/immutable/chunks/index.CGVde19D.js @@ -0,0 +1,41 @@ +import{b as a}from"./2.CpRWH4-H.js";import{M as e,T as n,U as L,o,q as W,r as l,ad as r,ah as M,t as Z,W as V,v as d,u as p,w as m,af as H,ag as c,x as k,y as _,z as h,A as I,B as g,C as v,ap as T,aq as B,f as b,D as w,am as S,E as f,g as x,ak as A,F as N,G as E,H as P,I as U,a6 as D,an as G,a7 as O,aj as R,J as j,a8 as q,ao as y,ai as z,N as F,a9 as Q,h as J,j as K,k as X,P as Y,O as $,Q as a1,R as i1,a5 as C1,aa as s1,ab as t1,S as u1,al as e1,ae as n1,ac as L1,V as o1,X as W1,ar as l1,l as r1,Y as M1,Z as Z1,$ as V1,m as d1,_ as p1,a1 as m1,a0 as H1,K as c1,L as k1,a2 as _1,n as h1,a3 as I1,a4 as g1,e as v1,i as T1,c as B1,d as b1}from"./2.CpRWH4-H.js";const C=a` + + + + + +`,s=a` + + + + + +`;export{e as MathUtil,n as TransactionUtil,L as UiHelperUtil,o as WuiAccountButton,W as WuiAllWalletsImage,l as WuiAvatar,r as WuiBalance,M as WuiBanner,Z as WuiButton,V as WuiCard,d as WuiCardSelect,p as WuiCardSelectLoader,m as WuiChip,H as WuiChipButton,c as WuiCompatibleNetwork,k as WuiConnectButton,_ as WuiCtaButton,h as WuiDetailsGroup,I as WuiDetailsGroupItem,g as WuiEmailInput,v as WuiEnsInput,T as WuiFlex,B as WuiGrid,b as WuiIcon,w as WuiIconBox,S as WuiIconButton,f as WuiIconLink,x as WuiImage,A as WuiInputAmount,N as WuiInputElement,E as WuiInputNumeric,P as WuiInputText,U as WuiLink,D as WuiListAccordion,G as WuiListButton,O as WuiListContent,R as WuiListDescription,j as WuiListItem,q as WuiListNetwork,y as WuiListSocial,z as WuiListToken,F as WuiListWallet,Q as WuiListWalletTransaction,J as WuiLoadingHexagon,K as WuiLoadingSpinner,X as WuiLoadingThumbnail,Y as WuiLogo,$ as WuiLogoSelect,a1 as WuiNetworkButton,i1 as WuiNetworkImage,C1 as WuiNoticeCard,s1 as WuiOnRampActivityItem,t1 as WuiOnRampProviderItem,u1 as WuiOtp,e1 as WuiPreviewItem,n1 as WuiProfileButton,L1 as WuiPromo,o1 as WuiQrCode,W1 as WuiSearchBar,l1 as WuiSeparator,r1 as WuiShimmer,M1 as WuiSnackbar,Z1 as WuiTabs,V1 as WuiTag,d1 as WuiText,p1 as WuiTokenButton,m1 as WuiTokenListItem,H1 as WuiTooltip,c1 as WuiTransactionListItem,k1 as WuiTransactionListItemLoader,_1 as WuiTransactionVisual,h1 as WuiVisual,I1 as WuiVisualThumbnail,g1 as WuiWalletImage,v1 as customElement,T1 as initializeTheming,B1 as setColorTheme,b1 as setThemeVariables,C as swapInputMaskBottomSvg,s as swapInputMaskTopSvg}; diff --git a/_app/immutable/chunks/index.CaJWFNre.js b/_app/immutable/chunks/index.CaJWFNre.js new file mode 100644 index 0000000..d1e8d17 --- /dev/null +++ b/_app/immutable/chunks/index.CaJWFNre.js @@ -0,0 +1,99 @@ +import{as as bi,at as ps,au as ms,av as Mn,aw as Mi,ax as Sn,ay as gs,p as As,az as vs,s as ws,aA as ys,aB as Ni,e as En,aC as zi,aD as Ir,aE as bs,aF as Hi}from"./2.CpRWH4-H.js";const Li={FIVE_MINUTES_IN_MS:3e5};class Ms{constructor(t){const{enabled:r=!0,nonceRefetchIntervalMs:i=Li.FIVE_MINUTES_IN_MS,sessionRefetchIntervalMs:s=Li.FIVE_MINUTES_IN_MS,signOutOnAccountChange:o=!0,signOutOnDisconnect:u=!0,signOutOnNetworkChange:A=!0,...v}=t;this.options={enabled:r,nonceRefetchIntervalMs:i,sessionRefetchIntervalMs:s,signOutOnDisconnect:u,signOutOnAccountChange:o,signOutOnNetworkChange:A},this.methods=v}async getNonce(t){const r=await this.methods.getNonce(t);if(!r)throw new Error("siweControllerClient:getNonce - nonce is undefined");return r}async getMessageParams(){return await this.methods.getMessageParams()||{}}createMessage(t){const r=this.methods.createMessage(t);if(!r)throw new Error("siweControllerClient:createMessage - message is undefined");return r}async verifyMessage(t){return await this.methods.verifyMessage(t)}async getSession(){const t=await this.methods.getSession();if(!t)throw new Error("siweControllerClient:getSession - session is undefined");return t}async signIn(){var y;const{address:t}=bi.state,r=await this.methods.getNonce(t);if(!t)throw new Error("An address is required to create a SIWE message.");const i=ps.caipNetworkIdToNumber((y=ms.state.caipNetwork)==null?void 0:y.id);if(!i)throw new Error("A chainId is required to create a SIWE message.");const s=await this.getMessageParams(),o=this.methods.createMessage({address:`eip155:${i}:${t}`,chainId:i,nonce:r,version:"1",iat:s.iat||new Date().toISOString(),...s});Mn.getConnectedConnector()==="AUTH"&&Mi.pushTransactionStack({view:null,goBack:!1,replace:!0,onCancel(){Mi.replace("ConnectingSiwe")}});const A=await Sn.signMessage(o);if(!await this.methods.verifyMessage({message:o,signature:A}))throw new Error("Error verifying SIWE signature");const g=await this.methods.getSession();if(!g)throw new Error("Error verifying SIWE signature");return this.methods.onSignIn&&this.methods.onSignIn(g),gs.navigateAfterNetworkSwitch(),g}async signOut(){var t,r;return(r=(t=this.methods).onSignOut)==null||r.call(t),this.methods.signOut()}}var _n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ss(e){var t=e.default;if(typeof t=="function"){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),r}var In={exports:{}};/** +* [js-sha3]{@link https://github.com/emn178/js-sha3} +* +* @version 0.8.0 +* @author Chen, Yi-Cyuan [emn178@gmail.com] +* @copyright Chen, Yi-Cyuan 2015-2018 +* @license MIT +*/(function(e){(function(){var t="input is invalid type",r="finalize already called",i=typeof window=="object",s=i?window:{};s.JS_SHA3_NO_WINDOW&&(i=!1);var o=!i&&typeof self=="object",u=!s.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;u?s=_n:o&&(s=self);var A=!s.JS_SHA3_NO_COMMON_JS&&!0&&e.exports,v=!s.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],b=[4,1024,262144,67108864],E=[1,256,65536,16777216],I=[6,1536,393216,100663296],B=[0,8,16,24],F=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],T=[224,256,384,512],q=[128,256],Ct=["hex","buffer","arrayBuffer","array","digest"],xt={128:168,256:136};(s.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(f){return Object.prototype.toString.call(f)==="[object Array]"}),v&&(s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(f){return typeof f=="object"&&f.buffer&&f.buffer.constructor===ArrayBuffer});for(var j=function(f,_,S){return function(C){return new c(f,_,f).update(C)[S]()}},K=function(f,_,S){return function(C,k){return new c(f,_,k).update(C)[S]()}},Q=function(f,_,S){return function(C,k,x,N){return a["cshake"+f].update(C,k,x,N)[S]()}},Rt=function(f,_,S){return function(C,k,x,N){return a["kmac"+f].update(C,k,x,N)[S]()}},Y=function(f,_,S,C){for(var k=0;k>5,this.byteCount=this.blockCount<<2,this.outputBlocks=S>>5,this.extraBytes=(S&31)>>3;for(var C=0;C<50;++C)this.s[C]=0}c.prototype.update=function(f){if(this.finalized)throw new Error(r);var _,S=typeof f;if(S!=="string"){if(S==="object"){if(f===null)throw new Error(t);if(v&&f.constructor===ArrayBuffer)f=new Uint8Array(f);else if(!Array.isArray(f)&&(!v||!ArrayBuffer.isView(f)))throw new Error(t)}else throw new Error(t);_=!0}for(var C=this.blocks,k=this.byteCount,x=f.length,N=this.blockCount,U=0,z=this.s,R,$;U>2]|=f[U]<>2]|=$<>2]|=(192|$>>6)<>2]|=(128|$&63)<=57344?(C[R>>2]|=(224|$>>12)<>2]|=(128|$>>6&63)<>2]|=(128|$&63)<>2]|=(240|$>>18)<>2]|=(128|$>>12&63)<>2]|=(128|$>>6&63)<>2]|=(128|$&63)<=k){for(this.start=R-k,this.block=C[N],R=0;R>8,S=f&255;S>0;)k.unshift(S),f=f>>8,S=f&255,++C;return _?k.push(C):k.unshift(C),this.update(k),k.length},c.prototype.encodeString=function(f){var _,S=typeof f;if(S!=="string"){if(S==="object"){if(f===null)throw new Error(t);if(v&&f.constructor===ArrayBuffer)f=new Uint8Array(f);else if(!Array.isArray(f)&&(!v||!ArrayBuffer.isView(f)))throw new Error(t)}else throw new Error(t);_=!0}var C=0,k=f.length;if(_)C=k;else for(var x=0;x=57344?C+=3:(N=65536+((N&1023)<<10|f.charCodeAt(++x)&1023),C+=4)}return C+=this.encode(C*8),this.update(f),C},c.prototype.bytepad=function(f,_){for(var S=this.encode(_),C=0;C>2]|=this.padding[_&3],this.lastByteIndex===this.byteCount)for(f[0]=f[S],_=1;_>4&15]+g[U&15]+g[U>>12&15]+g[U>>8&15]+g[U>>20&15]+g[U>>16&15]+g[U>>28&15]+g[U>>24&15];x%f===0&&(P(_),k=0)}return C&&(U=_[k],N+=g[U>>4&15]+g[U&15],C>1&&(N+=g[U>>12&15]+g[U>>8&15]),C>2&&(N+=g[U>>20&15]+g[U>>16&15])),N},c.prototype.arrayBuffer=function(){this.finalize();var f=this.blockCount,_=this.s,S=this.outputBlocks,C=this.extraBytes,k=0,x=0,N=this.outputBits>>3,U;C?U=new ArrayBuffer(S+1<<2):U=new ArrayBuffer(N);for(var z=new Uint32Array(U);x>8&255,N[U+2]=z>>16&255,N[U+3]=z>>24&255;x%f===0&&P(_)}return C&&(U=x<<2,z=_[k],N[U]=z&255,C>1&&(N[U+1]=z>>8&255),C>2&&(N[U+2]=z>>16&255)),N};function O(f,_,S){c.call(this,f,_,S)}O.prototype=new c,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),c.prototype.finalize.call(this)};var P=function(f){var _,S,C,k,x,N,U,z,R,$,G,W,Ne,V,X,Re,Z,tt,ke,et,rt,Te,it,nt,Pe,st,ot,Ue,ht,at,Fe,ft,ut,Oe,lt,ct,De,dt,pt,ze,mt,gt,He,At,vt,Le,wt,yt,qe,bt,Mt,Qe,St,Et,Ke,_t,It,ve,we,ye,be,Me,Se;for(C=0;C<48;C+=2)k=f[0]^f[10]^f[20]^f[30]^f[40],x=f[1]^f[11]^f[21]^f[31]^f[41],N=f[2]^f[12]^f[22]^f[32]^f[42],U=f[3]^f[13]^f[23]^f[33]^f[43],z=f[4]^f[14]^f[24]^f[34]^f[44],R=f[5]^f[15]^f[25]^f[35]^f[45],$=f[6]^f[16]^f[26]^f[36]^f[46],G=f[7]^f[17]^f[27]^f[37]^f[47],W=f[8]^f[18]^f[28]^f[38]^f[48],Ne=f[9]^f[19]^f[29]^f[39]^f[49],_=W^(N<<1|U>>>31),S=Ne^(U<<1|N>>>31),f[0]^=_,f[1]^=S,f[10]^=_,f[11]^=S,f[20]^=_,f[21]^=S,f[30]^=_,f[31]^=S,f[40]^=_,f[41]^=S,_=k^(z<<1|R>>>31),S=x^(R<<1|z>>>31),f[2]^=_,f[3]^=S,f[12]^=_,f[13]^=S,f[22]^=_,f[23]^=S,f[32]^=_,f[33]^=S,f[42]^=_,f[43]^=S,_=N^($<<1|G>>>31),S=U^(G<<1|$>>>31),f[4]^=_,f[5]^=S,f[14]^=_,f[15]^=S,f[24]^=_,f[25]^=S,f[34]^=_,f[35]^=S,f[44]^=_,f[45]^=S,_=z^(W<<1|Ne>>>31),S=R^(Ne<<1|W>>>31),f[6]^=_,f[7]^=S,f[16]^=_,f[17]^=S,f[26]^=_,f[27]^=S,f[36]^=_,f[37]^=S,f[46]^=_,f[47]^=S,_=$^(k<<1|x>>>31),S=G^(x<<1|k>>>31),f[8]^=_,f[9]^=S,f[18]^=_,f[19]^=S,f[28]^=_,f[29]^=S,f[38]^=_,f[39]^=S,f[48]^=_,f[49]^=S,V=f[0],X=f[1],Le=f[11]<<4|f[10]>>>28,wt=f[10]<<4|f[11]>>>28,Ue=f[20]<<3|f[21]>>>29,ht=f[21]<<3|f[20]>>>29,ye=f[31]<<9|f[30]>>>23,be=f[30]<<9|f[31]>>>23,gt=f[40]<<18|f[41]>>>14,He=f[41]<<18|f[40]>>>14,Oe=f[2]<<1|f[3]>>>31,lt=f[3]<<1|f[2]>>>31,Re=f[13]<<12|f[12]>>>20,Z=f[12]<<12|f[13]>>>20,yt=f[22]<<10|f[23]>>>22,qe=f[23]<<10|f[22]>>>22,at=f[33]<<13|f[32]>>>19,Fe=f[32]<<13|f[33]>>>19,Me=f[42]<<2|f[43]>>>30,Se=f[43]<<2|f[42]>>>30,Et=f[5]<<30|f[4]>>>2,Ke=f[4]<<30|f[5]>>>2,ct=f[14]<<6|f[15]>>>26,De=f[15]<<6|f[14]>>>26,tt=f[25]<<11|f[24]>>>21,ke=f[24]<<11|f[25]>>>21,bt=f[34]<<15|f[35]>>>17,Mt=f[35]<<15|f[34]>>>17,ft=f[45]<<29|f[44]>>>3,ut=f[44]<<29|f[45]>>>3,nt=f[6]<<28|f[7]>>>4,Pe=f[7]<<28|f[6]>>>4,_t=f[17]<<23|f[16]>>>9,It=f[16]<<23|f[17]>>>9,dt=f[26]<<25|f[27]>>>7,pt=f[27]<<25|f[26]>>>7,et=f[36]<<21|f[37]>>>11,rt=f[37]<<21|f[36]>>>11,Qe=f[47]<<24|f[46]>>>8,St=f[46]<<24|f[47]>>>8,At=f[8]<<27|f[9]>>>5,vt=f[9]<<27|f[8]>>>5,st=f[18]<<20|f[19]>>>12,ot=f[19]<<20|f[18]>>>12,ve=f[29]<<7|f[28]>>>25,we=f[28]<<7|f[29]>>>25,ze=f[38]<<8|f[39]>>>24,mt=f[39]<<8|f[38]>>>24,Te=f[48]<<14|f[49]>>>18,it=f[49]<<14|f[48]>>>18,f[0]=V^~Re&tt,f[1]=X^~Z&ke,f[10]=nt^~st&Ue,f[11]=Pe^~ot&ht,f[20]=Oe^~ct&dt,f[21]=lt^~De&pt,f[30]=At^~Le&yt,f[31]=vt^~wt&qe,f[40]=Et^~_t&ve,f[41]=Ke^~It&we,f[2]=Re^~tt&et,f[3]=Z^~ke&rt,f[12]=st^~Ue&at,f[13]=ot^~ht&Fe,f[22]=ct^~dt&ze,f[23]=De^~pt&mt,f[32]=Le^~yt&bt,f[33]=wt^~qe&Mt,f[42]=_t^~ve&ye,f[43]=It^~we&be,f[4]=tt^~et&Te,f[5]=ke^~rt&it,f[14]=Ue^~at&ft,f[15]=ht^~Fe&ut,f[24]=dt^~ze>,f[25]=pt^~mt&He,f[34]=yt^~bt&Qe,f[35]=qe^~Mt&St,f[44]=ve^~ye&Me,f[45]=we^~be&Se,f[6]=et^~Te&V,f[7]=rt^~it&X,f[16]=at^~ft&nt,f[17]=Fe^~ut&Pe,f[26]=ze^~gt&Oe,f[27]=mt^~He<,f[36]=bt^~Qe&At,f[37]=Mt^~St&vt,f[46]=ye^~Me&Et,f[47]=be^~Se&Ke,f[8]=Te^~V&Re,f[9]=it^~X&Z,f[18]=ft^~nt&st,f[19]=ut^~Pe&ot,f[28]=gt^~Oe&ct,f[29]=He^~lt&De,f[38]=Qe^~At&Le,f[39]=St^~vt&wt,f[48]=Me^~Et&_t,f[49]=Se^~Ke&It,f[0]^=F[C],f[1]^=F[C+1]};if(A)e.exports=a;else for(d=0;d{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(e){return e.message}return null}const ji=Is();var Si;(function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"})(Si||(Si={}));var re;(function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"})(re||(re={}));const Ji="0123456789abcdef";let Ot=class kt{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,r){const i=t.toLowerCase();kr[i]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Ki>kr[i])&&console.log.apply(console,r)}debug(...t){this._log(kt.levels.DEBUG,t)}info(...t){this._log(kt.levels.INFO,t)}warn(...t){this._log(kt.levels.WARNING,t)}makeError(t,r,i){if(Qi)return this.makeError("censored error",r,{});r||(r=kt.errors.UNKNOWN_ERROR),i||(i={});const s=[];Object.keys(i).forEach(v=>{const g=i[v];try{if(g instanceof Uint8Array){let y="";for(let b=0;b>4],y+=Ji[g[b]&15];s.push(v+"=Uint8Array(0x"+y+")")}else s.push(v+"="+JSON.stringify(g))}catch{s.push(v+"="+JSON.stringify(i[v].toString()))}}),s.push(`code=${r}`),s.push(`version=${this.version}`);const o=t;let u="";switch(r){case re.NUMERIC_FAULT:{u="NUMERIC_FAULT";const v=t;switch(v){case"overflow":case"underflow":case"division-by-zero":u+="-"+v;break;case"negative-power":case"negative-width":u+="-unsupported";break;case"unbound-bitwise-result":u+="-unbound-result";break}break}case re.CALL_EXCEPTION:case re.INSUFFICIENT_FUNDS:case re.MISSING_NEW:case re.NONCE_EXPIRED:case re.REPLACEMENT_UNDERPRICED:case re.TRANSACTION_REPLACED:case re.UNPREDICTABLE_GAS_LIMIT:u=r;break}u&&(t+=" [ See: https://links.ethers.org/v5-errors-"+u+" ]"),s.length&&(t+=" ("+s.join(", ")+")");const A=new Error(t);return A.reason=o,A.code=r,Object.keys(i).forEach(function(v){A[v]=i[v]}),A}throwError(t,r,i){throw this.makeError(t,r,i)}throwArgumentError(t,r,i){return this.throwError(t,kt.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(t,r,i,s){t||this.throwError(r,i,s)}assertArgument(t,r,i,s){t||this.throwArgumentError(r,i,s)}checkNormalize(t){ji&&this.throwError("platform missing String.prototype.normalize",kt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ji})}checkSafeUint53(t,r){typeof t=="number"&&(r==null&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,kt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,kt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,r,i){i?i=": "+i:i="",tr&&this.throwError("too many arguments"+i,kt.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}checkNew(t,r){(t===Object||t==null)&&this.throwError("missing new",kt.errors.MISSING_NEW,{name:r.name})}checkAbstract(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",kt.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",kt.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return ii||(ii=new kt(_s)),ii}static setCensorship(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",kt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),qi){if(!t)return;this.globalLogger().throwError("error censorship permanent",kt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Qi=!!t,qi=!!r}static setLogLevel(t){const r=kr[t.toLowerCase()];if(r==null){kt.globalLogger().warn("invalid log level - "+t);return}Ki=r}static from(t){return new kt(t)}};Ot.errors=re,Ot.levels=Si;const Cs="bytes/5.7.0",Nt=new Ot(Cs);function Cn(e){return!!e.toHexString}function Xe(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Xe(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Bs(e){return Jt(e)&&!(e.length%2)||or(e)}function Yi(e){return typeof e=="number"&&e==e&&e%1===0}function or(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e=="string"||!Yi(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Bt(e,t){if(t||(t={}),typeof e=="number"){Nt.checkSafeUint53(e,"invalid arrayify value");const r=[];for(;e;)r.unshift(e&255),e=parseInt(String(e/256));return r.length===0&&r.push(0),Xe(new Uint8Array(r))}if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),Cn(e)&&(e=e.toHexString()),Jt(e)){let r=e.substring(2);r.length%2&&(t.hexPad==="left"?r="0"+r:t.hexPad==="right"?r+="0":Nt.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let s=0;sBt(s)),r=t.reduce((s,o)=>s+o.length,0),i=new Uint8Array(r);return t.reduce((s,o)=>(i.set(o,s),s+o.length),0),Xe(i)}function Ns(e,t){e=Bt(e),e.length>t&&Nt.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),Xe(r)}function Jt(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const ni="0123456789abcdef";function Qt(e,t){if(t||(t={}),typeof e=="number"){Nt.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=ni[e&15]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof e=="bigint")return e=e.toString(16),e.length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),Cn(e))return e.toHexString();if(Jt(e))return e.length%2&&(t.hexPad==="left"?e="0x0"+e.substring(2):t.hexPad==="right"?e+="0":Nt.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(or(e)){let r="0x";for(let i=0;i>4]+ni[s&15]}return r}return Nt.throwArgumentError("invalid hexlify value","value",e)}function Rs(e){if(typeof e!="string")e=Qt(e);else if(!Jt(e)||e.length%2)return null;return(e.length-2)/2}function $i(e,t,r){return typeof e!="string"?e=Qt(e):(!Jt(e)||e.length%2)&&Nt.throwArgumentError("invalid hexData","value",e),t=2+2*t,r!=null?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function fe(e,t){for(typeof e!="string"?e=Qt(e):Jt(e)||Nt.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&Nt.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Bn(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Bs(e)){let r=Bt(e);r.length===64?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Qt(r.slice(0,32)),t.s=Qt(r.slice(32,64))):r.length===65?(t.r=Qt(r.slice(0,32)),t.s=Qt(r.slice(32,64)),t.v=r[64]):Nt.throwArgumentError("invalid signature string","signature",e),t.v<27&&(t.v===0||t.v===1?t.v+=27:Nt.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Qt(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,t._vs!=null){const s=Ns(Bt(t._vs),32);t._vs=Qt(s);const o=s[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=o:t.recoveryParam!==o&&Nt.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),s[0]&=127;const u=Qt(s);t.s==null?t.s=u:t.s!==u&&Nt.throwArgumentError("signature v mismatch _vs","signature",e)}if(t.recoveryParam==null)t.v==null?Nt.throwArgumentError("signature missing v and recoveryParam","signature",e):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const s=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==s&&Nt.throwArgumentError("signature recoveryParam mismatch v","signature",e)}t.r==null||!Jt(t.r)?Nt.throwArgumentError("signature missing or invalid r","signature",e):t.r=fe(t.r,32),t.s==null||!Jt(t.s)?Nt.throwArgumentError("signature missing or invalid s","signature",e):t.s=fe(t.s,32);const r=Bt(t.s);r[0]>=128&&Nt.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const i=Qt(r);t._vs&&(Jt(t._vs)||Nt.throwArgumentError("signature invalid _vs","signature",e),t._vs=fe(t._vs,32)),t._vs==null?t._vs=i:t._vs!==i&&Nt.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Ri(e){return"0x"+Es.keccak_256(Bt(e))}var xn={exports:{}},ks={},Ts=Object.freeze({__proto__:null,default:ks}),Ps=Ss(Ts);(function(e){(function(t,r){function i(n,a){if(!n)throw new Error(a||"Assertion failed")}function s(n,a){n.super_=a;var l=function(){};l.prototype=a.prototype,n.prototype=new l,n.prototype.constructor=n}function o(n,a,l){if(o.isBN(n))return n;this.negative=0,this.words=null,this.length=0,this.red=null,n!==null&&((a==="le"||a==="be")&&(l=a,a=10),this._init(n||0,a||10,l||"be"))}typeof t=="object"?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=Ps.Buffer}catch{}o.isBN=function(n){return n instanceof o?!0:n!==null&&typeof n=="object"&&n.constructor.wordSize===o.wordSize&&Array.isArray(n.words)},o.max=function(n,a){return n.cmp(a)>0?n:a},o.min=function(n,a){return n.cmp(a)<0?n:a},o.prototype._init=function(n,a,l){if(typeof n=="number")return this._initNumber(n,a,l);if(typeof n=="object")return this._initArray(n,a,l);a==="hex"&&(a=16),i(a===(a|0)&&a>=2&&a<=36),n=n.toString().replace(/\s+/g,"");var d=0;n[0]==="-"&&(d++,this.negative=1),d=0;d-=3)w=n[d]|n[d-1]<<8|n[d-2]<<16,this.words[m]|=w<>>26-M&67108863,M+=24,M>=26&&(M-=26,m++);else if(l==="le")for(d=0,m=0;d>>26-M&67108863,M+=24,M>=26&&(M-=26,m++);return this._strip()};function A(n,a){var l=n.charCodeAt(a);if(l>=48&&l<=57)return l-48;if(l>=65&&l<=70)return l-55;if(l>=97&&l<=102)return l-87;i(!1,"Invalid character in "+n)}function v(n,a,l){var d=A(n,l);return l-1>=a&&(d|=A(n,l-1)<<4),d}o.prototype._parseHex=function(n,a,l){this.length=Math.ceil((n.length-a)/6),this.words=new Array(this.length);for(var d=0;d=a;d-=2)M=v(n,a,d)<=18?(m-=18,w+=1,this.words[w]|=M>>>26):m+=8;else{var p=n.length-a;for(d=p%2===0?a+1:a;d=18?(m-=18,w+=1,this.words[w]|=M>>>26):m+=8}this._strip()};function g(n,a,l,d){for(var m=0,w=0,M=Math.min(n.length,l),p=a;p=49?w=h-49+10:h>=17?w=h-17+10:w=h,i(h>=0&&w1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch{o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],B=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(n,a){n=n||10,a=a|0||1;var l;if(n===16||n==="hex"){l="";for(var d=0,m=0,w=0;w>>24-d&16777215,d+=2,d>=26&&(d-=26,w--),m!==0||w!==this.length-1?l=E[6-p.length]+p+l:l=p+l}for(m!==0&&(l=m.toString(16)+l);l.length%a!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}if(n===(n|0)&&n>=2&&n<=36){var h=I[n],c=B[n];l="";var O=this.clone();for(O.negative=0;!O.isZero();){var P=O.modrn(c).toString(n);O=O.idivn(c),O.isZero()?l=P+l:l=E[h-P.length]+P+l}for(this.isZero()&&(l="0"+l);l.length%a!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var n=this.words[0];return this.length===2?n+=this.words[1]*67108864:this.length===3&&this.words[2]===1?n+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-n:n},o.prototype.toJSON=function(){return this.toString(16,2)},u&&(o.prototype.toBuffer=function(n,a){return this.toArrayLike(u,n,a)}),o.prototype.toArray=function(n,a){return this.toArrayLike(Array,n,a)};var F=function(n,a){return n.allocUnsafe?n.allocUnsafe(a):new n(a)};o.prototype.toArrayLike=function(n,a,l){this._strip();var d=this.byteLength(),m=l||Math.max(1,d);i(d<=m,"byte array longer than desired length"),i(m>0,"Requested array length <= 0");var w=F(n,m),M=a==="le"?"LE":"BE";return this["_toArrayLike"+M](w,d),w},o.prototype._toArrayLikeLE=function(n,a){for(var l=0,d=0,m=0,w=0;m>8&255),l>16&255),w===6?(l>24&255),d=0,w=0):(d=M>>>24,w+=2)}if(l=0&&(n[l--]=M>>8&255),l>=0&&(n[l--]=M>>16&255),w===6?(l>=0&&(n[l--]=M>>24&255),d=0,w=0):(d=M>>>24,w+=2)}if(l>=0)for(n[l--]=d;l>=0;)n[l--]=0},Math.clz32?o.prototype._countBits=function(n){return 32-Math.clz32(n)}:o.prototype._countBits=function(n){var a=n,l=0;return a>=4096&&(l+=13,a>>>=13),a>=64&&(l+=7,a>>>=7),a>=8&&(l+=4,a>>>=4),a>=2&&(l+=2,a>>>=2),l+a},o.prototype._zeroBits=function(n){if(n===0)return 26;var a=n,l=0;return a&8191||(l+=13,a>>>=13),a&127||(l+=7,a>>>=7),a&15||(l+=4,a>>>=4),a&3||(l+=2,a>>>=2),a&1||l++,l},o.prototype.bitLength=function(){var n=this.words[this.length-1],a=this._countBits(n);return(this.length-1)*26+a};function T(n){for(var a=new Array(n.bitLength()),l=0;l>>m&1}return a}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,a=0;an.length?this.clone().ior(n):n.clone().ior(this)},o.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},o.prototype.iuand=function(n){var a;this.length>n.length?a=n:a=this;for(var l=0;ln.length?this.clone().iand(n):n.clone().iand(this)},o.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},o.prototype.iuxor=function(n){var a,l;this.length>n.length?(a=this,l=n):(a=n,l=this);for(var d=0;dn.length?this.clone().ixor(n):n.clone().ixor(this)},o.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},o.prototype.inotn=function(n){i(typeof n=="number"&&n>=0);var a=Math.ceil(n/26)|0,l=n%26;this._expand(a),l>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-l),this._strip()},o.prototype.notn=function(n){return this.clone().inotn(n)},o.prototype.setn=function(n,a){i(typeof n=="number"&&n>=0);var l=n/26|0,d=n%26;return this._expand(l+1),a?this.words[l]=this.words[l]|1<n.length?(l=this,d=n):(l=n,d=this);for(var m=0,w=0;w>>26;for(;m!==0&&w>>26;if(this.length=l.length,m!==0)this.words[this.length]=m,this.length++;else if(l!==this)for(;wn.length?this.clone().iadd(n):n.clone().iadd(this)},o.prototype.isub=function(n){if(n.negative!==0){n.negative=0;var a=this.iadd(n);return n.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var l=this.cmp(n);if(l===0)return this.negative=0,this.length=1,this.words[0]=0,this;var d,m;l>0?(d=this,m=n):(d=n,m=this);for(var w=0,M=0;M>26,this.words[M]=a&67108863;for(;w!==0&&M>26,this.words[M]=a&67108863;if(w===0&&M>>26,P=h&67108863,f=Math.min(c,a.length-1),_=Math.max(0,c-n.length+1);_<=f;_++){var S=c-_|0;m=n.words[S]|0,w=a.words[_]|0,M=m*w+P,O+=M/67108864|0,P=M&67108863}l.words[c]=P|0,h=O|0}return h!==0?l.words[c]=h|0:l.length--,l._strip()}var Ct=function(n,a,l){var d=n.words,m=a.words,w=l.words,M=0,p,h,c,O=d[0]|0,P=O&8191,f=O>>>13,_=d[1]|0,S=_&8191,C=_>>>13,k=d[2]|0,x=k&8191,N=k>>>13,U=d[3]|0,z=U&8191,R=U>>>13,$=d[4]|0,G=$&8191,W=$>>>13,Ne=d[5]|0,V=Ne&8191,X=Ne>>>13,Re=d[6]|0,Z=Re&8191,tt=Re>>>13,ke=d[7]|0,et=ke&8191,rt=ke>>>13,Te=d[8]|0,it=Te&8191,nt=Te>>>13,Pe=d[9]|0,st=Pe&8191,ot=Pe>>>13,Ue=m[0]|0,ht=Ue&8191,at=Ue>>>13,Fe=m[1]|0,ft=Fe&8191,ut=Fe>>>13,Oe=m[2]|0,lt=Oe&8191,ct=Oe>>>13,De=m[3]|0,dt=De&8191,pt=De>>>13,ze=m[4]|0,mt=ze&8191,gt=ze>>>13,He=m[5]|0,At=He&8191,vt=He>>>13,Le=m[6]|0,wt=Le&8191,yt=Le>>>13,qe=m[7]|0,bt=qe&8191,Mt=qe>>>13,Qe=m[8]|0,St=Qe&8191,Et=Qe>>>13,Ke=m[9]|0,_t=Ke&8191,It=Ke>>>13;l.negative=n.negative^a.negative,l.length=19,p=Math.imul(P,ht),h=Math.imul(P,at),h=h+Math.imul(f,ht)|0,c=Math.imul(f,at);var ve=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(ve>>>26)|0,ve&=67108863,p=Math.imul(S,ht),h=Math.imul(S,at),h=h+Math.imul(C,ht)|0,c=Math.imul(C,at),p=p+Math.imul(P,ft)|0,h=h+Math.imul(P,ut)|0,h=h+Math.imul(f,ft)|0,c=c+Math.imul(f,ut)|0;var we=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(we>>>26)|0,we&=67108863,p=Math.imul(x,ht),h=Math.imul(x,at),h=h+Math.imul(N,ht)|0,c=Math.imul(N,at),p=p+Math.imul(S,ft)|0,h=h+Math.imul(S,ut)|0,h=h+Math.imul(C,ft)|0,c=c+Math.imul(C,ut)|0,p=p+Math.imul(P,lt)|0,h=h+Math.imul(P,ct)|0,h=h+Math.imul(f,lt)|0,c=c+Math.imul(f,ct)|0;var ye=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(ye>>>26)|0,ye&=67108863,p=Math.imul(z,ht),h=Math.imul(z,at),h=h+Math.imul(R,ht)|0,c=Math.imul(R,at),p=p+Math.imul(x,ft)|0,h=h+Math.imul(x,ut)|0,h=h+Math.imul(N,ft)|0,c=c+Math.imul(N,ut)|0,p=p+Math.imul(S,lt)|0,h=h+Math.imul(S,ct)|0,h=h+Math.imul(C,lt)|0,c=c+Math.imul(C,ct)|0,p=p+Math.imul(P,dt)|0,h=h+Math.imul(P,pt)|0,h=h+Math.imul(f,dt)|0,c=c+Math.imul(f,pt)|0;var be=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(be>>>26)|0,be&=67108863,p=Math.imul(G,ht),h=Math.imul(G,at),h=h+Math.imul(W,ht)|0,c=Math.imul(W,at),p=p+Math.imul(z,ft)|0,h=h+Math.imul(z,ut)|0,h=h+Math.imul(R,ft)|0,c=c+Math.imul(R,ut)|0,p=p+Math.imul(x,lt)|0,h=h+Math.imul(x,ct)|0,h=h+Math.imul(N,lt)|0,c=c+Math.imul(N,ct)|0,p=p+Math.imul(S,dt)|0,h=h+Math.imul(S,pt)|0,h=h+Math.imul(C,dt)|0,c=c+Math.imul(C,pt)|0,p=p+Math.imul(P,mt)|0,h=h+Math.imul(P,gt)|0,h=h+Math.imul(f,mt)|0,c=c+Math.imul(f,gt)|0;var Me=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Me>>>26)|0,Me&=67108863,p=Math.imul(V,ht),h=Math.imul(V,at),h=h+Math.imul(X,ht)|0,c=Math.imul(X,at),p=p+Math.imul(G,ft)|0,h=h+Math.imul(G,ut)|0,h=h+Math.imul(W,ft)|0,c=c+Math.imul(W,ut)|0,p=p+Math.imul(z,lt)|0,h=h+Math.imul(z,ct)|0,h=h+Math.imul(R,lt)|0,c=c+Math.imul(R,ct)|0,p=p+Math.imul(x,dt)|0,h=h+Math.imul(x,pt)|0,h=h+Math.imul(N,dt)|0,c=c+Math.imul(N,pt)|0,p=p+Math.imul(S,mt)|0,h=h+Math.imul(S,gt)|0,h=h+Math.imul(C,mt)|0,c=c+Math.imul(C,gt)|0,p=p+Math.imul(P,At)|0,h=h+Math.imul(P,vt)|0,h=h+Math.imul(f,At)|0,c=c+Math.imul(f,vt)|0;var Se=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Se>>>26)|0,Se&=67108863,p=Math.imul(Z,ht),h=Math.imul(Z,at),h=h+Math.imul(tt,ht)|0,c=Math.imul(tt,at),p=p+Math.imul(V,ft)|0,h=h+Math.imul(V,ut)|0,h=h+Math.imul(X,ft)|0,c=c+Math.imul(X,ut)|0,p=p+Math.imul(G,lt)|0,h=h+Math.imul(G,ct)|0,h=h+Math.imul(W,lt)|0,c=c+Math.imul(W,ct)|0,p=p+Math.imul(z,dt)|0,h=h+Math.imul(z,pt)|0,h=h+Math.imul(R,dt)|0,c=c+Math.imul(R,pt)|0,p=p+Math.imul(x,mt)|0,h=h+Math.imul(x,gt)|0,h=h+Math.imul(N,mt)|0,c=c+Math.imul(N,gt)|0,p=p+Math.imul(S,At)|0,h=h+Math.imul(S,vt)|0,h=h+Math.imul(C,At)|0,c=c+Math.imul(C,vt)|0,p=p+Math.imul(P,wt)|0,h=h+Math.imul(P,yt)|0,h=h+Math.imul(f,wt)|0,c=c+Math.imul(f,yt)|0;var Kr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,p=Math.imul(et,ht),h=Math.imul(et,at),h=h+Math.imul(rt,ht)|0,c=Math.imul(rt,at),p=p+Math.imul(Z,ft)|0,h=h+Math.imul(Z,ut)|0,h=h+Math.imul(tt,ft)|0,c=c+Math.imul(tt,ut)|0,p=p+Math.imul(V,lt)|0,h=h+Math.imul(V,ct)|0,h=h+Math.imul(X,lt)|0,c=c+Math.imul(X,ct)|0,p=p+Math.imul(G,dt)|0,h=h+Math.imul(G,pt)|0,h=h+Math.imul(W,dt)|0,c=c+Math.imul(W,pt)|0,p=p+Math.imul(z,mt)|0,h=h+Math.imul(z,gt)|0,h=h+Math.imul(R,mt)|0,c=c+Math.imul(R,gt)|0,p=p+Math.imul(x,At)|0,h=h+Math.imul(x,vt)|0,h=h+Math.imul(N,At)|0,c=c+Math.imul(N,vt)|0,p=p+Math.imul(S,wt)|0,h=h+Math.imul(S,yt)|0,h=h+Math.imul(C,wt)|0,c=c+Math.imul(C,yt)|0,p=p+Math.imul(P,bt)|0,h=h+Math.imul(P,Mt)|0,h=h+Math.imul(f,bt)|0,c=c+Math.imul(f,Mt)|0;var jr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(jr>>>26)|0,jr&=67108863,p=Math.imul(it,ht),h=Math.imul(it,at),h=h+Math.imul(nt,ht)|0,c=Math.imul(nt,at),p=p+Math.imul(et,ft)|0,h=h+Math.imul(et,ut)|0,h=h+Math.imul(rt,ft)|0,c=c+Math.imul(rt,ut)|0,p=p+Math.imul(Z,lt)|0,h=h+Math.imul(Z,ct)|0,h=h+Math.imul(tt,lt)|0,c=c+Math.imul(tt,ct)|0,p=p+Math.imul(V,dt)|0,h=h+Math.imul(V,pt)|0,h=h+Math.imul(X,dt)|0,c=c+Math.imul(X,pt)|0,p=p+Math.imul(G,mt)|0,h=h+Math.imul(G,gt)|0,h=h+Math.imul(W,mt)|0,c=c+Math.imul(W,gt)|0,p=p+Math.imul(z,At)|0,h=h+Math.imul(z,vt)|0,h=h+Math.imul(R,At)|0,c=c+Math.imul(R,vt)|0,p=p+Math.imul(x,wt)|0,h=h+Math.imul(x,yt)|0,h=h+Math.imul(N,wt)|0,c=c+Math.imul(N,yt)|0,p=p+Math.imul(S,bt)|0,h=h+Math.imul(S,Mt)|0,h=h+Math.imul(C,bt)|0,c=c+Math.imul(C,Mt)|0,p=p+Math.imul(P,St)|0,h=h+Math.imul(P,Et)|0,h=h+Math.imul(f,St)|0,c=c+Math.imul(f,Et)|0;var Jr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,p=Math.imul(st,ht),h=Math.imul(st,at),h=h+Math.imul(ot,ht)|0,c=Math.imul(ot,at),p=p+Math.imul(it,ft)|0,h=h+Math.imul(it,ut)|0,h=h+Math.imul(nt,ft)|0,c=c+Math.imul(nt,ut)|0,p=p+Math.imul(et,lt)|0,h=h+Math.imul(et,ct)|0,h=h+Math.imul(rt,lt)|0,c=c+Math.imul(rt,ct)|0,p=p+Math.imul(Z,dt)|0,h=h+Math.imul(Z,pt)|0,h=h+Math.imul(tt,dt)|0,c=c+Math.imul(tt,pt)|0,p=p+Math.imul(V,mt)|0,h=h+Math.imul(V,gt)|0,h=h+Math.imul(X,mt)|0,c=c+Math.imul(X,gt)|0,p=p+Math.imul(G,At)|0,h=h+Math.imul(G,vt)|0,h=h+Math.imul(W,At)|0,c=c+Math.imul(W,vt)|0,p=p+Math.imul(z,wt)|0,h=h+Math.imul(z,yt)|0,h=h+Math.imul(R,wt)|0,c=c+Math.imul(R,yt)|0,p=p+Math.imul(x,bt)|0,h=h+Math.imul(x,Mt)|0,h=h+Math.imul(N,bt)|0,c=c+Math.imul(N,Mt)|0,p=p+Math.imul(S,St)|0,h=h+Math.imul(S,Et)|0,h=h+Math.imul(C,St)|0,c=c+Math.imul(C,Et)|0,p=p+Math.imul(P,_t)|0,h=h+Math.imul(P,It)|0,h=h+Math.imul(f,_t)|0,c=c+Math.imul(f,It)|0;var Yr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,p=Math.imul(st,ft),h=Math.imul(st,ut),h=h+Math.imul(ot,ft)|0,c=Math.imul(ot,ut),p=p+Math.imul(it,lt)|0,h=h+Math.imul(it,ct)|0,h=h+Math.imul(nt,lt)|0,c=c+Math.imul(nt,ct)|0,p=p+Math.imul(et,dt)|0,h=h+Math.imul(et,pt)|0,h=h+Math.imul(rt,dt)|0,c=c+Math.imul(rt,pt)|0,p=p+Math.imul(Z,mt)|0,h=h+Math.imul(Z,gt)|0,h=h+Math.imul(tt,mt)|0,c=c+Math.imul(tt,gt)|0,p=p+Math.imul(V,At)|0,h=h+Math.imul(V,vt)|0,h=h+Math.imul(X,At)|0,c=c+Math.imul(X,vt)|0,p=p+Math.imul(G,wt)|0,h=h+Math.imul(G,yt)|0,h=h+Math.imul(W,wt)|0,c=c+Math.imul(W,yt)|0,p=p+Math.imul(z,bt)|0,h=h+Math.imul(z,Mt)|0,h=h+Math.imul(R,bt)|0,c=c+Math.imul(R,Mt)|0,p=p+Math.imul(x,St)|0,h=h+Math.imul(x,Et)|0,h=h+Math.imul(N,St)|0,c=c+Math.imul(N,Et)|0,p=p+Math.imul(S,_t)|0,h=h+Math.imul(S,It)|0,h=h+Math.imul(C,_t)|0,c=c+Math.imul(C,It)|0;var $r=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+($r>>>26)|0,$r&=67108863,p=Math.imul(st,lt),h=Math.imul(st,ct),h=h+Math.imul(ot,lt)|0,c=Math.imul(ot,ct),p=p+Math.imul(it,dt)|0,h=h+Math.imul(it,pt)|0,h=h+Math.imul(nt,dt)|0,c=c+Math.imul(nt,pt)|0,p=p+Math.imul(et,mt)|0,h=h+Math.imul(et,gt)|0,h=h+Math.imul(rt,mt)|0,c=c+Math.imul(rt,gt)|0,p=p+Math.imul(Z,At)|0,h=h+Math.imul(Z,vt)|0,h=h+Math.imul(tt,At)|0,c=c+Math.imul(tt,vt)|0,p=p+Math.imul(V,wt)|0,h=h+Math.imul(V,yt)|0,h=h+Math.imul(X,wt)|0,c=c+Math.imul(X,yt)|0,p=p+Math.imul(G,bt)|0,h=h+Math.imul(G,Mt)|0,h=h+Math.imul(W,bt)|0,c=c+Math.imul(W,Mt)|0,p=p+Math.imul(z,St)|0,h=h+Math.imul(z,Et)|0,h=h+Math.imul(R,St)|0,c=c+Math.imul(R,Et)|0,p=p+Math.imul(x,_t)|0,h=h+Math.imul(x,It)|0,h=h+Math.imul(N,_t)|0,c=c+Math.imul(N,It)|0;var Gr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,p=Math.imul(st,dt),h=Math.imul(st,pt),h=h+Math.imul(ot,dt)|0,c=Math.imul(ot,pt),p=p+Math.imul(it,mt)|0,h=h+Math.imul(it,gt)|0,h=h+Math.imul(nt,mt)|0,c=c+Math.imul(nt,gt)|0,p=p+Math.imul(et,At)|0,h=h+Math.imul(et,vt)|0,h=h+Math.imul(rt,At)|0,c=c+Math.imul(rt,vt)|0,p=p+Math.imul(Z,wt)|0,h=h+Math.imul(Z,yt)|0,h=h+Math.imul(tt,wt)|0,c=c+Math.imul(tt,yt)|0,p=p+Math.imul(V,bt)|0,h=h+Math.imul(V,Mt)|0,h=h+Math.imul(X,bt)|0,c=c+Math.imul(X,Mt)|0,p=p+Math.imul(G,St)|0,h=h+Math.imul(G,Et)|0,h=h+Math.imul(W,St)|0,c=c+Math.imul(W,Et)|0,p=p+Math.imul(z,_t)|0,h=h+Math.imul(z,It)|0,h=h+Math.imul(R,_t)|0,c=c+Math.imul(R,It)|0;var Wr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,p=Math.imul(st,mt),h=Math.imul(st,gt),h=h+Math.imul(ot,mt)|0,c=Math.imul(ot,gt),p=p+Math.imul(it,At)|0,h=h+Math.imul(it,vt)|0,h=h+Math.imul(nt,At)|0,c=c+Math.imul(nt,vt)|0,p=p+Math.imul(et,wt)|0,h=h+Math.imul(et,yt)|0,h=h+Math.imul(rt,wt)|0,c=c+Math.imul(rt,yt)|0,p=p+Math.imul(Z,bt)|0,h=h+Math.imul(Z,Mt)|0,h=h+Math.imul(tt,bt)|0,c=c+Math.imul(tt,Mt)|0,p=p+Math.imul(V,St)|0,h=h+Math.imul(V,Et)|0,h=h+Math.imul(X,St)|0,c=c+Math.imul(X,Et)|0,p=p+Math.imul(G,_t)|0,h=h+Math.imul(G,It)|0,h=h+Math.imul(W,_t)|0,c=c+Math.imul(W,It)|0;var Vr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,p=Math.imul(st,At),h=Math.imul(st,vt),h=h+Math.imul(ot,At)|0,c=Math.imul(ot,vt),p=p+Math.imul(it,wt)|0,h=h+Math.imul(it,yt)|0,h=h+Math.imul(nt,wt)|0,c=c+Math.imul(nt,yt)|0,p=p+Math.imul(et,bt)|0,h=h+Math.imul(et,Mt)|0,h=h+Math.imul(rt,bt)|0,c=c+Math.imul(rt,Mt)|0,p=p+Math.imul(Z,St)|0,h=h+Math.imul(Z,Et)|0,h=h+Math.imul(tt,St)|0,c=c+Math.imul(tt,Et)|0,p=p+Math.imul(V,_t)|0,h=h+Math.imul(V,It)|0,h=h+Math.imul(X,_t)|0,c=c+Math.imul(X,It)|0;var Xr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,p=Math.imul(st,wt),h=Math.imul(st,yt),h=h+Math.imul(ot,wt)|0,c=Math.imul(ot,yt),p=p+Math.imul(it,bt)|0,h=h+Math.imul(it,Mt)|0,h=h+Math.imul(nt,bt)|0,c=c+Math.imul(nt,Mt)|0,p=p+Math.imul(et,St)|0,h=h+Math.imul(et,Et)|0,h=h+Math.imul(rt,St)|0,c=c+Math.imul(rt,Et)|0,p=p+Math.imul(Z,_t)|0,h=h+Math.imul(Z,It)|0,h=h+Math.imul(tt,_t)|0,c=c+Math.imul(tt,It)|0;var Zr=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,p=Math.imul(st,bt),h=Math.imul(st,Mt),h=h+Math.imul(ot,bt)|0,c=Math.imul(ot,Mt),p=p+Math.imul(it,St)|0,h=h+Math.imul(it,Et)|0,h=h+Math.imul(nt,St)|0,c=c+Math.imul(nt,Et)|0,p=p+Math.imul(et,_t)|0,h=h+Math.imul(et,It)|0,h=h+Math.imul(rt,_t)|0,c=c+Math.imul(rt,It)|0;var ti=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(ti>>>26)|0,ti&=67108863,p=Math.imul(st,St),h=Math.imul(st,Et),h=h+Math.imul(ot,St)|0,c=Math.imul(ot,Et),p=p+Math.imul(it,_t)|0,h=h+Math.imul(it,It)|0,h=h+Math.imul(nt,_t)|0,c=c+Math.imul(nt,It)|0;var ei=(M+p|0)+((h&8191)<<13)|0;M=(c+(h>>>13)|0)+(ei>>>26)|0,ei&=67108863,p=Math.imul(st,_t),h=Math.imul(st,It),h=h+Math.imul(ot,_t)|0,c=Math.imul(ot,It);var ri=(M+p|0)+((h&8191)<<13)|0;return M=(c+(h>>>13)|0)+(ri>>>26)|0,ri&=67108863,w[0]=ve,w[1]=we,w[2]=ye,w[3]=be,w[4]=Me,w[5]=Se,w[6]=Kr,w[7]=jr,w[8]=Jr,w[9]=Yr,w[10]=$r,w[11]=Gr,w[12]=Wr,w[13]=Vr,w[14]=Xr,w[15]=Zr,w[16]=ti,w[17]=ei,w[18]=ri,M!==0&&(w[19]=M,l.length++),l};Math.imul||(Ct=q);function xt(n,a,l){l.negative=a.negative^n.negative,l.length=n.length+a.length;for(var d=0,m=0,w=0;w>>26)|0,m+=M>>>26,M&=67108863}l.words[w]=p,d=M,M=m}return d!==0?l.words[w]=d:l.length--,l._strip()}function j(n,a,l){return xt(n,a,l)}o.prototype.mulTo=function(n,a){var l,d=this.length+n.length;return this.length===10&&n.length===10?l=Ct(this,n,a):d<63?l=q(this,n,a):d<1024?l=xt(this,n,a):l=j(this,n,a),l},o.prototype.mul=function(n){var a=new o(null);return a.words=new Array(this.length+n.length),this.mulTo(n,a)},o.prototype.mulf=function(n){var a=new o(null);return a.words=new Array(this.length+n.length),j(this,n,a)},o.prototype.imul=function(n){return this.clone().mulTo(n,this)},o.prototype.imuln=function(n){var a=n<0;a&&(n=-n),i(typeof n=="number"),i(n<67108864);for(var l=0,d=0;d>=26,l+=m/67108864|0,l+=w>>>26,this.words[d]=w&67108863}return l!==0&&(this.words[d]=l,this.length++),a?this.ineg():this},o.prototype.muln=function(n){return this.clone().imuln(n)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(n){var a=T(n);if(a.length===0)return new o(1);for(var l=this,d=0;d=0);var a=n%26,l=(n-a)/26,d=67108863>>>26-a<<26-a,m;if(a!==0){var w=0;for(m=0;m>>26-a}w&&(this.words[m]=w,this.length++)}if(l!==0){for(m=this.length-1;m>=0;m--)this.words[m+l]=this.words[m];for(m=0;m=0);var d;a?d=(a-a%26)/26:d=0;var m=n%26,w=Math.min((n-m)/26,this.length),M=67108863^67108863>>>m<w)for(this.length-=w,h=0;h=0&&(c!==0||h>=d);h--){var O=this.words[h]|0;this.words[h]=c<<26-m|O>>>m,c=O&M}return p&&c!==0&&(p.words[p.length++]=c),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(n,a,l){return i(this.negative===0),this.iushrn(n,a,l)},o.prototype.shln=function(n){return this.clone().ishln(n)},o.prototype.ushln=function(n){return this.clone().iushln(n)},o.prototype.shrn=function(n){return this.clone().ishrn(n)},o.prototype.ushrn=function(n){return this.clone().iushrn(n)},o.prototype.testn=function(n){i(typeof n=="number"&&n>=0);var a=n%26,l=(n-a)/26,d=1<=0);var a=n%26,l=(n-a)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=l)return this;if(a!==0&&l++,this.length=Math.min(l,this.length),a!==0){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},o.prototype.isubn=function(n){if(i(typeof n=="number"),i(n<67108864),n<0)return this.iaddn(-n);if(this.negative!==0)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(p/67108864|0),this.words[m+l]=w&67108863}for(;m>26,this.words[m+l]=w&67108863;if(M===0)return this._strip();for(i(M===-1),M=0,m=0;m>26,this.words[m]=w&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(n,a){var l=this.length-n.length,d=this.clone(),m=n,w=m.words[m.length-1]|0,M=this._countBits(w);l=26-M,l!==0&&(m=m.ushln(l),d.iushln(l),w=m.words[m.length-1]|0);var p=d.length-m.length,h;if(a!=="mod"){h=new o(null),h.length=p+1,h.words=new Array(h.length);for(var c=0;c=0;P--){var f=(d.words[m.length+P]|0)*67108864+(d.words[m.length+P-1]|0);for(f=Math.min(f/w|0,67108863),d._ishlnsubmul(m,f,P);d.negative!==0;)f--,d.negative=0,d._ishlnsubmul(m,1,P),d.isZero()||(d.negative^=1);h&&(h.words[P]=f)}return h&&h._strip(),d._strip(),a!=="div"&&l!==0&&d.iushrn(l),{div:h||null,mod:d}},o.prototype.divmod=function(n,a,l){if(i(!n.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var d,m,w;return this.negative!==0&&n.negative===0?(w=this.neg().divmod(n,a),a!=="mod"&&(d=w.div.neg()),a!=="div"&&(m=w.mod.neg(),l&&m.negative!==0&&m.iadd(n)),{div:d,mod:m}):this.negative===0&&n.negative!==0?(w=this.divmod(n.neg(),a),a!=="mod"&&(d=w.div.neg()),{div:d,mod:w.mod}):this.negative&n.negative?(w=this.neg().divmod(n.neg(),a),a!=="div"&&(m=w.mod.neg(),l&&m.negative!==0&&m.isub(n)),{div:w.div,mod:m}):n.length>this.length||this.cmp(n)<0?{div:new o(0),mod:this}:n.length===1?a==="div"?{div:this.divn(n.words[0]),mod:null}:a==="mod"?{div:null,mod:new o(this.modrn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new o(this.modrn(n.words[0]))}:this._wordDiv(n,a)},o.prototype.div=function(n){return this.divmod(n,"div",!1).div},o.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},o.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},o.prototype.divRound=function(n){var a=this.divmod(n);if(a.mod.isZero())return a.div;var l=a.div.negative!==0?a.mod.isub(n):a.mod,d=n.ushrn(1),m=n.andln(1),w=l.cmp(d);return w<0||m===1&&w===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},o.prototype.modrn=function(n){var a=n<0;a&&(n=-n),i(n<=67108863);for(var l=(1<<26)%n,d=0,m=this.length-1;m>=0;m--)d=(l*d+(this.words[m]|0))%n;return a?-d:d},o.prototype.modn=function(n){return this.modrn(n)},o.prototype.idivn=function(n){var a=n<0;a&&(n=-n),i(n<=67108863);for(var l=0,d=this.length-1;d>=0;d--){var m=(this.words[d]|0)+l*67108864;this.words[d]=m/n|0,l=m%n}return this._strip(),a?this.ineg():this},o.prototype.divn=function(n){return this.clone().idivn(n)},o.prototype.egcd=function(n){i(n.negative===0),i(!n.isZero());var a=this,l=n.clone();a.negative!==0?a=a.umod(n):a=a.clone();for(var d=new o(1),m=new o(0),w=new o(0),M=new o(1),p=0;a.isEven()&&l.isEven();)a.iushrn(1),l.iushrn(1),++p;for(var h=l.clone(),c=a.clone();!a.isZero();){for(var O=0,P=1;!(a.words[0]&P)&&O<26;++O,P<<=1);if(O>0)for(a.iushrn(O);O-- >0;)(d.isOdd()||m.isOdd())&&(d.iadd(h),m.isub(c)),d.iushrn(1),m.iushrn(1);for(var f=0,_=1;!(l.words[0]&_)&&f<26;++f,_<<=1);if(f>0)for(l.iushrn(f);f-- >0;)(w.isOdd()||M.isOdd())&&(w.iadd(h),M.isub(c)),w.iushrn(1),M.iushrn(1);a.cmp(l)>=0?(a.isub(l),d.isub(w),m.isub(M)):(l.isub(a),w.isub(d),M.isub(m))}return{a:w,b:M,gcd:l.iushln(p)}},o.prototype._invmp=function(n){i(n.negative===0),i(!n.isZero());var a=this,l=n.clone();a.negative!==0?a=a.umod(n):a=a.clone();for(var d=new o(1),m=new o(0),w=l.clone();a.cmpn(1)>0&&l.cmpn(1)>0;){for(var M=0,p=1;!(a.words[0]&p)&&M<26;++M,p<<=1);if(M>0)for(a.iushrn(M);M-- >0;)d.isOdd()&&d.iadd(w),d.iushrn(1);for(var h=0,c=1;!(l.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(l.iushrn(h);h-- >0;)m.isOdd()&&m.iadd(w),m.iushrn(1);a.cmp(l)>=0?(a.isub(l),d.isub(m)):(l.isub(a),m.isub(d))}var O;return a.cmpn(1)===0?O=d:O=m,O.cmpn(0)<0&&O.iadd(n),O},o.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var a=this.clone(),l=n.clone();a.negative=0,l.negative=0;for(var d=0;a.isEven()&&l.isEven();d++)a.iushrn(1),l.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;l.isEven();)l.iushrn(1);var m=a.cmp(l);if(m<0){var w=a;a=l,l=w}else if(m===0||l.cmpn(1)===0)break;a.isub(l)}while(!0);return l.iushln(d)},o.prototype.invm=function(n){return this.egcd(n).a.umod(n)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(n){return this.words[0]&n},o.prototype.bincn=function(n){i(typeof n=="number");var a=n%26,l=(n-a)/26,d=1<>>26,M&=67108863,this.words[w]=M}return m!==0&&(this.words[w]=m,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(n){var a=n<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var l;if(this.length>1)l=1;else{a&&(n=-n),i(n<=67108863,"Number is too big");var d=this.words[0]|0;l=d===n?0:dn.length)return 1;if(this.length=0;l--){var d=this.words[l]|0,m=n.words[l]|0;if(d!==m){dm&&(a=1);break}}return a},o.prototype.gtn=function(n){return this.cmpn(n)===1},o.prototype.gt=function(n){return this.cmp(n)===1},o.prototype.gten=function(n){return this.cmpn(n)>=0},o.prototype.gte=function(n){return this.cmp(n)>=0},o.prototype.ltn=function(n){return this.cmpn(n)===-1},o.prototype.lt=function(n){return this.cmp(n)===-1},o.prototype.lten=function(n){return this.cmpn(n)<=0},o.prototype.lte=function(n){return this.cmp(n)<=0},o.prototype.eqn=function(n){return this.cmpn(n)===0},o.prototype.eq=function(n){return this.cmp(n)===0},o.red=function(n){return new J(n)},o.prototype.toRed=function(n){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),n.convertTo(this)._forceRed(n)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(n){return this.red=n,this},o.prototype.forceRed=function(n){return i(!this.red,"Already a number in reduction context"),this._forceRed(n)},o.prototype.redAdd=function(n){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},o.prototype.redIAdd=function(n){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},o.prototype.redSub=function(n){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},o.prototype.redISub=function(n){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},o.prototype.redShl=function(n){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},o.prototype.redMul=function(n){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},o.prototype.redIMul=function(n){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(n){return i(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var K={k256:null,p224:null,p192:null,p25519:null};function Q(n,a){this.name=n,this.p=new o(a,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Q.prototype._tmp=function(){var n=new o(null);return n.words=new Array(Math.ceil(this.n/13)),n},Q.prototype.ireduce=function(n){var a=n,l;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),l=a.bitLength();while(l>this.n);var d=l0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},Q.prototype.split=function(n,a){n.iushrn(this.n,0,a)},Q.prototype.imulK=function(n){return n.imul(this.k)};function Rt(){Q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(Rt,Q),Rt.prototype.split=function(n,a){for(var l=4194303,d=Math.min(n.length,9),m=0;m>>22,w=M}w>>>=22,n.words[m-10]=w,w===0&&n.length>10?n.length-=10:n.length-=9},Rt.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var a=0,l=0;l>>=26,n.words[l]=m,a=d}return a!==0&&(n.words[n.length++]=a),n},o._prime=function(n){if(K[n])return K[n];var a;if(n==="k256")a=new Rt;else if(n==="p224")a=new Y;else if(n==="p192")a=new Dt;else if(n==="p25519")a=new $t;else throw new Error("Unknown prime "+n);return K[n]=a,a};function J(n){if(typeof n=="string"){var a=o._prime(n);this.m=a.p,this.prime=a}else i(n.gtn(1),"modulus must be greater than 1"),this.m=n,this.prime=null}J.prototype._verify1=function(n){i(n.negative===0,"red works only with positives"),i(n.red,"red works only with red numbers")},J.prototype._verify2=function(n,a){i((n.negative|a.negative)===0,"red works only with positives"),i(n.red&&n.red===a.red,"red works only with red numbers")},J.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):(y(n,n.umod(this.m)._forceRed(this)),n)},J.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},J.prototype.add=function(n,a){this._verify2(n,a);var l=n.add(a);return l.cmp(this.m)>=0&&l.isub(this.m),l._forceRed(this)},J.prototype.iadd=function(n,a){this._verify2(n,a);var l=n.iadd(a);return l.cmp(this.m)>=0&&l.isub(this.m),l},J.prototype.sub=function(n,a){this._verify2(n,a);var l=n.sub(a);return l.cmpn(0)<0&&l.iadd(this.m),l._forceRed(this)},J.prototype.isub=function(n,a){this._verify2(n,a);var l=n.isub(a);return l.cmpn(0)<0&&l.iadd(this.m),l},J.prototype.shl=function(n,a){return this._verify1(n),this.imod(n.ushln(a))},J.prototype.imul=function(n,a){return this._verify2(n,a),this.imod(n.imul(a))},J.prototype.mul=function(n,a){return this._verify2(n,a),this.imod(n.mul(a))},J.prototype.isqr=function(n){return this.imul(n,n.clone())},J.prototype.sqr=function(n){return this.mul(n,n)},J.prototype.sqrt=function(n){if(n.isZero())return n.clone();var a=this.m.andln(3);if(i(a%2===1),a===3){var l=this.m.add(new o(1)).iushrn(2);return this.pow(n,l)}for(var d=this.m.subn(1),m=0;!d.isZero()&&d.andln(1)===0;)m++,d.iushrn(1);i(!d.isZero());var w=new o(1).toRed(this),M=w.redNeg(),p=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);this.pow(h,p).cmp(M)!==0;)h.redIAdd(M);for(var c=this.pow(h,d),O=this.pow(n,d.addn(1).iushrn(1)),P=this.pow(n,d),f=m;P.cmp(w)!==0;){for(var _=P,S=0;_.cmp(w)!==0;S++)_=_.redSqr();i(S=0;m--){for(var c=a.words[m],O=h-1;O>=0;O--){var P=c>>O&1;if(w!==d[0]&&(w=this.sqr(w)),P===0&&M===0){p=0;continue}M<<=1,M|=P,p++,!(p!==l&&(m!==0||O!==0))&&(w=this.mul(w,d[M]),p=0,M=0)}h=26}return w},J.prototype.convertTo=function(n){var a=n.umod(this.m);return a===n?a.clone():a},J.prototype.convertFrom=function(n){var a=n.clone();return a.red=null,a},o.mont=function(n){return new Gt(n)};function Gt(n){J.call(this,n),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(Gt,J),Gt.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},Gt.prototype.convertFrom=function(n){var a=this.imod(n.mul(this.rinv));return a.red=null,a},Gt.prototype.imul=function(n,a){if(n.isZero()||a.isZero())return n.words[0]=0,n.length=1,n;var l=n.imul(a),d=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=l.isub(d).iushrn(this.shift),w=m;return m.cmp(this.m)>=0?w=m.isub(this.m):m.cmpn(0)<0&&(w=m.iadd(this.m)),w._forceRed(this)},Gt.prototype.mul=function(n,a){if(n.isZero()||a.isZero())return new o(0)._forceRed(this);var l=n.mul(a),d=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=l.isub(d).iushrn(this.shift),w=m;return m.cmp(this.m)>=0?w=m.isub(this.m):m.cmpn(0)<0&&(w=m.iadd(this.m)),w._forceRed(this)},Gt.prototype.invm=function(n){var a=this.imod(n._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(e,_n)})(xn);var D=xn.exports;const Nn="bignumber/5.7.0";var Fr=D.BN;const me=new Ot(Nn),si={},Gi=9007199254740991;function Us(e){return e!=null&&(Lt.isBigNumber(e)||typeof e=="number"&&e%1===0||typeof e=="string"&&!!e.match(/^-?[0-9]+$/)||Jt(e)||typeof e=="bigint"||or(e))}let Wi=!1,Lt=class ee{constructor(t,r){t!==si&&me.throwError("cannot call constructor directly; use BigNumber.from",Ot.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return qt(H(this).fromTwos(t))}toTwos(t){return qt(H(this).toTwos(t))}abs(){return this._hex[0]==="-"?ee.from(this._hex.substring(1)):this}add(t){return qt(H(this).add(H(t)))}sub(t){return qt(H(this).sub(H(t)))}div(t){return ee.from(t).isZero()&&Wt("division-by-zero","div"),qt(H(this).div(H(t)))}mul(t){return qt(H(this).mul(H(t)))}mod(t){const r=H(t);return r.isNeg()&&Wt("division-by-zero","mod"),qt(H(this).umod(r))}pow(t){const r=H(t);return r.isNeg()&&Wt("negative-power","pow"),qt(H(this).pow(r))}and(t){const r=H(t);return(this.isNegative()||r.isNeg())&&Wt("unbound-bitwise-result","and"),qt(H(this).and(r))}or(t){const r=H(t);return(this.isNegative()||r.isNeg())&&Wt("unbound-bitwise-result","or"),qt(H(this).or(r))}xor(t){const r=H(t);return(this.isNegative()||r.isNeg())&&Wt("unbound-bitwise-result","xor"),qt(H(this).xor(r))}mask(t){return(this.isNegative()||t<0)&&Wt("negative-width","mask"),qt(H(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Wt("negative-width","shl"),qt(H(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Wt("negative-width","shr"),qt(H(this).shrn(t))}eq(t){return H(this).eq(H(t))}lt(t){return H(this).lt(H(t))}lte(t){return H(this).lte(H(t))}gt(t){return H(this).gt(H(t))}gte(t){return H(this).gte(H(t))}isNegative(){return this._hex[0]==="-"}isZero(){return H(this).isZero()}toNumber(){try{return H(this).toNumber()}catch{Wt("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return me.throwError("this platform does not support BigInt",Ot.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Wi||(Wi=!0,me.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?me.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ot.errors.UNEXPECTED_ARGUMENT,{}):me.throwError("BigNumber.toString does not accept parameters",Ot.errors.UNEXPECTED_ARGUMENT,{})),H(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof ee)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new ee(si,yr(t)):t.match(/^-?[0-9]+$/)?new ee(si,yr(new Fr(t))):me.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&Wt("underflow","BigNumber.from",t),(t>=Gi||t<=-Gi)&&Wt("overflow","BigNumber.from",t),ee.from(String(t));const r=t;if(typeof r=="bigint")return ee.from(r.toString());if(or(r))return ee.from(Qt(r));if(r)if(r.toHexString){const i=r.toHexString();if(typeof i=="string")return ee.from(i)}else{let i=r._hex;if(i==null&&r.type==="BigNumber"&&(i=r.hex),typeof i=="string"&&(Jt(i)||i[0]==="-"&&Jt(i.substring(1))))return ee.from(i)}return me.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}};function yr(e){if(typeof e!="string")return yr(e.toString(16));if(e[0]==="-")return e=e.substring(1),e[0]==="-"&&me.throwArgumentError("invalid hex","value",e),e=yr(e),e==="0x00"?e:"-"+e;if(e.substring(0,2)!=="0x"&&(e="0x"+e),e==="0x")return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&e.substring(0,4)==="0x00";)e="0x"+e.substring(4);return e}function qt(e){return Lt.from(yr(e))}function H(e){const t=Lt.from(e).toHexString();return t[0]==="-"?new Fr("-"+t.substring(3),16):new Fr(t.substring(2),16)}function Wt(e,t,r){const i={fault:e,operation:t};return r!=null&&(i.value=r),me.throwError(e,Ot.errors.NUMERIC_FAULT,i)}function Fs(e){return new Fr(e,36).toString(16)}const Ht=new Ot(Nn),gr={},Rn=Lt.from(0),kn=Lt.from(-1);function Tn(e,t,r,i){const s={fault:t,operation:r};return i!==void 0&&(s.value=i),Ht.throwError(e,Ot.errors.NUMERIC_FAULT,s)}let Ar="0";for(;Ar.length<256;)Ar+=Ar;function ki(e){if(typeof e!="number")try{e=Lt.from(e).toNumber()}catch{}return typeof e=="number"&&e>=0&&e<=256&&!(e%1)?"1"+Ar.substring(0,e):Ht.throwArgumentError("invalid decimal size","decimals",e)}function oi(e,t){t==null&&(t=0);const r=ki(t);e=Lt.from(e);const i=e.lt(Rn);i&&(e=e.mul(kn));let s=e.mod(r).toString();for(;s.length2&&Ht.throwArgumentError("too many decimal points","value",e);let o=s[0],u=s[1];for(o||(o="0"),u||(u="0");u[u.length-1]==="0";)u=u.substring(0,u.length-1);for(u.length>r.length-1&&Tn("fractional component exceeds decimals","underflow","parseFixed"),u===""&&(u="0");u.lengtht[u]==null?v:(typeof t[u]!==A&&Ht.throwArgumentError("invalid fixed format ("+u+" not "+A+")","format."+u,t[u]),t[u]);r=o("signed","boolean",r),i=o("width","number",i),s=o("decimals","number",s)}return i%8&&Ht.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),s>80&&Ht.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",s),new Ze(gr,r,i,s)}}class Ft{constructor(t,r,i,s){t!==gr&&Ht.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Ot.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=s,this._hex=r,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&Ht.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const r=pe(this._value,this.format.decimals),i=pe(t._value,t.format.decimals);return Ft.fromValue(r.add(i),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const r=pe(this._value,this.format.decimals),i=pe(t._value,t.format.decimals);return Ft.fromValue(r.sub(i),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const r=pe(this._value,this.format.decimals),i=pe(t._value,t.format.decimals);return Ft.fromValue(r.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const r=pe(this._value,this.format.decimals),i=pe(t._value,t.format.decimals);return Ft.fromValue(r.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");t.length===1&&t.push("0");let r=Ft.from(t[0],this.format);const i=!t[1].match(/^(0*)$/);return this.isNegative()&&i&&(r=r.subUnsafe(Vi.toFormat(r.format))),r}ceiling(){const t=this.toString().split(".");t.length===1&&t.push("0");let r=Ft.from(t[0],this.format);const i=!t[1].match(/^(0*)$/);return!this.isNegative()&&i&&(r=r.addUnsafe(Vi.toFormat(r.format))),r}round(t){t==null&&(t=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(t<0||t>80||t%1)&&Ht.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;const i=Ft.from("1"+Ar.substring(0,t),this.format),s=Os.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(s).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(t){if(t==null)return this._hex;t%8&&Ht.throwArgumentError("invalid byte width","width",t);const r=Lt.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return fe(r,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Ft.fromString(this._value,t)}static fromValue(t,r,i){return i==null&&r!=null&&!Us(r)&&(i=r,r=null),r==null&&(r=0),i==null&&(i="fixed"),Ft.fromString(oi(t,r),Ze.from(i))}static fromString(t,r){r==null&&(r="fixed");const i=Ze.from(r),s=pe(t,i.decimals);!i.signed&&s.lt(Rn)&&Tn("unsigned value cannot be negative","overflow","value",t);let o=null;i.signed?o=s.toTwos(i.width).toHexString():(o=s.toHexString(),o=fe(o,i.width/8));const u=oi(s,i.decimals);return new Ft(gr,o,u,i)}static fromBytes(t,r){r==null&&(r="fixed");const i=Ze.from(r);if(Bt(t).length>i.width/8)throw new Error("overflow");let s=Lt.from(t);i.signed&&(s=s.fromTwos(i.width));const o=s.toTwos((i.signed?0:1)+i.width).toHexString(),u=oi(s,i.decimals);return new Ft(gr,o,u,i)}static from(t,r){if(typeof t=="string")return Ft.fromString(t,r);if(or(t))return Ft.fromBytes(t,r);try{return Ft.fromValue(t,0,r)}catch(i){if(i.code!==Ot.errors.INVALID_ARGUMENT)throw i}return Ht.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}const Vi=Ft.from(1),Os=Ft.from("0.5"),Ds="strings/5.7.0",zs=new Ot(Ds);var Or;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(Or||(Or={}));var Xi;(function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"})(Xi||(Xi={}));function hi(e,t=Or.current){t!=Or.current&&(zs.checkNormalize(),e=e.normalize(t));let r=[];for(let i=0;i>6|192),r.push(s&63|128);else if((s&64512)==55296){i++;const o=e.charCodeAt(i);if(i>=e.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const u=65536+((s&1023)<<10)+(o&1023);r.push(u>>18|240),r.push(u>>12&63|128),r.push(u>>6&63|128),r.push(u&63|128)}else r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128)}return Bt(r)}function Hs(e){if(e.length%4!==0)throw new Error("bad data");let t=[];for(let r=0;r{let o=s.split(":");r+=parseInt(o[0],16),i[r]=t(o[1])}),i}function Zi(e){let t=0;return e.split(",").map(r=>{let i=r.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let s=t+parseInt(i[0],16);return t=parseInt(i[1],16),{l:s,h:t}})}Zi("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(e=>parseInt(e,16)),ai("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),ai("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),ai("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",Hs),Zi("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Ls(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(A)?s(A,u-1):r.push(A)})};return s(e,t),r}function qs(e){const t={};for(let r=0;r>--v&1}const b=31,E=Math.pow(2,b),I=E>>>1,B=I>>1,F=E-1;let T=0;for(let K=0;K1;){let $t=Q+Rt>>>1;K>>1|y(),Y=Y<<1^I,Dt=(Dt^I)<<1|I|1;Ct=Y,xt=1+Dt-Y}let j=i-4;return q.map(K=>{switch(K-j){case 3:return j+65792+(e[A++]<<16|e[A++]<<8|e[A++]);case 2:return j+256+(e[A++]<<8|e[A++]);case 1:return j+e[A++];default:return K-1}})}function Ks(e){let t=0;return()=>e[t++]}function js(e){return Ks(Qs(e))}function Js(e){return e&1?~e>>1:e>>1}function Ys(e,t){let r=Array(e);for(let i=0;it[u]):r}function Gs(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(Vs(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Xs(r,e))}return qs(Pn(t))}function Ws(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(r)}return t}function Un(e,t,r){let i=Array(e).fill(void 0).map(()=>[]);for(let s=0;si[u].push(o));return i}function Vs(e,t){let r=1+t(),i=t(),s=Ws(t),o=Un(s.length,1+e,t);return Pn(o.map((u,A)=>{const v=u[0],g=u.slice(1);return Array(s[A]).fill(void 0).map((y,b)=>{let E=b*i;return[v+b*r,g.map(I=>I+E)]})}))}function Xs(e,t){let r=1+t();return Un(r,1+e,t).map(i=>[i[0],i.slice(1)])}function Zs(e){let t=Dr(e).sort((i,s)=>i-s);return r();function r(){let i=[];for(;;){let g=Dr(e,t);if(g.length==0)break;i.push({set:new Set(g),node:r()})}i.sort((g,y)=>y.set.size-g.set.size);let s=e(),o=s%3;s=s/3|0;let u=!!(s&1);s>>=1;let A=s==1,v=s==2;return{branches:i,valid:o,fe0f:u,save:A,check:v}}}function to(){return js(Ls("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Cr=to();new Set(Dr(Cr)),new Set(Dr(Cr)),Gs(Cr),Zs(Cr);const eo=new Uint8Array(32);eo.fill(0);const ro=`Ethereum Signed Message: +`;function Fn(e){return typeof e=="string"&&(e=hi(e)),Ri(xs([hi(ro),hi(String(e.length)),e]))}const io="address/5.7.0",mr=new Ot(io);function en(e){Jt(e,20)||mr.throwArgumentError("invalid address","address",e),e=e.toLowerCase();const t=e.substring(2).split(""),r=new Uint8Array(40);for(let s=0;s<40;s++)r[s]=t[s].charCodeAt(0);const i=Bt(Ri(r));for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(i[s>>1]&15)>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}const no=9007199254740991;function so(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const Ti={};for(let e=0;e<10;e++)Ti[String(e)]=String(e);for(let e=0;e<26;e++)Ti[String.fromCharCode(65+e)]=String(10+e);const rn=Math.floor(so(no));function oo(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(i=>Ti[i]).join("");for(;t.length>=rn;){let i=t.substring(0,rn);t=parseInt(i,10)%97+t.substring(i.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function ho(e){let t=null;if(typeof e!="string"&&mr.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!=="0x"&&(e="0x"+e),t=en(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&mr.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==oo(e)&&mr.throwArgumentError("bad icap checksum","address",e),t=Fs(e.substring(4));t.length<40;)t="0"+t;t=en("0x"+t)}else mr.throwArgumentError("invalid address","address",e);return t}function ur(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}const ao=new Uint8Array(32);ao.fill(0),Lt.from(-1);const fo=Lt.from(0),uo=Lt.from(1);Lt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),fe(uo.toHexString(),32),fe(fo.toHexString(),32);var se={},L={},Er=On;function On(e,t){if(!e)throw new Error(t||"Assertion failed")}On.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Ei={exports:{}};typeof Object.create=="function"?Ei.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ei.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var lo=Er,co=Ei.exports;L.inherits=co;function po(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function mo(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),s=0;s>6|192,r[i++]=o&63|128):po(e,s)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++s)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else for(s=0;s>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}L.htonl=Dn;function Ao(e,t){for(var r="",i=0;i>>0}return o}L.join32=vo;function wo(e,t){for(var r=new Array(e.length*4),i=0,s=0;i>>24,r[s+1]=o>>>16&255,r[s+2]=o>>>8&255,r[s+3]=o&255):(r[s+3]=o>>>24,r[s+2]=o>>>16&255,r[s+1]=o>>>8&255,r[s]=o&255)}return r}L.split32=wo;function yo(e,t){return e>>>t|e<<32-t}L.rotr32=yo;function bo(e,t){return e<>>32-t}L.rotl32=bo;function Mo(e,t){return e+t>>>0}L.sum32=Mo;function So(e,t,r){return e+t+r>>>0}L.sum32_3=So;function Eo(e,t,r,i){return e+t+r+i>>>0}L.sum32_4=Eo;function _o(e,t,r,i,s){return e+t+r+i+s>>>0}L.sum32_5=_o;function Io(e,t,r,i){var s=e[t],o=e[t+1],u=i+o>>>0,A=(u>>0,e[t+1]=u}L.sum64=Io;function Co(e,t,r,i){var s=t+i>>>0,o=(s>>0}L.sum64_hi=Co;function Bo(e,t,r,i){var s=t+i;return s>>>0}L.sum64_lo=Bo;function xo(e,t,r,i,s,o,u,A){var v=0,g=t;g=g+i>>>0,v+=g>>0,v+=g>>0,v+=g>>0}L.sum64_4_hi=xo;function No(e,t,r,i,s,o,u,A){var v=t+i+o+A;return v>>>0}L.sum64_4_lo=No;function Ro(e,t,r,i,s,o,u,A,v,g){var y=0,b=t;b=b+i>>>0,y+=b>>0,y+=b>>0,y+=b>>0,y+=b>>0}L.sum64_5_hi=Ro;function ko(e,t,r,i,s,o,u,A,v,g){var y=t+i+o+A+g;return y>>>0}L.sum64_5_lo=ko;function To(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}L.rotr64_hi=To;function Po(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}L.rotr64_lo=Po;function Uo(e,t,r){return e>>>r}L.shr64_hi=Uo;function Fo(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}L.shr64_lo=Fo;var hr={},nn=L,Oo=Er;function Br(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}hr.BlockHash=Br,Br.prototype.update=function(e,t){if(e=nn.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),this.pending.length===0&&(this.pending=null),e=nn.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}de.g0_256=qo;function Qo(e){return ue(e,17)^ue(e,19)^e>>>10}de.g1_256=Qo;var rr=L,Ko=hr,jo=de,fi=rr.rotl32,lr=rr.sum32,Jo=rr.sum32_5,Yo=jo.ft_1,Kn=Ko.BlockHash,$o=[1518500249,1859775393,2400959708,3395469782];function he(){if(!(this instanceof he))return new he;Kn.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}rr.inherits(he,Kn);var Go=he;he.blockSize=512,he.outSize=160,he.hmacStrength=80,he.padLength=64,he.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),F0(e.length<=this.blockSize);for(var t=e.length;t>8,E=y&255;b?v.push(b,E):v.push(E)}return v}r.toArray=i;function s(u){return u.length===1?"0"+u:u}r.zero2=s;function o(u){for(var A="",v=0;v(E>>1)-1?F=(E>>1)-T:F=T,I.isubn(F)):F=0,b[B]=F,I.iushrn(1)}return b}r.getNAF=i;function s(v,g){var y=[[],[]];v=v.clone(),g=g.clone();for(var b=0,E=0,I;v.cmpn(-b)>0||g.cmpn(-E)>0;){var B=v.andln(3)+b&3,F=g.andln(3)+E&3;B===3&&(B=-1),F===3&&(F=-1);var T;B&1?(I=v.andln(7)+b&7,(I===3||I===5)&&F===2?T=-B:T=B):T=0,y[0].push(T);var q;F&1?(I=g.andln(7)+E&7,(I===3||I===5)&&B===2?q=-F:q=F):q=0,y[1].push(q),2*b===T+1&&(b=1-b),2*E===q+1&&(E=1-E),v.iushrn(1),g.iushrn(1)}return y}r.getJSF=s;function o(v,g,y){var b="_"+g;v.prototype[g]=function(){return this[b]!==void 0?this[b]:this[b]=y.call(this)}}r.cachedProperty=o;function u(v){return typeof v=="string"?r.toArray(v,"hex"):v}r.parseBytes=u;function A(v){return new D(v,"hex","le")}r.intFromLE=A}),Nr=Yt.getNAF,z0=Yt.getJSF,zr=Yt.assert;function Ie(e,t){this.type=e,this.p=new D(t.p,16),this.red=t.prime?D.red(t.prime):D.mont(this.p),this.zero=new D(0).toRed(this.red),this.one=new D(1).toRed(this.red),this.two=new D(2).toRed(this.red),this.n=t.n&&new D(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ge=Ie;Ie.prototype.point=function(){throw new Error("Not implemented")},Ie.prototype.validate=function(){throw new Error("Not implemented")},Ie.prototype._fixedNafMul=function(e,t){zr(e.precomputed);var r=e._getDoubles(),i=Nr(t,1,this._bitLength),s=(1<=u;v--)A=(A<<1)+i[v];o.push(A)}for(var g=this.jpoint(null,null,null),y=this.jpoint(null,null,null),b=s;b>0;b--){for(u=0;u=0;A--){for(var v=0;A>=0&&o[A]===0;A--)v++;if(A>=0&&v++,u=u.dblp(v),A<0)break;var g=o[A];zr(g!==0),e.type==="affine"?g>0?u=u.mixedAdd(s[g-1>>1]):u=u.mixedAdd(s[-g-1>>1].neg()):g>0?u=u.add(s[g-1>>1]):u=u.add(s[-g-1>>1].neg())}return e.type==="affine"?u.toP():u},Ie.prototype._wnafMulAdd=function(e,t,r,i,s){var o=this._wnafT1,u=this._wnafT2,A=this._wnafT3,v=0,g,y,b;for(g=0;g=1;g-=2){var I=g-1,B=g;if(o[I]!==1||o[B]!==1){A[I]=Nr(r[I],o[I],this._bitLength),A[B]=Nr(r[B],o[B],this._bitLength),v=Math.max(A[I].length,v),v=Math.max(A[B].length,v);continue}var F=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(F[1]=t[I].add(t[B]),F[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(F[1]=t[I].toJ().mixedAdd(t[B]),F[2]=t[I].add(t[B].neg())):(F[1]=t[I].toJ().mixedAdd(t[B]),F[2]=t[I].toJ().mixedAdd(t[B].neg()));var T=[-3,-1,-5,-7,0,7,5,1,3],q=z0(r[I],r[B]);for(v=Math.max(q[0].length,v),A[I]=new Array(v),A[B]=new Array(v),y=0;y=0;g--){for(var Q=0;g>=0;){var Rt=!0;for(y=0;y=0&&Q++,j=j.dblp(Q),g<0)break;for(y=0;y0?b=u[y][Y-1>>1]:Y<0&&(b=u[y][-Y-1>>1].neg()),b.type==="affine"?j=j.mixedAdd(b):j=j.add(b))}}for(g=0;g=Math.ceil((e.bitLength()+1)/t.step):!1},Vt.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,s=0;s=0&&(E=v,I=g),y.negative&&(y=y.neg(),b=b.neg()),E.negative&&(E=E.neg(),I=I.neg()),[{a:y,b},{a:E,b:I}]},Zt.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),u=s.mul(r.a),A=o.mul(i.a),v=s.mul(r.b),g=o.mul(i.b),y=e.sub(u).sub(A),b=v.add(g).neg();return{k1:y,k2:b}},Zt.prototype.pointFromX=function(e,t){e=new D(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},Zt.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(s).cmpn(0)===0},Zt.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""},Tt.prototype.isInfinity=function(){return this.inf},Tt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},Tt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),s=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,u)},Tt.prototype.getX=function(){return this.x.fromRed()},Tt.prototype.getY=function(){return this.y.fromRed()},Tt.prototype.mul=function(e){return e=new D(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Tt.prototype.mulAdd=function(e,t,r){var i=[this,t],s=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},Tt.prototype.jmulAdd=function(e,t,r){var i=[this,t],s=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},Tt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},Tt.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(s){return s.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},Tt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Ut(e,t,r,i){Ge.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new D(0)):(this.x=new D(t,16),this.y=new D(r,16),this.z=new D(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Ui(Ut,Ge.BasePoint),Zt.prototype.jpoint=function(e,t,r){return new Ut(this,e,t,r)},Ut.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},Ut.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ut.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(r.redMul(this.z)),A=i.redSub(s),v=o.redSub(u);if(A.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=A.redSqr(),y=g.redMul(A),b=i.redMul(g),E=v.redSqr().redIAdd(y).redISub(b).redISub(b),I=v.redMul(b.redISub(E)).redISub(o.redMul(y)),B=this.z.redMul(e.z).redMul(A);return this.curve.jpoint(E,I,B)},Ut.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),s=this.y,o=e.y.redMul(t).redMul(this.z),u=r.redSub(i),A=s.redSub(o);if(u.cmpn(0)===0)return A.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),g=v.redMul(u),y=r.redMul(v),b=A.redSqr().redIAdd(g).redISub(y).redISub(y),E=A.redMul(y.redISub(b)).redISub(s.redMul(g)),I=this.z.redMul(u);return this.curve.jpoint(b,E,I)},Ut.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(s),this.x.cmp(r)===0)return!0}},Ut.prototype.inspect=function(){return this.isInfinity()?"":""},Ut.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Tr=fr(function(e,t){var r=t;r.base=Ge,r.short=L0,r.mont=null,r.edwards=null}),Pr=fr(function(e,t){var r=t,i=Yt.assert;function s(A){A.type==="short"?this.curve=new Tr.short(A):A.type==="edwards"?this.curve=new Tr.edwards(A):this.curve=new Tr.mont(A),this.g=this.curve.g,this.n=this.curve.n,this.hash=A.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=s;function o(A,v){Object.defineProperty(r,A,{configurable:!0,enumerable:!0,get:function(){var g=new s(v);return Object.defineProperty(r,A,{configurable:!0,enumerable:!0,value:g}),g}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:se.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:se.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:se.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:se.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:se.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:se.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:se.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=null.crash()}catch{u=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:se.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})});function Ce(e){if(!(this instanceof Ce))return new Ce(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ne.toArray(e.entropy,e.entropyEnc||"hex"),r=ne.toArray(e.nonce,e.nonceEnc||"hex"),i=ne.toArray(e.pers,e.persEnc||"hex");Pi(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var an=Ce;Ce.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Ce.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=r,r=t,t=null),r&&(r=ne.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length"};var q0=Yt.assert;function qr(e,t){if(e instanceof qr)return e;this._importDER(e,t)||(q0(e.r&&e.s,"Signature without r or s"),this.r=new D(e.r,16),this.s=new D(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Rr=qr;function Q0(){this.place=0}function pi(e,t){var r=e[t.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var s=0,o=0,u=t.place;o>>=0;return s<=127?!1:(t.place=u,s)}function fn(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}qr.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),r[0]&128&&(r=[0].concat(r)),t=fn(t),r=fn(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var i=[2];mi(i,t.length),i=i.concat(t),i.push(2),mi(i,r.length);var s=i.concat(r),o=[48];return mi(o,s.length),o=o.concat(s),Yt.encode(o,e)};var K0=function(){throw new Error("unsupported")},rs=Yt.assert;function Xt(e){if(!(this instanceof Xt))return new Xt(e);typeof e=="string"&&(rs(Object.prototype.hasOwnProperty.call(Pr,e),"Unknown curve "+e),e=Pr[e]),e instanceof Pr.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var j0=Xt;Xt.prototype.keyPair=function(e){return new di(this,e)},Xt.prototype.keyFromPrivate=function(e,t){return di.fromPrivate(this,e,t)},Xt.prototype.keyFromPublic=function(e,t){return di.fromPublic(this,e,t)},Xt.prototype.genKeyPair=function(e){e||(e={});for(var t=new an({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||K0(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new D(2));;){var s=new D(t.generate(r));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},Xt.prototype._truncateToN=function(e,t){var r=e.byteLength()*8-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Xt.prototype.sign=function(e,t,r,i){typeof r=="object"&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new D(e,16));for(var s=this.n.byteLength(),o=t.getPrivate().toArray("be",s),u=e.toArray("be",s),A=new an({hash:this.hash,entropy:o,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new D(1)),g=0;;g++){var y=i.k?i.k(g):new D(A.generate(this.n.byteLength()));if(y=this._truncateToN(y,!0),!(y.cmpn(1)<=0||y.cmp(v)>=0)){var b=this.g.mul(y);if(!b.isInfinity()){var E=b.getX(),I=E.umod(this.n);if(I.cmpn(0)!==0){var B=y.invm(this.n).mul(I.mul(t.getPrivate()).iadd(e));if(B=B.umod(this.n),B.cmpn(0)!==0){var F=(b.getY().isOdd()?1:0)|(E.cmp(I)!==0?2:0);return i.canonical&&B.cmp(this.nh)>0&&(B=this.n.sub(B),F^=1),new Rr({r:I,s:B,recoveryParam:F})}}}}}},Xt.prototype.verify=function(e,t,r,i){e=this._truncateToN(new D(e,16)),r=this.keyFromPublic(r,i),t=new Rr(t,"hex");var s=t.r,o=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var u=o.invm(this.n),A=u.mul(e).umod(this.n),v=u.mul(s).umod(this.n),g;return this.curve._maxwellTrick?(g=this.g.jmulAdd(A,r.getPublic(),v),g.isInfinity()?!1:g.eqXToP(s)):(g=this.g.mulAdd(A,r.getPublic(),v),g.isInfinity()?!1:g.getX().umod(this.n).cmp(s)===0)},Xt.prototype.recoverPubKey=function(e,t,r,i){rs((3&r)===r,"The recovery param is more than two bits"),t=new Rr(t,i);var s=this.n,o=new D(e),u=t.r,A=t.s,v=r&1,g=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?u=this.curve.pointFromX(u.add(this.curve.n),v):u=this.curve.pointFromX(u,v);var y=t.r.invm(s),b=s.sub(o).mul(y).umod(s),E=A.mul(y).umod(s);return this.g.mulAdd(b,u,E)},Xt.prototype.getKeyRecoveryParam=function(e,t,r,i){if(t=new Rr(t,i),t.recoveryParam!==null)return t.recoveryParam;for(var s=0;s<4;s++){var o;try{o=this.recoverPubKey(e,t,s)}catch{continue}if(o.eq(r))return s}throw new Error("Unable to find valid recovery factor")};var J0=fr(function(e,t){var r=t;r.version="6.5.4",r.utils=Yt,r.rand=function(){throw new Error("unsupported")},r.curve=Tr,r.curves=Pr,r.ec=j0,r.eddsa=null}),Y0=J0.ec;const $0="signing-key/5.7.0",Ci=new Ot($0);let gi=null;function _e(){return gi||(gi=new Y0("secp256k1")),gi}class G0{constructor(t){ur(this,"curve","secp256k1"),ur(this,"privateKey",Qt(t)),Rs(this.privateKey)!==32&&Ci.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=_e().keyFromPrivate(Bt(this.privateKey));ur(this,"publicKey","0x"+r.getPublic(!1,"hex")),ur(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ur(this,"_isSigningKey",!0)}_addPoint(t){const r=_e().keyFromPublic(Bt(this.publicKey)),i=_e().keyFromPublic(Bt(t));return"0x"+r.pub.add(i.pub).encodeCompressed("hex")}signDigest(t){const r=_e().keyFromPrivate(Bt(this.privateKey)),i=Bt(t);i.length!==32&&Ci.throwArgumentError("bad digest length","digest",t);const s=r.sign(i,{canonical:!0});return Bn({recoveryParam:s.recoveryParam,r:fe("0x"+s.r.toString(16),32),s:fe("0x"+s.s.toString(16),32)})}computeSharedSecret(t){const r=_e().keyFromPrivate(Bt(this.privateKey)),i=_e().keyFromPublic(Bt(is(t)));return fe("0x"+r.derive(i.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function W0(e,t){const r=Bn(t),i={r:Bt(r.r),s:Bt(r.s)};return"0x"+_e().recoverPubKey(Bt(e),i,r.recoveryParam).encode("hex",!1)}function is(e,t){const r=Bt(e);return r.length===32?new G0(r).publicKey:r.length===33?"0x"+_e().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?Qt(r):Ci.throwArgumentError("invalid public or private key","key","[REDACTED]")}var un;(function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"})(un||(un={}));function V0(e){const t=is(e);return ho($i(Ri($i(t,1)),12))}function X0(e,t){return V0(W0(Bt(e),t))}const Z0="https://rpc.walletconnect.com/v1";function th(e,t,r){return X0(Fn(t),r).toLowerCase()===e.toLowerCase()}async function eh(e,t,r,i,s,o){try{const u="0x1626ba7e",A="0000000000000000000000000000000000000000000000000000000000000040",v="0000000000000000000000000000000000000000000000000000000000000041",g=r.substring(2),y=Fn(t).substring(2),b=u+y+A+v+g,E=await fetch(`${o||Z0}/?chainId=${i}&projectId=${s}`,{method:"POST",body:JSON.stringify({id:rh(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:b},"latest"]})}),{result:I}=await E.json();return I?I.slice(0,u.length).toLowerCase()===u.toLowerCase():!1}catch(u){return console.error("isValidEip1271Signature: ",u),!1}}function rh(){return Date.now()+Math.floor(Math.random()*1e3)}const ih="did:pkh:",ns=e=>e==null?void 0:e.split(":"),nh=e=>{const t=e&&ns(e);if(t)return e.includes(ih)?t[3]:t[1]},sh=e=>{const t=e&&ns(e);if(t)return t.pop()},Hh=(e,t)=>{const r=`${e.domain} wants you to sign in with your Ethereum account:`,i=sh(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=e.statement||void 0;const o=`URI: ${e.aud||e.uri}`,u=`Version: ${e.version}`,A=`Chain ID: ${nh(t)}`,v=`Nonce: ${e.nonce}`,g=`Issued At: ${e.iat}`,y=e.resources?`Resources:${e.resources.map(E=>` +- ${E}`).join("")}`:void 0,b=uh(e.resources);if(b){const E=hh(b);s=fh(s,E)}return[r,i,"",s,"",o,u,A,v,g,y].filter(E=>E!=null).join(` +`)};function oh(e){return JSON.parse(Buffer.from(e,"base64").toString("utf-8"))}function ss(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(!(t!=null&&t.length))throw new Error("No resources found in `att` property");t.forEach(r=>{const i=e.att[r];if(Array.isArray(i))throw new Error(`Resource must be an object: ${r}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(i).forEach(s=>{const o=i[s];if(!Array.isArray(o))throw new Error(`Ability limits ${s} must be an array of objects, found: ${o}`);if(!o.length)throw new Error(`Value of ${s} is empty array, must be an array with objects`);o.forEach(u=>{if(typeof u!="object")throw new Error(`Ability limits (${s}) must be an array of objects, found: ${u}`)})})})}function hh(e){const t=oh(e.replace("urn:recap:",""));return ss(t),t}function ah(e){return e&&e.includes("urn:recap:")}function fh(e="",t){ss(t);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;const i=[];let s=0;Object.keys(t.att).forEach(A=>{const v=Object.keys(t.att[A]).map(b=>({ability:b.split("/")[0],action:b.split("/")[1]}));v.sort((b,E)=>b.action.localeCompare(E.action));const g={};v.forEach(b=>{g[b.ability]||(g[b.ability]=[]),g[b.ability].push(b.action)});const y=Object.keys(g).map(b=>(s++,`(${s}) '${b}': '${g[b].join("', '")}' for '${A}'.`));i.push(y.join(", ").replace(".,","."))});const o=i.join(" "),u=`${r}${o}`;return`${e?e+" ":""}${u}`}function uh(e){if(!e)return;const t=e==null?void 0:e[e.length-1];return ah(t)?t:void 0}const lh=/0x[a-fA-F0-9]{40}/u,ch=/Chain ID: (?\d+)/u;function Lh(e){var t;return((t=e.match(lh))==null?void 0:t[0])||""}function qh(e){var t;return`eip155:${((t=e.match(ch))==null?void 0:t[1])||1}`}async function Qh({address:e,message:t,signature:r,chainId:i,projectId:s}){let o=th(e,t,r);return o||(o=await eh(e,t,r,i,s)),o}const jt=As({status:"uninitialized"}),dr={state:jt,subscribeKey(e,t){return vs(jt,e,t)},subscribe(e){return ws(jt,()=>e(jt))},_getClient(){if(!jt._client)throw new Error("SIWEController client not set");return jt._client},async getNonce(e){const r=await this._getClient().getNonce(e);return this.setNonce(r),r},async getSession(){try{const t=await this._getClient().getSession();return t&&(this.setSession(t),this.setStatus("success")),t}catch{return}},createMessage(e){const r=this._getClient().createMessage(e);return this.setMessage(r),r},async verifyMessage(e){return await this._getClient().verifyMessage(e)},async signIn(){return await this._getClient().signIn()},async signOut(){var t;const e=this._getClient();await e.signOut(),this.setStatus("ready"),this.setSession(void 0),(t=e.onSignOut)==null||t.call(e)},onSignIn(e){var r;const t=this._getClient();(r=t.onSignIn)==null||r.call(t,e)},onSignOut(){var t;const e=this._getClient();(t=e.onSignOut)==null||t.call(e)},setSIWEClient(e){jt._client=ys(e),jt.status="ready",Ni.setIsSiweEnabled(e.options.enabled)},setNonce(e){jt.nonce=e},setStatus(e){jt.status=e},setMessage(e){jt.message=e},setSession(e){jt.session=e,jt.status=e?"success":"ready"}};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ur=globalThis,Fi=Ur.ShadowRoot&&(Ur.ShadyCSS===void 0||Ur.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Oi=Symbol(),ln=new WeakMap;let os=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==Oi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o;const r=this.t;if(Fi&&t===void 0){const i=r!==void 0&&r.length===1;i&&(t=ln.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ln.set(r,t))}return t}toString(){return this.cssText}};const dh=e=>new os(typeof e=="string"?e:e+"",void 0,Oi),ph=(e,...t)=>{const r=e.length===1?e[0]:t.reduce((i,s,o)=>i+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+e[o+1],e[0]);return new os(r,e,Oi)},mh=(e,t)=>{if(Fi)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of t){const i=document.createElement("style"),s=Ur.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=r.cssText,e.appendChild(i)}},cn=Fi?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const i of t.cssRules)r+=i.cssText;return dh(r)})(e):e;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:gh,defineProperty:Ah,getOwnPropertyDescriptor:vh,getOwnPropertyNames:wh,getOwnPropertySymbols:yh,getPrototypeOf:bh}=Object,xe=globalThis,dn=xe.trustedTypes,Mh=dn?dn.emptyScript:"",Ai=xe.reactiveElementPolyfillSupport,vr=(e,t)=>e,Hr={toAttribute(e,t){switch(t){case Boolean:e=e?Mh:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},Di=(e,t)=>!gh(e,t),pn={attribute:!0,type:String,converter:Hr,reflect:!1,hasChanged:Di};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),xe.litPropertyMetadata??(xe.litPropertyMetadata=new WeakMap);class Ve extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=pn){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(t,r),!r.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,r);s!==void 0&&Ah(this.prototype,t,s)}}static getPropertyDescriptor(t,r,i){const{get:s,set:o}=vh(this.prototype,t)??{get(){return this[r]},set(u){this[r]=u}};return{get(){return s==null?void 0:s.call(this)},set(u){const A=s==null?void 0:s.call(this);o.call(this,u),this.requestUpdate(t,A,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??pn}static _$Ei(){if(this.hasOwnProperty(vr("elementProperties")))return;const t=bh(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(vr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(vr("properties"))){const r=this.properties,i=[...wh(r),...yh(r)];for(const s of i)this.createProperty(s,r[s])}const t=this[Symbol.metadata];if(t!==null){const r=litPropertyMetadata.get(t);if(r!==void 0)for(const[i,s]of r)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[r,i]of this.elementProperties){const s=this._$Eu(r,i);s!==void 0&&this._$Eh.set(s,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const r=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)r.unshift(cn(s))}else t!==void 0&&r.push(cn(t));return r}static _$Eu(t,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(r=>r(this))}addController(t){var r;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var r;(r=this._$EO)==null||r.delete(t)}_$E_(){const t=new Map,r=this.constructor.elementProperties;for(const i of r.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return mh(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostDisconnected)==null?void 0:i.call(r)})}attributeChangedCallback(t,r,i){this._$AK(t,i)}_$EC(t,r){var o;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const u=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:Hr).toAttribute(r,i.type);this._$Em=t,u==null?this.removeAttribute(s):this.setAttribute(s,u),this._$Em=null}}_$AK(t,r){var o;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const u=i.getPropertyOptions(s),A=typeof u.converter=="function"?{fromAttribute:u.converter}:((o=u.converter)==null?void 0:o.fromAttribute)!==void 0?u.converter:Hr;this._$Em=s,this[s]=A.fromAttribute(r,u.type),this._$Em=null}}requestUpdate(t,r,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??Di)(this[t],r))return;this.P(t,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,r,i){this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,u]of this._$Ep)this[o]=u;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,u]of s)u.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],u)}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(r)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(r)}willUpdate(t){}_$AE(t){var r;(r=this._$EO)==null||r.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(t){}firstUpdated(t){}}Ve.elementStyles=[],Ve.shadowRootOptions={mode:"open"},Ve[vr("elementProperties")]=new Map,Ve[vr("finalized")]=new Map,Ai==null||Ai({ReactiveElement:Ve}),(xe.reactiveElementVersions??(xe.reactiveElementVersions=[])).push("2.0.4");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const wr=globalThis,Lr=wr.trustedTypes,mn=Lr?Lr.createPolicy("lit-html",{createHTML:e=>e}):void 0,hs="$lit$",Be=`lit$${Math.random().toFixed(9).slice(2)}$`,as="?"+Be,Sh=`<${as}>`,$e=document,br=()=>$e.createComment(""),Mr=e=>e===null||typeof e!="object"&&typeof e!="function",fs=Array.isArray,Eh=e=>fs(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",vi=`[ +\f\r]`,pr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gn=/-->/g,An=/>/g,je=RegExp(`>|${vi}(?:([^\\s"'>=/]+)(${vi}*=${vi}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),vn=/'/g,wn=/"/g,us=/^(?:script|style|textarea|title)$/i,_h=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),ls=_h(1),nr=Symbol.for("lit-noChange"),Pt=Symbol.for("lit-nothing"),yn=new WeakMap,Je=$e.createTreeWalker($e,129);function cs(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return mn!==void 0?mn.createHTML(t):t}const Ih=(e,t)=>{const r=e.length-1,i=[];let s,o=t===2?"":"",u=pr;for(let A=0;A"?(u=s??pr,b=-1):y[1]===void 0?b=-2:(b=u.lastIndex-y[2].length,g=y[1],u=y[3]===void 0?je:y[3]==='"'?wn:vn):u===wn||u===vn?u=je:u===gn||u===An?u=pr:(u=je,s=void 0);const I=u===je&&e[A+1].startsWith("/>")?" ":"";o+=u===pr?v+Sh:b>=0?(i.push(g),v.slice(0,b)+hs+v.slice(b)+Be+I):v+Be+(b===-2?A:I)}return[cs(e,o+(e[r]||"")+(t===2?"":"")),i]};class Sr{constructor({strings:t,_$litType$:r},i){let s;this.parts=[];let o=0,u=0;const A=t.length-1,v=this.parts,[g,y]=Ih(t,r);if(this.el=Sr.createElement(g,i),Je.currentNode=this.el.content,r===2){const b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(s=Je.nextNode())!==null&&v.length0){s.textContent=Lr?Lr.emptyScript:"";for(let I=0;I2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Pt}_$AI(t,r=this,i,s){const o=this.strings;let u=!1;if(o===void 0)t=sr(this,t,r,0),u=!Mr(t)||t!==this._$AH&&t!==nr,u&&(this._$AH=t);else{const A=t;let v,g;for(t=o[0],v=0;v{const i=(r==null?void 0:r.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const o=(r==null?void 0:r.renderBefore)??null;i._$litPart$=s=new _r(t.insertBefore(br(),o),o,void 0,r??{})}return s._$AI(e),s};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class er extends Ve{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const t=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=t.firstChild),t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=kh(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return nr}}var bn;er._$litElement$=!0,er.finalized=!0,(bn=globalThis.litElementHydrateSupport)==null||bn.call(globalThis,{LitElement:er});const yi=globalThis.litElementPolyfillSupport;yi==null||yi({LitElement:er});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.6");const Th=ph` + :host { + display: flex; + justify-content: center; + gap: var(--wui-spacing-2xl); + } + + wui-visual-thumbnail:nth-child(1) { + z-index: 1; + } +`;var Ph=function(e,t,r,i){var s=arguments.length,o=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,i);else for(var A=e.length-1;A>=0;A--)(u=e[A])&&(o=(s<3?u(o):s>3?u(t,r,o):u(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o};let Bi=class extends er{constructor(){var t;super(...arguments),this.dappImageUrl=(t=Ni.state.metadata)==null?void 0:t.icons,this.walletImageUrl=Mn.getConnectedWalletImageUrl()}firstUpdated(){var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelectorAll("wui-visual-thumbnail");t!=null&&t[0]&&this.createAnimation(t[0],"translate(18px)"),t!=null&&t[1]&&this.createAnimation(t[1],"translate(-18px)")}render(){var t;return ls` + + + `}createAnimation(t,r){t.animate([{transform:"translateX(0px)"},{transform:r}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};Bi.styles=Th;Bi=Ph([En("w3m-connecting-siwe")],Bi);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Uh={attribute:!0,type:String,converter:Hr,reflect:!1,hasChanged:Di},Fh=(e=Uh,t,r)=>{const{kind:i,metadata:s}=r;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(r.name,e),i==="accessor"){const{name:u}=r;return{set(A){const v=t.get.call(this);t.set.call(this,A),this.requestUpdate(u,v,e)},init(A){return A!==void 0&&this.P(u,void 0,e),A}}}if(i==="setter"){const{name:u}=r;return function(A){const v=this[u];t.call(this,A),this.requestUpdate(u,v,e)}}throw Error("Unsupported decorator location: "+i)};function Oh(e){return(t,r)=>typeof r=="object"?Fh(e,t,r):((i,s,o)=>{const u=s.hasOwnProperty(o);return s.constructor.createProperty(o,u?{...i,wrapped:!0}:i),u?Object.getOwnPropertyDescriptor(s,o):void 0})(e,t,r)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function Dh(e){return Oh({...e,state:!0,attribute:!1})}var ds=function(e,t,r,i){var s=arguments.length,o=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,i);else for(var A=e.length-1;A>=0;A--)(u=e[A])&&(o=(s<3?u(o):s>3?u(t,r,o):u(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o};let xi=class extends er{constructor(){var t;super(...arguments),this.dappName=(t=Ni.state.metadata)==null?void 0:t.name,this.isSigning=!1}render(){return this.onRender(),ls` + + + + + ${this.dappName??"Dapp"} needs to connect to your wallet + + + Sign this message to prove you own this wallet and proceed. Canceling will disconnect + you. + + + + Cancel + + + ${this.isSigning?"Signing...":"Sign"} + + + `}onRender(){dr.state.session&&zi.close()}async onSign(){this.isSigning=!0,Ir.sendEvent({event:"CLICK_SIGN_SIWE_MESSAGE",type:"track"});try{dr.setStatus("loading");const t=await dr.signIn();return dr.setStatus("success"),Ir.sendEvent({event:"SIWE_AUTH_SUCCESS",type:"track"}),t}catch{return bi.state.preferredAccountType===bs.ACCOUNT_TYPES.SMART_ACCOUNT?Hi.showError("This application might not support Smart Accounts"):Hi.showError("Signature declined"),dr.setStatus("error"),Ir.sendEvent({event:"SIWE_AUTH_ERROR",type:"track"})}finally{this.isSigning=!1}}async onCancel(){const{isConnected:t}=bi.state;t?(await Sn.disconnect(),zi.close()):Mi.push("Connect"),Ir.sendEvent({event:"CLICK_CANCEL_SIWE",type:"track"})}};ds([Dh()],xi.prototype,"isSigning",void 0);xi=ds([En("w3m-connecting-siwe-view")],xi);function Yh(e){return new Ms(e)}export{dr as SIWEController,Bi as W3mConnectingSiwe,xi as W3mConnectingSiweView,Yh as createSIWEConfig,Hh as formatMessage,Lh as getAddressFromMessage,qh as getChainIdFromMessage,sh as getDidAddress,nh as getDidChainId,Qh as verifySignature}; diff --git a/_app/immutable/chunks/index.DFmxPlw4.js b/_app/immutable/chunks/index.DFmxPlw4.js new file mode 100644 index 0000000..2c976aa --- /dev/null +++ b/_app/immutable/chunks/index.DFmxPlw4.js @@ -0,0 +1 @@ +var E=Object.defineProperty;var O=(t,e,n)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _=(t,e,n)=>(O(t,typeof e!="symbol"?e+"":e,n),n);import{r as $,n as c,O as p,f as b,i as C,P as I,D as v,Q as P,R as x,S as R,T as U,U as w,V,W as j,X as B,Y as D,Z as L}from"./scheduler.C1FoT2GD.js";const u=new Set;let f;function Z(){f={r:0,c:[],p:f}}function z(){f.r||$(f.c),f=f.p}function M(t,e){t&&t.i&&(u.delete(t),t.i(e))}function A(t,e,n,a){if(t&&t.o){if(u.has(t))return;u.add(t),f.c.push(()=>{u.delete(t),a&&(n&&t.d(1),a())}),t.o(e)}else a&&a()}function F(t){t&&t.c()}function G(t,e){t&&t.l(e)}function N(t,e,n){const{fragment:a,after_update:i}=t.$$;a&&a.m(e,n),x(()=>{const d=t.$$.on_mount.map(V).filter(v);t.$$.on_destroy?t.$$.on_destroy.push(...d):$(d),t.$$.on_mount=[]}),i.forEach(x)}function Q(t,e){const n=t.$$;n.fragment!==null&&(R(n.after_update),$(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function T(t,e){t.$$.dirty[0]===-1&&(j.push(t),B(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const y=m.length?m[0]:g;return s.ctx&&i(s.ctx[r],s.ctx[r]=y)&&(!s.skip_bound&&s.bound[r]&&s.bound[r](y),h&&T(t,r)),g}):[],s.update(),h=!0,$(s.before_update),s.fragment=a?a(s.ctx):!1,e.target){if(e.hydrate){D();const r=b(e.target);s.fragment&&s.fragment.l(r),r.forEach(C)}else s.fragment&&s.fragment.c();e.intro&&M(t.$$.fragment),N(t,e.target,e.anchor),L(),I()}w(o)}class J{constructor(){_(this,"$$");_(this,"$$set")}$destroy(){Q(this,1),this.$destroy=c}$on(e,n){if(!v(n))return c;const a=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return a.push(n),()=>{const i=a.indexOf(n);i!==-1&&a.splice(i,1)}}$set(e){this.$$set&&!P(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const W="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(W);export{J as S,A as a,G as b,F as c,Q as d,z as e,Z as g,H as i,N as m,M as t}; diff --git a/_app/immutable/chunks/index.hW7Iu6gF.js b/_app/immutable/chunks/index.hW7Iu6gF.js new file mode 100644 index 0000000..223d607 --- /dev/null +++ b/_app/immutable/chunks/index.hW7Iu6gF.js @@ -0,0 +1,2 @@ +const __vite__fileDeps=["./index.Bw9ky5pK.js","./2.CpRWH4-H.js","./scheduler.C1FoT2GD.js","./index.DFmxPlw4.js","./kit.CACir_b1.js","./preload-helper.D6kgxu3v.js","./paths.2ZvcQRjx.js","./contest.LM7IXEuc.js","./stores.uos4ky2n.js","./entry.CTvLC5-Q.js","../assets/2.BD708D1f.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{_ as R}from"./preload-helper.D6kgxu3v.js";import{p as u,s as h,a as V}from"./2.CpRWH4-H.js";const n=u({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),x={state:n,subscribe(e){return h(n,()=>e(n))},push(e,t){e!==n.view&&(n.view=e,t&&(n.data=t),n.history.push(e))},reset(e){n.view=e,n.history=[e]},replace(e){n.history.length>1&&(n.history[n.history.length-1]=e,n.view=e)},goBack(){if(n.history.length>1){n.history.pop();const[e]=n.history.slice(-1);n.view=e}},setData(e){n.data=e}},r={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return r.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return r.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(r.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const i=encodeURIComponent(t);return`${o}wc?uri=${i}`},formatUniversalUrl(e,t,s){if(!r.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const i=encodeURIComponent(t);return`${o}wc?uri=${i}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(r.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(r.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(r.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(r.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=x.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},H=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),a=u({enabled:H,userSessionId:"",events:[],connectedWalletId:void 0}),B={state:a,subscribe(e){return h(a.events,()=>e(V(a.events[a.events.length-1])))},initialize(){a.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(a.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){a.connectedWalletId=e},click(e){if(a.enabled){const t={type:"CLICK",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}},track(e){if(a.enabled){const t={type:"TRACK",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}},view(e){if(a.enabled){const t={type:"VIEW",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}}},d=u({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),c={state:d,subscribe(e){return h(d,()=>e(d))},setChains(e){d.chains=e},setWalletConnectUri(e){d.walletConnectUri=e},setIsCustomDesktop(e){d.isCustomDesktop=e},setIsCustomMobile(e){d.isCustomMobile=e},setIsDataLoaded(e){d.isDataLoaded=e},setIsUiLoaded(e){d.isUiLoaded=e},setIsAuth(e){d.isAuth=e}},w=u({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),v={state:w,subscribe(e){return h(w,()=>e(w))},setConfig(e){var t,s;B.initialize(),c.setChains(e.chains),c.setIsAuth(!!e.enableAuthMode),c.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),c.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),r.setModalVersionInStorage(),Object.assign(w,e)}};var K=Object.defineProperty,j=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,D=(e,t,s)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,q=(e,t)=>{for(var s in t||(t={}))z.call(t,s)&&D(e,s,t[s]);if(j)for(var s of j(t))J.call(t,s)&&D(e,s,t[s]);return e};const E="https://explorer-api.walletconnect.com",O="wcm",A="js-2.6.2";async function W(e,t){const s=q({sdkType:O,sdkVersion:A},t),o=new URL(e,E);return o.searchParams.append("projectId",v.state.projectId),Object.entries(s).forEach(([i,l])=>{l&&o.searchParams.append(i,String(l))}),(await fetch(o)).json()}const m={async getDesktopListings(e){return W("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return W("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return W("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return W("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${E}/w3m/v1/getWalletImage/${e}?projectId=${v.state.projectId}&sdkType=${O}&sdkVersion=${A}`},getAssetImageUrl(e){return`${E}/w3m/v1/getAssetImage/${e}?projectId=${v.state.projectId}&sdkType=${O}&sdkVersion=${A}`}};var F=Object.defineProperty,k=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,_=(e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,X=(e,t)=>{for(var s in t||(t={}))G.call(t,s)&&_(e,s,t[s]);if(k)for(var s of k(t))Q.call(t,s)&&_(e,s,t[s]);return e};const S=r.isMobile(),p=u({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),re={state:p,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=v.state;if(e==="NONE"||t==="ALL"&&!e)return p.recomendedWallets;if(r.isArray(e)){const s={recommendedIds:e.join(",")},{listings:o}=await m.getAllListings(s),i=Object.values(o);i.sort((l,b)=>{const y=e.indexOf(l.id),C=e.indexOf(b.id);return y-C}),p.recomendedWallets=i}else{const{chains:s,isAuth:o}=c.state,i=s==null?void 0:s.join(","),l=r.isArray(t),b={page:1,sdks:o?"auth_v1":void 0,entries:r.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:l?t.join(","):void 0},{listings:y}=S?await m.getMobileListings(b):await m.getDesktopListings(b);p.recomendedWallets=Object.values(y)}return p.recomendedWallets},async getWallets(e){const t=X({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=v.state,{recomendedWallets:i}=p;if(o==="ALL")return p.wallets;i.length?t.excludedIds=i.map($=>$.id).join(","):r.isArray(s)&&(t.excludedIds=s.join(",")),r.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),c.state.isAuth&&(t.sdks="auth_v1");const{page:l,search:b}=e,{listings:y,total:C}=S?await m.getMobileListings(t):await m.getDesktopListings(t),U=Object.values(y),M=b?"search":"wallets";return p[M]={listings:[...p[M].listings,...U],total:C,page:l??1},{listings:U,total:C}},getWalletImageUrl(e){return m.getWalletImageUrl(e)},getAssetImageUrl(e){return m.getAssetImageUrl(e)},resetSearch(){p.search={listings:[],total:0,page:1}}},I=u({open:!1}),L={state:I,subscribe(e){return h(I,()=>e(I))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:o}=c.state;if(r.removeWalletConnectDeepLink(),c.setWalletConnectUri(e==null?void 0:e.uri),c.setChains(e==null?void 0:e.chains),x.reset("ConnectWallet"),s&&o)I.open=!0,t();else{const i=setInterval(()=>{const l=c.state;l.isUiLoaded&&l.isDataLoaded&&(clearInterval(i),I.open=!0,t())},200)}})},close(){I.open=!1}};var Y=Object.defineProperty,N=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,T=(e,t,s)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,te=(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&T(e,s,t[s]);if(N)for(var s of N(t))ee.call(t,s)&&T(e,s,t[s]);return e};function se(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const f=u({themeMode:se()?"dark":"light"}),P={state:f,subscribe(e){return h(f,()=>e(f))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(f.themeMode=t),s&&(f.themeVariables=te({},s))}},g=u({open:!1,message:"",variant:"success"}),ie={state:g,subscribe(e){return h(g,()=>e(g))},openToast(e,t){g.open=!0,g.message=e,g.variant=t},closeToast(){g.open=!1}};class oe{constructor(t){this.openModal=L.open,this.closeModal=L.close,this.subscribeModal=L.subscribe,this.setTheme=P.setThemeConfig,P.setThemeConfig(t),v.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await R(()=>import("./index.Bw9ky5pK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),c.setIsUiLoaded(!0)}}}const le=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:oe},Symbol.toStringTag,{value:"Module"}));export{B as R,x as T,r as a,le as i,P as n,ie as o,c as p,L as s,re as t,v as y}; diff --git a/_app/immutable/chunks/kit.CACir_b1.js b/_app/immutable/chunks/kit.CACir_b1.js new file mode 100644 index 0000000..3a77ea6 --- /dev/null +++ b/_app/immutable/chunks/kit.CACir_b1.js @@ -0,0 +1,40 @@ +import{a1 as si}from"./scheduler.C1FoT2GD.js";import{_ as oi}from"./preload-helper.D6kgxu3v.js";import{r as ii}from"./paths.2ZvcQRjx.js";const ai="1.0.0";let se=class wn extends Error{constructor(t,n={}){var i;const r=n.cause instanceof wn?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,s=n.cause instanceof wn&&n.cause.docsPath||n.docsPath,o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${ai}`].join(` +`);super(o),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function Se(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const ps=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ys=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,ms=/^\(.+?\).*?$/,jr=/^tuple(?(\[(\d*)\])*)$/;function vn(e){let t=e.type;if(jr.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function ui(e){return gs.test(e)}function li(e){return Se(gs,e)}const ws=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function fi(e){return ws.test(e)}function di(e){return Se(ws,e)}const vs=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function hi(e){return vs.test(e)}function bi(e){return Se(vs,e)}const xs=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function Es(e){return xs.test(e)}function pi(e){return Se(xs,e)}const Ps=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function yi(e){return Ps.test(e)}function mi(e){return Se(Ps,e)}const gi=/^fallback\(\)$/;function wi(e){return gi.test(e)}const vi=/^receive\(\) external payable$/;function xi(e){return vi.test(e)}const Ei=new Set(["indexed"]),xn=new Set(["calldata","memory","storage"]);class Pi extends se{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Bi extends se{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Ii extends se{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Ai extends se{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class $i extends se{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Ti extends se{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Si extends se{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class ut extends se{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Oi extends se{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Ci extends se{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class ki extends se{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Ni extends se{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Fi(e,t){return t?`${t}:${e}`:e}const cn=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function ji(e,t={}){if(hi(e)){const n=bi(e);if(!n)throw new ut({signature:e,type:"function"});const r=ae(n.parameters),s=[],o=r.length;for(let a=0;a[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,zi=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Mi=/^u?int$/;function ke(e,t){var f,d;const n=Fi(e,t==null?void 0:t.type);if(cn.has(n))return cn.get(n);const r=ms.test(e),s=Se(r?zi:Ri,e);if(!s)throw new Ii({param:e});if(s.name&&Ui(s.name))throw new Ai({param:e,name:s.name});const o=s.name?{name:s.name}:{},i=s.modifier==="indexed"?{indexed:!0}:{},a=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const p=ae(s.type),b=[],h=p.length;for(let y=0;y[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function Is(e,t,n=new Set){const r=[],s=e.length;for(let o=0;o{var s,o;return((s=e[t.name])==null?void 0:s.call(e,r))??((o=e[n])==null?void 0:o.call(e,r))??t(e,r)}}function me(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new oa(e.type);return`${e.name}(${Vt(e.inputs,{includeName:t})})`}function Vt(e,{includeName:t=!1}={}){return e?e.map(n=>Hi(n,{includeName:t})).join(t?", ":","):""}function Hi(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Vt(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function fe(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function _(e){return fe(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const qi="2.15.0",Vi=e=>e,Hn=e=>e,Zi=()=>`viem@${qi}`;class w extends Error{constructor(t,n={}){var o;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:Zi()});const r=n.cause instanceof w?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof w&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${n.docsBaseUrl??"https://viem.sh"}${s}${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` +`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return $s(this,t)}}function $s(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e?$s(e.cause,t):t?null:e}class Wi extends w{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class Rr extends w{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class Ts extends w{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${Vt(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class Zt extends w{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Yi extends w{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Ki extends w{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${_(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Ji extends w{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class Ss extends w{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Xi extends w{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class Os extends w{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class zr extends w{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class Ht extends w{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Qi extends w{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class ea extends w{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${me(t.abiItem)}\`, and`,`\`${n.type}\` in \`${me(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class ta extends w{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class ft extends w{constructor({abiItem:t,data:n,params:r,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(` +`),{metaMessages:[`Params: (${Vt(r,{includeName:!0})})`,`Data: ${n} (${s} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=s}}class Wt extends w{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${me(t,{includeName:!0})}".`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class na extends w{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class ra extends w{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class sa extends w{constructor(t){super([`Value "${t}" is not a valid array.`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class oa extends w{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class ia extends w{constructor(t){super(`Filter type "${t}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}class Cs extends w{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class ks extends w{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class Mr extends w{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function Ue(e,{dir:t,size:n=32}={}){return typeof e=="string"?Ae(e,{dir:t,size:n}):aa(e,{dir:t,size:n})}function Ae(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new ks({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function aa(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new ks({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;st)throw new la({givenSize:_(e),maxSize:t})}function G(e,t={}){const{signed:n}=t;t.size&&ue(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,o=(1n<t.toString(16).padStart(2,"0"));function O(e,t={}){return typeof e=="number"||typeof e=="bigint"?F(e,t):typeof e=="string"?qn(e,t):typeof e=="boolean"?Ns(e,t):D(e,t)}function Ns(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(ue(n,{size:t.size}),Ue(n,{size:t.size})):n}function D(e,t={}){let n="";for(let s=0;so||s=he.zero&&e<=he.nine)return e-he.zero;if(e>=he.A&&e<=he.F)return e-(he.A-10);if(e>=he.a&&e<=he.f)return e-(he.a-10)}function re(e,t={}){let n=e;t.size&&(ue(n,{size:t.size}),n=Ue(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,o=new Uint8Array(s);for(let i=0,a=0;i0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function ya(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");qt(e.outputLen),qt(e.blockLen)}function Ke(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Fs(e,t){Vn(e);const n=t.outputLen;if(e.length>Ur&Lt)}:{h:Number(e>>Ur&Lt)|0,l:Number(e&Lt)|0}}function ga(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;se<>>32-n,va=(e,t,n)=>t<>>32-n,xa=(e,t,n)=>t<>>64-n,Ea=(e,t,n)=>e<>>64-n,un=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const js=e=>e instanceof Uint8Array,Pa=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),ln=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),le=(e,t)=>e<<32-t|e>>>t,Ba=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ba)throw new Error("Non little-endian hardware is not supported");function Ia(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Yt(e){if(typeof e=="string"&&(e=Ia(e)),!js(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Aa(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!js(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class Zn{clone(){return this._cloneInto()}}function Rs(e){const t=r=>e().update(Yt(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function $a(e=32){if(un&&typeof un.getRandomValues=="function")return un.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[zs,Ms,Ls]=[[],[],[]],Ta=BigInt(0),at=BigInt(1),Sa=BigInt(2),Oa=BigInt(7),Ca=BigInt(256),ka=BigInt(113);for(let e=0,t=at,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],zs.push(2*(5*r+n)),Ms.push((e+1)*(e+2)/2%64);let s=Ta;for(let o=0;o<7;o++)t=(t<>Oa)*ka)%Ca,t&Sa&&(s^=at<<(at<n>32?xa(e,t,n):wa(e,t,n),Dr=(e,t,n)=>n>32?Ea(e,t,n):va(e,t,n);function ja(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,u=n[c],l=n[c+1],f=_r(u,l,1)^n[a],d=Dr(u,l,1)^n[a+1];for(let p=0;p<50;p+=10)e[i+p]^=f,e[i+p+1]^=d}let s=e[2],o=e[3];for(let i=0;i<24;i++){const a=Ms[i],c=_r(s,o,a),u=Dr(s,o,a),l=zs[i];s=e[l],o=e[l+1],e[l]=c,e[l+1]=u}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)n[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=Na[r],e[1]^=Fa[r]}n.fill(0)}class Wn extends Zn{constructor(t,n,r,s=!1,o=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,qt(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Pa(this.state)}keccak(){ja(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){Ke(this);const{blockLen:n,state:r}=this;t=Yt(t);const s=t.length;for(let o=0;o=r&&this.keccak();const i=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return qt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Fs(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:i}=this;return t||(t=new Wn(n,r,s,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=i,t.destroyed=this.destroyed,t}}const Ra=(e,t,n)=>Rs(()=>new Wn(t,e,n)),za=Ra(1,136,256/8);function Y(e,t){const n=t||"hex",r=za(fe(e,{strict:!1})?ce(e):e);return n==="bytes"?r:O(r)}const Ma=e=>Y(ce(e));function La(e){return Ma(e)}function Ua(e){let t=!0,n="",r=0,s="",o=!1;for(let i=0;i{const t=typeof e=="string"?e:ci(e);return Ua(t)};function Us(e){return La(_a(e))}const Yn=Us;class K extends w{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class Kn extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}set(t,n){return super.set(t,n),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}const fn=new Kn(8192);function Jn(e,t){if(fn.has(`${e}.${t}`))return fn.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=Y(pe(n),"bytes"),s=(t?n.substring(`${t}0x`.length):n).split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&s[i]&&(s[i]=s[i].toUpperCase()),(r[i>>1]&15)>=8&&s[i+1]&&(s[i+1]=s[i+1].toUpperCase());const o=`0x${s.join("")}`;return fn.set(`${e}.${t}`,o),o}function od(e,t){if(!q(e,{strict:!1}))throw new K({address:e});return Jn(e,t)}const Da=/^0x[a-fA-F0-9]{40}$/,dn=new Kn(8192);function q(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(dn.has(r))return dn.get(r);const s=Da.test(e)?e.toLowerCase()===e?!0:n?Jn(e)===e:!0:!1;return dn.set(r,s),s}function ge(e){return typeof e[0]=="string"?_e(e):Ga(e)}function Ga(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function _e(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function dt(e,t,n,{strict:r}={}){return fe(e,{strict:!1})?Ha(e,t,n,{strict:r}):Gs(e,t,n,{strict:r})}function _s(e,t){if(typeof t=="number"&&t>0&&t>_(e)-1)throw new Cs({offset:t,position:"start",size:_(e)})}function Ds(e,t,n){if(typeof t=="number"&&typeof n=="number"&&_(e)!==n-t)throw new Cs({offset:n,position:"end",size:_(e)})}function Gs(e,t,n,{strict:r}={}){_s(e,t);const s=e.slice(t,n);return r&&Ds(s,t,n),s}function Ha(e,t,n,{strict:r}={}){_s(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Ds(s,t,n),s}function Ct(e,t){if(e.length!==t.length)throw new Ji({expectedLength:e.length,givenLength:t.length});const n=qa({params:e,values:t}),r=Qn(n);return r.length===0?"0x":r}function qa({params:e,values:t}){const n=[];for(let r=0;r0?ge([a,i]):a}}if(s)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:ge(o.map(({encoded:i})=>i))}}function Wa(e,{param:t}){const[,n]=t.type.split("bytes"),r=_(e);if(!n){let s=e;return r%32!==0&&(s=Ae(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:ge([Ae(F(r,{size:32})),s])}}if(r!==Number.parseInt(n))throw new Ki({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Ae(e,{dir:"right"})}}function Ya(e){if(typeof e!="boolean")throw new w(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Ae(Ns(e))}}function Ka(e,{signed:t}){return{dynamic:!1,encoded:F(e,{size:32,signed:t})}}function Ja(e){const t=qn(e),n=Math.ceil(_(t)/32),r=[];for(let s=0;ss))}}function er(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const tr=e=>dt(Us(e),0,4);function kt(e){const{abi:t,args:n=[],name:r}=e,s=fe(r,{strict:!1}),o=t.filter(a=>s?a.type==="function"?tr(a)===r:a.type==="event"?Yn(a)===r:!1:"name"in a&&a.name===r);if(o.length===0)return;if(o.length===1)return o[0];let i;for(const a of o){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((u,l)=>{const f="inputs"in a&&a.inputs[l];return f?En(u,f):!1})){if(i&&"inputs"in i&&i.inputs){const u=Hs(a.inputs,i.inputs,n);if(u)throw new ea({abiItem:a,type:u[0]},{abiItem:i,type:u[1]})}i=a}}return i||o[0]}function En(e,t){const n=typeof e,r=t.type;switch(r){case"address":return q(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>En(Object.values(e)[o],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>En(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Hs(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return Hs(s.components,o.components,n[r]);const i=[s.type,o.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?q(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?q(n[r],{strict:!1}):!1)return i}}const Gr="/docs/contract/encodeEventTopics";function Nt(e){var c;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=kt({abi:t,name:n});if(!u)throw new zr(n,{docsPath:Gr});s=u}if(s.type!=="event")throw new zr(void 0,{docsPath:Gr});const o=me(s),i=Yn(o);let a=[];if(r&&"inputs"in s){const u=(c=s.inputs)==null?void 0:c.filter(f=>"indexed"in f&&f.indexed),l=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(f=>r[f.name]))??[]:[];l.length>0&&(a=(u==null?void 0:u.map((f,d)=>Array.isArray(l[d])?l[d].map((p,b)=>Hr({param:f,value:l[d][b]})):l[d]?Hr({param:f,value:l[d]}):null))??[])}return[i,...a]}function Hr({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Y(ce(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new ia(e.type);return Ct([e],[t])}function Kt(e,{method:t}){var r,s;const n={};return e.transport.type==="fallback"&&((s=(r=e.transport).onResponse)==null||s.call(r,({method:o,response:i,status:a,transport:c})=>{a==="success"&&t===o&&(n[i]=c.request)})),o=>n[o]||e.request}async function qs(e,t){const{address:n,abi:r,args:s,eventName:o,fromBlock:i,strict:a,toBlock:c}=t,u=Kt(e,{method:"eth_newFilter"}),l=o?Nt({abi:r,args:s,eventName:o}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?F(i):i,toBlock:typeof c=="bigint"?F(c):c,topics:l}]});return{abi:r,args:s,eventName:o,id:f,request:u(f),strict:!!a,type:"event"}}function Oe(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const qr="/docs/contract/encodeFunctionData";function Qa(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const o=kt({abi:t,args:n,name:r});if(!o)throw new Ht(r,{docsPath:qr});s=o}if(s.type!=="function")throw new Ht(void 0,{docsPath:qr});return{abi:[s],functionName:tr(me(s))}}function De(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var a;return e.abi.length===1&&((a=e.functionName)!=null&&a.startsWith("0x"))?e:Qa(e)})(),s=n[0],o=r,i="inputs"in s&&s.inputs?Ct(s.inputs,t??[]):void 0;return _e([o,i??"0x"])}const Vs={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},ec={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},tc={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class Vr extends w{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class Zs extends w{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class nc extends w{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const rc={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new nc({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Zs({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Vr({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Vr({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function nr(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(rc);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function sc(e,t={}){typeof t.size<"u"&&ue(e,{size:t.size});const n=D(e,t);return G(n,t)}function oc(e,t={}){let n=e;if(typeof t.size<"u"&&(ue(n,{size:t.size}),n=Re(n)),n.length>1||n[0]>1)throw new ua(n);return!!n[0]}function ye(e,t={}){typeof t.size<"u"&&ue(e,{size:t.size});const n=D(e,t);return de(n,t)}function ic(e,t={}){let n=e;return typeof t.size<"u"&&(ue(n,{size:t.size}),n=Re(n,{dir:"right"})),new TextDecoder().decode(n)}function Jt(e,t){const n=typeof t=="string"?re(t):t,r=nr(n);if(_(n)===0&&e.length>0)throw new Zt;if(_(t)&&_(t)<32)throw new Ts({data:typeof t=="string"?t:D(t),params:e,size:_(t)});let s=0;const o=[];for(let i=0;i48?sc(s,{signed:n}):ye(s,{signed:n}),32]}function dc(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),s=r?[]:{};let o=0;if(ht(t)){const i=ye(e.readBytes(Pn)),a=n+i;for(let c=0;ci.type==="error"&&r===tr(me(i)));if(!o)throw new Ss(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Jt(o.inputs,dt(n,4)):void 0,errorName:o.name}}const Z=(e,t,n)=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s,n);function Ws({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,o)=>`${r&&s.name?`${s.name}: `:""}${typeof t[o]=="object"?Z(t[o]):t[o]}`).join(", ")})`}const pc={gwei:9,wei:18},yc={ether:-9,wei:9},id={ether:-18,gwei:-9};function Ys(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${o?`.${o}`:""}`}function rr(e,t="wei"){return Ys(e,pc[t])}function X(e,t="wei"){return Ys(e,yc[t])}class mc extends w{constructor({address:t}){super(`State for account "${t}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class gc extends w{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function Wr(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r} +`,"")}function wc(e){return e.reduce((t,{address:n,...r})=>{let s=`${t} ${n}: +`;return r.nonce&&(s+=` nonce: ${r.nonce} +`),r.balance&&(s+=` balance: ${r.balance} +`),r.code&&(s+=` code: ${r.code} +`),r.state&&(s+=` state: +`,s+=Wr(r.state)),r.stateDiff&&(s+=` stateDiff: +`,s+=Wr(r.stateDiff)),s},` State Override: +`).slice(0,-1)}function Ft(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(` +`)}class vc extends w{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class xc extends w{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class Ec extends w{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ft(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class Pc extends w{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class ad extends w{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:l,to:f,value:d}){var b;const p=Ft({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:f,value:typeof d<"u"&&`${rr(d)} ${((b=s==null?void 0:s.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${X(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${X(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${X(u)} gwei`,nonce:l});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=t}}class Ks extends w{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:s,index:o}){let i="Transaction";r&&o!==void 0&&(i=`Transaction at block time "${r}" at index "${o}"`),t&&o!==void 0&&(i=`Transaction at block hash "${t}" at index "${o}"`),n&&o!==void 0&&(i=`Transaction at block number "${n}" at index "${o}"`),s&&(i=`Transaction with hash "${s}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class Js extends w{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class Yr extends w{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}class Xs extends w{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:l,to:f,value:d,stateOverride:p}){var y;const b=n?Oe(n):void 0;let h=Ft({from:b==null?void 0:b.address,to:f,value:typeof d<"u"&&`${rr(d)} ${((y=s==null?void 0:s.nativeCurrency)==null?void 0:y.symbol)||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${X(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${X(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${X(u)} gwei`,nonce:l});p&&(h+=` +${wc(p)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=t}}class Bc extends w{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:o,functionName:i,sender:a}){const c=kt({abi:n,args:r,name:i}),u=c?Ws({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,l=c?me(c,{includeName:!0}):void 0,f=Ft({address:s&&Vi(s),function:l,args:u&&u!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:o,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=s,this.functionName=i,this.sender=a}}class Bn extends w{constructor({abi:t,data:n,functionName:r,message:s}){let o,i,a,c;if(n&&n!=="0x")try{i=bc({abi:t,data:n});const{abiItem:l,errorName:f,args:d}=i;if(f==="Error")c=d[0];else if(f==="Panic"){const[p]=d;c=Vs[p]}else{const p=l?me(l,{includeName:!0}):void 0,b=l&&d?Ws({abiItem:l,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[p?`Error: ${p}`:"",b&&b!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${b}`:""]}}catch(l){o=l}else s&&(c=s);let u;o instanceof Ss&&(u=o.signature,a=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(` +`):`The contract function "${r}" reverted.`,{cause:o,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=c,this.signature=u}}class Ic extends w{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class Ac extends w{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CounterfactualDeploymentFailedError"})}}class sr extends w{constructor({data:t,message:n}){super(n||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class lt extends w{constructor({body:t,details:n,headers:r,status:s,url:o}){super("HTTP request failed.",{details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${Hn(o)}`,t&&`Request body: ${Z(t)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=r,this.status=s,this.url=o}}class Qs extends w{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${Hn(r)}`,`Request body: ${Z(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code}}class Kr extends w{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Hn(n)}`,`Request body: ${Z(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const $c=-1;class Q extends w{constructor(t,{code:n,docsPath:r,metaMessages:s,shortMessage:o}){super(o,{cause:t,docsPath:r,metaMessages:s||(t==null?void 0:t.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t.name,this.code=t instanceof Qs?t.code:n??$c}}class nt extends Q{constructor(t,n){super(t,n),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class bt extends Q{constructor(t){super(t,{code:bt.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(bt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class pt extends Q{constructor(t){super(t,{code:pt.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(pt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class yt extends Q{constructor(t){super(t,{code:yt.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(yt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class mt extends Q{constructor(t){super(t,{code:mt.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(mt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class ze extends Q{constructor(t){super(t,{code:ze.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Me extends Q{constructor(t){super(t,{code:Me.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(Me,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class gt extends Q{constructor(t){super(t,{code:gt.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(gt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class wt extends Q{constructor(t){super(t,{code:wt.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(wt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class vt extends Q{constructor(t){super(t,{code:vt.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(vt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class xt extends Q{constructor(t){super(t,{code:xt.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(xt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Je extends Q{constructor(t){super(t,{code:Je.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(Je,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Et extends Q{constructor(t){super(t,{code:Et.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(Et,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ye extends nt{constructor(t){super(t,{code:Ye.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Ye,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Pt extends nt{constructor(t){super(t,{code:Pt.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(Pt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Bt extends nt{constructor(t){super(t,{code:Bt.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(Bt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class It extends nt{constructor(t){super(t,{code:It.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(It,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class At extends nt{constructor(t){super(t,{code:At.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(At,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class $t extends nt{constructor(t){super(t,{code:$t.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty($t,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Tc extends Q{constructor(t){super(t,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const Sc=3;function Tt(e,{abi:t,address:n,args:r,docsPath:s,functionName:o,sender:i}){const{code:a,data:c,message:u,shortMessage:l}=e instanceof sr?e:e instanceof w?e.walk(d=>"data"in d)||e.walk():{},f=e instanceof Zt?new Ic({functionName:o}):[Sc,ze.code].includes(a)&&(c||u||l)?new Bn({abi:t,data:typeof c=="object"?c.data:c,functionName:o,message:l??u}):e;return new Bc(f,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:o,sender:i})}class Oc extends w{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:l,to:f,value:d}){var b;const p=Ft({from:n==null?void 0:n.address,to:f,value:typeof d<"u"&&`${rr(d)} ${((b=s==null?void 0:s.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${X(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${X(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${X(u)} gwei`,nonce:l});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=t}}class Ze extends w{constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(Ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Ze,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Le extends w{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${X(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(Le,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class In extends w{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${X(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(In,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class An extends w{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(An,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class $n extends w{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty($n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Tn extends w{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(Tn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Sn extends w{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(Sn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class On extends w{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(On,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Cn extends w{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(Cn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class kn extends w{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(kn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class St extends w{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${X(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${X(r)} gwei`:""}).`].join(` +`),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(St,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class or extends w{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function eo(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof w?e.walk(s=>s.code===Ze.code):e;return r instanceof w?new Ze({cause:e,message:r.details}):Ze.nodeMessage.test(n)?new Ze({cause:e,message:e.details}):Le.nodeMessage.test(n)?new Le({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):In.nodeMessage.test(n)?new In({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):An.nodeMessage.test(n)?new An({cause:e,nonce:t==null?void 0:t.nonce}):$n.nodeMessage.test(n)?new $n({cause:e,nonce:t==null?void 0:t.nonce}):Tn.nodeMessage.test(n)?new Tn({cause:e,nonce:t==null?void 0:t.nonce}):Sn.nodeMessage.test(n)?new Sn({cause:e}):On.nodeMessage.test(n)?new On({cause:e,gas:t==null?void 0:t.gas}):Cn.nodeMessage.test(n)?new Cn({cause:e,gas:t==null?void 0:t.gas}):kn.nodeMessage.test(n)?new kn({cause:e}):St.nodeMessage.test(n)?new St({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new or({cause:e})}function Cc(e,{docsPath:t,...n}){const r=(()=>{const s=eo(e,n);return s instanceof or?e:s})();return new Oc(r,{docsPath:t,...n})}function to(e,{format:t}){if(!t)return{};const n={};function r(o){const i=Object.keys(o);for(const a of i)a in e&&(n[a]=e[a]),o[a]&&typeof o[a]=="object"&&!Array.isArray(o[a])&&r(o[a])}const s=t(e||{});return r(s),n}function Xt(e,t){return({exclude:n,format:r})=>({exclude:n,format:s=>{const o=t(s);if(n)for(const i of n)delete o[i];return{...o,...r(s)}},type:e})}const kc={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function ir(e){const t={};return typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>D(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=F(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=F(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=F(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=F(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=F(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=F(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=kc[e.type]),typeof e.value<"u"&&(t.value=F(e.value)),t}const Nc=Xt("transactionRequest",ir);function Jr(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Mr({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Mr({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Fc(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:o}=e,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=F(t)),n!==void 0&&(i.nonce=F(n)),r!==void 0&&(i.state=Jr(r)),s!==void 0){if(i.state)throw new gc;i.stateDiff=Jr(s)}return i}function no(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!q(n,{strict:!1}))throw new K({address:n});if(t[n])throw new mc({address:n});t[n]=Fc(r)}return t}function ar(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:o}=e,i=t?Oe(t):void 0;if(i&&!q(i.address))throw new K({address:i.address});if(o&&!q(o))throw new K({address:o});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new vc;if(r&&r>2n**256n-1n)throw new Le({maxFeePerGas:r});if(s&&r&&s>r)throw new St({maxFeePerGas:r,maxPriorityFeePerGas:s})}class jc extends w{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class cr extends w{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Rc extends w{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${X(t)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class ro extends w{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const so={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function ur(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?de(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?de(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?so[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}const zc=Xt("transaction",ur);function lr(e){var n;const t=(n=e.transactions)==null?void 0:n.map(r=>typeof r=="string"?r:ur(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Mc=Xt("block",lr);async function $e(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){var l,f,d;const o=r??"latest",i=s??!1,a=n!==void 0?F(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,i]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[a||o,i]},{dedupe:!!a}),!c)throw new ro({blockHash:t,blockNumber:n});return(((d=(f=(l=e.chain)==null?void 0:l.formatters)==null?void 0:f.block)==null?void 0:d.format)||lr)(c)}async function fr(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Lc(e,t){return oo(e,t)}async function oo(e,t){var o,i,a;const{block:n,chain:r=e.chain,request:s}=t||{};if(typeof((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee)=="function"){const c=n||await k(e,$e,"getBlock")({});return r.fees.defaultPriorityFee({block:c,client:e,request:s})}if(typeof((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee)<"u")return(a=r==null?void 0:r.fees)==null?void 0:a.defaultPriorityFee;try{const c=await e.request({method:"eth_maxPriorityFeePerGas"});return G(c)}catch{const[c,u]=await Promise.all([n?Promise.resolve(n):k(e,$e,"getBlock")({}),k(e,fr,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new cr;const l=u-c.baseFeePerGas;return l<0n?0n:l}}async function Uc(e,t){return Nn(e,t)}async function Nn(e,t){var d,p;const{block:n,chain:r=e.chain,request:s,type:o="eip1559"}=t||{},i=await(async()=>{var b,h;return typeof((b=r==null?void 0:r.fees)==null?void 0:b.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)??1.2})();if(i<1)throw new jc;const c=10**(((d=i.toString().split(".")[1])==null?void 0:d.length)??0),u=b=>b*BigInt(Math.ceil(i*c))/BigInt(c),l=n||await k(e,$e,"getBlock")({});if(typeof((p=r==null?void 0:r.fees)==null?void 0:p.estimateFeesPerGas)=="function"){const b=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:o});if(b!==null)return b}if(o==="eip1559"){if(typeof l.baseFeePerGas!="bigint")throw new cr;const b=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await oo(e,{block:l,chain:r,request:s}),h=u(l.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??h+b,maxPriorityFeePerGas:b}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await k(e,fr,"getGasPrice")({}))}}async function io(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,r?F(r):n]},{dedupe:!!r});return de(s)}function dr(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>re(o)):e.blobs,s=[];for(const o of r)s.push(Uint8Array.from(t.blobToKzgCommitment(o)));return n==="bytes"?s:s.map(o=>D(o))}function hr(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>re(i)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(i=>re(i)):e.commitments,o=[];for(let i=0;iD(i))}function _c(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),o=BigInt(4294967295),i=Number(n>>s&o),a=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+u,a,r)}class Dc extends Zn{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ln(this.buffer)}update(t){Ke(this);const{view:n,buffer:r,blockLen:s}=this;t=Yt(t);const o=t.length;for(let i=0;is-i&&(this.process(r,0),i=0);for(let f=i;fl.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&n,Hc=(e,t,n)=>e&t^e&n^t&n,qc=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]),Be=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ie=new Uint32Array(64);class Vc extends Dc{constructor(){super(64,32,8,!1),this.A=Be[0]|0,this.B=Be[1]|0,this.C=Be[2]|0,this.D=Be[3]|0,this.E=Be[4]|0,this.F=Be[5]|0,this.G=Be[6]|0,this.H=Be[7]|0}get(){const{A:t,B:n,C:r,D:s,E:o,F:i,G:a,H:c}=this;return[t,n,r,s,o,i,a,c]}set(t,n,r,s,o,i,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)Ie[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const d=Ie[f-15],p=Ie[f-2],b=le(d,7)^le(d,18)^d>>>3,h=le(p,17)^le(p,19)^p>>>10;Ie[f]=h+Ie[f-7]+b+Ie[f-16]|0}let{A:r,B:s,C:o,D:i,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){const d=le(a,6)^le(a,11)^le(a,25),p=l+d+Gc(a,c,u)+qc[f]+Ie[f]|0,h=(le(r,2)^le(r,13)^le(r,22))+Hc(r,s,o)|0;l=u,u=c,c=a,a=i+p|0,i=o,o=s,s=r,r=p+h|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,s,o,i,a,c,u,l)}roundClean(){Ie.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const ao=Rs(()=>new Vc);function co(e,t){const n=t||"hex",r=ao(fe(e,{strict:!1})?ce(e):e);return n==="bytes"?r:O(r)}function Zc(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=co(t,"bytes");return s.set([n],0),r==="bytes"?s:D(s)}function uo(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const o of t)s.push(Zc({commitment:o,to:r,version:n}));return s}const Xr=6,lo=32,br=4096,fo=lo*br,Qr=fo*Xr-1-1*br*Xr,ho=1;class Wc extends w{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class bo extends w{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class Yc extends w{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class Kc extends w{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${ho}`,`Received: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function Jc(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?re(e.data):e.data,r=_(n);if(!r)throw new bo;if(r>Qr)throw new Wc({maxSize:Qr,size:r});const s=[];let o=!0,i=0;for(;o;){const a=nr(new Uint8Array(fo));let c=0;for(;ca.bytes):s.map(a=>D(a.bytes))}function po(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Jc({data:t,to:r}),o=e.commitments??dr({blobs:s,kzg:n,to:r}),i=e.proofs??hr({blobs:s,commitments:o,kzg:n,to:r}),a=[];for(let c=0;c"u"&&l)if(l.nonceManager){const y=await h();f.nonce=await l.nonceManager.consume({address:l.address,chainId:y,client:e})}else f.nonce=await k(e,io,"getTransactionCount")({address:l.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{f.type=yo(f)}catch{const y=await p();f.type=typeof(y==null?void 0:y.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(f.type!=="legacy"&&f.type!=="eip2930"){if(typeof f.maxFeePerGas>"u"||typeof f.maxPriorityFeePerGas>"u"){const y=await p(),{maxFeePerGas:m,maxPriorityFeePerGas:g}=await Nn(e,{block:y,chain:s,request:f});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas"u"&&(f.gas=await k(e,pr,"estimateGas")({...f,account:l?{address:l.address,type:"json-rpc"}:void 0})),ar(f),delete f.parameters,f}async function pr(e,t){var s,o,i;const n=t.account??e.account,r=n?Oe(n):void 0;try{const{accessList:a,blobs:c,blobVersionedHashes:u,blockNumber:l,blockTag:f,data:d,gas:p,gasPrice:b,maxFeePerBlobGas:h,maxFeePerGas:y,maxPriorityFeePerGas:m,nonce:g,to:v,value:E,stateOverride:A,...x}=await go(e,{...t,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),P=(l?F(l):void 0)||f,T=no(A);ar(t);const C=(i=(o=(s=e.chain)==null?void 0:s.formatters)==null?void 0:o.transactionRequest)==null?void 0:i.format,j=(C||ir)({...to(x,{format:C}),from:r==null?void 0:r.address,accessList:a,blobs:c,blobVersionedHashes:u,data:d,gas:p,gasPrice:b,maxFeePerBlobGas:h,maxFeePerGas:y,maxPriorityFeePerGas:m,nonce:g,to:v,value:E}),z=await e.request({method:"eth_estimateGas",params:T?[j,P??"latest",T]:P?[j,P]:[j]});return BigInt(z)}catch(a){throw Cc(a,{...t,account:r,chain:e.chain})}}async function Qc(e,t){const{abi:n,address:r,args:s,functionName:o,...i}=t,a=De({abi:n,args:s,functionName:o});try{return await k(e,pr,"estimateGas")({data:a,to:r,...i})}catch(c){const u=i.account?Oe(i.account):void 0;throw Tt(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:u==null?void 0:u.address})}}const es="/docs/contract/decodeEventLog";function yr(e){const{abi:t,data:n,strict:r,topics:s}=e,o=r??!0,[i,...a]=s;if(!i)throw new Xi({docsPath:es});const c=t.find(h=>h.type==="event"&&i===Yn(me(h)));if(!(c&&"name"in c)||c.type!=="event")throw new Os(i,{docsPath:es});const{name:u,inputs:l}=c,f=l==null?void 0:l.some(h=>!("name"in h&&h.name));let d=f?[]:{};const p=l.filter(h=>"indexed"in h&&h.indexed);for(let h=0;h!("indexed"in h&&h.indexed));if(b.length>0){if(n&&n!=="0x")try{const h=Jt(b,n);if(h)if(f)d=[...d,...h];else for(let y=0;y0?d:void 0}}function eu({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Jt([e],t)||[])[0]}function mr({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map(s=>{var o;try{const i=yr({...s,abi:e,strict:r});return t&&!t.includes(i.eventName)?null:{...i,...s}}catch(i){let a,c;if(i instanceof Os)return null;if(i instanceof ft||i instanceof Wt){if(r)return null;a=i.abiItem.name,c=(o=i.abiItem.inputs)==null?void 0:o.some(u=>!("name"in u&&u.name))}return{...s,args:c?[]:{},eventName:a}}}).filter(Boolean)}function we(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function gr(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:o,events:i,args:a,strict:c}={}){const u=c??!1,l=i??(o?[o]:void 0);let f=[];l&&(f=[l.flatMap(b=>Nt({abi:[b],eventName:b.name,args:a}))],o&&(f=f[0]));let d;n?d=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):d=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?F(r):r,toBlock:typeof s=="bigint"?F(s):s}]});const p=d.map(b=>we(b));return l?mr({abi:l,logs:p,strict:u}):p}async function wo(e,t){const{abi:n,address:r,args:s,blockHash:o,eventName:i,fromBlock:a,toBlock:c,strict:u}=t,l=i?kt({abi:n,name:i}):void 0,f=l?void 0:n.filter(d=>d.type==="event");return k(e,gr,"getLogs")({address:r,args:s,blockHash:o,event:l,events:f,fromBlock:a,toBlock:c,strict:u})}const hn="/docs/contract/decodeFunctionResult";function rt(e){const{abi:t,args:n,functionName:r,data:s}=e;let o=t[0];if(r){const a=kt({abi:t,args:n,name:r});if(!a)throw new Ht(r,{docsPath:hn});o=a}if(o.type!=="function")throw new Ht(void 0,{docsPath:hn});if(!o.outputs)throw new Qi(o.name,{docsPath:hn});const i=Jt(o.outputs,s);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const Fn=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],vo=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],xo=[...vo,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],tu=[...vo,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],ts=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ns=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],nu=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],ru="0x82ad56cb",su="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",ou="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",iu="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";class jn extends w{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class cd extends w{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class ud extends w{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class Eo extends w{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class Qt extends w{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}const bn="/docs/contract/encodeDeployData";function wr(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(i=>"type"in i&&i.type==="constructor");if(!s)throw new Wi({docsPath:bn});if(!("inputs"in s))throw new Rr({docsPath:bn});if(!s.inputs||s.inputs.length===0)throw new Rr({docsPath:bn});const o=Ct(s.inputs,n);return _e([r,o])}function st({blockNumber:e,chain:t,contract:n}){var s;const r=(s=t==null?void 0:t.contracts)==null?void 0:s[n];if(!r)throw new jn({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new jn({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function au(e,{docsPath:t,...n}){const r=(()=>{const s=eo(e,n);return s instanceof or?e:s})();return new Xs(r,{docsPath:t,...n})}const pn=new Map;function Po({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const o=async()=>{const l=c();i();const f=l.map(({args:d})=>d);f.length!==0&&e(f).then(d=>{var p;s&&Array.isArray(d)&&d.sort(s);for(let b=0;b{var p;for(let b=0;bpn.delete(t),a=()=>c().map(({args:l})=>l),c=()=>pn.get(t)||[],u=l=>pn.set(t,[...c(),l]);return{flush:i,async schedule(l){const f={},d=new Promise((h,y)=>{f.resolve=h,f.reject=y});return(n==null?void 0:n([...a(),l]))&&o(),c().length>0?(u({args:l,pendingPromise:f}),d):(u({args:l,pendingPromise:f}),setTimeout(o,r),d)}}}async function en(e,t){var S,j,z,ee;const{account:n=e.account,batch:r=!!((S=e.batch)!=null&&S.multicall),blockNumber:s,blockTag:o="latest",accessList:i,blobs:a,code:c,data:u,factory:l,factoryData:f,gas:d,gasPrice:p,maxFeePerBlobGas:b,maxFeePerGas:h,maxPriorityFeePerGas:y,nonce:m,to:g,value:v,stateOverride:E,...A}=t,x=n?Oe(n):void 0;if(c&&(l||f))throw new w("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&g)throw new w("Cannot provide both `code` & `to` as parameters.");const B=c&&u,P=l&&f&&g&&u,T=B||P,C=B?lu({code:c,data:u}):P?fu({data:u,factory:l,factoryData:f,to:g}):u;try{ar(t);const $=(s?F(s):void 0)||o,N=no(E),R=(ee=(z=(j=e.chain)==null?void 0:j.formatters)==null?void 0:z.transactionRequest)==null?void 0:ee.format,L=(R||ir)({...to(A,{format:R}),from:x==null?void 0:x.address,accessList:i,blobs:a,data:C,gas:d,gasPrice:p,maxFeePerBlobGas:b,maxFeePerGas:h,maxPriorityFeePerGas:y,nonce:m,to:T?void 0:g,value:v});if(r&&cu({request:L})&&!N)try{return await uu(e,{...L,blockNumber:s,blockTag:o})}catch(V){if(!(V instanceof Eo)&&!(V instanceof jn))throw V}const W=await e.request({method:"eth_call",params:N?[L,$,N]:[L,$]});return W==="0x"?{data:void 0}:{data:W}}catch(I){const $=du(I),{offchainLookup:N,offchainLookupSignature:R}=await oi(()=>import("./ccip.B3nTU6BT.js"),[],import.meta.url);if(e.ccipRead!==!1&&($==null?void 0:$.slice(0,10))===R&&g)return{data:await N(e,{data:$,to:g})};throw T&&($==null?void 0:$.slice(0,10))==="0x101bb98d"?new Ac({factory:l}):au(I,{...t,account:x,chain:e.chain})}}function cu({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(ru)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function uu(e,t){var h;const{batchSize:n=1024,wait:r=0}=typeof((h=e.batch)==null?void 0:h.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:o="latest",data:i,multicallAddress:a,to:c}=t;let u=a;if(!u){if(!e.chain)throw new Eo;u=st({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=(s?F(s):void 0)||o,{schedule:d}=Po({id:`${e.uid}.${f}`,wait:r,shouldSplitBatch(y){return y.reduce((g,{data:v})=>g+(v.length-2),0)>n*2},fn:async y=>{const m=y.map(E=>({allowFailure:!0,callData:E.data,target:E.to})),g=De({abi:Fn,args:[m],functionName:"aggregate3"}),v=await e.request({method:"eth_call",params:[{data:g,to:u},f]});return rt({abi:Fn,args:[m],functionName:"aggregate3",data:v||"0x"})}}),[{returnData:p,success:b}]=await d({data:i,to:c});if(!b)throw new sr({data:p});return p==="0x"?{data:void 0}:{data:p}}function lu(e){const{code:t,data:n}=e;return wr({abi:As(["constructor(bytes, bytes)"]),bytecode:su,args:[t,n]})}function fu(e){const{data:t,factory:n,factoryData:r,to:s}=e;return wr({abi:As(["constructor(address, bytes, address, bytes)"]),bytecode:ou,args:[s,t,n,r]})}function du(e){var n;if(!(e instanceof w))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function ve(e,t){const{abi:n,address:r,args:s,functionName:o,...i}=t,a=De({abi:n,args:s,functionName:o});try{const{data:c}=await k(e,en,"call")({...i,data:a,to:r});return rt({abi:n,args:s,functionName:o,data:c||"0x"})}catch(c){throw Tt(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:o})}}async function hu(e,t){const{abi:n,address:r,args:s,dataSuffix:o,functionName:i,...a}=t,c=a.account?Oe(a.account):e.account,u=De({abi:n,args:s,functionName:i});try{const{data:l}=await k(e,en,"call")({batch:!1,data:`${u}${o?o.replace("0x",""):""}`,to:r,...a,account:c}),f=rt({abi:n,args:s,functionName:i,data:l||"0x"}),d=n.filter(p=>"name"in p&&p.name===t.functionName);return{result:f,request:{abi:d,address:r,args:s,dataSuffix:o,functionName:i,...a,account:c}}}catch(l){throw Tt(l,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c==null?void 0:c.address})}}const yn=new Map,rs=new Map;let bu=0;function Te(e,t,n){const r=++bu,s=()=>yn.get(e)||[],o=()=>{const l=s();yn.set(e,l.filter(f=>f.id!==r))},i=()=>{const l=rs.get(e);s().length===1&&l&&l(),o()},a=s();if(yn.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const c={};for(const l in t)c[l]=(...f)=>{var p,b;const d=s();if(d.length!==0)for(const h of d)(b=(p=h.fns)[l])==null||b.call(p,...f)};const u=n(c);return typeof u=="function"&&rs.set(e,u),i}async function Rn(e){return new Promise(t=>setTimeout(t,e))}function jt(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const o=()=>s=!1;return(async()=>{let a;t&&(a=await e({unpoll:o}));const c=await(n==null?void 0:n(a))??r;await Rn(c);const u=async()=>{s&&(await e({unpoll:o}),await Rn(r),u())};u()})(),o}const pu=new Map,yu=new Map;function mu(e){const t=(s,o)=>({clear:()=>o.delete(s),get:()=>o.get(s),set:i=>o.set(s,i)}),n=t(e,pu),r=t(e,yu);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function gu(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=mu(t),s=r.response.get();if(s&&n>0&&new Date().getTime()-s.created.getTime()`blockNumber.${e}`;async function Rt(e,{cacheTime:t=e.cacheTime}={}){const n=await gu(()=>e.request({method:"eth_blockNumber"}),{cacheKey:wu(e.uid),cacheTime:t});return BigInt(n)}async function tn(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(o=>we(o));return!("abi"in t)||!t.abi?s:mr({abi:t.abi,logs:s,strict:n})}async function nn(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function vu(e,t){const{abi:n,address:r,args:s,batch:o=!0,eventName:i,fromBlock:a,onError:c,onLogs:u,poll:l,pollingInterval:f=e.pollingInterval,strict:d}=t;return(typeof l<"u"?l:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const y=d??!1,m=Z(["watchContractEvent",r,s,o,e.uid,i,f,y,a]);return Te(m,{onLogs:u,onError:c},g=>{let v;a!==void 0&&(v=a-1n);let E,A=!1;const x=jt(async()=>{var B;if(!A){try{E=await k(e,qs,"createContractEventFilter")({abi:n,address:r,args:s,eventName:i,strict:y,fromBlock:a})}catch{}A=!0;return}try{let P;if(E)P=await k(e,tn,"getFilterChanges")({filter:E});else{const T=await k(e,Rt,"getBlockNumber")({});v&&v!==T?P=await k(e,wo,"getContractEvents")({abi:n,address:r,args:s,eventName:i,fromBlock:v+1n,toBlock:T,strict:y}):P=[],v=T}if(P.length===0)return;if(o)g.onLogs(P);else for(const T of P)g.onLogs([T])}catch(P){E&&P instanceof Me&&(A=!1),(B=g.onError)==null||B.call(g,P)}},{emitOnBegin:!0,interval:f});return async()=>{E&&await k(e,nn,"uninstallFilter")({filter:E}),x()}})})():(()=>{const y=d??!1,m=Z(["watchContractEvent",r,s,o,e.uid,i,f,y]);let g=!0,v=()=>g=!1;return Te(m,{onLogs:u,onError:c},E=>((async()=>{try{const A=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(T=>T.config.type==="webSocket");return P?P.value:e.transport}return e.transport})(),x=i?Nt({abi:n,eventName:i,args:s}):[],{unsubscribe:B}=await A.subscribe({params:["logs",{address:r,topics:x}],onData(P){var C;if(!g)return;const T=P.result;try{const{eventName:S,args:j}=yr({abi:n,data:T.data,topics:T.topics,strict:d}),z=we(T,{args:j,eventName:S});E.onLogs([z])}catch(S){let j,z;if(S instanceof ft||S instanceof Wt){if(d)return;j=S.abiItem.name,z=(C=S.abiItem.inputs)==null?void 0:C.some(I=>!("name"in I&&I.name))}const ee=we(T,{args:z?[]:{},eventName:j});E.onLogs([ee])}},onError(P){var T;(T=E.onError)==null||T.call(E,P)}});v=B,g||v()}catch(A){c==null||c(A)}})(),()=>v()))})()}async function xu(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}class Eu extends w{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip712DomainNotFoundError"})}}async function Pu(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[o,i,a,c,u,l,f]=await k(e,ve,"readContract")({abi:Bu,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:i,version:a,chainId:Number(c),verifyingContract:u,salt:l},extensions:f,fields:o}}catch(o){const i=o;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new Eu({address:n}):i}}const Bu=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}],zn=256;let Ut=zn,_t;function Bo(e=11){if(!_t||Ut+e>zn*2){_t="",Ut=0;for(let t=0;t{const g=m(y);for(const E in b)delete g[E];const v={...y,...g};return Object.assign(v,{extend:h(v)})}}return Object.assign(b,{extend:h(b)})}const Dt=new Kn(8192);function Au(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Dt.get(n))return Dt.get(n);const r=e().finally(()=>Dt.delete(n));return Dt.set(n,r),r}function Mn(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,o)=>{const i=async({count:a=0}={})=>{const c=async({error:u})=>{const l=typeof t=="function"?t({count:a,error:u}):t;l&&await Rn(l),i({count:a+1})};try{const u=await e();s(u)}catch(u){if(a{const{dedupe:s=!1,retryDelay:o=150,retryCount:i=3,uid:a}={...t,...r},c=s?Y(qn(`${a}.${Z(n)}`)):void 0;return Au(()=>Mn(async()=>{try{return await e(n)}catch(u){const l=u;switch(l.code){case bt.code:throw new bt(l);case pt.code:throw new pt(l);case yt.code:throw new yt(l);case mt.code:throw new mt(l);case ze.code:throw new ze(l);case Me.code:throw new Me(l);case gt.code:throw new gt(l);case wt.code:throw new wt(l);case vt.code:throw new vt(l);case xt.code:throw new xt(l);case Je.code:throw new Je(l);case Et.code:throw new Et(l);case Ye.code:throw new Ye(l);case Pt.code:throw new Pt(l);case Bt.code:throw new Bt(l);case It.code:throw new It(l);case At.code:throw new At(l);case $t.code:throw new $t(l);case 5e3:throw new Ye(l);default:throw u instanceof w?u:new Tc(l)}}},{delay:({count:u,error:l})=>{var f;if(l&&l instanceof lt){const d=(f=l==null?void 0:l.headers)==null?void 0:f.get("Retry-After");if(d!=null&&d.match(/\d/))return Number.parseInt(d)*1e3}return~~(1<Tu(u)}),{enabled:s,id:c})}}function Tu(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Je.code||e.code===ze.code:e instanceof lt&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function Su({key:e,name:t,request:n,retryCount:r=3,retryDelay:s=150,timeout:o,type:i},a){const c=Bo();return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:s,timeout:o,type:i},request:$u(n,{retryCount:r,retryDelay:s,uid:c}),value:a}}class Ou extends w{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function Cu(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,o)=>{(async()=>{let i;try{const a=new AbortController;n>0&&(i=setTimeout(()=>{r?a.abort():o(t)},n)),s(await e({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&o(t),o(a)}finally{clearTimeout(i)}})()})}function ku(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ss=ku();function Nu(e,t={}){return{async request(n){var f;const{body:r,onRequest:s=t.onRequest,onResponse:o=t.onResponse,timeout:i=t.timeout??1e4}=n,a={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:u,signal:l}=a;try{const d=await Cu(async({signal:b})=>{const h={...a,body:Array.isArray(r)?Z(r.map(g=>({jsonrpc:"2.0",id:g.id??ss.take(),...g}))):Z({jsonrpc:"2.0",id:r.id??ss.take(),...r}),headers:{...c,"Content-Type":"application/json"},method:u||"POST",signal:l||(i>0?b:null)},y=new Request(e,h);return s&&await s(y),await fetch(e,h)},{errorInstance:new Kr({body:r,url:e}),timeout:i,signal:!0});o&&await o(d);let p;if((f=d.headers.get("Content-Type"))!=null&&f.startsWith("application/json")?p=await d.json():(p=await d.text(),p=JSON.parse(p||"{}")),!d.ok)throw new lt({body:r,details:Z(p.error)||d.statusText,headers:d.headers,status:d.status,url:e});return p}catch(d){throw d instanceof lt||d instanceof Kr?d:new lt({body:r,details:d.message,url:e})}}}}function Fu(e,t={}){const{batch:n,fetchOptions:r,key:s="http",name:o="HTTP JSON-RPC",onFetchRequest:i,onFetchResponse:a,retryDelay:c}=t;return({chain:u,retryCount:l,timeout:f})=>{const{batchSize:d=1e3,wait:p=0}=typeof n=="object"?n:{},b=t.retryCount??l,h=f??t.timeout??1e4,y=e||(u==null?void 0:u.rpcUrls.default.http[0]);if(!y)throw new Ou;const m=Nu(y,{fetchOptions:r,onRequest:i,onResponse:a,timeout:h});return Su({key:s,name:o,async request({method:g,params:v}){const E={method:g,params:v},{schedule:A}=Po({id:y,wait:p,shouldSplitBatch(T){return T.length>d},fn:T=>m.request({body:T}),sort:(T,C)=>T.id-C.id}),x=async T=>n?A(T):[await m.request({body:T})],[{error:B,result:P}]=await x(E);if(B)throw new Qs({body:E,error:B,url:y});return P},retryCount:b,retryDelay:c,timeout:h,type:"http"},{fetchOptions:r,url:y})}}function vr(e,t){var r,s,o,i,a,c;if(!(e instanceof w))return!1;const n=e.walk(u=>u instanceof Bn);return n instanceof Bn?!!(((r=n.data)==null?void 0:r.errorName)==="ResolverNotFound"||((s=n.data)==null?void 0:s.errorName)==="ResolverWildcardNotSupported"||((o=n.data)==null?void 0:o.errorName)==="ResolverNotContract"||((i=n.data)==null?void 0:i.errorName)==="ResolverError"||((a=n.data)==null?void 0:a.errorName)==="HttpError"||(c=n.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&n.reason===Vs[50]):!1}function Io(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return fe(t)?t:null}function Gt(e){let t=new Uint8Array(32).fill(0);if(!e)return D(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=Io(n[r]),o=s?ce(s):Y(pe(n[r]),"bytes");t=Y(ge([t,o]),"bytes")}return D(t)}function ju(e){return`[${e.slice(2)}]`}function Ru(e){const t=new Uint8Array(32).fill(0);return e?Io(e)||Y(pe(e)):D(t)}function rn(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(pe(t).byteLength+2);let r=0;const s=t.split(".");for(let o=0;o255&&(i=pe(ju(Ru(s[o])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function zu(e,{blockNumber:t,blockTag:n,coinType:r,name:s,gatewayUrls:o,strict:i,universalResolverAddress:a}){let c=a;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=st({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const u=De({abi:ns,functionName:"addr",...r!=null?{args:[Gt(s),BigInt(r)]}:{args:[Gt(s)]}}),l={address:c,abi:xo,functionName:"resolve",args:[O(rn(s)),u],blockNumber:t,blockTag:n},f=k(e,ve,"readContract"),d=o?await f({...l,args:[...l.args,o]}):await f(l);if(d[0]==="0x")return null;const p=rt({abi:ns,args:r!=null?[Gt(s),BigInt(r)]:void 0,functionName:"addr",data:d[0]});return p==="0x"||Re(p)==="0x00"?null:p}catch(u){if(i)throw u;if(vr(u,"resolve"))return null;throw u}}class Mu extends w{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class ct extends w{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class xr extends w{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class Lu extends w{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const Uu=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,_u=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,Du=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Gu=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Hu(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function os(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Ao({uri:e,gatewayUrls:t}){const n=Du.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=os(t==null?void 0:t.ipfs,"https://ipfs.io"),s=os(t==null?void 0:t.arweave,"https://arweave.net"),o=e.match(Uu),{protocol:i,subpath:a,target:c,subtarget:u=""}=(o==null?void 0:o.groups)||{},l=i==="ipns:/"||a==="ipns/",f=i==="ipfs:/"||a==="ipfs/"||_u.test(e);if(e.startsWith("http")&&!l&&!f){let p=e;return t!=null&&t.arweave&&(p=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((l||f)&&c)return{uri:`${r}/${l?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let d=e.replace(Gu,"");if(d.startsWith("s.json());return await Er({gatewayUrls:e,uri:$o(n)})}catch{throw new xr({uri:t})}}async function Er({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Ao({uri:t,gatewayUrls:e});if(r||await Hu(n))return n;throw new xr({uri:t})}function Vu(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[o,i]=n.split(":"),[a,c]=r.split(":");if(!o||o.toLowerCase()!=="eip155")throw new ct({reason:"Only EIP-155 supported"});if(!i)throw new ct({reason:"Chain ID not found"});if(!c)throw new ct({reason:"Contract address not found"});if(!s)throw new ct({reason:"Token ID not found"});if(!a)throw new ct({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i),namespace:a.toLowerCase(),contractAddress:c,tokenID:s}}async function Zu(e,{nft:t}){if(t.namespace==="erc721")return ve(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return ve(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Lu({namespace:t.namespace})}async function Wu(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Yu(e,{gatewayUrls:t,record:n}):Er({uri:n,gatewayUrls:t})}async function Yu(e,{gatewayUrls:t,record:n}){const r=Vu(n),s=await Zu(e,{nft:r}),{uri:o,isOnChain:i,isEncoded:a}=Ao({uri:s,gatewayUrls:t});if(i&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const u=a?atob(o.replace("data:application/json;base64,","")):o,l=JSON.parse(u);return Er({uri:$o(l),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),qu({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,c)})}async function To(e,{blockNumber:t,blockTag:n,name:r,key:s,gatewayUrls:o,strict:i,universalResolverAddress:a}){let c=a;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=st({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const u={address:c,abi:xo,functionName:"resolve",args:[O(rn(r)),De({abi:ts,functionName:"text",args:[Gt(r),s]})],blockNumber:t,blockTag:n},l=k(e,ve,"readContract"),f=o?await l({...u,args:[...u.args,o]}):await l(u);if(f[0]==="0x")return null;const d=rt({abi:ts,functionName:"text",data:f[0]});return d===""?null:d}catch(u){if(i)throw u;if(vr(u,"resolve"))return null;throw u}}async function Ku(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:o,strict:i,universalResolverAddress:a}){const c=await k(e,To,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:a,gatewayUrls:o,strict:i});if(!c)return null;try{return await Wu(e,{record:c,gatewayUrls:r})}catch{return null}}async function Ju(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:s,strict:o,universalResolverAddress:i}){let a=i;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=st({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const u={address:a,abi:tu,functionName:"reverse",args:[O(rn(c))],blockNumber:n,blockTag:r},l=k(e,ve,"readContract"),[f,d]=s?await l({...u,args:[...u.args,s]}):await l(u);return t.toLowerCase()!==d.toLowerCase()?null:f}catch(u){if(o)throw u;if(vr(u,"reverse"))return null;throw u}}async function Xu(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:s}){let o=s;if(!o){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=st({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[i]=await k(e,ve,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[O(rn(r))],blockNumber:t,blockTag:n});return i}async function Qu(e){const t=Kt(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function So(e,{address:t,args:n,event:r,events:s,fromBlock:o,strict:i,toBlock:a}={}){const c=s??(r?[r]:void 0),u=Kt(e,{method:"eth_newFilter"});let l=[];c&&(l=[c.flatMap(d=>Nt({abi:[d],eventName:d.name,args:n}))],r&&(l=l[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof o=="bigint"?F(o):o,toBlock:typeof a=="bigint"?F(a):a,...l.length?{topics:l}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:o,id:f,request:u(f),strict:!!i,toBlock:a,type:"event"}}async function Oo(e){const t=Kt(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function el(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?F(n):void 0,o=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(o)}async function tl(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function nl(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?F(n):void 0;let o;return t?o=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):o=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),de(o)}async function is(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?F(n):void 0,o=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:!!s});if(o!=="0x")return o}function rl(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function sl(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const o=n?F(n):void 0,i=await e.request({method:"eth_feeHistory",params:[F(t),o||r,s]},{dedupe:!!o});return rl(i)}async function ol(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(o=>we(o));return t.abi?mr({abi:t.abi,logs:s,strict:n}):s}function il(e,t){if(!q(e,{strict:!1}))throw new K({address:e});if(!q(t,{strict:!1}))throw new K({address:t});return e.toLowerCase()===t.toLowerCase()}function zt(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const al=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,cl=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function ul(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:bl({domain:t}),...e.types};hl({domain:t,message:n,primaryType:r,types:s});const o=["0x1901"];return t&&o.push(ll({domain:t,types:s})),r!=="EIP712Domain"&&o.push(Co({data:n,primaryType:r,types:s})),Y(ge(o))}function ll({domain:e,types:t}){return Co({data:e,primaryType:"EIP712Domain",types:t})}function Co({data:e,primaryType:t,types:n}){const r=ko({data:e,primaryType:t,types:n});return Y(r)}function ko({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[fl({primaryType:t,types:n})];for(const o of n[t]){const[i,a]=Fo({types:n,name:o.name,type:o.type,value:e[o.name]});r.push(i),s.push(a)}return Ct(r,s)}function fl({primaryType:e,types:t}){const n=O(dl({primaryType:e,types:t}));return Y(n)}function dl({primaryType:e,types:t}){let n="";const r=No({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const o of s)n+=`${o}(${t[o].map(({name:i,type:a})=>`${a} ${i}`).join(",")})`;return n}function No({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r==null?void 0:r[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const o of t[s])No({primaryType:o.type,types:t},n);return n}function Fo({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},Y(ko({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},Y(r)];if(n==="string")return[{type:"bytes32"},Y(O(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),o=r.map(i=>Fo({name:t,type:s,types:e,value:i}));return[{type:"bytes32"},Y(Ct(o.map(([i])=>i),o.map(([,i])=>i)))]}return[{type:n},r]}function ld(e){const{domain:t,message:n,primaryType:r,types:s}=e,o=(c,u)=>{const l={...u};for(const f of c){const{name:d,type:p}=f;p==="address"&&(l[d]=l[d].toLowerCase())}return l},i=s.EIP712Domain?t?o(s.EIP712Domain,t):{}:{},a=(()=>{if(r!=="EIP712Domain")return o(s[r],n)})();return Z({domain:i,message:a,primaryType:r,types:s})}function hl(e){const{domain:t,message:n,primaryType:r,types:s}=e,o=(i,a)=>{for(const c of i){const{name:u,type:l}=c,f=a[u],d=l.match(cl);if(d&&(typeof f=="number"||typeof f=="bigint")){const[h,y,m]=d;F(f,{signed:y==="int",size:Number.parseInt(m)/8})}if(l==="address"&&typeof f=="string"&&!q(f))throw new K({address:f});const p=l.match(al);if(p){const[h,y]=p;if(y&&_(f)!==Number.parseInt(y))throw new ta({expectedSize:Number.parseInt(y),givenSize:_(f)})}const b=s[l];b&&o(b,f)}};s.EIP712Domain&&t&&o(s.EIP712Domain,t),r!=="EIP712Domain"&&o(s[r],n)}function bl({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},typeof(e==null?void 0:e.chainId)=="number"&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Xe(e,t="hex"){const n=jo(e),r=nr(new Uint8Array(n.length));return n.encode(r),t==="hex"?D(r.bytes):r.bytes}function jo(e){return Array.isArray(e)?pl(e.map(t=>jo(t))):yl(e)}function pl(e){const t=e.reduce((s,o)=>s+o.length,0),n=Ro(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:o}of e)o(s)}}}function yl(e){const t=typeof e=="string"?re(e):e,n=Ro(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Ro(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new w("Length is too large.")}const ml={"0x0":"reverted","0x1":"success"};function zo(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>we(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?de(e.transactionIndex):null,status:e.status?ml[e.status]:null,type:e.type?so[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const gl=Xt("transactionReceipt",zo),wl=`Ethereum Signed Message: +`;function Mo(e,t){const n=typeof e=="string"?pe(e):e.raw instanceof Uint8Array?e.raw:ce(e.raw),r=pe(`${wl}${n.length}`);return Y(ge([r,n]),t)}function vl(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new bo;for(const n of t){const r=_(n),s=de(dt(n,0,1));if(r!==32)throw new Yc({hash:n,size:r});if(s!==ho)throw new Kc({hash:n,version:s})}}Lo(e)}function Lo(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new Qt({chainId:t});if(s&&!q(s))throw new K({address:s});if(r&&r>2n**256n-1n)throw new Le({maxFeePerGas:r});if(n&&r&&n>r)throw new St({maxFeePerGas:r,maxPriorityFeePerGas:n})}function xl(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:o}=e;if(t<=0)throw new Qt({chainId:t});if(o&&!q(o))throw new K({address:o});if(n||s)throw new w("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new Le({maxFeePerGas:r})}function El(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:o,accessList:i}=e;if(o&&!q(o))throw new K({address:o});if(typeof t<"u"&&t<=0)throw new Qt({chainId:t});if(n||s)throw new w("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new Le({maxFeePerGas:r});if(i)throw new w("`accessList` is not a valid Legacy Transaction attribute.")}function Pr(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n"u"||typeof p>"u")){const v=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(x=>D(x)),E=e.kzg,A=dr({blobs:v,kzg:E});if(typeof d>"u"&&(d=uo({commitments:A})),typeof p>"u"){const x=hr({blobs:v,commitments:A,kzg:E});p=po({blobs:v,commitments:A,proofs:x})}}const b=Pr(l),h=[O(n),s?O(s):"0x",u?O(u):"0x",c?O(c):"0x",r?O(r):"0x",o??"0x",i?O(i):"0x",f??"0x",b,a?O(a):"0x",d??[],...Br(e,t)],y=[],m=[],g=[];if(p)for(let v=0;v{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const f=27n+(t.v===27n?0n:1n);if(t.v!==f)throw new xc({v:t.v});return f})();u=[...u,O(l),t.r,t.s]}else n>0&&(u=[...u,O(n),"0x","0x"]);return Xe(u)}function Br(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const o=Re(n.r),i=Re(n.s);return[typeof s=="number"?s?O(1):"0x":r===0n?"0x":r===1n?O(1):r===27n?"0x":O(1),o==="0x00"?"0x":o,i==="0x00"?"0x":i]}function Tl(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function Sl(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?de(e.nonce):void 0,storageProof:e.storageProof?Tl(e.storageProof):void 0}}async function Ol(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const o=r??"latest",i=n!==void 0?F(n):void 0,a=await e.request({method:"eth_getProof",params:[t,s,i||o]});return Sl(a)}async function Cl(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const o=n!==void 0?F(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,o||r]})}async function Ir(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:o}){var l,f,d;const i=r||"latest",a=n!==void 0?F(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,F(o)]},{dedupe:!0}):(a||i)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||i,F(o)]},{dedupe:!!a})),!c)throw new Ks({blockHash:t,blockNumber:n,blockTag:i,hash:s,index:o});return(((d=(f=(l=e.chain)==null?void 0:l.formatters)==null?void 0:f.transaction)==null?void 0:d.format)||ur)(c)}async function kl(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([k(e,Rt,"getBlockNumber")({}),t?k(e,Ir,"getTransaction")({hash:t}):void 0]),o=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return o?r-o+1n:0n}async function Ln(e,{hash:t}){var s,o,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Js({hash:t});return(((i=(o=(s=e.chain)==null?void 0:s.formatters)==null?void 0:o.transactionReceipt)==null?void 0:i.format)||zo)(n)}async function Nl(e,t){var y;const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:o,multicallAddress:i,stateOverride:a}=t,c=t.contracts,u=r??(typeof((y=e.batch)==null?void 0:y.multicall)=="object"&&e.batch.multicall.batchSize||1024);let l=i;if(!l){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");l=st({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=[[]];let d=0,p=0;for(let m=0;m0&&p>u&&f[d].length>0&&(d++,p=(x.length-2)/2,f[d]=[]),f[d]=[...f[d],{allowFailure:!0,callData:x,target:v}]}catch(x){const B=Tt(x,{abi:g,address:v,args:E,docsPath:"/docs/contract/multicall",functionName:A});if(!n)throw B;f[d]=[...f[d],{allowFailure:!0,callData:"0x",target:v}]}}const b=await Promise.allSettled(f.map(m=>k(e,ve,"readContract")({abi:Fn,address:l,args:[m],blockNumber:s,blockTag:o,functionName:"aggregate3",stateOverride:a}))),h=[];for(let m=0;me instanceof Uint8Array,jl=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Qe(e){if(!on(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+s.length,0));let n=0;return e.forEach(r=>{if(!on(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function Do(e,t){if(e.length!==t.length)return!1;for(let n=0;nUo;e>>=sn,t+=1);return t}function Ll(e,t){return e>>BigInt(t)&sn}const Ul=(e,t,n)=>e|(n?sn:Uo)<(Fl<new Uint8Array(e),as=e=>Uint8Array.from(e);function Go(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=mn(e),s=mn(e),o=0;const i=()=>{r.fill(1),s.fill(0),o=0},a=(...f)=>n(s,r,...f),c=(f=mn())=>{s=a(as([0]),f),r=a(),f.length!==0&&(s=a(as([1]),f),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{i(),c(f);let p;for(;!(p=d(u()));)c();return i(),p}}const _l={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Mt(e,t,n={}){const r=(s,o,i)=>{const a=_l[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);const c=e[s];if(!(i&&c===void 0)&&!a(c,e))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${o}`)};for(const[s,o]of Object.entries(t))r(s,o,!1);for(const[s,o]of Object.entries(n))r(s,o,!0);return e}const Dl=Object.freeze(Object.defineProperty({__proto__:null,bitGet:Ll,bitLen:Ml,bitMask:Sr,bitSet:Ul,bytesToHex:Qe,bytesToNumberBE:je,bytesToNumberLE:$r,concatBytes:Ot,createHmacDrbg:Go,ensureBytes:ie,equalBytes:Do,hexToBytes:et,hexToNumber:Ar,numberToBytesBE:tt,numberToBytesLE:Tr,numberToHexUnpadded:_o,numberToVarBytesBE:Rl,utf8ToBytes:zl,validateObject:Mt},Symbol.toStringTag,{value:"Module"}));function Gl(e,t){const n=fe(e)?ce(e):e,r=fe(t)?ce(t):t;return Do(n,r)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const H=BigInt(0),U=BigInt(1),Ne=BigInt(2),Hl=BigInt(3),Un=BigInt(4),cs=BigInt(5),us=BigInt(8);BigInt(9);BigInt(16);function J(e,t){const n=e%t;return n>=H?n:t+n}function ql(e,t,n){if(n<=H||t 0");if(n===U)return H;let r=U;for(;t>H;)t&U&&(r=r*e%n),e=e*e%n,t>>=U;return r}function te(e,t,n){let r=e;for(;t-- >H;)r*=r,r%=n;return r}function _n(e,t){if(e===H||t<=H)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=J(e,t),r=t,s=H,o=U;for(;n!==H;){const a=r/n,c=r%n,u=s-o*a;r=n,n=c,s=o,o=u}if(r!==U)throw new Error("invert: does not exist");return J(s,t)}function Vl(e){const t=(e-U)/Ne;let n,r,s;for(n=e-U,r=0;n%Ne===H;n/=Ne,r++);for(s=Ne;s(r[s]="function",r),t);return Mt(e,n)}function Kl(e,t,n){if(n 0");if(n===H)return e.ONE;if(n===U)return t;let r=e.ONE,s=t;for(;n>H;)n&U&&(r=e.mul(r,s)),s=e.sqr(s),n>>=U;return r}function Jl(e,t){const n=new Array(t.length),r=t.reduce((o,i,a)=>e.is0(i)?o:(n[a]=o,e.mul(o,i)),e.ONE),s=e.inv(r);return t.reduceRight((o,i,a)=>e.is0(i)?o:(n[a]=e.mul(o,n[a]),e.mul(o,i)),s),n}function Ho(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Xl(e,t,n=!1,r={}){if(e<=H)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=Ho(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const i=Zl(e),a=Object.freeze({ORDER:e,BITS:s,BYTES:o,MASK:Sr(s),ZERO:H,ONE:U,create:c=>J(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return H<=c&&cc===H,isOdd:c=>(c&U)===U,neg:c=>J(-c,e),eql:(c,u)=>c===u,sqr:c=>J(c*c,e),add:(c,u)=>J(c+u,e),sub:(c,u)=>J(c-u,e),mul:(c,u)=>J(c*u,e),pow:(c,u)=>Kl(a,c,u),div:(c,u)=>J(c*_n(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>_n(c,e),sqrt:r.sqrt||(c=>i(a,c)),invertBatch:c=>Jl(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>n?Tr(c,o):tt(c,o),fromBytes:c=>{if(c.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);return n?$r(c):je(c)}});return Object.freeze(a)}function qo(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Vo(e){const t=qo(e);return t+Math.ceil(t/2)}function Ql(e,t,n=!1){const r=e.length,s=qo(t),o=Vo(t);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const i=n?je(e):$r(e),a=J(i,t-U)+U;return n?Tr(a,s):tt(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ef=BigInt(0),gn=BigInt(1);function tf(e,t){const n=(s,o)=>{const i=o.negate();return s?i:o},r=s=>{const o=Math.ceil(t/s)+1,i=2**(s-1);return{windows:o,windowSize:i}};return{constTimeNegate:n,unsafeLadder(s,o){let i=e.ZERO,a=s;for(;o>ef;)o&gn&&(i=i.add(a)),a=a.double(),o>>=gn;return i},precomputeWindow(s,o){const{windows:i,windowSize:a}=r(o),c=[];let u=s,l=u;for(let f=0;f>=p,y>c&&(y-=d,i+=gn);const m=h,g=h+Math.abs(y)-1,v=b%2!==0,E=y<0;y===0?l=l.add(n(v,o[m])):u=u.add(n(E,o[g]))}return{p:u,f:l}},wNAFCached(s,o,i,a){const c=s._WINDOW_SIZE||1;let u=o.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&o.set(s,a(u))),this.wNAF(c,u,i)}}}function Zo(e){return Yl(e.Fp),Mt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ho(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function nf(e){const t=Zo(e);Mt(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:rf,hexToBytes:sf}=Dl,Fe={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Fe;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:rf(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Fe,n=typeof e=="string"?sf(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:o}=Fe._parseInt(n.subarray(2)),{d:i,l:a}=Fe._parseInt(o);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:i}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const l=u.toString(16);return l.length&1?`0${l}`:l},r=t(n(e.s)),s=t(n(e.r)),o=r.length/2,i=s.length/2,a=n(o),c=n(i);return`30${n(i+o+4)}02${c}${s}02${a}${r}`}},be=BigInt(0),ne=BigInt(1);BigInt(2);const ls=BigInt(3);BigInt(4);function of(e){const t=nf(e),{Fp:n}=t,r=t.toBytes||((b,h,y)=>{const m=h.toAffine();return Ot(Uint8Array.from([4]),n.toBytes(m.x),n.toBytes(m.y))}),s=t.fromBytes||(b=>{const h=b.subarray(1),y=n.fromBytes(h.subarray(0,n.BYTES)),m=n.fromBytes(h.subarray(n.BYTES,2*n.BYTES));return{x:y,y:m}});function o(b){const{a:h,b:y}=t,m=n.sqr(b),g=n.mul(m,b);return n.add(n.add(g,n.mul(b,h)),y)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function i(b){return typeof b=="bigint"&&ben.eql(v,n.ZERO);return g(y)&&g(m)?f.ZERO:new f(y,m,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(h){const y=n.invertBatch(h.map(m=>m.pz));return h.map((m,g)=>m.toAffine(y[g])).map(f.fromAffine)}static fromHex(h){const y=f.fromAffine(s(ie("pointHex",h)));return y.assertValidity(),y}static fromPrivateKey(h){return f.BASE.multiply(c(h))}_setWindowSize(h){this._WINDOW_SIZE=h,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:h,y}=this.toAffine();if(!n.isValid(h)||!n.isValid(y))throw new Error("bad point: x or y not FE");const m=n.sqr(y),g=o(h);if(!n.eql(m,g))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:h}=this.toAffine();if(n.isOdd)return!n.isOdd(h);throw new Error("Field doesn't support isOdd")}equals(h){l(h);const{px:y,py:m,pz:g}=this,{px:v,py:E,pz:A}=h,x=n.eql(n.mul(y,A),n.mul(v,g)),B=n.eql(n.mul(m,A),n.mul(E,g));return x&&B}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:h,b:y}=t,m=n.mul(y,ls),{px:g,py:v,pz:E}=this;let A=n.ZERO,x=n.ZERO,B=n.ZERO,P=n.mul(g,g),T=n.mul(v,v),C=n.mul(E,E),S=n.mul(g,v);return S=n.add(S,S),B=n.mul(g,E),B=n.add(B,B),A=n.mul(h,B),x=n.mul(m,C),x=n.add(A,x),A=n.sub(T,x),x=n.add(T,x),x=n.mul(A,x),A=n.mul(S,A),B=n.mul(m,B),C=n.mul(h,C),S=n.sub(P,C),S=n.mul(h,S),S=n.add(S,B),B=n.add(P,P),P=n.add(B,P),P=n.add(P,C),P=n.mul(P,S),x=n.add(x,P),C=n.mul(v,E),C=n.add(C,C),P=n.mul(C,S),A=n.sub(A,P),B=n.mul(C,T),B=n.add(B,B),B=n.add(B,B),new f(A,x,B)}add(h){l(h);const{px:y,py:m,pz:g}=this,{px:v,py:E,pz:A}=h;let x=n.ZERO,B=n.ZERO,P=n.ZERO;const T=t.a,C=n.mul(t.b,ls);let S=n.mul(y,v),j=n.mul(m,E),z=n.mul(g,A),ee=n.add(y,m),I=n.add(v,E);ee=n.mul(ee,I),I=n.add(S,j),ee=n.sub(ee,I),I=n.add(y,g);let $=n.add(v,A);return I=n.mul(I,$),$=n.add(S,z),I=n.sub(I,$),$=n.add(m,g),x=n.add(E,A),$=n.mul($,x),x=n.add(j,z),$=n.sub($,x),P=n.mul(T,I),x=n.mul(C,z),P=n.add(x,P),x=n.sub(j,P),P=n.add(j,P),B=n.mul(x,P),j=n.add(S,S),j=n.add(j,S),z=n.mul(T,z),I=n.mul(C,I),j=n.add(j,z),z=n.sub(S,z),z=n.mul(T,z),I=n.add(I,z),S=n.mul(j,I),B=n.add(B,S),S=n.mul($,I),x=n.mul(ee,x),x=n.sub(x,S),S=n.mul(ee,j),P=n.mul($,P),P=n.add(P,S),new f(x,B,P)}subtract(h){return this.add(h.negate())}is0(){return this.equals(f.ZERO)}wNAF(h){return p.wNAFCached(this,u,h,y=>{const m=n.invertBatch(y.map(g=>g.pz));return y.map((g,v)=>g.toAffine(m[v])).map(f.fromAffine)})}multiplyUnsafe(h){const y=f.ZERO;if(h===be)return y;if(a(h),h===ne)return this;const{endo:m}=t;if(!m)return p.unsafeLadder(this,h);let{k1neg:g,k1:v,k2neg:E,k2:A}=m.splitScalar(h),x=y,B=y,P=this;for(;v>be||A>be;)v&ne&&(x=x.add(P)),A&ne&&(B=B.add(P)),P=P.double(),v>>=ne,A>>=ne;return g&&(x=x.negate()),E&&(B=B.negate()),B=new f(n.mul(B.px,m.beta),B.py,B.pz),x.add(B)}multiply(h){a(h);let y=h,m,g;const{endo:v}=t;if(v){const{k1neg:E,k1:A,k2neg:x,k2:B}=v.splitScalar(y);let{p:P,f:T}=this.wNAF(A),{p:C,f:S}=this.wNAF(B);P=p.constTimeNegate(E,P),C=p.constTimeNegate(x,C),C=new f(n.mul(C.px,v.beta),C.py,C.pz),m=P.add(C),g=T.add(S)}else{const{p:E,f:A}=this.wNAF(y);m=E,g=A}return f.normalizeZ([m,g])[0]}multiplyAndAddUnsafe(h,y,m){const g=f.BASE,v=(A,x)=>x===be||x===ne||!A.equals(g)?A.multiplyUnsafe(x):A.multiply(x),E=v(this,y).add(v(h,m));return E.is0()?void 0:E}toAffine(h){const{px:y,py:m,pz:g}=this,v=this.is0();h==null&&(h=v?n.ONE:n.inv(g));const E=n.mul(y,h),A=n.mul(m,h),x=n.mul(g,h);if(v)return{x:n.ZERO,y:n.ZERO};if(!n.eql(x,n.ONE))throw new Error("invZ was invalid");return{x:E,y:A}}isTorsionFree(){const{h,isTorsionFree:y}=t;if(h===ne)return!0;if(y)return y(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h,clearCofactor:y}=t;return h===ne?this:y?y(f,this):this.multiplyUnsafe(t.h)}toRawBytes(h=!0){return this.assertValidity(),r(f,this,h)}toHex(h=!0){return Qe(this.toRawBytes(h))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=t.nBitLength,p=tf(f,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:i}}function af(e){const t=Zo(e);return Mt(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function cf(e){const t=af(e),{Fp:n,n:r}=t,s=n.BYTES+1,o=2*n.BYTES+1;function i(I){return beQe(tt(I,t.nByteLength));function b(I){const $=r>>ne;return I>$}function h(I){return b(I)?a(-I):I}const y=(I,$,N)=>je(I.slice($,N));class m{constructor($,N,R){this.r=$,this.s=N,this.recovery=R,this.assertValidity()}static fromCompact($){const N=t.nByteLength;return $=ie("compactSignature",$,N*2),new m(y($,0,N),y($,N,2*N))}static fromDER($){const{r:N,s:R}=Fe.toSig(ie("DER",$));return new m(N,R)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit($){return new m(this.r,this.s,$)}recoverPublicKey($){const{r:N,s:R,recovery:M}=this,L=B(ie("msgHash",$));if(M==null||![0,1,2,3].includes(M))throw new Error("recovery id invalid");const W=M===2||M===3?N+t.n:N;if(W>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const V=M&1?"03":"02",xe=u.fromHex(V+p(W)),Ee=c(W),Ge=a(-L*Ee),ot=a(R*Ee),Pe=u.BASE.multiplyAndAddUnsafe(xe,Ge,ot);if(!Pe)throw new Error("point at infinify");return Pe.assertValidity(),Pe}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return et(this.toDERHex())}toDERHex(){return Fe.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return et(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const g={isValidPrivateKey(I){try{return l(I),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const I=Vo(t.n);return Ql(t.randomBytes(I),t.n)},precompute(I=8,$=u.BASE){return $._setWindowSize(I),$.multiply(BigInt(3)),$}};function v(I,$=!0){return u.fromPrivateKey(I).toRawBytes($)}function E(I){const $=I instanceof Uint8Array,N=typeof I=="string",R=($||N)&&I.length;return $?R===s||R===o:N?R===2*s||R===2*o:I instanceof u}function A(I,$,N=!0){if(E(I))throw new Error("first arg must be private key");if(!E($))throw new Error("second arg must be public key");return u.fromHex($).multiply(l(I)).toRawBytes(N)}const x=t.bits2int||function(I){const $=je(I),N=I.length*8-t.nBitLength;return N>0?$>>BigInt(N):$},B=t.bits2int_modN||function(I){return a(x(I))},P=Sr(t.nBitLength);function T(I){if(typeof I!="bigint")throw new Error("bigint expected");if(!(be<=I&&ICe in N))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:M}=t;let{lowS:L,prehash:W,extraEntropy:V}=N;L==null&&(L=!0),I=ie("msgHash",I),W&&(I=ie("prehashed msgHash",R(I)));const xe=B(I),Ee=l($),Ge=[T(Ee),T(xe)];if(V!=null){const Ce=V===!0?M(n.BYTES):V;Ge.push(ie("extraEntropy",Ce))}const ot=Ot(...Ge),Pe=xe;function an(Ce){const He=x(Ce);if(!d(He))return;const kr=c(He),qe=u.BASE.multiply(He).toAffine(),oe=a(qe.x);if(oe===be)return;const Ve=a(kr*a(Pe+oe*Ee));if(Ve===be)return;let Nr=(qe.x===oe?0:2)|Number(qe.y&ne),Fr=Ve;return L&&b(Ve)&&(Fr=h(Ve),Nr^=1),new m(oe,Fr,Nr)}return{seed:ot,k2sig:an}}const S={lowS:t.lowS,prehash:!1},j={lowS:t.lowS,prehash:!1};function z(I,$,N=S){const{seed:R,k2sig:M}=C(I,$,N),L=t;return Go(L.hash.outputLen,L.nByteLength,L.hmac)(R,M)}u.BASE._setWindowSize(8);function ee(I,$,N,R=j){var qe;const M=I;if($=ie("msgHash",$),N=ie("publicKey",N),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:L,prehash:W}=R;let V,xe;try{if(typeof M=="string"||M instanceof Uint8Array)try{V=m.fromDER(M)}catch(oe){if(!(oe instanceof Fe.Err))throw oe;V=m.fromCompact(M)}else if(typeof M=="object"&&typeof M.r=="bigint"&&typeof M.s=="bigint"){const{r:oe,s:Ve}=M;V=new m(oe,Ve)}else throw new Error("PARSE");xe=u.fromHex(N)}catch(oe){if(oe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(L&&V.hasHighS())return!1;W&&($=t.hash($));const{r:Ee,s:Ge}=V,ot=B($),Pe=c(Ge),an=a(ot*Pe),Ce=a(Ee*Pe),He=(qe=u.BASE.multiplyAndAddUnsafe(xe,an,Ce))==null?void 0:qe.toAffine();return He?a(He.x)===Ee:!1}return{CURVE:t,getPublicKey:v,getSharedSecret:A,sign:z,verify:ee,ProjectivePoint:u,Signature:m,utils:g}}class Wo extends Zn{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,ya(t);const r=Yt(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?t.create().update(r).digest():r);for(let i=0;inew Wo(e,t).update(n).digest();Yo.create=(e,t)=>new Wo(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function uf(e){return{hash:e,hmac:(t,...n)=>Yo(e,t,Aa(...n)),randomBytes:$a}}function lf(e,t){const n=r=>cf({...e,...uf(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ko=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),fs=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ff=BigInt(1),Dn=BigInt(2),ds=(e,t)=>(e+t/Dn)/t;function df(e){const t=Ko,n=BigInt(3),r=BigInt(6),s=BigInt(11),o=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,f=te(l,n,t)*l%t,d=te(f,n,t)*l%t,p=te(d,Dn,t)*u%t,b=te(p,s,t)*p%t,h=te(b,o,t)*b%t,y=te(h,a,t)*h%t,m=te(y,c,t)*y%t,g=te(m,a,t)*h%t,v=te(g,n,t)*l%t,E=te(v,i,t)*b%t,A=te(E,r,t)*u%t,x=te(A,Dn,t);if(!Gn.eql(Gn.sqr(x),e))throw new Error("Cannot find square root");return x}const Gn=Xl(Ko,void 0,void 0,{sqrt:df}),Jo=lf({a:BigInt(0),b:BigInt(7),Fp:Gn,n:fs,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=fs,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ff*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,i=BigInt("0x100000000000000000000000000000000"),a=ds(o*e,t),c=ds(-r*e,t);let u=J(e-a*n-c*s,t),l=J(-a*r-c*o,t);const f=u>i,d=l>i;if(f&&(u=t-u),d&&(l=t-l),u>i||l>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:l}}}},ao);BigInt(0);Jo.ProjectivePoint;function hf({r:e,s:t,v:n,yParity:r}){const s=(()=>{if(r===0||r===1)return r;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new Jo.Signature(G(e),G(t)).toCompactHex()}${s===0?"1b":"1c"}`}async function Or(e,{address:t,hash:n,signature:r,...s}){const o=fe(r)?r:typeof r=="object"&&"r"in r&&"s"in r?hf(r):D(r);try{const{data:i}=await k(e,en,"call")({data:wr({abi:nu,args:[t,n,o],bytecode:iu}),...s});return Gl(i??"0x0","0x1")}catch(i){if(i instanceof Xs)return!1;throw i}}async function bf(e,{address:t,message:n,signature:r,...s}){const o=Mo(n);return Or(e,{address:t,hash:o,signature:r,...s})}async function pf(e,t){const{address:n,signature:r,message:s,primaryType:o,types:i,domain:a,...c}=t,u=ul({message:s,primaryType:o,types:i,domain:a});return Or(e,{address:n,hash:u,signature:r,...c})}function Xo(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:o,pollingInterval:i=e.pollingInterval}){const a=typeof o<"u"?o:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket");let c;return a?(()=>{const f=Z(["watchBlockNumber",e.uid,t,n,i]);return Te(f,{onBlockNumber:r,onError:s},d=>jt(async()=>{var p;try{const b=await k(e,Rt,"getBlockNumber")({cacheTime:0});if(c){if(b===c)return;if(b-c>1&&n)for(let h=c+1n;hc)&&(d.onBlockNumber(b,c),c=b)}catch(b){(p=d.onError)==null||p.call(d,b)}},{emitOnBegin:t,interval:i}))})():(()=>{const f=Z(["watchBlockNumber",e.uid,t,n]);return Te(f,{onBlockNumber:r,onError:s},d=>{let p=!0,b=()=>p=!1;return(async()=>{try{const h=(()=>{if(e.transport.type==="fallback"){const m=e.transport.transports.find(g=>g.config.type==="webSocket");return m?m.value:e.transport}return e.transport})(),{unsubscribe:y}=await h.subscribe({params:["newHeads"],onData(m){var v;if(!p)return;const g=G((v=m.result)==null?void 0:v.number);d.onBlockNumber(g,c),c=g},onError(m){var g;(g=d.onError)==null||g.call(d,m)}});b=y,p||b()}catch(h){s==null||s(h)}})(),()=>b()})})()}async function yf(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,retryCount:o=6,retryDelay:i=({count:c})=>~~(1<{a&&setTimeout(()=>h(new Yr({hash:n})),a);const y=Te(c,{onReplaced:r,resolve:b,reject:h},m=>{const g=k(e,Xo,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(v){const E=x=>{g(),x(),y()};let A=v;if(!p){u>o&&E(()=>m.reject(new Yr({hash:n})));try{if(d){if(t>1&&(!d.blockNumber||A-d.blockNumber+1nm.resolve(d));return}if(l||(p=!0,await Mn(async()=>{l=await k(e,Ir,"getTransaction")({hash:n}),l.blockNumber&&(A=l.blockNumber)},{delay:i,retryCount:o}),p=!1),d=await k(e,Ln,"getTransactionReceipt")({hash:n}),t>1&&(!d.blockNumber||A-d.blockNumber+1nm.resolve(d))}catch(x){if(x instanceof Ks||x instanceof Js){if(!l){p=!1;return}try{f=l,p=!0;const B=await Mn(()=>k(e,$e,"getBlock")({blockNumber:A,includeTransactions:!0}),{delay:i,retryCount:o,shouldRetry:({error:C})=>C instanceof ro});p=!1;const P=B.transactions.find(({from:C,nonce:S})=>C===f.from&&S===f.nonce);if(!P||(d=await k(e,Ln,"getTransactionReceipt")({hash:P.hash}),t>1&&(!d.blockNumber||A-d.blockNumber+1n{var C;(C=m.onReplaced)==null||C.call(m,{reason:T,replacedTransaction:f,transaction:P,transactionReceipt:d}),m.resolve(d)})}catch(B){E(()=>m.reject(B))}}else E(()=>m.reject(x))}finally{u++}}}})})})}function mf(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:o,includeTransactions:i,poll:a,pollingInterval:c=e.pollingInterval}){const u=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),l=i??!1;let f;return u?(()=>{const b=Z(["watchBlocks",e.uid,t,n,r,l,c]);return Te(b,{onBlock:s,onError:o},h=>jt(async()=>{var y;try{const m=await k(e,$e,"getBlock")({blockTag:t,includeTransactions:l});if(m.number&&(f!=null&&f.number)){if(m.number===f.number)return;if(m.number-f.number>1&&n)for(let g=(f==null?void 0:f.number)+1n;gf.number)&&(h.onBlock(m,f),f=m)}catch(m){(y=h.onError)==null||y.call(h,m)}},{emitOnBegin:r,interval:c}))})():(()=>{let b=!0,h=()=>b=!1;return(async()=>{try{const y=(()=>{if(e.transport.type==="fallback"){const g=e.transport.transports.find(v=>v.config.type==="webSocket");return g?g.value:e.transport}return e.transport})(),{unsubscribe:m}=await y.subscribe({params:["newHeads"],onData(g){var A,x,B;if(!b)return;const E=(((B=(x=(A=e.chain)==null?void 0:A.formatters)==null?void 0:x.block)==null?void 0:B.format)||lr)(g.result);s(E,f),f=E},onError(g){o==null||o(g)}});h=m,b||h()}catch(y){o==null||o(y)}})(),()=>h()})()}function gf(e,{address:t,args:n,batch:r=!0,event:s,events:o,fromBlock:i,onError:a,onLogs:c,poll:u,pollingInterval:l=e.pollingInterval,strict:f}){const d=typeof u<"u"?u:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),p=f??!1;return d?(()=>{const y=Z(["watchEvent",t,n,r,e.uid,s,l,i]);return Te(y,{onLogs:c,onError:a},m=>{let g;i!==void 0&&(g=i-1n);let v,E=!1;const A=jt(async()=>{var x;if(!E){try{v=await k(e,So,"createEventFilter")({address:t,args:n,event:s,events:o,strict:p,fromBlock:i})}catch{}E=!0;return}try{let B;if(v)B=await k(e,tn,"getFilterChanges")({filter:v});else{const P=await k(e,Rt,"getBlockNumber")({});g&&g!==P?B=await k(e,gr,"getLogs")({address:t,args:n,event:s,events:o,fromBlock:g+1n,toBlock:P}):B=[],g=P}if(B.length===0)return;if(r)m.onLogs(B);else for(const P of B)m.onLogs([P])}catch(B){v&&B instanceof Me&&(E=!1),(x=m.onError)==null||x.call(m,B)}},{emitOnBegin:!0,interval:l});return async()=>{v&&await k(e,nn,"uninstallFilter")({filter:v}),A()}})})():(()=>{let y=!0,m=()=>y=!1;return(async()=>{try{const g=(()=>{if(e.transport.type==="fallback"){const x=e.transport.transports.find(B=>B.config.type==="webSocket");return x?x.value:e.transport}return e.transport})(),v=o??(s?[s]:void 0);let E=[];v&&(E=[v.flatMap(x=>Nt({abi:[x],eventName:x.name,args:n}))],s&&(E=E[0]));const{unsubscribe:A}=await g.subscribe({params:["logs",{address:t,topics:E}],onData(x){var P;if(!y)return;const B=x.result;try{const{eventName:T,args:C}=yr({abi:v??[],data:B.data,topics:B.topics,strict:p}),S=we(B,{args:C,eventName:T});c([S])}catch(T){let C,S;if(T instanceof ft||T instanceof Wt){if(f)return;C=T.abiItem.name,S=(P=T.abiItem.inputs)==null?void 0:P.some(z=>!("name"in z&&z.name))}const j=we(B,{args:S?[]:{},eventName:C});c([j])}},onError(x){a==null||a(x)}});m=A,y||m()}catch(g){a==null||a(g)}})(),()=>m()})()}function wf(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:o=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket")?(()=>{const u=Z(["watchPendingTransactions",e.uid,t,o]);return Te(u,{onTransactions:r,onError:n},l=>{let f;const d=jt(async()=>{var p;try{if(!f)try{f=await k(e,Oo,"createPendingTransactionFilter")({});return}catch(h){throw d(),h}const b=await k(e,tn,"getFilterChanges")({filter:f});if(b.length===0)return;if(t)l.onTransactions(b);else for(const h of b)l.onTransactions([h])}catch(b){(p=l.onError)==null||p.call(l,b)}},{emitOnBegin:!0,interval:o});return async()=>{f&&await k(e,nn,"uninstallFilter")({filter:f}),d()}})})():(()=>{let u=!0,l=()=>u=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!u)return;const p=d.result;r([p])},onError(d){n==null||n(d)}});l=f,u||l()}catch(f){n==null||n(f)}})(),()=>l()})()}function vf(e){var f,d,p;const{scheme:t,statement:n,...r}=((f=e.match(xf))==null?void 0:f.groups)??{},{chainId:s,expirationTime:o,issuedAt:i,notBefore:a,requestId:c,...u}=((d=e.match(Ef))==null?void 0:d.groups)??{},l=(p=e.split("Resources:")[1])==null?void 0:p.split(` +- `).slice(1);return{...r,...u,...s?{chainId:Number(s)}:{},...o?{expirationTime:new Date(o)}:{},...i?{issuedAt:new Date(i)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...l?{resources:l}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const xf=/^(?:(?[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?
0x[a-fA-F0-9]{40})\n\n(?:(?.*)\n\n)?/,Ef=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function Pf(e){const{address:t,domain:n,message:r,nonce:s,scheme:o,time:i=new Date}=e;if(n&&r.domain!==n||s&&r.nonce!==s||o&&r.scheme!==o||r.expirationTime&&i>=r.expirationTime||r.notBefore&&ien(e,t),createBlockFilter:()=>Qu(e),createContractEventFilter:t=>qs(e,t),createEventFilter:t=>So(e,t),createPendingTransactionFilter:()=>Oo(e),estimateContractGas:t=>Qc(e,t),estimateGas:t=>pr(e,t),getBalance:t=>el(e,t),getBlobBaseFee:()=>tl(e),getBlock:t=>$e(e,t),getBlockNumber:t=>Rt(e,t),getBlockTransactionCount:t=>nl(e,t),getBytecode:t=>is(e,t),getChainId:()=>mo(e),getCode:t=>is(e,t),getContractEvents:t=>wo(e,t),getEip712Domain:t=>Pu(e,t),getEnsAddress:t=>zu(e,t),getEnsAvatar:t=>Ku(e,t),getEnsName:t=>Ju(e,t),getEnsResolver:t=>Xu(e,t),getEnsText:t=>To(e,t),getFeeHistory:t=>sl(e,t),estimateFeesPerGas:t=>Uc(e,t),getFilterChanges:t=>tn(e,t),getFilterLogs:t=>ol(e,t),getGasPrice:()=>fr(e),getLogs:t=>gr(e,t),getProof:t=>Ol(e,t),estimateMaxPriorityFeePerGas:t=>Lc(e,t),getStorageAt:t=>Cl(e,t),getTransaction:t=>Ir(e,t),getTransactionConfirmations:t=>kl(e,t),getTransactionCount:t=>io(e,t),getTransactionReceipt:t=>Ln(e,t),multicall:t=>Nl(e,t),prepareTransactionRequest:t=>go(e,t),readContract:t=>ve(e,t),sendRawTransaction:t=>xu(e,t),simulateContract:t=>hu(e,t),verifyMessage:t=>bf(e,t),verifySiweMessage:t=>Bf(e,t),verifyTypedData:t=>pf(e,t),uninstallFilter:t=>nn(e,t),waitForTransactionReceipt:t=>yf(e,t),watchBlocks:t=>mf(e,t),watchBlockNumber:t=>Xo(e,t),watchContractEvent:t=>vu(e,t),watchEvent:t=>gf(e,t),watchPendingTransactions:t=>wf(e,t)}}function Af(e){const{key:t="public",name:n="Public Client"}=e;return Iu({...e,key:t,name:n,type:"publicClient"}).extend(If)}const $f=2n**16n-1n,Tf=zt({id:31337,name:"Foundry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}}),Cr=50000n,hs=$f*32n,Qo={block:Mc({format(e){var n;const t=(n=e.transactions)==null?void 0:n.map(r=>{var o;if(typeof r=="string")return r;const s=(o=Qo.transaction)==null?void 0:o.format(r);return s.typeHex==="0x71"?s.type="eip712":s.typeHex==="0xff"&&(s.type="priority"),s});return{l1BatchNumber:e.l1BatchNumber?G(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?G(e.l1BatchTimestamp):null,transactions:t}}}),transaction:zc({format(e){const t={};return e.type==="0x71"?t.type="eip712":e.type==="0xff"&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?G(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?G(e.l1BatchTxIndex):null}}}),transactionReceipt:gl({format(e){return{l1BatchNumber:e.l1BatchNumber?G(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?G(e.l1BatchTxIndex):null,logs:e.logs.map(t=>({...we(t),l1BatchNumber:t.l1BatchNumber?G(t.l1BatchNumber):null,transactionLogIndex:de(t.transactionLogIndex),logType:t.logType})),l2ToL1Logs:e.l2ToL1Logs.map(t=>({blockNumber:G(t.blockHash),blockHash:t.blockHash,l1BatchNumber:G(t.l1BatchNumber),transactionIndex:G(t.transactionIndex),shardId:G(t.shardId),isService:t.isService,sender:t.sender,key:t.key,value:t.value,transactionHash:t.transactionHash,logIndex:G(t.logIndex)}))}}}),transactionRequest:Nc({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format(e){return e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:O(e.gasPerPubdata)}:{gasPerPubdata:O(Cr)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(re(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(t=>Array.from(re(t)))}:{},...e.customSignature?{customSignature:Array.from(re(e.customSignature))}:{}},type:"0x71"}:{}}})};class Sf extends w{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidEip712TransactionError"})}}function ei(e){return!!(e.type==="eip712"||"customSignature"in e&&e.customSignature||"paymaster"in e&&e.paymaster||"paymasterInput"in e&&e.paymasterInput||"gasPerPubdata"in e&&typeof e.gasPerPubdata=="bigint"||"factoryDeps"in e&&e.factoryDeps)}function ti(e){const{chainId:t,to:n,from:r,paymaster:s,paymasterInput:o}=e;if(!ei(e))throw new Sf;if(!t||t<=0)throw new Qt({chainId:t});if(n&&!q(n))throw new K({address:n});if(r&&!q(r))throw new K({address:r});if(s&&!q(s))throw new K({address:s});if(s&&!o)throw new w("`paymasterInput` must be provided when `paymaster` is defined");if(!s&&o)throw new w("`paymaster` must be provided when `paymasterInput` is defined")}function Of(e,t){return ei(e)?kf(e):Pl(e,t)}const Cf={transaction:Of};function kf(e){const{chainId:t,gas:n,nonce:r,to:s,from:o,value:i,maxFeePerGas:a,maxPriorityFeePerGas:c,customSignature:u,factoryDeps:l,paymaster:f,paymasterInput:d,gasPerPubdata:p,data:b}=e;ti(e);const h=[r?O(r):"0x",c?O(c):"0x",a?O(a):"0x",n?O(n):"0x",s??"0x",i?O(i):"0x",b??"0x0",O(t),O(""),O(""),O(t),o??"0x",O(p||Cr),l??[],u??"0x",f&&d?[f,d]:[]];return _e(["0x71",Xe(h)])}class Nf extends w{constructor({givenLength:t,maxBytecodeSize:n}){super(`Bytecode cannot be longer than ${n} bytes. Given length: ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthExceedsMaxSizeError"})}}class Ff extends w{constructor({givenLengthInWords:t}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthInWordsMustBeOddError"})}}class jf extends w{constructor({givenLength:t}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthMustBeDivisibleBy32Error"})}}function Rf(e){const t=ce(e);if(t.length%32!==0)throw new jf({givenLength:t.length});if(t.length>hs)throw new Nf({givenLength:t.length,maxBytecodeSize:hs});const n=co(t),r=ce(n),s=t.length/32;if(s%2===0)throw new Ff({givenLengthInWords:s});const o=ce(s),i=Ue(o,{size:2}),a=new Uint8Array([1,0]);return r.set(a,0),r.set(i,2),r}const zf=e=>{ti(e);const t=Mf(e);return{domain:{name:"zkSync",version:"2",chainId:e.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:t}};function Mf(e){const{gas:t,nonce:n,to:r,from:s,value:o,maxFeePerGas:i,maxPriorityFeePerGas:a,factoryDeps:c,paymaster:u,paymasterInput:l,gasPerPubdata:f,data:d}=e;return{txType:113n,from:BigInt(s),to:r?BigInt(r):0n,gasLimit:t??0n,gasPerPubdataByteLimit:f??Cr,maxFeePerGas:i??0n,maxPriorityFeePerGas:a??0n,paymaster:u?BigInt(u):0n,nonce:n?BigInt(n):0n,value:o??0n,data:d||"0x0",factoryDeps:(c==null?void 0:c.map(p=>O(Rf(p))))??[],paymasterInput:l||"0x"}}const ni={formatters:Qo,serializers:Cf,custom:{getEip712Domain:zf}},Lf=zt({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Uf=zt({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0}),_f=zt({...ni,id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://era.zksync.network/",apiUrl:"https://api-era.zksync.network/api"},native:{name:"zkSync Explorer",url:"https://explorer.zksync.io/"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}}),Df=zt({...ni,id:300,name:"zkSync Sepolia Testnet",network:"zksync-sepolia-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia-era.zksync.network/"},native:{name:"zkSync Explorer",url:"https://sepolia.explorer.zksync.io/"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0}),dd="https://us-central1-nottingham-420415.cloudfunctions.net/registrar",hd="36624378",Gf="1142,2285,4573",Hf="https://mainnet.era.zksync.io",qf="2024-06-15T13:00:00-04:00",bd="Ov23limY2NSRpoMnVolm",pd="0xE8582331D79948887B52A8092a5983288275F60E",yd="4bd7b24c55f8dc771ec3120f569f3e9c",md="https://us-central1-nottingham-420415.cloudfunctions.net/data",Vf="2024-06-20T13:00:00-04:00,2024-06-25T13:00:00-04:00,2024-06-30T13:00:00-04:00",bs="324",Zf="Game contracts have been updated for season 3!",gd=Zf,Wf=new Date(qf),wd=Wf.getTime()new Date(e)),xd=Gf.split(",").map(e=>Number(e)),Yf={11155111:Uf,1:Lf,300:Df,324:_f,31337:Tf};function Ed(){const e=Fu(Hf),t=Yf[Number(bs)];if(t.id===324){const n=[{name:"default",url:"https://explorer.zksync.io/"}];n.default=n[0],t.blockExplorers=n}if(!t)throw new Error(`Unsupported chain: ${bs}`);return Af({transport:e,chain:t})}const Kf="site";function Pd(){return si(Kf)}function Bd(e){return(e*1e3+1e3).toFixed(0)}const ri=60,Jf=ri*60,Id=ri*1e3,Xf=Jf*1e3,Ad=Xf*24,Qf=()=>{};function $d(e=32){const t=new Uint8Array(e);return crypto.getRandomValues(t),O(t)}function Td(e,t){return e===t?0:e{t=r}),r=>t(r)]}function Nd(e){let t=0;return n=>(typeof n=="function"&&(n=n()),t++===0&&e(n),n.then(r=>(--t===0&&e(r),r)).catch(r=>{throw--t===0&&e(r),r}))}export{yf as $,xd as A,w as B,Wf as C,ud as D,cd as E,eo as F,or as G,lt as H,ar as I,k as J,mo as K,wd as L,go as M,Xc as N,Jf as O,md as P,xu as Q,ir as R,vd as S,ad as T,ed as U,to as V,Oe as W,De as X,pd as Y,ve as Z,Jt as _,Pd as a,Td as a0,hd as a1,bs as a2,Cd as a3,F as a4,Su as a5,wr as a6,Jn as a7,od as a8,qn as a9,_f as aA,Uf as aB,Tf as aC,Ed as aD,kd as aE,Kf as aF,gd as aG,bl as aa,hl as ab,ld as ac,Iu as ad,Ye as ae,wt as af,Mn as ag,Cu as ah,$t as ai,pr as aj,id as ak,Nl as al,Bc as am,sd as an,Re as ao,Ys as ap,el as aq,zu as ar,Ku as as,Ju as at,hu as au,Ir as av,Fu as aw,Lf as ax,yd as ay,Df as az,bd as b,Nd as c,dd as d,Ha as e,Bd as f,Od as g,de as h,Sd as i,rr as j,Y as k,Hn as l,Z as m,bc as n,il as o,en as p,ge as q,$d as r,pe as s,Ct as t,fe as u,ce as v,O as w,Ad as x,Xf as y,Id as z}; diff --git a/_app/immutable/chunks/page.CWCv2ozC.js b/_app/immutable/chunks/page.CWCv2ozC.js new file mode 100644 index 0000000..10b14ab --- /dev/null +++ b/_app/immutable/chunks/page.CWCv2ozC.js @@ -0,0 +1 @@ +import{s as p,e as d,d as h,f as _,i as f,v as c,M as D,k as m,n as I,c as V,b,j as k,l as v,u as N,g as S,a as C,_ as j}from"./scheduler.C1FoT2GD.js";import{S as $,i as g,t as L,a as P}from"./index.DFmxPlw4.js";function M(o){let e;return{c(){e=d("div"),this.h()},l(a){e=h(a,"DIV",{class:!0,title:!0}),_(e).forEach(f),this.h()},h(){c(e,"class","spinner svelte-a8ekfe"),c(e,"title","loading..."),D(e,"failed",o[0]===!0)},m(a,l){m(a,e,l)},p(a,[l]){l&1&&D(e,"failed",a[0]===!0)},i:I,o:I,d(a){a&&f(e)}}}function w(o,e,a){let{failed:l=null}=e;return o.$$set=i=>{"failed"in i&&a(0,l=i.failed)},[l]}class H extends ${constructor(e){super(),g(this,e,w,M,p,{failed:0})}}function y(o){let e,a,l,i;const r=o[1].default,n=V(r,o,o[0],null);return{c(){e=d("div"),n&&n.c(),a=b(),l=d("div"),this.h()},l(t){e=h(t,"DIV",{class:!0});var s=_(e);n&&n.l(s),a=k(s),l=h(s,"DIV",{class:!0}),_(l).forEach(f),s.forEach(f),this.h()},h(){c(l,"class","svelte-qse11b"),c(e,"class","lede svelte-qse11b")},m(t,s){m(t,e,s),n&&n.m(e,null),v(e,a),v(e,l),i=!0},p(t,[s]){n&&n.p&&(!i||s&1)&&N(n,r,t,t[0],i?C(r,t[0],s,null):S(t[0]),null)},i(t){i||(L(n,t),i=!0)},o(t){P(n,t),i=!1},d(t){t&&f(e),n&&n.d(t)}}}function z(o,e,a){let{$$slots:l={},$$scope:i}=e;return o.$$set=r=>{"$$scope"in r&&a(0,i=r.$$scope)},[i,l]}class J extends ${constructor(e){super(),g(this,e,z,y,p,{})}}function A(o){let e,a,l,i,r;document.title=e=o[0]?`Nottingham: ${o[0]}`:"Searchers of Nottingham";const n=o[2].default,t=V(n,o,o[1],null);return{c(){a=b(),l=d("div"),i=d("div"),t&&t.c(),this.h()},l(s){j("svelte-3olkkt",document.head).forEach(f),a=k(s),l=h(s,"DIV",{class:!0});var E=_(l);i=h(E,"DIV",{class:!0});var q=_(i);t&&t.l(q),q.forEach(f),E.forEach(f),this.h()},h(){c(i,"class","content svelte-18qstv3"),c(l,"class","page svelte-18qstv3")},m(s,u){m(s,a,u),m(s,l,u),v(l,i),t&&t.m(i,null),r=!0},p(s,[u]){(!r||u&1)&&e!==(e=s[0]?`Nottingham: ${s[0]}`:"Searchers of Nottingham")&&(document.title=e),t&&t.p&&(!r||u&2)&&N(t,n,s,s[1],r?C(n,s[1],u,null):S(s[1]),null)},i(s){r||(L(t,s),r=!0)},o(s){P(t,s),r=!1},d(s){s&&(f(a),f(l)),t&&t.d(s)}}}function B(o,e,a){let{$$slots:l={},$$scope:i}=e,{title:r=""}=e;return o.$$set=n=>{"title"in n&&a(0,r=n.title),"$$scope"in n&&a(1,i=n.$$scope)},[r,i,l]}class K extends ${constructor(e){super(),g(this,e,B,A,p,{title:0})}}export{H as C,J as L,K as P}; diff --git a/_app/immutable/chunks/paths.2ZvcQRjx.js b/_app/immutable/chunks/paths.2ZvcQRjx.js new file mode 100644 index 0000000..171826d --- /dev/null +++ b/_app/immutable/chunks/paths.2ZvcQRjx.js @@ -0,0 +1 @@ +import{n as l,s as k,C as m,r as w,D as x}from"./scheduler.C1FoT2GD.js";const c=[];function z(e,i){return{subscribe:A(e,i).subscribe}}function A(e,i=l){let r;const n=new Set;function a(t){if(k(e,t)&&(e=t,r)){const o=!c.length;for(const s of n)s[1](),c.push(s,e);if(o){for(let s=0;s{n.delete(s),n.size===0&&r&&(r(),r=null)}}return{set:a,update:b,subscribe:f}}function C(e,i,r){const n=!Array.isArray(e),a=n?[e]:e;if(!a.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const b=i.length<2;return z(r,(f,t)=>{let o=!1;const s=[];let d=0,p=l;const h=()=>{if(d)return;p();const u=i(n?s[0]:s,f,t);b?f(u):p=x(u)?u:l},y=a.map((u,_)=>m(u,q=>{s[_]=q,d&=~(1<<_),o&&h()},()=>{d|=1<<_}));return o=!0,h(),function(){w(y),p(),o=!1}})}var g;const T=((g=globalThis.__sveltekit_1kthvqv)==null?void 0:g.base)??"/nottingham-frontend";var v;const D=((v=globalThis.__sveltekit_1kthvqv)==null?void 0:v.assets)??T;export{D as a,T as b,C as d,z as r,A as w}; diff --git a/_app/immutable/chunks/player.rtVQwoeI.js b/_app/immutable/chunks/player.rtVQwoeI.js new file mode 100644 index 0000000..91169c1 --- /dev/null +++ b/_app/immutable/chunks/player.rtVQwoeI.js @@ -0,0 +1 @@ +import{s as f,e as h,t as c,d as _,f as p,h as u,i as l,v as i,k as d,l as v,m as y,n as m}from"./scheduler.C1FoT2GD.js";import{S as $,i as b}from"./index.DFmxPlw4.js";import{b as o}from"./paths.2ZvcQRjx.js";function k(n){let e,r,t;return{c(){e=h("a"),r=c(n[0]),this.h()},l(a){e=_(a,"A",{href:!0,class:!0});var s=p(e);r=u(s,n[0]),s.forEach(l),this.h()},h(){i(e,"href",t=`${o}/player?name=${n[0]}`),i(e,"class","svelte-amw2kc")},m(a,s){d(a,e,s),v(e,r)},p(a,[s]){s&1&&y(r,a[0]),s&1&&t!==(t=`${o}/player?name=${a[0]}`)&&i(e,"href",t)},i:m,o:m,d(a){a&&l(e)}}}function P(n,e,r){let{name:t}=e;return n.$$set=a=>{"name"in a&&r(0,t=a.name)},[t]}class w extends ${constructor(e){super(),b(this,e,P,k,f,{name:0})}}export{w as P}; diff --git a/_app/immutable/chunks/preload-helper.D6kgxu3v.js b/_app/immutable/chunks/preload-helper.D6kgxu3v.js new file mode 100644 index 0000000..e9c4089 --- /dev/null +++ b/_app/immutable/chunks/preload-helper.D6kgxu3v.js @@ -0,0 +1 @@ +const v="modulepreload",y=function(a,l){return new URL(a,l).href},d={},w=function(l,c,u){let f=Promise.resolve();if(c&&c.length>0){const r=document.getElementsByTagName("link"),e=document.querySelector("meta[property=csp-nonce]"),h=(e==null?void 0:e.nonce)||(e==null?void 0:e.getAttribute("nonce"));f=Promise.all(c.map(t=>{if(t=y(t,u),t in d)return;d[t]=!0;const s=t.endsWith(".css"),m=s?'[rel="stylesheet"]':"";if(!!u)for(let o=r.length-1;o>=0;o--){const i=r[o];if(i.href===t&&(!s||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${m}`))return;const n=document.createElement("link");if(n.rel=s?"stylesheet":v,s||(n.as="script",n.crossOrigin=""),n.href=t,h&&n.setAttribute("nonce",h),document.head.appendChild(n),s)return new Promise((o,i)=>{n.addEventListener("load",o),n.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${t}`)))})}))}return f.then(()=>l()).catch(r=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=r,window.dispatchEvent(e),!e.defaultPrevented)throw r})};export{w as _}; diff --git a/_app/immutable/chunks/scheduler.C1FoT2GD.js b/_app/immutable/chunks/scheduler.C1FoT2GD.js new file mode 100644 index 0000000..943377d --- /dev/null +++ b/_app/immutable/chunks/scheduler.C1FoT2GD.js @@ -0,0 +1 @@ +var W=Object.defineProperty;var O=(t,e,n)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var f=(t,e,n)=>(O(t,typeof e!="symbol"?e+"":e,n),n);function G(){}function I(t,e){for(const n in e)t[n]=e[n];return t}function R(t){return t()}function lt(){return Object.create(null)}function F(t){t.forEach(R)}function ot(t){return typeof t=="function"}function at(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let p;function ut(t,e){return t===e?!0:(p||(p=document.createElement("a")),p.href=e,t===p.href)}function ft(t){return Object.keys(t).length===0}function U(t,...e){if(t==null){for(const i of e)i(void 0);return G}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function dt(t,e,n){t.$$.on_destroy.push(U(e,n))}function _t(t,e,n,i){if(t){const s=S(t,e,n,i);return t[0](s)}}function S(t,e,n,i){return t[1]&&i?I(n.ctx.slice(),t[1](i(e))):n.ctx}function ht(t,e,n,i){if(t[2]&&i){const s=t[2](i(n));if(e.dirty===void 0)return s;if(typeof s=="object"){const c=[],r=Math.max(e.dirty.length,s.length);for(let o=0;o32){const e=[],n=t.ctx.length/32;for(let i=0;i>1);n(s)<=i?t=s+1:e=s}return t}function K(t){if(t.hydrate_init)return;t.hydrate_init=!0;let e=t.childNodes;if(t.nodeName==="HEAD"){const l=[];for(let a=0;a0&&e[n[s]].claim_order<=a?s+1:J(1,s,B=>e[n[B]].claim_order,a))-1;i[l]=n[u]+1;const k=u+1;n[k]=l,s=Math.max(k,s)}const c=[],r=[];let o=e.length-1;for(let l=n[s]+1;l!=0;l=i[l-1]){for(c.push(e[l-1]);o>=l;o--)r.push(e[o]);o--}for(;o>=0;o--)r.push(e[o]);c.reverse(),r.sort((l,a)=>l.claim_order-a.claim_order);for(let l=0,a=0;l=c[a].claim_order;)a++;const u=at.removeEventListener(e,n,i)}function Et(t){return function(e){return e.preventDefault(),t.call(this,e)}}function vt(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Tt(t){return t.dataset.svelteH}function Nt(t){return Array.from(t.childNodes)}function j(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function P(t,e,n,i,s=!1){j(t);const c=(()=>{for(let r=t.claim_info.last_index;r=0;r--){const o=t[r];if(e(o)){const l=n(o);return l===void 0?t.splice(r,1):t[r]=l,s?l===void 0&&t.claim_info.last_index--:t.claim_info.last_index=r,o}}return i()})();return c.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,c}function z(t,e,n,i){return P(t,s=>s.nodeName===e,s=>{const c=[];for(let r=0;rs.removeAttribute(r))},()=>i(e))}function At(t,e,n){return z(t,e,n,N)}function kt(t,e,n){return z(t,e,n,D)}function Z(t,e){return P(t,n=>n.nodeType===3,n=>{const i=""+e;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>A(e),!0)}function Ct(t){return Z(t," ")}function H(t,e,n){for(let i=n;i{r.source===i.contentWindow&&e()})):(i.src="about:blank",i.onload=()=>{c=C(i.contentWindow,"resize",e),e()}),Q(t,i),()=>{(s||c&&i.contentWindow)&&c(),b(i)}}function jt(t,e,n){t.classList.toggle(e,!!n)}function tt(t,e,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:i})}function Pt(t,e){const n=[];let i=0;for(const s of e.childNodes)if(s.nodeType===8){const c=s.textContent.trim();c===`HEAD_${t}_END`?(i-=1,n.push(s)):c===`HEAD_${t}_START`&&(i+=1,n.push(s))}else i>0&&n.push(s);return n}class et{constructor(e=!1){f(this,"is_svg",!1);f(this,"e");f(this,"n");f(this,"t");f(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=D(n.nodeName):this.e=N(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n{const s=t.$$.callbacks[e];if(s){const c=tt(e,n,{cancelable:i});return s.slice().forEach(r=>{r.call(t,c)}),!c.defaultPrevented}return!0}}function Gt(t,e){return h().$$.context.set(t,e),e}function It(t){return h().$$.context.get(t)}function Rt(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const m=[],M=[];let _=[];const L=[],q=Promise.resolve();let T=!1;function nt(){T||(T=!0,q.then(st))}function Ft(){return nt(),q}function it(t){_.push(t)}const v=new Set;let d=0;function st(){if(d!==0)return;const t=g;do{try{for(;dt.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),_=e}export{Dt as $,Et as A,gt as B,U as C,ot as D,Ht as E,Bt as F,St as G,w as H,M as I,zt as J,Ft as K,Rt as L,jt as M,Wt as N,lt as O,st as P,ft as Q,it as R,Ut as S,g as T,E as U,R as V,m as W,nt as X,yt as Y,bt as Z,Pt as _,ht as a,Gt as a0,It as a1,D as a2,kt as a3,Ot as a4,xt as b,_t as c,At as d,N as e,Nt as f,pt as g,Z as h,b as i,Ct as j,Y as k,V as l,Mt as m,G as n,dt as o,wt as p,Tt as q,F as r,at as s,A as t,mt as u,vt as v,Lt as w,C as x,qt as y,ut as z}; diff --git a/_app/immutable/chunks/stores.uos4ky2n.js b/_app/immutable/chunks/stores.uos4ky2n.js new file mode 100644 index 0000000..dcba9c6 --- /dev/null +++ b/_app/immutable/chunks/stores.uos4ky2n.js @@ -0,0 +1 @@ +import{s as e}from"./entry.CTvLC5-Q.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p}; diff --git a/_app/immutable/entry/app.DqLS9uG_.js b/_app/immutable/entry/app.DqLS9uG_.js new file mode 100644 index 0000000..9e3e9d0 --- /dev/null +++ b/_app/immutable/entry/app.DqLS9uG_.js @@ -0,0 +1,2 @@ +const __vite__fileDeps=["../nodes/0.BBXFTmWg.js","../chunks/scheduler.C1FoT2GD.js","../chunks/index.DFmxPlw4.js","../nodes/1.CX7DfjzI.js","../chunks/stores.uos4ky2n.js","../chunks/entry.CTvLC5-Q.js","../chunks/paths.2ZvcQRjx.js","../nodes/2.Br0Ktlaf.js","../chunks/2.CpRWH4-H.js","../chunks/kit.CACir_b1.js","../chunks/preload-helper.D6kgxu3v.js","../chunks/contest.LM7IXEuc.js","../assets/2.BD708D1f.css","../nodes/3.CLG0najm.js","../chunks/each.Bmx-BImQ.js","../chunks/page.CWCv2ozC.js","../assets/page.CLNrBPMz.css","../chunks/player.rtVQwoeI.js","../assets/player.BGZDgu9l.css","../assets/3.CFmUWSZw.css","../nodes/4.CZ-l8y60.js","../assets/4.y4NXrGVz.css","../nodes/5.ozp2_2H7.js","../assets/5.CfogKFzx.css","../nodes/6.BlofK9mi.js","../chunks/bytes.BO06K83n.js","../assets/6.DurNQoRk.css","../nodes/7.lJ7Rfakj.js","../assets/7.SRjcVSip.css","../nodes/8.Dct53QGN.js","../assets/8.RY5G_MoP.css","../nodes/9.EUKtwSR-.js","../assets/9.BlIaaKWA.css","../nodes/10.VPAmih96.js","../assets/10.Bng8cVAW.css","../nodes/11.ChO8jBkK.js","../nodes/12.a84Fgjde.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{_ as h}from"../chunks/preload-helper.D6kgxu3v.js";import{s as C,b as F,p as u,j as G,k as g,i as w,F as J,y as K,e as M,d as U,f as z,v as L,G as I,t as B,h as H,m as Q,I as V,J as b,K as W}from"../chunks/scheduler.C1FoT2GD.js";import{S as X,i as Y,a as m,e as D,t as p,g as P,c as k,b as A,m as E,d as v}from"../chunks/index.DFmxPlw4.js";const fe={};function Z(_){let e,i,s;var n=_[1][0];function c(t,o){return{props:{data:t[3],form:t[2]}}}return n&&(e=b(n,c(_)),_[15](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][0])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[15](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&8&&(r.data=t[3]),o&4&&(r.form=t[2]),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[15](null),e&&v(e,t)}}}function x(_){let e,i,s;var n=_[1][0];function c(t,o){return{props:{data:t[3],$$slots:{default:[ne]},$$scope:{ctx:t}}}}return n&&(e=b(n,c(_)),_[14](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][0])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[14](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&8&&(r.data=t[3]),o&65591&&(r.$$scope={dirty:o,ctx:t}),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[14](null),e&&v(e,t)}}}function ee(_){let e,i,s;var n=_[1][1];function c(t,o){return{props:{data:t[4],form:t[2]}}}return n&&(e=b(n,c(_)),_[13](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][1])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[13](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&16&&(r.data=t[4]),o&4&&(r.form=t[2]),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[13](null),e&&v(e,t)}}}function te(_){let e,i,s;var n=_[1][1];function c(t,o){return{props:{data:t[4],$$slots:{default:[ie]},$$scope:{ctx:t}}}}return n&&(e=b(n,c(_)),_[12](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][1])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[12](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&16&&(r.data=t[4]),o&65575&&(r.$$scope={dirty:o,ctx:t}),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[12](null),e&&v(e,t)}}}function ie(_){let e,i,s;var n=_[1][2];function c(t,o){return{props:{data:t[5],form:t[2]}}}return n&&(e=b(n,c(_)),_[11](e)),{c(){e&&k(e.$$.fragment),i=u()},l(t){e&&A(e.$$.fragment,t),i=u()},m(t,o){e&&E(e,t,o),g(t,i,o),s=!0},p(t,o){if(o&2&&n!==(n=t[1][2])){if(e){P();const r=e;m(r.$$.fragment,1,0,()=>{v(r,1)}),D()}n?(e=b(n,c(t)),t[11](e),k(e.$$.fragment),p(e.$$.fragment,1),E(e,i.parentNode,i)):e=null}else if(n){const r={};o&32&&(r.data=t[5]),o&4&&(r.form=t[2]),e.$set(r)}},i(t){s||(e&&p(e.$$.fragment,t),s=!0)},o(t){e&&m(e.$$.fragment,t),s=!1},d(t){t&&w(i),_[11](null),e&&v(e,t)}}}function ne(_){let e,i,s,n;const c=[te,ee],t=[];function o(r,l){return r[1][2]?0:1}return e=o(_),i=t[e]=c[e](_),{c(){i.c(),s=u()},l(r){i.l(r),s=u()},m(r,l){t[e].m(r,l),g(r,s,l),n=!0},p(r,l){let f=e;e=o(r),e===f?t[e].p(r,l):(P(),m(t[f],1,1,()=>{t[f]=null}),D(),i=t[e],i?i.p(r,l):(i=t[e]=c[e](r),i.c()),p(i,1),i.m(s.parentNode,s))},i(r){n||(p(i),n=!0)},o(r){m(i),n=!1},d(r){r&&w(s),t[e].d(r)}}}function T(_){let e,i=_[7]&&y(_);return{c(){e=M("div"),i&&i.c(),this.h()},l(s){e=U(s,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var n=z(e);i&&i.l(n),n.forEach(w),this.h()},h(){L(e,"id","svelte-announcer"),L(e,"aria-live","assertive"),L(e,"aria-atomic","true"),I(e,"position","absolute"),I(e,"left","0"),I(e,"top","0"),I(e,"clip","rect(0 0 0 0)"),I(e,"clip-path","inset(50%)"),I(e,"overflow","hidden"),I(e,"white-space","nowrap"),I(e,"width","1px"),I(e,"height","1px")},m(s,n){g(s,e,n),i&&i.m(e,null)},p(s,n){s[7]?i?i.p(s,n):(i=y(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(s){s&&w(e),i&&i.d()}}}function y(_){let e;return{c(){e=B(_[8])},l(i){e=H(i,_[8])},m(i,s){g(i,e,s)},p(i,s){s&256&&Q(e,i[8])},d(i){i&&w(e)}}}function re(_){let e,i,s,n,c;const t=[x,Z],o=[];function r(f,d){return f[1][1]?0:1}e=r(_),i=o[e]=t[e](_);let l=_[6]&&T(_);return{c(){i.c(),s=F(),l&&l.c(),n=u()},l(f){i.l(f),s=G(f),l&&l.l(f),n=u()},m(f,d){o[e].m(f,d),g(f,s,d),l&&l.m(f,d),g(f,n,d),c=!0},p(f,[d]){let R=e;e=r(f),e===R?o[e].p(f,d):(P(),m(o[R],1,1,()=>{o[R]=null}),D(),i=o[e],i?i.p(f,d):(i=o[e]=t[e](f),i.c()),p(i,1),i.m(s.parentNode,s)),f[6]?l?l.p(f,d):(l=T(f),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},i(f){c||(p(i),c=!0)},o(f){m(i),c=!1},d(f){f&&(w(s),w(n)),o[e].d(f),l&&l.d(f)}}}function se(_,e,i){let{stores:s}=e,{page:n}=e,{constructors:c}=e,{components:t=[]}=e,{form:o}=e,{data_0:r=null}=e,{data_1:l=null}=e,{data_2:f=null}=e;J(s.page.notify);let d=!1,R=!1,O=null;K(()=>{const a=s.page.subscribe(()=>{d&&(i(7,R=!0),W().then(()=>{i(8,O=document.title||"untitled page")}))});return i(6,d=!0),a});function N(a){V[a?"unshift":"push"](()=>{t[2]=a,i(0,t)})}function $(a){V[a?"unshift":"push"](()=>{t[1]=a,i(0,t)})}function S(a){V[a?"unshift":"push"](()=>{t[1]=a,i(0,t)})}function j(a){V[a?"unshift":"push"](()=>{t[0]=a,i(0,t)})}function q(a){V[a?"unshift":"push"](()=>{t[0]=a,i(0,t)})}return _.$$set=a=>{"stores"in a&&i(9,s=a.stores),"page"in a&&i(10,n=a.page),"constructors"in a&&i(1,c=a.constructors),"components"in a&&i(0,t=a.components),"form"in a&&i(2,o=a.form),"data_0"in a&&i(3,r=a.data_0),"data_1"in a&&i(4,l=a.data_1),"data_2"in a&&i(5,f=a.data_2)},_.$$.update=()=>{_.$$.dirty&1536&&s.page.set(n)},[t,c,o,r,l,f,d,R,O,s,n,N,$,S,j,q]}class le extends X{constructor(e){super(),Y(this,e,se,re,C,{stores:9,page:10,constructors:1,components:0,form:2,data_0:3,data_1:4,data_2:5})}}const ce=[()=>h(()=>import("../nodes/0.BBXFTmWg.js"),__vite__mapDeps([0,1,2]),import.meta.url),()=>h(()=>import("../nodes/1.CX7DfjzI.js"),__vite__mapDeps([3,1,2,4,5,6]),import.meta.url),()=>h(()=>import("../nodes/2.Br0Ktlaf.js"),__vite__mapDeps([7,8,1,2,9,10,6,11,4,5,12]),import.meta.url),()=>h(()=>import("../nodes/3.CLG0najm.js"),__vite__mapDeps([13,1,2,14,6,9,10,15,16,17,18,11,19]),import.meta.url),()=>h(()=>import("../nodes/4.CZ-l8y60.js"),__vite__mapDeps([20,1,2,14,6,4,5,9,10,15,16,17,18,21]),import.meta.url),()=>h(()=>import("../nodes/5.ozp2_2H7.js"),__vite__mapDeps([22,1,2,14,6,4,5,9,10,15,16,17,18,23]),import.meta.url),()=>h(()=>import("../nodes/6.BlofK9mi.js"),__vite__mapDeps([24,1,2,14,15,16,4,5,6,9,10,11,25,26]),import.meta.url),()=>h(()=>import("../nodes/7.lJ7Rfakj.js"),__vite__mapDeps([27,1,2,14,15,16,4,5,6,9,10,17,18,11,25,28]),import.meta.url),()=>h(()=>import("../nodes/8.Dct53QGN.js"),__vite__mapDeps([29,1,2,15,16,9,10,6,4,5,11,30]),import.meta.url),()=>h(()=>import("../nodes/9.EUKtwSR-.js"),__vite__mapDeps([31,1,2,14,6,4,5,9,10,15,16,17,18,11,32]),import.meta.url),()=>h(()=>import("../nodes/10.VPAmih96.js"),__vite__mapDeps([33,1,2,14,6,4,5,9,10,15,16,17,18,34]),import.meta.url),()=>h(()=>import("../nodes/11.ChO8jBkK.js"),__vite__mapDeps([35,1,2]),import.meta.url),()=>h(()=>import("../nodes/12.a84Fgjde.js"),__vite__mapDeps([36,1,2]),import.meta.url)],ue=[],me={"/(app)":[3,[2]],"/(app)/bracket":[4,[2]],"/(app)/match":[5,[2]],"/(app)/players":[7,[2]],"/(app)/player":[6,[2]],"/(terms)/privacy":[11],"/(app)/register":[8,[2]],"/(terms)/rules":[12],"/(app)/season":[9,[2]],"/(app)/tournament":[10,[2]]},pe={handleError:({error:_})=>{console.error(_)},reroute:()=>{}};export{me as dictionary,pe as hooks,fe as matchers,ce as nodes,le as root,ue as server_loads}; diff --git a/_app/immutable/entry/start.Buy_i1Up.js b/_app/immutable/entry/start.Buy_i1Up.js new file mode 100644 index 0000000..df700b4 --- /dev/null +++ b/_app/immutable/entry/start.Buy_i1Up.js @@ -0,0 +1 @@ +import{a as t}from"../chunks/entry.CTvLC5-Q.js";export{t as start}; diff --git a/_app/immutable/nodes/0.BBXFTmWg.js b/_app/immutable/nodes/0.BBXFTmWg.js new file mode 100644 index 0000000..b41b173 --- /dev/null +++ b/_app/immutable/nodes/0.BBXFTmWg.js @@ -0,0 +1 @@ +import{s as l,c as i,u as r,g as u,a as f}from"../chunks/scheduler.C1FoT2GD.js";import{S as _,i as c,t as p,a as m}from"../chunks/index.DFmxPlw4.js";function $(a){let s;const n=a[1].default,e=i(n,a,a[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,o){e&&e.m(t,o),s=!0},p(t,[o]){e&&e.p&&(!s||o&1)&&r(e,n,t,t[0],s?f(n,t[0],o,null):u(t[0]),null)},i(t){s||(p(e,t),s=!0)},o(t){m(e,t),s=!1},d(t){e&&e.d(t)}}}function d(a,s,n){let{$$slots:e={},$$scope:t}=s;return a.$$set=o=>{"$$scope"in o&&n(0,t=o.$$scope)},[t,e]}class S extends _{constructor(s){super(),c(this,s,d,$,l,{})}}export{S as component}; diff --git a/_app/immutable/nodes/1.CX7DfjzI.js b/_app/immutable/nodes/1.CX7DfjzI.js new file mode 100644 index 0000000..fecc584 --- /dev/null +++ b/_app/immutable/nodes/1.CX7DfjzI.js @@ -0,0 +1 @@ +import{s as x,e as u,t as h,b as S,d,f as v,h as b,i as m,j,k as _,l as g,m as E,n as $,o as k}from"../chunks/scheduler.C1FoT2GD.js";import{S as q,i as y}from"../chunks/index.DFmxPlw4.js";import{p as C}from"../chunks/stores.uos4ky2n.js";function H(i){var f;let t,s=i[0].status+"",r,o,n,p=((f=i[0].error)==null?void 0:f.message)+"",c;return{c(){t=u("h1"),r=h(s),o=S(),n=u("p"),c=h(p)},l(e){t=d(e,"H1",{});var a=v(t);r=b(a,s),a.forEach(m),o=j(e),n=d(e,"P",{});var l=v(n);c=b(l,p),l.forEach(m)},m(e,a){_(e,t,a),g(t,r),_(e,o,a),_(e,n,a),g(n,c)},p(e,[a]){var l;a&1&&s!==(s=e[0].status+"")&&E(r,s),a&1&&p!==(p=((l=e[0].error)==null?void 0:l.message)+"")&&E(c,p)},i:$,o:$,d(e){e&&(m(t),m(o),m(n))}}}function P(i,t,s){let r;return k(i,C,o=>s(0,r=o)),[r]}class B extends q{constructor(t){super(),y(this,t,P,H,x,{})}}export{B as component}; diff --git a/_app/immutable/nodes/10.VPAmih96.js b/_app/immutable/nodes/10.VPAmih96.js new file mode 100644 index 0000000..5aac502 --- /dev/null +++ b/_app/immutable/nodes/10.VPAmih96.js @@ -0,0 +1,9 @@ +import{s as Ae,o as He,p as se,k as P,i as m,b as j,e as y,j as M,d as w,f as I,q as ve,v as B,l as u,t as b,h as E,m as q,n as Me}from"../chunks/scheduler.C1FoT2GD.js";import{S as Fe,i as Re,c as x,b as ee,m as te,t as T,a as O,d as le,g as ie,e as oe}from"../chunks/index.DFmxPlw4.js";import{e as Z,u as ge,o as ke}from"../chunks/each.Bmx-BImQ.js";import{b as fe}from"../chunks/paths.2ZvcQRjx.js";import{p as Te}from"../chunks/stores.uos4ky2n.js";import{P as Oe,c as Ue,g as Ie,f as ce}from"../chunks/kit.CACir_b1.js";import{P as qe,L as Ge,C as Ne}from"../chunks/page.CWCv2ozC.js";import{P as Be}from"../chunks/player.rtVQwoeI.js";function De(_,e,t){const l=_.slice();return l[7]=e[t],l}function Ce(_,e,t){const l=_.slice();return l[10]=e[t],l}function Pe(_,e,t){const l=_.slice();return l[10]=e[t],l}function Qe(_){let e,t,l,r,a="Final Ranking",h,f,n=[],c=new Map,i,v,D,A="Brackets",S,V,p=[],g=new Map,$;e=new Ge({props:{$$slots:{default:[Xe]},$$scope:{ctx:_}}});let N=Z(_[1].rankings);const F=s=>s[10].address;for(let s=0;ss[7].idx;for(let s=0;sC[10].address;for(let C=0;C{h[i]=null}),oe()),~e?(t=h[e],t?t.p(n,c):(t=h[e]=a[e](n),t.c()),T(t,1),t.m(l.parentNode,l)):t=null)},i(n){r||(T(t),r=!0)},o(n){O(t),r=!1},d(n){n&&m(l),~e&&h[e].d(n)}}}function Ze(_){let e,t;return e=new qe({props:{title:"Tournament Details",$$slots:{default:[Ye]},$$scope:{ctx:_}}}),{c(){x(e.$$.fragment)},l(l){ee(e.$$.fragment,l)},m(l,r){te(e,l,r),t=!0},p(l,[r]){const a={};r&32771&&(a.$$scope={dirty:r,ctx:l}),e.$set(a)},i(l){t||(T(e.$$.fragment,l),t=!0)},o(l){O(e.$$.fragment,l),t=!1},d(l){le(e,l)}}}function xe(_,e,t){let l;He(_,Te,i=>t(4,l=i));let r,a,h,f;const n=Ue(i=>t(1,f=i));function c(i){t(2,r=i.get("id")??void 0),t(3,h=Number(i.get("season")??"1")-1),t(0,a=Number(i.get("idx")??NaN)),isNaN(a)?t(0,a=void 0):t(0,a-=1)}return _.$$.update=()=>{_.$$.dirty&16&&c(l.url.searchParams),_.$$.dirty&12&&r&&n(async()=>{const i=await fetch(`${Oe}/results/tournament?${new URLSearchParams({id:r,season:h.toString()})}`);if(!i.ok)throw console.error(await i.text()),new Error(i.statusText);const v=await i.json();return{...v,time:new Date(v.time),brackets:v.brackets.sort((D,A)=>A.idx-D.idx)}})},[a,f,r,h,l]}class ot extends Fe{constructor(e){super(),Re(this,e,xe,Ze,Ae,{})}}export{ot as component}; diff --git a/_app/immutable/nodes/11.ChO8jBkK.js b/_app/immutable/nodes/11.ChO8jBkK.js new file mode 100644 index 0000000..ecb77a0 --- /dev/null +++ b/_app/immutable/nodes/11.ChO8jBkK.js @@ -0,0 +1,1286 @@ +import{s as l,H as p,p as a,E as c,k as r,n as e,i as d}from"../chunks/scheduler.C1FoT2GD.js";import{S as h,i as u}from"../chunks/index.DFmxPlw4.js";const f=` + + + + + + + + +

 

+

DRAGONFLY "SEARCHERS OF NOTTINGHAM" COMPETITION 

+

PRIVACY POLICY 

+

 

+

Last Updated June 6, 2024 

+

 

+

Welcome to the website (the “Site”) of the Dragonfly "Searchers of Nottingham" Competition (the “Competition”). Through the Site Dragonfly Operations, LLC (“Company,” “we,” or “our”) administers the Competition and related services (the “Service”).  

+

 

+

This Privacy Policy explains what Personal Data (defined below) we collect, how we use and share that data, and your choices concerning our data practices. This Privacy Policy is incorporated into and forms part of our Official Rules which are available on the Site.  For information on how to enter the Competition and the terms and conditions of entry please visit the Official Rules. 

+

 

+

Before using the Service or submitting any Personal Data to Company, please review this Privacy Policy carefully and contact us if you have any questions. By using the Service, you agree to the practices described in this Privacy Policy. If you do not agree to this Privacy Policy, please do not access the Site or otherwise use the Service. 

+

 

+

1. PERSONAL DATA WE COLLECT 

+

We collect information that alone or in combination with other information in our possession could be used to identify you (“Personal Data”) as follows: 

+

Personal Data You Provide: We collect Personal Data from you when you sign up to participate in the Competition. The Personal Data we collect includes your email address, Github account, and if you are a winner of the Competition, we will also collect information relevant for tax reporting including, but not limited to, government identification and mailing address. Additionally, we may receive Personal Data from third party sites that are linked with the Service. For example, if you sign up through a third party service such as Github, we may collect other information about you that is made publicly available on such third party service. The Personal Data collected during these interactions may vary based on what you are asked to submit in connection with a particular feature of the Service or that you otherwise choose to share with us.  

+

We may also have pages on social media sites like Instagram, Facebook, Twitter, and LinkedIn 

+

(“Social Media Pages”). When you interact with our Social Media Pages, we will collect Personal Data that you elect to provide to us, such as your contact details. In addition, the companies that host our Social Media Pages may provide us with aggregate information and analytics regarding the use of our Social Media Pages. 

+

Internet Activity Data: When you visit, use, and interact with the Service, we may receive certain information about your visit, use, or interactions. For example, we may monitor the number of people that visit the Service, peak hours of visits, which page(s) are visited, the domains our visitors come from (e.g., google.com, yahoo.com, etc.), and which browsers people use to access the Service (e.g., Chrome, Firefox, Microsoft Internet Explorer, etc.), broad geographical information, and navigation pattern. In particular, the following information is created and automatically logged in our systems:  

+
    +
  • Log Data: Information that your browser automatically sends whenever you visit the Site. Log Data includes your Internet Protocol address, browser type and settings, the date and time of your request, and how you interacted with the Site.  
  • +
  • Cookies Data: Please see the Cookies section below to learn more about how we use cookies. 
  • +
  • Device Data: Includes name of the device, operating system, and browser you are using. Information collected may depend on the type of device you use and its settings.  
  • +
  • Usage Data: We collect information about how you use our Service, such as the types of content that you view or engage with, the features you use, the actions you take, and the time, frequency, and duration of your activities. 
  • +
  • Location Data: We derive a rough estimate of your location from your IP address.  
  • +
+

 

+

Personal Information We Process on Behalf of Our Business Customers: When you use and interact with the Service, we will have your IP address in order to ensure that you are able to access the Services, and we will collect your browser information so that we may provide any necessary technical support through a third party vendor.  

+

Cookies: We use cookies to operate and administer our Site, gather usage data on our Site, and improve your experience on it. A “cookie” is a piece of information sent to your browser by a website you visit. Cookies can be stored on your computer for different periods of time. Some cookies expire after a certain amount of time, or upon logging out (session cookies), others survive after your browser is closed until a defined expiration date set in the cookie (as determined by the third party placing it), and help recognize your computer when you open your browser and browse the Internet again (persistent cookies). 

+

 

+

On most web browsers, you will find a “help” section on the toolbar. Please refer to this section for information on how to receive a notification when you are receiving a new cookie and how to turn cookies off. Please see the links below for guidance on how to modify your web browser’s settings on the most popular browsers: 

+

 

+
    +
  • Internet Explorer 
  • +
  • Mozilla Firefox 
  • +
  • Google Chrome 
  • +
  • Apple Safari 
  • +
+

 

+

Please note that if you limit the ability of websites to set cookies, you may be unable to access certain parts of the Site and you may not be able to benefit from the full functionality of the Site. 

+

 

+

Advertising networks may use cookies to collect Personal Data. Most advertising networks offer you a way to opt out of targeted advertising. If you would like to find out more information, please         visit the Network Advertising Initiative’s online resources at http://www.networkadvertising.org and follow the opt-out instructions there. 

+

If you access the Site on your mobile device, you may not be able to control tracking technologies through the settings.  

+

Online Tracking and Do Not Track Signals: We and our third party service providers, including Amazon Web Services and Vercel, may use cookies, pixels, or other tracking technologies to collect information about your browsing activities over time and across different websites following your use of the Site and use that information to send targeted advertisements. Our Site currently does not respond to “Do Not Track” (“DNT”) signals and operates as described in this Privacy Policy whether or not a DNT signal is received. If we do respond to DNT signals in the future, we will update this Privacy Policy to describe how we do so.  

+

 

+

2. HOW WE USE PERSONAL DATA 

+

We may use Personal Data for the following purposes: 

+

 

+
    +
  • To provide the Service, including fulfilling any prizes awarded in the Competition, and send you any information you request about our Service; 
  • +
  • To respond to your inquiries, comments, feedback, or questions; 
  • +
  • To send administrative information to you, for example, information regarding the Service and changes to our terms, conditions, and policies; 
  • +
  • To maintain and improve the Service; 
  • +
  • To prevent fraud, criminal activity, or misuses of our Service, and to ensure the security of our IT systems, architecture, and networks; and 
  • +
  • To comply with legal obligations and legal process and to protect our rights, privacy, safety, or property, and/or that of our affiliates, you, or other third parties. 
  • +
+

 

+

Aggregated Information.  We may aggregate Personal Data and use the aggregated  information to analyze the effectiveness of our Service, to improve and add features to our Service, and for other similar purposes. In addition, from time to time, we may analyze the general behavior and characteristics of users of our Service and share aggregated information like general user statistics with prospective business partners. We may collect aggregated information through the Service, through cookies, and through other means described in this Privacy Policy. 

+


+


+

3. SHARING AND DISCLOSURE OF PERSONAL DATA 

+

In certain circumstances we may share the categories of Personal Data described above without further notice to you, unless required by the law, with the following categories of third parties: 

+

 

+
    +
  • Prize Fulfillment: In connection with fulfilling the prizes in the Competition, we may share your Personal Data to assist us in fulfilling and delivering prizes to winners of the Competition, including for example the provider of the merchandise that will be awarded during the Competition. 
  • +
  • Vendors and Service Providers: To assist us in meeting business operations needs and to perform certain services and functions, we may share Personal Data with vendors and service providers, including providers of hosting services, cloud services, and other information technology services providers, email communication software and email newsletter services, advertising and marketing services, payment processors, customer relationship management and customer support services, and analytics services. Pursuant to our instructions, these parties will access, process, or store Personal Data in the course of performing their duties to us.  
  • +
  • Business Transfers: If we are involved in a merger, acquisition, financing due diligence, reorganization, bankruptcy, receivership, sale of all or a portion of our assets, or transition of service to another provider (collectively a “Transaction”), your Personal Data and other information may be shared in the diligence process with counterparties and others assisting with the Transaction and transferred to a successor or affiliate as part of that Transaction along with other assets. 
  • +
  • Legal Requirements: If required to do so by law or in the good faith belief that such action is necessary to (i) comply with a legal obligation, including to meet national security or law enforcement requirements, (ii) protect and defend our rights or property, (iii) prevent fraud, (iv) act in urgent circumstances to protect the personal safety of users of the Service, or the public, or (v) protect against legal liability. 
  • +
+

 

+

4. UPDATE YOUR INFORMATION 

+

Please contact us if you need to change or correct your Personal Data.  

+

 

+

5. CHILDREN 

+

Our Service is not directed to children who are under the age of 18. Company does not knowingly collect Personal Data from children under the age of 18. If you have reason to believe that a child under the age of 16 has provided Personal Data to Company through the Service please contact us and we will endeavor to delete that information from our databases. 

+

 

+

6. LINKS TO OTHER WEBSITES 

+

The Service may contain links to other websites not operated or controlled by Company, including social media services (“Third Party Sites”). The information that you share with Third Party Sites will be governed by the specific privacy policies and Official Rules of the Third Party Sites and not by this Privacy Policy. By providing these links we do not imply that we endorse or have reviewed these sites. Please contact the Third Party Sites directly for information on their privacy practices and policies.  

+

 

+

7. SECURITY 

+

You use the Service at your own risk. We implement commercially reasonable technical, administrative, and organizational measures to protect Personal Data both online and offline from loss, misuse, and unauthorized access, disclosure, alteration, or destruction. However, no Internet or e-mail transmission is ever fully secure or error free. In particular, e-mail sent to or from us may not be secure. Therefore, you should take special care in deciding what information you send to us via the Service or e-mail. Please keep this in mind when disclosing any Personal Data to Company via the Internet. In addition, we are not responsible for circumvention of any privacy settings or security measures contained on the Service, or third party websites. 

+

8. INTERNATIONAL USERS 

+

By using our Service, you understand and acknowledge that your Personal Data will be transferred from your location to our facilities and servers in the United States. 

+

9. YOUR CHOICES 

+

In certain circumstances providing Personal Data is optional. However, if you choose not to provide Personal Data that is needed to use some features of our Service, you may be unable to use those features. You can also contact us to ask us to update or correct your Personal Data. 

+

10. CHANGES TO THE PRIVACY POLICY 

+

The Service and our business may change from time to time. As a result, we may change this Privacy Policy at any time. When we do, we will post an updated version on this page, unless another type of notice is required by the applicable law. By continuing to use our Service or providing us with Personal Data after we have posted an updated Privacy Policy, or notified you by other means if applicable, you consent to the revised Privacy Policy and practices described in it. 

+

 

+

11. CONTACT US 

+

If you have any questions about our Privacy Policy or information practices, please feel free to contact us at privacy@dragonfly.xyz.  

+


+


+

 

+
+


+
+ + +`;function g(o){let n,s;return{c(){n=new p(!1),s=a(),this.h()},l(t){n=c(t,!1),s=a(),this.h()},h(){n.a=s},m(t,i){n.m(f,t,i),r(t,s,i)},p:e,i:e,o:e,d(t){t&&(d(s),n.d())}}}class m extends h{constructor(n){super(),u(this,n,null,g,l,{})}}export{m as component}; diff --git a/_app/immutable/nodes/12.a84Fgjde.js b/_app/immutable/nodes/12.a84Fgjde.js new file mode 100644 index 0000000..9c09243 --- /dev/null +++ b/_app/immutable/nodes/12.a84Fgjde.js @@ -0,0 +1 @@ +import{s as a,H as r,p as n,E as c,k as _,n as e,i as p}from"../chunks/scheduler.C1FoT2GD.js";import{S as x,i as k}from"../chunks/index.DFmxPlw4.js";const u='

Dragonfly Capture the Flag Competition (“Searchers of Nottingham”) Official Rules

Date:  June 15, 2024

THESE OFFICIAL RULES CONTAIN AN ARBITRATION AGREEMENT, WHICH WILL, WITH LIMITED EXCEPTION, REQUIRE YOU TO SUBMIT CLAIMS YOU HAVE AGAINST SPONSOR TO BINDING AND FINAL ARBITRATION. UNDER THE ARBITRATION AGREEMENT, (1) YOU WILL ONLY BE PERMITTED TO PURSUE CLAIMS AGAINST SPONSOR ON AN INDIVIDUAL BASIS, NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY CLASS OR REPRESENTATIVE ACTION OR PROCEEDING, AND (2) YOU WILL ONLY BE PERMITTED TO SEEK RELIEF (INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ON AN INDIVIDUAL BASIS.

The Dragonfly Capture the Flag Competition “Searchers of Nottingham” (the “Competition”) begins on Saturday, June 15, 2024 at 05:00 PM UTC (the “Competition Start Date”) and ends at 05:00 PM UTC on Sunday, June 30, 2024 (the “Competition End Date”) (such period referred to herein as the “Competition Period”). ENTRANTS ARE RESPONSIBLE FOR DETERMINING THE CORRESPONDING TIME ZONE IN THEIR RESPECTIVE JURISDICTIONS.  The Competition is sponsored by Dragonfly Operations, LLC (the “Sponsor”).

  1. HOW TO ENTER

NO PURCHASE NECESSARY TO ENTER OR CLAIM PRIZE. VOID WHERE PROHIBITED. A PURCHASE WILL NOT INCREASE YOUR CHANCES OF WINNING. Participation in the Competition is voluntary.  All entries are subject to Sponsor’s privacy policy located at nottingham.dragonfly.xyz/privacy.

Individuals or teams may participate in the Competition. At any time during the Competition Period, individual or team participants (each a “Participant”) may enter the Competition by completing all required steps in the sign-up process located at https://nottingham.dragonfly.xyz (the “Website”), including without limitation providing the Participant’s github account, name, email address, the names of the other team members (if applicable) and the team name (if applicable). After the Participants complete the sign-up process, they will receive access to the Competition dashboard (the “Dashboard”), which is where the Challenges (as defined below) are made available and where Participants can submit their solutions for each Challenge.

For teams participating in the Competition, each team must be represented by one (1) team leader (the “Team Leader”). The Team Leader is the sole contact person for purposes of the Competition and is responsible for submitting the sign-up form, generating a team token to distribute to the other team members so that they can join the team and also access the Dashboard, and submitting the solutions to each puzzle.

During the Competition Period, the Participants may submit a smart contract (each a “Solution”) which will be evaluated against Solutions from other Participants in a series of tournament-style games (each a “Challenge” and collectively, the “Challenges”). The performance of every Participants’ Solutions across Challenges will result in a relative score of all respective Participants. Challenges are hosted on a private EVM environment controlled by us.  Not all Challenges award prizes; each Challenge will specify whether a prize will be given. Three Challenges will occur during the Competition Period which award prizes to the Participant with the highest score.  No illegible, incomplete, forged or altered entries will be accepted. All entries become the property of Sponsor and will not be returned. An individual may not enter both individually and as a member of a team and can only submit one final entry for judging (either individually or as part of a team).  Participants may submit multiple Solutions, but each new Submission (as defined in Section 4) overwrites the previous one, so only one final entry per participant will be judged.

  1. SELECTION OF WINNERS; PRIZE:

For Challenges that award prizes, Participants will be ranked by a score derived from the relative performance of their Solution against other Participant Solutions. The top Participant(s) in each Challenge based on this score (collectively, the “Winners”) will be eligible to receive prizes ranging from approximately $1,000 USD to $4,000 USD worth of ETH (each a Prize, and collectively, the “Prizes”). To receive the applicable Prize, (i) each potential Winner must have and communicate a wallet address that will allow the Winner to receive a Prize, (ii) each potential Winner must submit information sufficient to verify identity for purposes of determining eligibility, including without limitation name, address, date of birth, and government ID, all of which must be submitted within 2 weeks of their receiving the notice in Section 6 (such date, the “Due Date”). In the event of a tie between two or more Participants, a Winner will be selected pseudorandomly, based on the configuration of the software conducting Challenges.

In the case of a Participant that is a team, the prize(s) will only be awarded to the Team Leader. The Team Leader is solely responsible for complying with all requirements applicable to receipt of such prize. The Team Leader is also solely liable and responsible for sharing the prize with the other members of its team, at the Team Leader’s sole discretion. Sponsor will not be liable for any action or omission by any Team Leader, including without limitation any Team Leader’s failure to share a prize with the other team members.

Allow 3-4 weeks after validation of eligibility for receipt of prize. Odds of winning are affected by the number of eligible entries received by the Competition End Date. The Winners will be solely responsible for all other expenses not specifically set forth herein. The Sponsor reserves the right to substitute prizes of equal or greater value (based on the fair market value at the Competition End Date. No other substitution or transfer of prizes permitted. To receive a prize, the Participants may be required to provide proof of identification, including name, age, address and date of birth, and agree to provide any other information reasonably requested by Sponsor in order to deliver the prize. In order to receive the ETH prize, Winners may be required to provide any information reasonably requested by Sponsor in order to fulfill and deliver the prize including their wallet address (as applicable), name, date of birth, mailing address, taxpayer information, and a copy of their passport or other valid proof of identity. All federal, state, and local or other taxes on any prize, including income and/or sales taxes, are the sole responsibility of the Winner. Any Winner who receives a prize with a value of $600 or greater will be issued an IRS Form Misc-1099 for the actual value of the prize, and are advised to seek independent counsel regarding the tax implications of the prize winnings; provided, however, Sponsor may elect to gross up the prize to cover the Winner’s taxes for such prize.

  1. ELIGIBILITY:

The Competition is only open to individuals who are (i) over eighteen (18) years of age at the time of entry and (ii) reside in a jurisdiction other than any jurisdiction comprehensively sanctioned by the United States Office of Foreign Asset Control (“OFAC”) at the time the entry is submitted (the list of sanctions programs administered by OFAC is available at https://www.treasury.gov/resource-center/sanctions/programs/pages/programs.aspx) and whom is not otherwise subject to OFAC sanctions. In addition, in order to be eligible to receive a prize, each potential winner must comply with the requirements set forth in Section 2. By participating in the Competition, each Participant accepts the conditions stated in these Official Rules, agrees to be bound by the decisions of Sponsor and warrants that she/he is eligible to participate in the Competition. Employees, independent contractors, interns, officers, and directors of Sponsor, affiliates, subsidiaries, advertising, Competition, and fulfillment agencies, and legal advisors, and their immediate family members and persons living in the same household, are not eligible to participate in the Competition. THE COMPETITION IS VOID WHERE PROHIBITED OR RESTRICTED BY LAW and is subject to applicable international, federal, state and local laws and regulations.

  1. USE OF CONTENT/SUBMISSIONS.

By submitting solutions to the Challenges (“Submissions”) to Sponsor in connection with this Competition, you automatically represent and warrant that you have the right to grant, and do hereby grant, to Sponsor the paid-up, royalty-free, perpetual, irrevocable, sublicensable, non-exclusive right and license to (a) use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, perform and display any such Submissions (in whole or in part) worldwide and/or to incorporate all or any portion of it in other works in any form, media or technology now known or later developed for the full term of any patent, trademark, trade secret, copyright or other proprietary rights of any party that may exist in such Submissions; and (b) use the Submissions, including without limitation, the right and license to make, use, sell, offer for sale, and import any products and/or services which practice or embody, or are configured for use in practicing, all or any portion of the Submissions and the right to practice. BY SUBMITTING AN ENTRY, EACH PARTICIPANT ACKNOWLEDGES THAT HIS/HER ENTRY MAY BE POSTED ON SPONSOR’S WEBSITE, SOCIAL MEDIA CHANNELS AND OTHER CHANNELS, AND EDITED, IN SPONSOR’S DISCRETION. Inclusion of Submissions on Sponsor’s website, social media channels or other channels will include attribution to the photographer and you hereby grant Sponsor the paid-up, royalty-free, perpetual, irrevocable, sublicensable, non-exclusive right and license to use your name and other likeness for such purpose. Under no circumstances will Sponsor be required to treat any Submissions as confidential. Sponsor will be entitled to use the Submissions for any purpose whatsoever without compensation to you or any other person. For the avoidance of doubt, Sponsor will not be liable to you or any other person for any ideas for Sponsor’s business (including, without limitation, product designs or ideas) derived from the Submissions and will not incur any liability as a result of any similarities to the Submissions that may appear in any future products or services of Sponsor. You warrant that the content in the Submission has not been copied from any third party and its use by Sponsor will not infringe or involve the misappropriation of any third party rights and agree to indemnify and hold harmless Sponsor and all other third parties licensed above from and against any breach of this warranty.

  1. LIMITATION OF LIABILITY & DISCLAIMER OF WARRANTIES: 

IN NO EVENT WILL SPONSOR OR ITS AFFILIATES, SUBSIDIARIES AND RELATED COMPANIES, OR THEIR RESPECTIVE OFFICERS, DIRECTORS, EMPLOYEES, REPRESENTATIVES AND AGENTS, BE RESPONSIBLE OR LIABLE FOR ANY DAMAGES OR LOSSES OF ANY KIND, INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL OR PUNITIVE DAMAGES ARISING OUT OF YOUR PARTICIPATION IN THE COMPETITION OR FOR ANY ACTION OR OMISSION MADE IN CONNECTION WITH THE COMPETITION. WITHOUT LIMITING THE FOREGOING, EVERYTHING IN THESE RULES AND IN THIS COMPETITION, INCLUDING THE PRIZES AWARDED, IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. SOME JURISDICTIONS MAY NOT ALLOW THE LIMITATIONS OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES OR EXCLUSION OF IMPLIED WARRANTIES SO SOME OF THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU. CHECK YOUR LOCAL LAWS FOR ANY RESTRICTIONS OR LIMITATIONS REGARDING THESE LIMITATIONS OR EXCLUSIONS.

  1. NOTIFICATION OF WINNERS:

The Winners will be notified by email using the information provided when the Participant entered the Competition, within approximately thirty (30) days of the Competition End Date.  Such notification to the Winners shall include instructions for proper acceptance of the prize by such Winner.  In the event a Winner does not accept a prize, a Winner is ineligible, or the prize or prize notification is not deliverable, an alternate Winner may be selected.  Sponsor is not responsible for and shall not be liable for late, lost, misdirected or unsuccessful efforts to notify a Winner.  Each Participant agrees to Sponsor’s use of their name, address, likeness, and/or prize information for promotional purposes in any medium without additional compensation to the extent permitted by law.  Where lawful, each Winner may be required to sign and return an Affidavit of Eligibility, Release of Liability, and Publicity Release.  All Participants will be notified of the points they earn from each Challenge (if any) through the Dashboard.

The Sponsor is not responsible for notifying or distributing the prize or redeemed merchandise amongst the other team members.

  1. WINNERS LIST:  

The list of Winners  may be posted on the Sponsor’s website and social media accounts within approximately 5 days of the Competition End Date.

  1. WARRANTY, INDMENITY AND RELEASE:

Sponsor and its respective agents, directors, officers, shareholders, employees, insurers, servants, parents, subsidiaries, divisions, affiliates, predecessors, successors, representatives, advertising, Competition, and fulfillment agencies, and legal advisors (the “Released Entities”), are not responsible for, shall not be liable for, and hereby disclaim all liability arising from or relating to: (i) late, lost, delayed, damaged, misdirected, misaddressed, incomplete, or unintelligible entries; (ii) telephone, electronic, hardware or software program, network, Internet, computer or other malfunctions, failures, or difficulties of any kind, whether human or technical; (iii) failed, incomplete, garbled, or delayed computer or e-mail transmissions; (iv) any condition caused by events beyond the control of Sponsor; (v) any injuries, losses, or damages of any kind arising in connection with or as a result of any prize, or any portion thereof that may have been awarded, or acceptance, possession, or use of any prize, or any portion thereof that may have been awarded, or from participation in the Competition; (vi) any printing or typographical errors in any materials associated with the Competition; or (v) the Competition. Sponsor reserves the right, in its sole discretion, to suspend, modify or cancel the Competition should any unauthorized human intervention or other causes beyond Sponsor’s control corrupt or affect the administration, security, fairness or proper conduct of the Competition. In the event that proper administration of the Competition is prevented by such causes as contemplated above, Sponsor will pick the Winners from all eligible, non-suspect entries received prior to such action. By participating in the Competition, Participants and Winners agree to release, discharge and hold harmless the Released Entities, and all others associated with the development and execution of the Competition, from any and all losses, damages, rights, claims and actions of any kind arising out of or relating to the Competition, participation in the Competition, any prize, or any portion thereof that may have been awarded, and/or acceptance, possession, use or misuse of any prize, or any portion thereof that may have been awarded, including but not limited to statutory and common law claims for misappropriation or Participant’s right of publicity.

  1. GOVERNING LAW:

The Sponsor’s computer is the official clock for the Competition. This Competition shall be governed by New York law.

  1. RIGHT TO CANCEL:

If for any reason the Competition not capable of running as planned, including tampering, unauthorized intervention, fraud, technical failures, printing errors, or any other causes which corrupt or affect the administration, security, fairness, integrity, or proper conduct of the Competition, Sponsor reserves the right at its sole discretion to cancel, terminate, modify or suspend the Competition. Sponsor further reserves the right to disqualify any Participant who tampers with the submission process or contest, cheats, deceives, abuses, annoys, threatens any other Participants or judges, or otherwise violates any law or behaves in an unfit manner as determined by Sponsor.

  1. ARBITRATION AGREEMENT

PLEASE READ THIS SECTION CAREFULLY AS IT AFFECTS YOUR RIGHTS.

  1. Agreement to Arbitrate. This Section 10 is referred to in these Official Rules as the “Arbitration Agreement.” You agree that any and all disputes or claims that have arisen or may arise between you and Sponsor, whether arising out of or relating to these Official Rules (including any alleged breach thereof), any advertising, any aspect of the relationship or transactions between us, shall be resolved exclusively through final and binding arbitration, rather than a court, in accordance with the terms of this Arbitration Agreement, except that you may assert individual claims in small claims court, if your claims qualify. Further, this Arbitration Agreement does not preclude you from bringing issues to the attention of federal, state, or local agencies, and such agencies can, if the law allows, seek relief against us on your behalf. You agree that, by entering into these Official Rules, you and Sponsor are each waiving the right to a trial by jury or to participate in a class action. Your rights will be determined by a neutral arbitrator, not a judge or jury. The Federal Arbitration Act governs the interpretation and enforcement of this Arbitration Agreement.

  1. Prohibition of Class and Representative Actions and Non-Individualized ReliefYOU AND SPONSOR AGREE THAT EACH OF US MAY BRING CLAIMS AGAINST THE OTHER ONLY ON AN INDIVIDUAL BASIS AND NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY PURPORTED CLASS OR REPRESENTATIVE ACTION OR PROCEEDING. UNLESS BOTH YOU AND SPONSOR AGREE OTHERWISE, THE ARBITRATOR MAY NOT CONSOLIDATE OR JOIN MORE THAN ONE PERSON’S OR PARTY’S CLAIMS AND MAY NOT OTHERWISE PRESIDE OVER ANY FORM OF A CONSOLIDATED, REPRESENTATIVE, OR CLASS PROCEEDING. ALSO, THE ARBITRATOR MAY AWARD RELIEF (INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ONLY IN FAVOR OF THE INDIVIDUAL PARTY SEEKING RELIEF AND ONLY TO THE EXTENT NECESSARY TO PROVIDE RELIEF NECESSITATED BY THAT PARTY’S INDIVIDUAL CLAIM(S).

  1. Pre-Arbitration Dispute Resolution.        Sponsor is always interested in resolving disputes amicably and efficiently, and most customer concerns can be resolved quickly and to the customer’s satisfaction by emailing Dragonfly at privacy@dragonfly.xyz. If such efforts prove unsuccessful, a party who intends to seek arbitration must first send to the other, by certified mail, a written Notice of Dispute (“Notice”). The Notice to Sponsor should be sent to Dragonfly Operations, LLC at 447 Sutter Street Ste 405, #475, San Francisco, CA 94108 (“Notice Address”). The Notice must (i) describe the nature and basis of the claim or dispute and (ii) set forth the specific relief sought. If Sponsor and you do not resolve the claim within sixty (60) calendar days after the Notice is received, you or Sponsor may commence an arbitration proceeding. During the arbitration, the amount of any settlement offer made by Sponsor or you shall not be disclosed to the arbitrator until after the arbitrator determines the amount, if any, to which you or Sponsor is entitled.

  1. Arbitration Procedures. Arbitration will be conducted by a neutral arbitrator in accordance with the American Arbitration Association’s (“AAA”) rules and procedures, including the AAA’s Supplementary Procedures for Consumer-Related Disputes (collectively, the “AAA Rules”), as modified by this Arbitration Agreement. For information on the AAA, please visit its website, http://www.adr.org. Information about the AAA Rules and fees for consumer disputes can be found at the AAA’s consumer arbitration page, http://www.adr.org/consumer_arbitration. If there is any inconsistency between any term of the AAA Rules and any term of this Arbitration Agreement, the applicable terms of this Arbitration Agreement will control unless the arbitrator determines that the application of the inconsistent Arbitration Agreement terms would not result in a fundamentally fair arbitration. The arbitrator must also follow the provisions of these Official Rules as a court would. All issues are for the arbitrator to decide, including, but not limited to, issues relating to the scope, enforceability, and arbitrability of this Arbitration Agreement. Although arbitration proceedings are usually simpler and more streamlined than trials and other judicial proceedings, the arbitrator can award the same damages and relief on an individual basis that a court can award to an individual under these Official Rules and applicable law. Decisions by the arbitrator are enforceable in court and may be overturned by a court only for very limited reasons.

Unless Sponsor and you agree otherwise, any arbitration hearings will take place in a reasonably convenient location for both parties with due consideration of their ability to travel and other pertinent circumstances. If the parties are unable to agree on a location, the determination shall be made by AAA. If your claim is for $10,000 or less, Sponsor agrees that you may choose whether the arbitration will be conducted solely on the basis of documents submitted to the arbitrator, through a telephonic hearing, or by an in-person hearing as established by the AAA Rules. If your claim exceeds $10,000, the right to a hearing will be determined by the AAA Rules. Regardless of the manner in which the arbitration is conducted, the arbitrator shall issue a reasoned written decision sufficient to explain the essential findings and conclusions on which the award is based.

  1. Costs of Arbitration. Payment of all filing, administration, and arbitrator fees (collectively, the “Arbitration Fees”) will be governed by the AAA Rules, unless otherwise provided in this Arbitration Agreement. If the value of the relief sought is $75,000 or less, at your request, Sponsor will pay all Arbitration Fees. If the value of relief sought is more than $75,000 and you are able to demonstrate to the arbitrator that you are economically unable to pay your portion of the Arbitration Fees or if the arbitrator otherwise determines for any reason that you should not be required to pay your portion of the Arbitration Fees, Sponsor will pay your portion of such fees. In addition, if you demonstrate to the arbitrator that the costs of arbitration will be prohibitive as compared to the costs of litigation, Sponsor will pay as much of the Arbitration Fees as the arbitrator deems necessary to prevent the arbitration from being cost-prohibitive. Finally, if the value of the relief sought is $75,000 or less, Sponsor will pay reasonable attorneys’ fees should you prevail. Sponsor will not seek attorneys’ fees from you. But, if you initiate an arbitration in which you seek more than $75,000 in relief, the payment of attorneys’ fees will be governed by the AAA Rules.

  1. Confidentiality. All aspects of the arbitration proceeding, and any ruling, decision, or award by the arbitrator, will be strictly confidential for the benefit of all parties.

  1. Severability. Without limiting the severability provision in Section 10 of the these Official Rules, if a court or the arbitrator decides that any term or provision of this Arbitration Agreement other than Section 10(b) above is invalid or unenforceable, the parties agree to replace such term or provision with a term or provision that is valid and enforceable and that comes closest to expressing the intention of the invalid or unenforceable term or provision, and this Arbitration Agreement shall be enforceable as so modified. If a court decides that any of the provisions of Section 10(b) is invalid or unenforceable, then the entirety of this Arbitration Agreement shall be null and void.  The remainder of these Official Rules will continue to apply.

  1. Future Changes to Arbitration Agreement. Notwithstanding any provision in these Official Rules to the contrary, Sponsor agrees that if it makes any future change to this Arbitration Agreement (other than a change to the Notice Address) while you are a user of the Services, you may reject any such change by sending Sponsor written notice within thirty (30) calendar days of the change to the Notice Address provided above. By rejecting any future change, you are agreeing that you will arbitrate any dispute between us in accordance with the language of this Arbitration Agreement.
  1. SPONSOR:  

This Competition is sponsored by Dragonfly Operations, LLC at 447 Sutter Street Ste 405, #475, San Francisco, CA 94108.

  1. NOTICE:

Sponsor reserves the right to prosecute and seek damages against any individual who attempts to deliberately undermine the proper operation of the Competition in violation of these Official Rules and/or criminal and/or civil law.

  1. PUBLICITY: 

By entering, Participant agrees and consents to permit Sponsor and its agencies to use his or her name, photographs and/or likeness, code and any provided or recorded/streamed video for advertising and promotional purposes without additional compensation.

FLAG-YOURE-IT

';function d(o){let t,i;return{c(){t=new r(!1),i=n(),this.h()},l(s){t=c(s,!1),i=n(),this.h()},h(){t.a=i},m(s,l){t.m(u,s,l),_(s,i,l)},p:e,i:e,o:e,d(s){s&&(p(i),t.d())}}}class y extends x{constructor(t){super(),k(this,t,null,d,a,{})}}export{y as component}; diff --git a/_app/immutable/nodes/2.Br0Ktlaf.js b/_app/immutable/nodes/2.Br0Ktlaf.js new file mode 100644 index 0000000..a4f8ca2 --- /dev/null +++ b/_app/immutable/nodes/2.Br0Ktlaf.js @@ -0,0 +1 @@ +import{aO as e}from"../chunks/2.CpRWH4-H.js";export{e as component}; diff --git a/_app/immutable/nodes/3.CLG0najm.js b/_app/immutable/nodes/3.CLG0najm.js new file mode 100644 index 0000000..fd64263 --- /dev/null +++ b/_app/immutable/nodes/3.CLG0najm.js @@ -0,0 +1,6 @@ +import{s as pt,e as m,d as _,f as I,i as f,k,o as Ct,y as Et,N as Mt,q as V,n as K,p as ze,b as x,t as C,j as T,h as E,v as h,l as c,m as re,z as Lt,M as tt,B as Dt}from"../chunks/scheduler.C1FoT2GD.js";import{S as kt,i as bt,g as Ce,a as U,e as Ee,t as R,c as ge,b as ye,m as $e,d as xe}from"../chunks/index.DFmxPlw4.js";import{e as ke,u as gt,o as yt}from"../chunks/each.Bmx-BImQ.js";import{b as Z}from"../chunks/paths.2ZvcQRjx.js";import{a as $t,P as Ht,c as St,S as be,x as lt,y as Re,z as at,i as It,g as st,j as nt,L as rt,A as pe,C as xt}from"../chunks/kit.CACir_b1.js";import{C as Tt,P as zt,L as jt}from"../chunks/page.CWCv2ozC.js";import{P as Pt}from"../chunks/player.rtVQwoeI.js";import{C as it}from"../chunks/contest.LM7IXEuc.js";function ot(u,e,t){const l=u.slice();return l[12]=e[t],l}function ct(u,e,t){const l=u.slice();return l[15]=e[t],l[17]=t,l}function Nt(u){let e,t="No games have been played yet.";return{c(){e=m("div"),e.textContent=t},l(l){e=_(l,"DIV",{"data-svelte-h":!0}),V(e)!=="svelte-9a3pkb"&&(e.textContent=t)},m(l,a){k(l,e,a)},p:K,i:K,o:K,d(l){l&&f(e)}}}function Vt(u){let e=[],t=new Map,l,a,s=ke(u[1].filter(dt).slice().sort(u[8]));const n=o=>o[12].idx;for(let o=0;oi[17];for(let i=0;iu[4]&&ht(u);return{c(){for(let i=0;ii[4]?r?r.p(i,v):(r=ht(i),r.c(),r.m(a.parentNode,a)):r&&(r.d(1),r=null)},i(i){if(!s){for(let v=0;v{P[L]=null}),Ee(),b=P[S],b?b.p(e,d):(b=P[S]=N[S](e),b.c()),R(b,1),b.m($,null))},i(M){z||(R(b),z=!0)},o(M){U(b),z=!1},d(M){M&&f(t),H.d(),P[S].d()}}}function ht(u){let e,t,l=u[3][u[12].idx].length-u[0]+"",a,s,n;return{c(){e=m("div"),t=m("a"),a=C(l),s=C(" more tournaments..."),this.h()},l(o){e=_(o,"DIV",{class:!0});var r=I(e);t=_(r,"A",{href:!0,class:!0});var i=I(t);a=E(i,l),s=E(i," more tournaments..."),i.forEach(f),r.forEach(f),this.h()},h(){h(t,"href",n=`${Z}/season?season=${u[12].idx+1}`),h(t,"class","svelte-a2bvju"),h(e,"class","more")},m(o,r){k(o,e,r),c(e,t),c(t,a),c(t,s)},p(o,r){r&11&&l!==(l=o[3][o[12].idx].length-o[0]+"")&&re(a,l),r&2&&n!==(n=`${Z}/season?season=${o[12].idx+1}`)&&h(t,"href",n)},d(o){o&&f(e)}}}function vt(u,e){let t,l,a,s,n,o,r,i=e[12].idx+1+"",v,p,$,w,S,b,z,A,D,H,N,P;function j(q,G){if(G&2&&(S=null),q[12].closedTime)return qt;if(S==null&&(S=!!q[6](q[12].idx)),S)return Ot}let M=j(e,-1),d=M&&M(e),L=e[12].prize&&e[12].prize>0n&&ut(e);const B=[Ut,Ft],O=[];function W(q,G){var F;return(F=q[3][q[12].idx])!=null&&F.length?0:1}return D=W(e),H=O[D]=B[D](e),{key:u,first:null,c(){t=m("div"),l=m("h3"),a=m("img"),n=x(),o=m("a"),r=C("Season "),v=C(i),$=x(),w=m("span"),d&&d.c(),b=x(),L&&L.c(),z=x(),A=m("div"),H.c(),N=x(),this.h()},l(q){t=_(q,"DIV",{class:!0});var G=I(t);l=_(G,"H3",{class:!0});var F=I(l);a=_(F,"IMG",{class:!0,src:!0,alt:!0}),n=T(F),o=_(F,"A",{href:!0,class:!0});var ie=I(o);r=E(ie,"Season "),v=E(ie,i),ie.forEach(f),$=T(F),w=_(F,"SPAN",{class:!0});var J=I(w);d&&d.l(J),J.forEach(f),b=T(F),L&&L.l(F),F.forEach(f),z=T(G),A=_(G,"DIV",{class:!0});var Te=I(A);H.l(Te),Te.forEach(f),N=T(G),G.forEach(f),this.h()},h(){h(a,"class","leaf svelte-a2bvju"),Lt(a.src,s=`${Z}/leaf.png`)||h(a,"src",s),h(a,"alt","season"),h(o,"href",p=`${Z}/season?season=${e[12].idx+1}`),h(o,"class","svelte-a2bvju"),h(w,"class","smaller svelte-a2bvju"),h(l,"class","svelte-a2bvju"),h(A,"class","tournaments svelte-a2bvju"),h(t,"class","season svelte-a2bvju"),tt(t,"current",e[12].idx===e[1].length-1),this.first=t},m(q,G){k(q,t,G),c(t,l),c(l,a),c(l,n),c(l,o),c(o,r),c(o,v),c(l,$),c(l,w),d&&d.m(w,null),c(l,b),L&&L.m(l,null),c(t,z),c(t,A),O[D].m(A,null),c(t,N),P=!0},p(q,G){e=q,(!P||G&2)&&i!==(i=e[12].idx+1+"")&&re(v,i),(!P||G&2&&p!==(p=`${Z}/season?season=${e[12].idx+1}`))&&h(o,"href",p),M===(M=j(e,G))&&d?d.p(e,G):(d&&d.d(1),d=M&&M(e),d&&(d.c(),d.m(w,null))),e[12].prize&&e[12].prize>0n?L?L.p(e,G):(L=ut(e),L.c(),L.m(l,null)):L&&(L.d(1),L=null);let F=D;D=W(e),D===F?O[D].p(e,G):(Ce(),U(O[F],1,1,()=>{O[F]=null}),Ee(),H=O[D],H?H.p(e,G):(H=O[D]=B[D](e),H.c()),R(H,1),H.m(A,null)),(!P||G&2)&&tt(t,"current",e[12].idx===e[1].length-1)},i(q){P||(R(H),P=!0)},o(q){U(H),P=!1},d(q){q&&f(t),d&&d.d(),L&&L.d(),O[D].d()}}}function Kt(u){let e,t,l,a;const s=[Gt,At,Vt,Nt],n=[];function o(r,i){return r[2]instanceof Promise?0:r[2]instanceof Error?1:r[1].length>0?2:3}return t=o(u),l=n[t]=s[t](u),{c(){e=m("div"),l.c()},l(r){e=_(r,"DIV",{});var i=I(e);l.l(i),i.forEach(f)},m(r,i){k(r,e,i),n[t].m(e,null),a=!0},p(r,[i]){let v=t;t=o(r),t===v?n[t].p(r,i):(Ce(),U(n[v],1,1,()=>{n[v]=null}),Ee(),l=n[t],l?l.p(r,i):(l=n[t]=s[t](r),l.c()),R(l,1),l.m(e,null))},i(r){a||(R(l),a=!0)},o(r){U(l),a=!1},d(r){r&&f(e),n[t].d()}}}const dt=u=>!u.isTerminal;function Qt(u,e,t){let l;const{seasons:a}=$t();Ct(u,a,b=>t(1,l=b));let s;const n=St(b=>t(2,s=b));let o={},r=null,{maxTournaments:i=5}=e,v=i;Et(()=>{r=setInterval(async()=>{t(3,o=await p())},6e4),(async()=>t(3,o=await n(p())))()}),Mt(()=>{r&&(clearInterval(r),r=null)});async function p(){const b=await fetch(`${Ht}/results`);if(!b.ok)throw console.error(await b.text()),new Error(b.statusText);const z=(await b.json()).map(A=>({...A,time:new Date(A.time)}));return z.sort((A,D)=>D.time.getTime()-A.time.getTime()),z.reduce((A,D)=>Object.assign(A,{[D.season]:[...A[D.season]??[],D]}),{})}function $(b){return be[b]?be[b]:null}function w(b){const z=b.getTime()-Date.now();return z>lt*2?`${Math.round(z/lt)} days`:z>=Re*2?`${Math.round(z/Re)} hours`:z>Re?"1 hour":z>at*2?`${Math.round(z/at)} minutes`:"a few seconds"}const S=(b,z)=>It(z.startTime,b.startTime);return u.$$set=b=>{"maxTournaments"in b&&t(0,i=b.maxTournaments)},u.$$.update=()=>{u.$$.dirty&3&&t(4,v=Math.max(i,l.length>1?i:10))},[i,l,s,o,v,a,$,w,S]}class Xt extends kt{constructor(e){super(),bt(this,e,Qt,Kt,pt,{maxTournaments:0})}}function mt(u,e,t){const l=u.slice();return l[2]=e[t],l[4]=t,l}function el(u){let e,t="Searchers of Nottingham",l,a,s="Nottingham beckons, merchants bold! Hawk your wares, outmaneuvering rivals in the Market's fickle dance. Bribe your way to Sheriff and control the trade flow to your own benefit. Wit and coin win the day - become Nottingham's wealthiest merchant!";return{c(){e=m("h1"),e.textContent=t,l=x(),a=m("p"),a.textContent=s,this.h()},l(n){e=_(n,"H1",{class:!0,"data-svelte-h":!0}),V(e)!=="svelte-15mx40m"&&(e.textContent=t),l=T(n),a=_(n,"P",{class:!0,"data-svelte-h":!0}),V(a)!=="svelte-14pgpqd"&&(a.textContent=s),this.h()},h(){h(e,"class","initialed svelte-xkivak"),h(a,"class","svelte-xkivak")},m(n,o){k(n,e,o),k(n,l,o),k(n,a,o)},p:K,d(n){n&&(f(e),f(l),f(a))}}}function tl(u){let e,t,l='Timeline',a,s,n,o=pe.reduce(ul).toLocaleString()+"",r,i,v=pe.length+"",p,$,w,S,b=xt.getTime()!=0,z,A,D=b&&ll(),H=ke(be),N=[];for(let j=0;j🚩 Game contracts (start here!) +
  • A foundry development environment containing all the core game logic, sample agents, and a local match runner. Once you've developed a contract, come back here to upload it and join tournaments during the season to see how it does.
`;return{c(){e=m("li"),e.innerHTML=t,this.h()},l(l){e=_(l,"LI",{class:!0,"data-svelte-h":!0}),V(e)!=="svelte-1heqvvf"&&(e.innerHTML=t),this.h()},h(){h(e,"class","svelte-xkivak")},m(l,a){k(l,e,a)},d(l){l&&f(e)}}}function ol(u){let e,t,l,a=`medieval illustration medieval illustration`,s,n,o='

Gameplay

Searchers of Nottingham is a multiplayer, MEV-themed game built on the Ethereum Virtual Machine. Players submit compiled smart contracts which represent Merchants at a medieval fair trying to stock their stall with goods (tokens). Merchants face each other in multiple small games. Each round Merchants will try to exchange their gold and goods at the Market (a constant product AMM). But a Merchant can also choose to bid gold to become the Sheriff for that round. The Sheriff chooses the order in which all trades are made and can also make their own trades at will. The first Merchant to acquire the maximum amount of any single good will win!

',r,i,v,p='The Contest',$,w,S='The contest will run approximately over a period of 15 days, with every 5 days marking a "Season." Seasons are made up of quick, daily tournaments and one final and conclusive tournament on the last day. Tournaments pit all players in the season against each other to produce an overall ranking.',b,z,A='On every day of a season, "Market Day" tournaments will be held every 2 hours. These tournaments award no prizes but are important to partake in because they give players a sense of how well their contract performs against others and creates an opportunity to discover and experiment with meta-strategies.',D,H,N='On the last day of the season, a single "Grand Faire" tournament is held. The Grand Faire DOES award prizes (in ETH) to the winner, and will also consist of more matches for certainty. The Grand Faire prize increases with each successive season, as players naturally become more sophisticated with time.',P,j,M,d,L="very",B,O,W=u[0].name+"",q,G,F,ie,J,Te='Tournaments',je,ve,Be="Players are ranked in a series of offchain tournament-style matches against each other, consisting of 4 players at a time. The top performing players of each bracket advance into the next bracket, and so on. The player that maintains the highest overall ranking in the final bracket wins the tournament!",Pe,de,We='To participate in tournaments, players must make at least one code submission while that season is open (any time before the Grand Faire). Submissions from a prior season will not automatically roll over into the next. You can submit multiple times and are encouraged to do so over the 5 days! Only the most recent submission will be used, so there is no harm in submitting early.',Ne,me,Ye="Code submissions are published onchain but are encrypted with a key that will only be revealed when the season is closes. This allows players to decrypt past season winners to train against and incentivizes players to gradually refine their solutions in the next.",Ve,Me,Le,Q,oe,Je='Resources',Ae,Y,Ge,ce,Ze='Telegram Support Group
  • Overburdened Guildsmen? Find Solace Here! Important announcements, lots of strategy/design discussions, technical support, and general good vibes.
',Oe,ue,Ke='Dragonfly Twitter Account
  • Here we'll post major progress updates and any important announcements. Be sure to follow!
',qe,ae,ee,Fe,De,Ue,_e,Qe="
  • The onchain component of the contest, which handles registration, submissions, and payouts.
  • ",He,se,Xe=`

    Legal Disclosures

    `,fe;e=new jt({props:{$$slots:{default:[el]},$$scope:{ctx:u}}});let te=be.length&&tl(u),X=rt&&nl();function wt(g,y){return rt?il:rl}let Se=wt()(u);return{c(){ge(e.$$.fragment),t=x(),l=m("div"),l.innerHTML=a,s=x(),n=m("section"),n.innerHTML=o,r=x(),i=m("section"),v=m("h2"),v.innerHTML=p,$=x(),w=m("p"),w.textContent=S,b=x(),z=m("p"),z.textContent=A,D=x(),H=m("p"),H.textContent=N,P=x(),j=m("p"),M=C("The contest is free to join, but you will need a "),d=m("em"),d.textContent=L,B=C(" small amount of ETH on "),O=m("a"),q=C(W),F=C(" to cover gas for registration, submissions, and to claim any prizes."),ie=x(),J=m("h3"),J.innerHTML=Te,je=x(),ve=m("p"),ve.innerHTML=Be,Pe=x(),de=m("p"),de.innerHTML=We,Ne=x(),me=m("p"),me.textContent=Ye,Ve=x(),te&&te.c(),Me=x(),X&&X.c(),Le=x(),Q=m("section"),oe=m("h2"),oe.innerHTML=Je,Ae=x(),Y=m("ul"),Se.c(),Ge=x(),ce=m("li"),ce.innerHTML=Ze,Oe=x(),ue=m("li"),ue.innerHTML=Ke,qe=x(),ae=m("li"),ee=m("a"),Fe=C("Contest contract"),Ue=x(),_e=m("ul"),_e.innerHTML=Qe,He=x(),se=m("section"),se.innerHTML=Xe,this.h()},l(g){ye(e.$$.fragment,g),t=T(g),l=_(g,"DIV",{class:!0,"data-svelte-h":!0}),V(l)!=="svelte-1gr30yy"&&(l.innerHTML=a),s=T(g),n=_(g,"SECTION",{id:!0,class:!0,"data-svelte-h":!0}),V(n)!=="svelte-10btu3a"&&(n.innerHTML=o),r=T(g),i=_(g,"SECTION",{id:!0,class:!0});var y=I(i);v=_(y,"H2",{class:!0,"data-svelte-h":!0}),V(v)!=="svelte-1eljlx7"&&(v.innerHTML=p),$=T(y),w=_(y,"P",{class:!0,"data-svelte-h":!0}),V(w)!=="svelte-1igs3u"&&(w.textContent=S),b=T(y),z=_(y,"P",{"data-svelte-h":!0}),V(z)!=="svelte-1bwfzdq"&&(z.textContent=A),D=T(y),H=_(y,"P",{"data-svelte-h":!0}),V(H)!=="svelte-stuewr"&&(H.textContent=N),P=T(y),j=_(y,"P",{});var le=I(j);M=E(le,"The contest is free to join, but you will need a "),d=_(le,"EM",{"data-svelte-h":!0}),V(d)!=="svelte-1q4y2nq"&&(d.textContent=L),B=E(le," small amount of ETH on "),O=_(le,"A",{href:!0,target:!0,class:!0});var we=I(O);q=E(we,W),we.forEach(f),F=E(le," to cover gas for registration, submissions, and to claim any prizes."),le.forEach(f),ie=T(y),J=_(y,"H3",{id:!0,class:!0,"data-svelte-h":!0}),V(J)!=="svelte-1af56s4"&&(J.innerHTML=Te),je=T(y),ve=_(y,"P",{"data-svelte-h":!0}),V(ve)!=="svelte-14dz9c9"&&(ve.innerHTML=Be),Pe=T(y),de=_(y,"P",{"data-svelte-h":!0}),V(de)!=="svelte-1hfp5lz"&&(de.innerHTML=We),Ne=T(y),me=_(y,"P",{"data-svelte-h":!0}),V(me)!=="svelte-15t461n"&&(me.textContent=Ye),Ve=T(y),te&&te.l(y),y.forEach(f),Me=T(g),X&&X.l(g),Le=T(g),Q=_(g,"SECTION",{id:!0,class:!0});var he=I(Q);oe=_(he,"H2",{class:!0,"data-svelte-h":!0}),V(oe)!=="svelte-z9d97e"&&(oe.innerHTML=Je),Ae=T(he),Y=_(he,"UL",{class:!0});var ne=I(Y);Se.l(ne),Ge=T(ne),ce=_(ne,"LI",{class:!0,"data-svelte-h":!0}),V(ce)!=="svelte-1jk137d"&&(ce.innerHTML=Ze),Oe=T(ne),ue=_(ne,"LI",{class:!0,"data-svelte-h":!0}),V(ue)!=="svelte-1arhalo"&&(ue.innerHTML=Ke),qe=T(ne),ae=_(ne,"LI",{class:!0});var Ie=I(ae);ee=_(Ie,"A",{href:!0,target:!0,class:!0});var et=I(ee);Fe=E(et,"Contest contract"),et.forEach(f),Ue=T(Ie),_e=_(Ie,"UL",{"data-svelte-h":!0}),V(_e)!=="svelte-uxljw5"&&(_e.innerHTML=Qe),Ie.forEach(f),ne.forEach(f),he.forEach(f),He=T(g),se=_(g,"SECTION",{class:!0,"data-svelte-h":!0}),V(se)!=="svelte-1j0sw85"&&(se.innerHTML=Xe),this.h()},h(){var g,y;h(l,"class","illustration svelte-xkivak"),h(n,"id","gameplay"),h(n,"class","svelte-xkivak"),h(v,"class","svelte-xkivak"),h(w,"class","svelte-xkivak"),h(O,"href",G=(g=u[0].blockExplorers)==null?void 0:g.default.url),h(O,"target","_blank"),h(O,"class","svelte-xkivak"),h(J,"id","tournaments"),h(J,"class","svelte-xkivak"),h(i,"id","contest"),h(i,"class","svelte-xkivak"),h(oe,"class","svelte-xkivak"),h(ce,"class","svelte-xkivak"),h(ue,"class","svelte-xkivak"),h(ee,"href",De=`${(y=u[0].blockExplorers)==null?void 0:y.default.url}address/${it}`),h(ee,"target","_blank"),h(ee,"class","svelte-xkivak"),h(ae,"class","svelte-xkivak"),h(Y,"class","svelte-xkivak"),h(Q,"id","resources"),h(Q,"class","resources svelte-xkivak"),h(se,"class","svelte-xkivak")},m(g,y){$e(e,g,y),k(g,t,y),k(g,l,y),k(g,s,y),k(g,n,y),k(g,r,y),k(g,i,y),c(i,v),c(i,$),c(i,w),c(i,b),c(i,z),c(i,D),c(i,H),c(i,P),c(i,j),c(j,M),c(j,d),c(j,B),c(j,O),c(O,q),c(j,F),c(i,ie),c(i,J),c(i,je),c(i,ve),c(i,Pe),c(i,de),c(i,Ne),c(i,me),c(i,Ve),te&&te.m(i,null),k(g,Me,y),X&&X.m(g,y),k(g,Le,y),k(g,Q,y),c(Q,oe),c(Q,Ae),c(Q,Y),Se.m(Y,null),c(Y,Ge),c(Y,ce),c(Y,Oe),c(Y,ue),c(Y,qe),c(Y,ae),c(ae,ee),c(ee,Fe),c(ae,Ue),c(ae,_e),k(g,He,y),k(g,se,y),fe=!0},p(g,y){var we,he;const le={};y&32&&(le.$$scope={dirty:y,ctx:g}),e.$set(le),(!fe||y&1)&&W!==(W=g[0].name+"")&&re(q,W),(!fe||y&1&&G!==(G=(we=g[0].blockExplorers)==null?void 0:we.default.url))&&h(O,"href",G),be.length&&te.p(g,y),(!fe||y&1&&De!==(De=`${(he=g[0].blockExplorers)==null?void 0:he.default.url}address/${it}`))&&h(ee,"href",De)},i(g){fe||(R(e.$$.fragment,g),R(X),fe=!0)},o(g){U(e.$$.fragment,g),U(X),fe=!1},d(g){g&&(f(t),f(l),f(s),f(n),f(r),f(i),f(Me),f(Le),f(Q),f(He),f(se)),xe(e,g),te&&te.d(),X&&X.d(g),Se.d()}}}function cl(u){let e,t;return e=new zt({props:{$$slots:{default:[ol]},$$scope:{ctx:u}}}),{c(){ge(e.$$.fragment)},l(l){ye(e.$$.fragment,l)},m(l,a){$e(e,l,a),t=!0},p(l,[a]){const s={};a&33&&(s.$$scope={dirty:a,ctx:l}),e.$set(s)},i(l){t||(R(e.$$.fragment,l),t=!0)},o(l){U(e.$$.fragment,l),t=!1},d(l){xe(e,l)}}}const ul=(u,e)=>u+e;function fl(u,e,t){const{publicClient:l}=$t();let a;return t(0,a=l.chain),[a]}class yl extends kt{constructor(e){super(),bt(this,e,fl,cl,pt,{})}}export{yl as component}; diff --git a/_app/immutable/nodes/4.CZ-l8y60.js b/_app/immutable/nodes/4.CZ-l8y60.js new file mode 100644 index 0000000..3f47928 --- /dev/null +++ b/_app/immutable/nodes/4.CZ-l8y60.js @@ -0,0 +1,9 @@ +import{s as Fe,o as Be,p as x,k as E,i as u,b as U,e as D,t as w,j as T,d as P,f as N,q as $e,h as y,v as I,l as g,w as ke,x as Ue,m as G,n as Ne}from"../chunks/scheduler.C1FoT2GD.js";import{S as Te,i as He,c as le,b as ae,m as re,t as H,a as R,d as se,g as ie,e as ce}from"../chunks/index.DFmxPlw4.js";import{e as ee,u as _e,o as he}from"../chunks/each.Bmx-BImQ.js";import{b as te}from"../chunks/paths.2ZvcQRjx.js";import{p as Oe}from"../chunks/stores.uos4ky2n.js";import{P as Re,c as je,g as be,f as Ee}from"../chunks/kit.CACir_b1.js";import{P as qe,L as Ge,C as Ve}from"../chunks/page.CWCv2ozC.js";import{P as Ae}from"../chunks/player.rtVQwoeI.js";function Ie(o,e,t){const l=o.slice();return l[9]=e[t],l[11]=t,l}function we(o,e,t){const l=o.slice();return l[12]=e[t],l}function ye(o,e,t){const l=o.slice();return l[12]=e[t],l}function ze(o){let e,t,l,s,i="Bracket Ranking",r,n,a=[],_=new Map,d,h,k,A="Matches",F,V,L,C,M=o[0].rankings.length+"",j,p,m=o[0].matches.length+"",$,v,b=o[0].matches.length/Math.ceil(o[0].rankings.length/4)+"",q,X,Q,O,Y,J,B=[],me=new Map,K,ue,de;e=new Ge({props:{$$slots:{default:[Xe]},$$scope:{ctx:o}}});let ne=ee(o[0].rankings);const pe=c=>c[12].address;for(let c=0;cc[9].id;for(let c=0;cp[12].address;for(let p=0;p{r=null}),ce())},i(n){i||(H(r),i=!0)},o(n){R(r),i=!1},d(n){n&&(u(t),u(s)),r&&r.d(n)}}}function xe(o){let e,t,l,s;const i=[Je,Qe,ze],r=[];function n(a,_){return a[0]instanceof Promise?0:a[0]instanceof Error?1:a[0]?2:-1}return~(e=n(o))&&(t=r[e]=i[e](o)),{c(){t&&t.c(),l=x()},l(a){t&&t.l(a),l=x()},m(a,_){~e&&r[e].m(a,_),E(a,l,_),s=!0},p(a,_){let d=e;e=n(a),e===d?~e&&r[e].p(a,_):(t&&(ie(),R(r[d],1,1,()=>{r[d]=null}),ce()),~e?(t=r[e],t?t.p(a,_):(t=r[e]=i[e](a),t.c()),H(t,1),t.m(l.parentNode,l)):t=null)},i(a){s||(H(t),s=!0)},o(a){R(t),s=!1},d(a){a&&u(l),~e&&r[e].d(a)}}}function et(o){let e,t;return e=new qe({props:{title:"Bracket Details",$$slots:{default:[xe]},$$scope:{ctx:o}}}),{c(){le(e.$$.fragment)},l(l){ae(e.$$.fragment,l)},m(l,s){re(e,l,s),t=!0},p(l,[s]){const i={};s&131075&&(i.$$scope={dirty:s,ctx:l}),e.$set(i)},i(l){t||(H(e.$$.fragment,l),t=!0)},o(l){R(e.$$.fragment,l),t=!1},d(l){se(e,l)}}}function Me(o,e){const t=(o??"").replaceAll(/\s/g,"");return t?e.some(l=>l.toLocaleLowerCase().includes(t)):!0}const Se=o=>o.name;function tt(o,e,t){let l;Be(o,Oe,k=>t(5,l=k));let s,i,r,n;const a=je(k=>t(0,n=k));let _=null;function d(k){t(2,s=k.get("tournament")??void 0),t(3,i=Number(k.get("season")??"1")-1),t(4,r=Number(k.get("bracket")??"1")-1)}function h(){_=this.value,t(1,_)}return o.$$.update=()=>{o.$$.dirty&32&&d(l.url.searchParams),o.$$.dirty&28&&(s&&i!==void 0&&r!==void 0?a(async()=>{const k=await fetch(`${Re}/results/bracket?${new URLSearchParams({tournament:s,season:i.toString(),bracket:r.toString()})}`);if(!k.ok)throw console.error(await k.text()),new Error(k.statusText);const A=await k.json();return{...A,time:new Date(A.time)}}):t(0,n=new Error("Not Found")))},[n,_,s,i,r,l,h]}class ft extends Te{constructor(e){super(),He(this,e,tt,et,Fe,{})}}export{ft as component}; diff --git a/_app/immutable/nodes/5.ozp2_2H7.js b/_app/immutable/nodes/5.ozp2_2H7.js new file mode 100644 index 0000000..b3b4946 --- /dev/null +++ b/_app/immutable/nodes/5.ozp2_2H7.js @@ -0,0 +1,31 @@ +import{s as ye,c as Ve,e as A,d as w,f as D,i as h,v as I,R as jt,M as x,k as B,$ as qt,x as qe,u as Me,g as Ce,a as Re,r as Tt,o as ue,a0 as Ot,I as zt,a1 as Ut,a2 as Ue,a3 as He,p as de,b as R,t as M,j as L,h as C,l as g,m as Q,n as ke,B as ve,q as Le}from"../chunks/scheduler.C1FoT2GD.js";import{S as Ie,i as Ee,t as F,a as z,c as le,b as se,m as ne,d as ae,g as oe,e as ie}from"../chunks/index.DFmxPlw4.js";import{e as W,u as Se,o as Te,d as Ht}from"../chunks/each.Bmx-BImQ.js";import{d as Pe,w as me,b as ge}from"../chunks/paths.2ZvcQRjx.js";import{p as Gt}from"../chunks/stores.uos4ky2n.js";import{U as Jt,P as Xt,c as Qt,g as We}from"../chunks/kit.CACir_b1.js";import{P as Wt,L as Yt,C as Ct}from"../chunks/page.CWCv2ozC.js";import{P as $e}from"../chunks/player.rtVQwoeI.js";function Oe(s,e){var t=s[0],l=e[0],n=(e[1]-l)/(s[1]-t);return Object.assign(function(o){return l+(o-t)*n},{inverse:function(){return Oe(e,s)}})}function Zt(s){let e,t,l,n,o;const a=s[15].default,r=Ve(a,s,s[14],null);return{c(){e=A("div"),r&&r.c(),this.h()},l(c){e=w(c,"DIV",{class:!0});var i=D(e);r&&r.l(i),i.forEach(h),this.h()},h(){I(e,"class","pancake-chart svelte-1gzh5rp"),jt(()=>s[17].call(e)),x(e,"clip",s[0])},m(c,i){B(c,e,i),r&&r.m(e,null),s[16](e),t=qt(e,s[17].bind(e)),l=!0,n||(o=[qe(e,"mousemove",s[6]),qe(e,"mouseleave",s[7])],n=!0)},p(c,[i]){r&&r.p&&(!l||i&16384)&&Me(r,a,c,c[14],l?Re(a,c[14],i,null):Ce(c[14]),null),(!l||i&1)&&x(e,"clip",c[0])},i(c){l||(F(r,c),l=!0)},o(c){z(r,c),l=!1},d(c){c&&h(e),r&&r.d(c),s[16](null),t(),n=!1,Tt(o)}}}const Rt={};function Lt(){return Ut(Rt)}function Kt(s,e,t){let l,n,o,a,{$$slots:r={},$$scope:c}=e,{x1:i=0}=e,{y1:f=0}=e,{x2:_=1}=e,{y2:d=1}=e,{clip:u=!1}=e,p;const v=me(),m=me(),$=me(),b=me(),k=me();ue(s,k,S=>t(2,o=S));const y=me();ue(s,y,S=>t(3,a=S));const N=me(null),j=S=>{const Z=p.getBoundingClientRect(),ce=S.clientX-Z.left,fe=S.clientY-Z.top,Y=n(100*ce/(Z.right-Z.left)),re=l(100*fe/(Z.bottom-Z.top));N.set({x:Y,y:re,left:ce,top:fe})},H=()=>{N.set(null)},P=Pe([v,$],([S,Z])=>Oe([S,Z],[0,100])),E=Pe([m,b],([S,Z])=>Oe([S,Z],[100,0])),T=Pe(P,S=>S.inverse());ue(s,T,S=>t(19,n=S));const J=Pe(E,S=>S.inverse());ue(s,J,S=>t(18,l=S)),Ot(Rt,{x1:v,y1:m,x2:$,y2:b,x_scale:P,y_scale:E,x_scale_inverse:T,y_scale_inverse:J,pointer:N,width:k,height:y});function U(S){zt[S?"unshift":"push"](()=>{p=S,t(1,p)})}function V(){o=this.clientWidth,k.set(o),a=this.clientHeight,y.set(a)}return s.$$set=S=>{"x1"in S&&t(10,i=S.x1),"y1"in S&&t(11,f=S.y1),"x2"in S&&t(12,_=S.x2),"y2"in S&&t(13,d=S.y2),"clip"in S&&t(0,u=S.clip),"$$scope"in S&&t(14,c=S.$$scope)},s.$$.update=()=>{s.$$.dirty&1024&&v.set(i),s.$$.dirty&2048&&m.set(f),s.$$.dirty&4096&&$.set(_),s.$$.dirty&8192&&b.set(d)},[u,p,o,a,k,y,j,H,T,J,i,f,_,d,c,r,U,V]}class xt extends Ie{constructor(e){super(),Ee(this,e,Kt,Zt,ye,{x1:10,y1:11,x2:12,y2:13,clip:0})}}const el=s=>s.x,tl=s=>s.y;function ll(s){let e,t;const l=s[2].default,n=Ve(l,s,s[1],null);return{c(){e=Ue("svg"),n&&n.c(),this.h()},l(o){e=He(o,"svg",{viewBox:!0,preserveAspectRatio:!0,class:!0});var a=D(e);n&&n.l(a),a.forEach(h),this.h()},h(){I(e,"viewBox","0 0 100 100"),I(e,"preserveAspectRatio","none"),I(e,"class","svelte-4s4ihd"),x(e,"clip",s[0])},m(o,a){B(o,e,a),n&&n.m(e,null),t=!0},p(o,[a]){n&&n.p&&(!t||a&2)&&Me(n,l,o,o[1],t?Re(l,o[1],a,null):Ce(o[1]),null),(!t||a&1)&&x(e,"clip",o[0])},i(o){t||(F(n,o),t=!0)},o(o){z(n,o),t=!1},d(o){o&&h(e),n&&n.d(o)}}}function sl(s,e,t){let{$$slots:l={},$$scope:n}=e,{clip:o=!1}=e;return s.$$set=a=>{"clip"in a&&t(0,o=a.clip),"$$scope"in a&&t(1,n=a.$$scope)},[o,n,l]}class nl extends Ie{constructor(e){super(),Ee(this,e,sl,ll,ye,{clip:0})}}const al=s=>({d:s&1}),Ye=s=>({d:s[0]});function rl(s){let e;const t=s[9].default,l=Ve(t,s,s[8],Ye);return{c(){l&&l.c()},l(n){l&&l.l(n)},m(n,o){l&&l.m(n,o),e=!0},p(n,[o]){l&&l.p&&(!e||o&257)&&Me(l,t,n,n[8],e?Re(t,n[8],o,al):Ce(n[8]),Ye)},i(n){e||(F(l,n),e=!0)},o(n){z(l,n),e=!1},d(n){l&&l.d(n)}}}function ol(s,e,t){let l,n,o,{$$slots:a={},$$scope:r}=e;const{x_scale:c,y_scale:i}=Lt();ue(s,c,u=>t(7,o=u)),ue(s,i,u=>t(6,n=u));let{data:f}=e,{x:_=el}=e,{y:d=tl}=e;return s.$$set=u=>{"data"in u&&t(3,f=u.data),"x"in u&&t(4,_=u.x),"y"in u&&t(5,d=u.y),"$$scope"in u&&t(8,r=u.$$scope)},s.$$.update=()=>{s.$$.dirty&248&&t(0,l="M"+f.map((u,p)=>`${o(_(u,p))},${n(d(u,p))}`).join("L"))},[l,c,i,f,_,d,n,o,r,a]}class il extends Ie{constructor(e){super(),Ee(this,e,ol,rl,ye,{data:3,x:4,y:5})}}const cl=s=>({d:s&1}),Ze=s=>({d:s[0]});function fl(s){let e;const t=s[8].default,l=Ve(t,s,s[7],Ze);return{c(){l&&l.c()},l(n){l&&l.l(n)},m(n,o){l&&l.m(n,o),e=!0},p(n,[o]){l&&l.p&&(!e||o&129)&&Me(l,t,n,n[7],e?Re(t,n[7],o,cl):Ce(n[7]),Ze)},i(n){e||(F(l,n),e=!0)},o(n){z(l,n),e=!1},d(n){l&&l.d(n)}}}function ul(s,e,t){let l,n,{$$slots:o={},$$scope:a}=e;const{x_scale:r,y_scale:c}=Lt();ue(s,r,d=>t(6,n=d)),ue(s,c,d=>t(5,l=d));let{x:i}=e,{y:f}=e,_;return s.$$set=d=>{"x"in d&&t(3,i=d.x),"y"in d&&t(4,f=d.y),"$$scope"in d&&t(7,a=d.$$scope)},s.$$.update=()=>{if(s.$$.dirty&120){const d=n(i),u=l(f);t(0,_=`M${d} ${u} A0 0 0 0 1 ${d+1e-4} ${u+1e-4}`)}},[_,r,c,i,f,l,n,a,o]}class _l extends Ie{constructor(e){super(),Ee(this,e,ul,fl,ye,{x:3,y:4})}}function Ke(s,e,t){const l=s.slice();return l[16]=e[t],l[18]=t,l}function xe(s,e,t){const l=s.slice();return l[19]=e[t].playerIdx,l[20]=e[t].swaps,l[22]=t,l}function et(s,e,t){const l=s.slice();return l[23]=e[t],l}function tt(s,e,t){const l=s.slice();return l[26]=e[t],l[28]=t,l}function lt(s,e,t){const l=s.slice();return l[19]=e[t],l}function st(s,e,t){const l=s.slice();return l[31]=e[t],l[28]=t,l}function nt(s,e,t){const l=s.slice();return l[33]=e[t],l[35]=t,l}function at(s,e,t){const l=s.slice();return l[36]=e[t],l}function rt(s,e,t){const l=s.slice();return l[36]=e[t],l}function ot(s,e,t){const l=s.slice();return l[36]=e[t],l}function it(s,e,t){const l=s.slice();l[16]=e[t],l[18]=t;const n=l[16].balances[l[36].idx];l[43]=n;const o=l[43].slice(1).reduce(function(...r){return s[10](l[43],...r)},0)+1;return l[44]=o,l}function dl(s){let e,t,l,n=s[0].time.toLocaleString()+"",o,a,r,c,i,f,_,d,u=s[0].rounds.length+"",p,v,m,$,b=[],k=new Map,y;e=new Yt({props:{$$slots:{default:[gl]},$$scope:{ctx:s}}}),i=new xt({props:{x1:-1,x2:s[0].rounds.length,y1:-1,y2:Math.max(...s[0].rounds.map(Mt).flat(2))+1,$$slots:{default:[Il]},$$scope:{ctx:s}}});let N=s[0].undeployedPlayers.length&&dt(s),j=W(s[0].rounds);const H=P=>P[18];for(let P=0;P{N=null}),ie()),E[0]&13&&(j=W(P[0].rounds),oe(),b=Se(b,E,H,1,P,j,k,r,Te,Nt,null,Ke),ie())},i(P){if(!y){F(e.$$.fragment,P),F(i.$$.fragment,P),F(N);for(let E=0;E({46:l}),({d:l})=>[0,l?32768:0]]},$$scope:{ctx:s}}}),{c(){le(e.$$.fragment)},l(l){se(e.$$.fragment,l)},m(l,n){ne(e,l,n),t=!0},p(l,n){const o={};n[0]&1&&(o.y=l[43][l[44]]),n[0]&1|n[1]&98304&&(o.$$scope={dirty:n,ctx:l}),e.$set(o)},i(l){t||(F(e.$$.fragment,l),t=!0)},o(l){z(e.$$.fragment,l),t=!1},d(l){ae(e,l)}}}function yl(s){let e,t,l,n;function o(...i){return s[9](s[36],...i)}e=new il({props:{data:s[0].rounds.map(o),$$slots:{default:[bl,({d:i})=>({46:i}),({d:i})=>[0,i?32768:0]]},$$scope:{ctx:s}}});let a=W(s[0].rounds),r=[];for(let i=0;iz(r[i],1,1,()=>{r[i]=null});return{c(){le(e.$$.fragment),t=R();for(let i=0;iu[36].idx;for(let u=0;uu[36].idx;for(let u=0;u<_.length;u+=1){let p=rt(s,_,u),v=d(p);r.set(v,a[u]=_t(v,p))}return{c(){e=A("div");for(let u=0;uz(n[a],1,1,()=>{n[a]=null});return{c(){e=A("div");for(let a=0;a0)return $l;if(e==null&&(e=!!isNaN(a[16].block.bids[a[19]])),e)return El}let n=l(s,[-1,-1]),o=n&&n(s);return{c(){o&&o.c(),t=de()},l(a){o&&o.l(a),t=de()},m(a,r){o&&o.m(a,r),B(a,t,r)},p(a,r){n===(n=l(a,r))&&o?o.p(a,r):(o&&o.d(1),o=n&&n(a),o&&(o.c(),o.m(t.parentNode,t)))},d(a){a&&h(t),o&&o.d(a)}}}function El(s){let e,t="FAILED their bid",l;return{c(){e=A("span"),e.textContent=t,l=M(` + and`),this.h()},l(n){e=w(n,"SPAN",{class:!0,"data-svelte-h":!0}),Le(e)!=="svelte-1rpx4iy"&&(e.textContent=t),l=C(n,` + and`),this.h()},h(){I(e,"class","failed-bid")},m(n,o){B(n,e,o),B(n,l,o)},p:ke,d(n){n&&(h(e),h(l))}}}function $l(s){let e,t,l,n=s[3](0)+"",o,a,r,c=te(s[16].block.bids[s[19]])+"",i,f;return{c(){e=A("span"),t=M(`bid + `),l=A("span"),o=M(n),a=R(),r=A("span"),i=M(c),f=M(` + and`),this.h()},l(_){e=w(_,"SPAN",{class:!0});var d=D(e);t=C(d,`bid + `),l=w(d,"SPAN",{class:!0});var u=D(l);o=C(u,n),u.forEach(h),a=L(d),r=w(d,"SPAN",{class:!0});var p=D(r);i=C(p,c),p.forEach(h),d.forEach(h),f=C(_,` + and`),this.h()},h(){I(l,"class","asset"),I(r,"class","quantity"),I(e,"class","bid")},m(_,d){B(_,e,d),g(e,t),g(e,l),g(l,o),g(e,a),g(e,r),g(r,i),B(_,f,d)},p(_,d){d[0]&1&&c!==(c=te(_[16].block.bids[_[19]])+"")&&Q(i,c)},d(_){_&&(h(e),h(f))}}}function bt(s){let e,t,l=s[3](s[28])+"",n,o,a,r=te(Math.max(0,s[31]))+"",c,i,f=s[16].balanceDeltas[s[19]][s[28]]!==0&&kt(s);return{c(){e=A("div"),t=A("span"),n=M(l),o=R(),a=A("span"),c=M(r),i=R(),f&&f.c(),this.h()},l(_){e=w(_,"DIV",{class:!0});var d=D(e);t=w(d,"SPAN",{class:!0});var u=D(t);n=C(u,l),u.forEach(h),o=L(d),a=w(d,"SPAN",{class:!0});var p=D(a);c=C(p,r),p.forEach(h),i=L(d),f&&f.l(d),d.forEach(h),this.h()},h(){I(t,"class","asset"),I(a,"class","quantity"),I(e,"class","balance svelte-u0942d")},m(_,d){B(_,e,d),g(e,t),g(t,n),g(e,o),g(e,a),g(a,c),g(e,i),f&&f.m(e,null)},p(_,d){d[0]&1&&r!==(r=te(Math.max(0,_[31]))+"")&&Q(c,r),_[16].balanceDeltas[_[19]][_[28]]!==0?f?f.p(_,d):(f=kt(_),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(_){_&&h(e),f&&f.d()}}}function kt(s){let e,t,l=Be(s[16].balanceDeltas[s[19]][s[28]])+"",n,o;return{c(){e=A("span"),t=M("("),n=M(l),o=M(")"),this.h()},l(a){e=w(a,"SPAN",{class:!0});var r=D(e);t=C(r,"("),n=C(r,l),o=C(r,")"),r.forEach(h),this.h()},h(){I(e,"class","delta svelte-u0942d"),x(e,"decreased",s[16].balanceDeltas[s[19]][s[28]]<0)},m(a,r){B(a,e,r),g(e,t),g(e,n),g(e,o)},p(a,r){r[0]&1&&l!==(l=Be(a[16].balanceDeltas[a[19]][a[28]])+"")&&Q(n,l),r[0]&1&&x(e,"decreased",a[16].balanceDeltas[a[19]][a[28]]<0)},d(a){a&&h(e)}}}function yt(s){let e,t=(s[31]>0||s[16].balanceDeltas[s[19]][s[28]]!==0)&&bt(s);return{c(){t&&t.c(),e=de()},l(l){t&&t.l(l),e=de()},m(l,n){t&&t.m(l,n),B(l,e,n)},p(l,n){l[31]>0||l[16].balanceDeltas[l[19]][l[28]]!==0?t?t.p(l,n):(t=bt(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&h(e),t&&t.d(l)}}}function It(s){var p;let e,t,l,n,o,a,r,c,i,f=s[18]===s[0].rounds.length-1&&s[19]===s[0].winnerIdx&&vt();n=new $e({props:{name:s[0].players[s[19]].name}});let _=((p=s[16].block)==null?void 0:p.bids)&>(s),d=W(s[16].balances[s[19]]),u=[];for(let v=0;vz(m[b],1,1,()=>{m[b]=null});return u=new $e({props:{name:s[0].players[s[16].block.builderIdx].name}}),{c(){for(let b=0;b1)},m(f,_){B(f,e,_),g(e,t),g(t,l),ne(n,l,null),g(t,o),g(e,a);for(let d=0;d1)},i(f){r||(F(n.$$.fragment,f),r=!0)},o(f){z(n.$$.fragment,f),r=!1},d(f){f&&h(e),ae(n),ve(i,f)}}}function Nt(s,e){let t,l,n,o,a,r,c=e[18]+1+"",i,f,_,d,u,p,v,m,$,b,k,y,N,j,H,P,E=[],T=new Map,J,U,V,S,Z,ce,fe,Y=e[16].market&&pt(e),re=W(Pt(e[16].balances,e[11])),G=[];for(let O=0;Oz(G[O],1,1,()=>{G[O]=null});let ee=e[16].block&&Et(e);function Ft(){return e[12](e[18])}let Ae=W(e[16].resupply[0]);const Ge=O=>O[28];for(let O=0;O{_e[X]=null}),ie(),V=_e[U],V?V.p(e,q):(V=_e[U]=Je[U](e),V.c()),F(V,1),V.m(j,null)),(!Z||q[0]&5)&&x(m,"expanded",e[2][e[18]])},i(O){if(!Z){for(let q=0;q{a[f]=null}),ie()),~e?(t=a[e],t?t.p(c,i):(t=a[e]=o[e](c),t.c()),F(t,1),t.m(l.parentNode,l)):t=null)},i(c){n||(F(t),n=!0)},o(c){z(t),n=!1},d(c){c&&h(l),~e&&a[e].d(c)}}}function Dl(s){let e,t;return e=new Wt({props:{title:"Match Details",$$slots:{default:[Nl]},$$scope:{ctx:s}}}),{c(){le(e.$$.fragment)},l(l){se(e.$$.fragment,l)},m(l,n){ne(e,l,n),t=!0},p(l,n){const o={};n[0]&7|n[1]&65536&&(o.$$scope={dirty:n,ctx:l}),e.$set(o)},i(l){t||(F(e.$$.fragment,l),t=!0)},o(l){z(e.$$.fragment,l),t=!1},d(l){ae(e,l)}}}const Pl=/(\.?0+(e[-+]\d+)|\.?0+)$/;function Sl(s){var r,c;const e=s.filter(i=>i.event==="create_player_failed").map(i=>i.player),t=s.findIndex(i=>i.event==="game_created"),l=s.findIndex(i=>i.event==="market_initialized"),n=l!==-1?s[l].reserves.map(i=>Number(i)/1e18):void 0,o=s[t].players,a=[];for(let i=t+1;iu.slice()):je(e);let i=t;for(;iu.map((v,m)=>v-a[p][m]))}}function Dt(s){return[...new Array(s)].fill(0)}function je(s){return[...new Array(s)].map(()=>[...new Array(s)].fill(0))}function ze(s,e,t,l){l=Math.min(e.length,l??e.length);let n=t;for(;n1e-5?e=s.toFixed(4):e=s.toExponential(4),e.replace(Pl,"$2"))}function Be(s){const e=te(s);return s<0?e:`+${e}`}function Pt(s,e){const t=s.map(e);return s.map((l,n)=>n).sort((l,n)=>t[l]-t[n])}function St(s){const e=[];let t=null;for(const l of s)(!t||t.playerIdx!==l.playerIdx)&&(t={playerIdx:l.playerIdx,swaps:[]},e.push(t)),t.swaps.push(l);return e}const Bt=(s,e)=>e.score-s.score,Vt=(s,e)=>e.score-s.score,Mt=s=>s.balances.map(e=>e.slice(1));function Vl(s,e,t){let l;ue(s,Gt,k=>t(8,l=k));const n=["🪙","🍅","🍞","🐟️","🥕","👕"];let o,a,r,c,i,f;const _=Qt(k=>t(0,f=k));let d=[];function u(k){t(4,o=k.get("tournament")??void 0),t(5,a=Number(k.get("season")??"1")-1),t(6,r=Number(k.get("bracket")??"1")-1),t(1,i=Number(k.get("idx")??NaN)),isNaN(i)?t(1,i=void 0):t(1,i-=1),t(7,c=k.get("match")??void 0)}function p(k){return n[k]??"?"}const v=(k,y,N)=>({x:N,y:Math.max(...y.balances[k.idx].slice(1))}),m=(k,y,N,j)=>N>=k[y+1]?j:y,$=k=>-Math.max(...k),b=k=>t(2,d[k]=!d[k],d);return s.$$.update=()=>{s.$$.dirty[0]&256&&u(l.url.searchParams),s.$$.dirty[0]&240&&(o&&a!==void 0&&r!==void 0&&c?_(async()=>{const k=await fetch(`${Xt}/results/match?${new URLSearchParams({tournament:o,season:a.toString(),bracket:r.toString(),id:c.toString()})}`);if(!k.ok)throw console.error(await k.text()),new Error(k.statusText);const y=await k.json(),{rounds:N,players:j,undeployedPlayers:H}=Sl(JSON.parse(y.logs));return{tournamentId:y.tournamentId,season:y.season,type:y.type,bracket:y.bracket,duration:y.duration,players:j.map((P,E)=>({...y.players.find(T=>T.address===P),idx:E,scoreAssetIdx:N[N.length-1].balances[E].slice(1).map((T,J)=>[J,T]).sort((T,J)=>J[1]-T[1]).map(([T])=>T)[0]+1})),undeployedPlayers:H.map(P=>y.players.find(E=>E.address===P).name),time:new Date(y.time),rounds:N,winnerIdx:j.findIndex(P=>P===y.players[0].address)}}):t(0,f=new Jt("Not found"))),s.$$.dirty[0]&1&&(f&&!(f instanceof Promise)&&!(f instanceof Error)?t(2,d=[...new Array(f.rounds.length)].map(()=>!1)):t(2,d=[]))},[f,i,d,p,o,a,r,c,l,v,m,$,b]}class Ol extends Ie{constructor(e){super(),Ee(this,e,Vl,Dl,ye,{},null,[-1,-1])}}export{Ol as component}; diff --git a/_app/immutable/nodes/6.BlofK9mi.js b/_app/immutable/nodes/6.BlofK9mi.js new file mode 100644 index 0000000..aab32ef --- /dev/null +++ b/_app/immutable/nodes/6.BlofK9mi.js @@ -0,0 +1,6 @@ +import{s as Ye,o as ye,b as V,p as $,j as M,k as S,i as _,L as We,I as qe,e as w,d as g,q as x,v as j,t as T,f as A,h as D,l as d,m as J,n as se,x as le,w as Ae,A as he,r as $e,M as Te}from"../chunks/scheduler.C1FoT2GD.js";import{S as Xe,i as Qe,c as je,b as Ce,m as Ee,t as ue,a as fe,d as Pe,g as Ze,e as xe}from"../chunks/index.DFmxPlw4.js";import{e as re,u as Se,d as Ie}from"../chunks/each.Bmx-BImQ.js";import{P as et,L as tt,C as lt}from"../chunks/page.CWCv2ozC.js";import{p as st}from"../chunks/stores.uos4ky2n.js";import{v as ge,w as ke,a as nt,r as at,P as rt,U as ee,c as we,k as it,g as _e,j as pe,f as me}from"../chunks/kit.CACir_b1.js";import{b as ve}from"../chunks/paths.2ZvcQRjx.js";import{m as De,w as ot,a as ct,b as ut,S as ft}from"../chunks/contest.LM7IXEuc.js";import{z as dt}from"../chunks/bytes.BO06K83n.js";async function ht(r,e,t){const l=Buffer.concat([ge(e),ge(t)]),s=await crypto.subtle.generateKey({name:"AES-GCM",length:128},!0,["encrypt","decrypt"]),n=crypto.getRandomValues(new Uint8Array(12)),a=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,l),i=await crypto.subtle.encrypt({name:"RSA-OAEP"},await crypto.subtle.importKey("jwk",_t(r),{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),await crypto.subtle.exportKey("raw",s));return{encryptedAesKey:ke(new Uint8Array(i)),encryptedCode:ke(new Uint8Array(a).slice(0,-16)),iv:ke(n)}}function _t(r){return JSON.parse(Buffer.from(ge(r)).toString())}function Ne(r,e,t){const l=r.slice();return l[38]=e[t],l[40]=t,l}function He(r,e,t){const l=r.slice();return l[41]=e[t],l}function Oe(r,e,t){const l=r.slice();return l[41]=e[t],l}function Ve(r){let e,t,l,s,n,a,i=r[0].playerAddress+"",p,C,h,m;function I(c,k){return c[12]?mt:pt}let b=I(r),v=b(r);function y(c,k){return c[9]?bt:vt}let o=y(r),f=o(r);return{c(){e=w("div"),t=T(`Name: + `),v.c(),l=V(),s=w("div"),n=T("Address: "),a=w("a"),p=T(i),h=V(),m=w("div"),f.c(),this.h()},l(c){e=g(c,"DIV",{});var k=A(e);t=D(k,`Name: + `),v.l(k),k.forEach(_),l=M(c),s=g(c,"DIV",{class:!0});var O=A(s);n=D(O,"Address: "),a=g(O,"A",{class:!0,href:!0,target:!0});var N=A(a);p=D(N,i),N.forEach(_),O.forEach(_),h=M(c),m=g(c,"DIV",{class:!0});var L=A(m);f.l(L),L.forEach(_),this.h()},h(){var c,k,O;j(a,"class","address svelte-1j7wjax"),j(a,"href",C=`${(O=(k=(c=r[15])==null?void 0:c.chain)==null?void 0:k.blockExplorers)==null?void 0:O.default.url}address/${r[0].playerAddress}`),j(a,"target","_blank"),j(s,"class","address svelte-1j7wjax"),j(m,"class","is-active")},m(c,k){S(c,e,k),d(e,t),v.m(e,null),S(c,l,k),S(c,s,k),d(s,n),d(s,a),d(a,p),S(c,h,k),S(c,m,k),f.m(m,null)},p(c,k){var O,N,L;b===(b=I(c))&&v?v.p(c,k):(v.d(1),v=b(c),v&&(v.c(),v.m(e,null))),k[0]&1&&i!==(i=c[0].playerAddress+"")&&J(p,i),k[0]&1&&C!==(C=`${(L=(N=(O=c[15])==null?void 0:O.chain)==null?void 0:N.blockExplorers)==null?void 0:L.default.url}address/${c[0].playerAddress}`)&&j(a,"href",C),o!==(o=y(c))&&(f.d(1),f=o(c),f&&(f.c(),f.m(m,null)))},d(c){c&&(_(e),_(l),_(s),_(h),_(m)),v.d(),f.d()}}}function pt(r){let e,t=r[0].playerName+"",l;return{c(){e=w("span"),l=T(t),this.h()},l(s){e=g(s,"SPAN",{class:!0});var n=A(e);l=D(n,t),n.forEach(_),this.h()},h(){j(e,"class","name svelte-1j7wjax")},m(s,n){S(s,e,n),d(e,l)},p(s,n){n[0]&1&&t!==(t=s[0].playerName+"")&&J(l,t)},d(s){s&&_(e)}}}function mt(r){let e,t=r[0].playerName+"",l;return{c(){e=w("a"),l=T(t),this.h()},l(s){e=g(s,"A",{class:!0,target:!0,href:!0});var n=A(e);l=D(n,t),n.forEach(_),this.h()},h(){j(e,"class","name svelte-1j7wjax"),j(e,"target","_blank"),j(e,"href",r[12])},m(s,n){S(s,e,n),d(e,l)},p(s,n){n[0]&1&&t!==(t=s[0].playerName+"")&&J(l,t),n[0]&4096&&j(e,"href",s[12])},d(s){s&&_(e)}}}function vt(r){let e;return{c(){e=T("Awaiting submission ✘")},l(t){e=D(t,"Awaiting submission ✘")},m(t,l){S(t,e,l)},d(t){t&&_(e)}}}function bt(r){let e;return{c(){e=T("Submission received ✓")},l(t){e=D(t,"Submission received ✓")},m(t,l){S(t,e,l)},d(t){t&&_(e)}}}function yt(r){let e,t="Merchant Details",l,s,n=r[0]&&Ve(r);return{c(){e=w("h1"),e.textContent=t,l=V(),n&&n.c(),s=$(),this.h()},l(a){e=g(a,"H1",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1g3lfz6"&&(e.textContent=t),l=M(a),n&&n.l(a),s=$(),this.h()},h(){j(e,"class","svelte-1j7wjax")},m(a,i){S(a,e,i),S(a,l,i),n&&n.m(a,i),S(a,s,i)},p(a,i){a[0]?n?n.p(a,i):(n=Ve(a),n.c(),n.m(s.parentNode,s)):n&&(n.d(1),n=null)},d(a){a&&(_(e),_(l),_(s)),n&&n.d(a)}}}function kt(r){var y;let e,t,l,s="Performance History",n,a,i,p=r[11]>0n&&((y=r[3])==null?void 0:y.address)==r[0].playerAddress&&Me(r);function C(o,f){var c;return(c=o[0].seasonResults)!=null&&c.length?Et:Pt}let h=C(r),m=h(r);function I(o,f){if(!o[1]||o[1].state!==ft.Started||o[1].isTerminal)return It;if(o[8])return St}let b=I(r),v=b&&b(r);return{c(){e=w("section"),p&&p.c(),t=V(),l=w("h2"),l.textContent=s,n=V(),m.c(),a=V(),i=w("section"),v&&v.c(),this.h()},l(o){e=g(o,"SECTION",{class:!0});var f=A(e);p&&p.l(f),t=M(f),l=g(f,"H2",{class:!0,"data-svelte-h":!0}),x(l)!=="svelte-9rlwd4"&&(l.textContent=s),n=M(f),m.l(f),f.forEach(_),a=M(o),i=g(o,"SECTION",{class:!0});var c=A(i);v&&v.l(c),c.forEach(_),this.h()},h(){j(l,"class","svelte-1j7wjax"),j(e,"class","stats svelte-1j7wjax"),j(i,"class","tools svelte-1j7wjax")},m(o,f){S(o,e,f),p&&p.m(e,null),d(e,t),d(e,l),d(e,n),m.m(e,null),S(o,a,f),S(o,i,f),v&&v.m(i,null)},p(o,f){var c;o[11]>0n&&((c=o[3])==null?void 0:c.address)==o[0].playerAddress?p?p.p(o,f):(p=Me(o),p.c(),p.m(e,t)):p&&(p.d(1),p=null),h===(h=C(o))&&m?m.p(o,f):(m.d(1),m=h(o),m&&(m.c(),m.m(e,null))),b===(b=I(o))&&v?v.p(o,f):(v&&v.d(1),v=b&&b(o),v&&(v.c(),v.m(i,null)))},i:se,o:se,d(o){o&&(_(e),_(a),_(i)),p&&p.d(),m.d(),v&&v.d()}}}function wt(r){let e,t,l=_e(r[4])+"",s;return{c(){e=w("section"),t=w("div"),s=T(l),this.h()},l(n){e=g(n,"SECTION",{class:!0});var a=A(e);t=g(a,"DIV",{});var i=A(t);s=D(i,l),i.forEach(_),a.forEach(_),this.h()},h(){j(e,"class","not-found svelte-1j7wjax")},m(n,a){S(n,e,a),d(e,t),d(t,s)},p(n,a){a[0]&16&&l!==(l=_e(n[4])+"")&&J(s,l)},i:se,o:se,d(n){n&&_(e)}}}function gt(r){let e,t,l;return t=new lt({}),{c(){e=w("section"),je(t.$$.fragment),this.h()},l(s){e=g(s,"SECTION",{class:!0});var n=A(e);Ce(t.$$.fragment,n),n.forEach(_),this.h()},h(){j(e,"class","loading svelte-1j7wjax")},m(s,n){S(s,e,n),Ee(t,e,null),l=!0},p:se,i(s){l||(ue(t.$$.fragment,s),l=!0)},o(s){fe(t.$$.fragment,s),l=!1},d(s){s&&_(e),Pe(t)}}}function Me(r){let e;function t(n,a){return n[10]?Ct:jt}let l=t(r),s=l(r);return{c(){e=w("div"),s.c(),this.h()},l(n){e=g(n,"DIV",{class:!0});var a=A(e);s.l(a),a.forEach(_),this.h()},h(){j(e,"class","alert svelte-1j7wjax")},m(n,a){S(n,e,a),s.m(e,null)},p(n,a){l===(l=t(n))&&s?s.p(n,a):(s.d(1),s=l(n),s&&(s.c(),s.m(e,null)))},d(n){n&&_(e),s.d()}}}function jt(r){let e,t,l=pe(r[11])+"",s,n;return{c(){e=w("p"),t=T("You have "),s=T(l),n=T(' ETH in unclaimed prizes! Look for an email from a "@dragonfly.xyz" address in the next few days with further instructions on how to claim.')},l(a){e=g(a,"P",{});var i=A(e);t=D(i,"You have "),s=D(i,l),n=D(i,' ETH in unclaimed prizes! Look for an email from a "@dragonfly.xyz" address in the next few days with further instructions on how to claim.'),i.forEach(_)},m(a,i){S(a,e,i),d(e,t),d(e,s),d(e,n)},p(a,i){i[0]&2048&&l!==(l=pe(a[11])+"")&&J(s,l)},d(a){a&&_(e)}}}function Ct(r){let e,t,l=pe(r[11])+"",s,n,a,i,p,C,h,m;return{c(){e=w("p"),t=T("You have "),s=T(l),n=T(` ETH in unclaimed prizes! + `),a=w("button"),i=T("Claim Prize"),this.h()},l(I){e=g(I,"P",{});var b=A(e);t=D(b,"You have "),s=D(b,l),n=D(b,` ETH in unclaimed prizes! + `),a=g(b,"BUTTON",{"aria-busy":!0,class:!0});var v=A(a);i=D(v,"Claim Prize"),v.forEach(_),b.forEach(_),this.h()},h(){a.disabled=p=r[6]instanceof Promise,j(a,"aria-busy",C=r[6]instanceof Promise),j(a,"class","svelte-1j7wjax")},m(I,b){S(I,e,b),d(e,t),d(e,s),d(e,n),d(e,a),d(a,i),h||(m=le(a,"click",r[24]),h=!0)},p(I,b){b[0]&2048&&l!==(l=pe(I[11])+"")&&J(s,l),b[0]&64&&p!==(p=I[6]instanceof Promise)&&(a.disabled=p),b[0]&64&&C!==(C=I[6]instanceof Promise)&&j(a,"aria-busy",C)},d(I){I&&_(e),h=!1,m()}}}function Et(r){let e=[],t=new Map,l,s=re(r[0].seasonResults);const n=a=>a[40];for(let a=0;aDate
    Type
    Rank
    Score
    ",C,h=[],m=new Map,I,b,v=re(r[38].slice(0,10));const y=f=>f[41].tournamentId;for(let f=0;f10&&Re(r);return{c(){e=w("div"),t=w("h3"),l=T("Season "),n=T(s),a=V(),i=w("div"),i.innerHTML=p,C=V();for(let f=0;f10?o?o.p(f,c):(o=Re(f),o.c(),o.m(e,b)):o&&(o.d(1),o=null),c[0]&5&&Te(e,"expanded",f[2][f[40]])},d(f){f&&_(e);for(let c=0;cy[41].tournamentId;for(let y=0;y/out folder under a folder of the same name as your contract file.`,b,v,y="If you're inputing your code manually, make sure you provide the undeployed bytecode and not the "deployed" one. These are typically named bytecode and deployedBytecode, respectively, in compiler artifacts.",o,f,c,k,O,N,L,F,E,z="Choose artifact",X,G,W,q,te,ie,oe;function ce(R,u){return R[9]?At:Tt}let ne=ce(r),Q=ne(r);function de(R,u){return typeof R[5]=="string"&&R[5]!=="0x"?Nt:Dt}let ae=de(r),Z=ae(r),K=r[5]instanceof Error&&Fe(r);return{c(){e=w("section"),t=w("h2"),l=T("Submit code for season "),n=T(s),a=V(),Q.c(),i=V(),p=w("p"),p.textContent=C,h=V(),m=w("p"),m.innerHTML=I,b=V(),v=w("p"),v.innerHTML=y,o=V(),f=w("div"),c=w("form"),k=w("textarea"),O=V(),N=w("div"),L=w("input"),F=V(),E=w("button"),E.textContent=z,X=V(),G=w("button"),Z.c(),te=V(),K&&K.c(),this.h()},l(R){e=g(R,"SECTION",{class:!0});var u=A(e);t=g(u,"H2",{class:!0});var H=A(t);l=D(H,"Submit code for season "),n=D(H,s),H.forEach(_),a=M(u),Q.l(u),i=M(u),p=g(u,"P",{"data-svelte-h":!0}),x(p)!=="svelte-10c3xuj"&&(p.textContent=C),h=M(u),m=g(u,"P",{"data-svelte-h":!0}),x(m)!=="svelte-1b18m7p"&&(m.innerHTML=I),b=M(u),v=g(u,"P",{"data-svelte-h":!0}),x(v)!=="svelte-uorx0t"&&(v.innerHTML=y),o=M(u),f=g(u,"DIV",{});var P=A(f);c=g(P,"FORM",{class:!0});var B=A(c);k=g(B,"TEXTAREA",{class:!0,placeholder:!0}),A(k).forEach(_),O=M(B),N=g(B,"DIV",{class:!0});var U=A(N);L=g(U,"INPUT",{type:!0,class:!0}),F=M(U),E=g(U,"BUTTON",{class:!0,"data-svelte-h":!0}),x(E)!=="svelte-1tv6386"&&(E.textContent=z),X=M(U),G=g(U,"BUTTON",{"aria-busy":!0,class:!0});var Y=A(G);Z.l(Y),Y.forEach(_),U.forEach(_),te=M(B),K&&K.l(B),B.forEach(_),P.forEach(_),u.forEach(_),this.h()},h(){j(t,"class","svelte-1j7wjax"),j(k,"class","bytecode svelte-1j7wjax"),j(k,"placeholder","Drop JSON artifact or paste (hex) bytecode"),j(L,"type","file"),j(L,"class","svelte-1j7wjax"),j(E,"class","file svelte-1j7wjax"),j(G,"aria-busy",W=r[5]instanceof Promise),G.disabled=q=!r[7]||r[5]instanceof Promise,j(G,"class","svelte-1j7wjax"),j(N,"class","buttons svelte-1j7wjax"),j(c,"class","submit-bytecode svelte-1j7wjax"),j(e,"class","svelte-1j7wjax")},m(R,u){S(R,e,u),d(e,t),d(t,l),d(t,n),d(e,a),Q.m(e,null),d(e,i),d(e,p),d(e,h),d(e,m),d(e,b),d(e,v),d(e,o),d(e,f),d(f,c),d(c,k),Ae(k,r[7]),d(c,O),d(c,N),d(N,L),r[27](L),d(N,F),d(N,E),d(N,X),d(N,G),Z.m(G,null),d(c,te),K&&K.m(c,null),ie||(oe=[le(k,"drop",he(r[19])),le(k,"dragover",he(r[23])),le(k,"input",r[26]),le(L,"change",r[28]),le(E,"click",he(r[29])),le(c,"submit",he(r[17]))],ie=!0)},p(R,u){u[0]&2&&s!==(s=(R[1].idx??0)+1+"")&&J(n,s),ne!==(ne=ce(R))&&(Q.d(1),Q=ne(R),Q&&(Q.c(),Q.m(e,i))),u[0]&128&&Ae(k,R[7]),ae!==(ae=de(R))&&(Z.d(1),Z=ae(R),Z&&(Z.c(),Z.m(G,null))),u[0]&32&&W!==(W=R[5]instanceof Promise)&&j(G,"aria-busy",W),u[0]&160&&q!==(q=!R[7]||R[5]instanceof Promise)&&(G.disabled=q),R[5]instanceof Error?K?K.p(R,u):(K=Fe(R),K.c(),K.m(c,null)):K&&(K.d(1),K=null)},d(R){R&&_(e),Q.d(),r[27](null),Z.d(),K&&K.d(),ie=!1,$e(oe)}}}function It(r){let e,t="Current season is closed and cannot accept new submissions at this time.";return{c(){e=w("div"),e.textContent=t},l(l){e=g(l,"DIV",{"data-svelte-h":!0}),x(e)!=="svelte-1e9vh8h"&&(e.textContent=t)},m(l,s){S(l,e,s)},p:se,d(l){l&&_(e)}}}function At(r){let e,t="You have already submitted your player code for the current season but you can replace your submission as often as you'd like up until the season close.";return{c(){e=w("p"),e.textContent=t,this.h()},l(l){e=g(l,"P",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1m9t20m"&&(e.textContent=t),this.h()},h(){j(e,"class","svelte-1j7wjax")},m(l,s){S(l,e,s)},d(l){l&&_(e)}}}function Tt(r){let e,t="You have not submitted player code for the current season, so you are not participating in any games!";return{c(){e=w("p"),e.textContent=t,this.h()},l(l){e=g(l,"P",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-ibe853"&&(e.textContent=t),this.h()},h(){j(e,"class","svelte-1j7wjax")},m(l,s){S(l,e,s)},d(l){l&&_(e)}}}function Dt(r){let e;return{c(){e=T("Submit Code")},l(t){e=D(t,"Submit Code")},m(t,l){S(t,e,l)},d(t){t&&_(e)}}}function Nt(r){let e;return{c(){e=T("Code Submitted!")},l(t){e=D(t,"Code Submitted!")},m(t,l){S(t,e,l)},d(t){t&&_(e)}}}function Fe(r){let e,t=_e(r[5])+"",l;return{c(){e=w("div"),l=T(t),this.h()},l(s){e=g(s,"DIV",{class:!0});var n=A(e);l=D(n,t),n.forEach(_),this.h()},h(){j(e,"class","error svelte-1j7wjax")},m(s,n){S(s,e,n),d(e,l)},p(s,n){n[0]&32&&t!==(t=_e(s[5])+"")&&J(l,t)},d(s){s&&_(e)}}}function Ht(r){let e,t,l,s,n,a;e=new tt({props:{$$slots:{default:[yt]},$$scope:{ctx:r}}});const i=[gt,wt,kt],p=[];function C(h,m){return h[4]instanceof Promise?0:h[4]instanceof Error?1:h[0]?2:-1}return~(l=C(r))&&(s=p[l]=i[l](r)),{c(){je(e.$$.fragment),t=V(),s&&s.c(),n=$()},l(h){Ce(e.$$.fragment,h),t=M(h),s&&s.l(h),n=$()},m(h,m){Ee(e,h,m),S(h,t,m),~l&&p[l].m(h,m),S(h,n,m),a=!0},p(h,m){const I={};m[0]&4609|m[1]&32768&&(I.$$scope={dirty:m,ctx:h}),e.$set(I);let b=l;l=C(h),l===b?~l&&p[l].p(h,m):(s&&(Ze(),fe(p[b],1,1,()=>{p[b]=null}),xe()),~l?(s=p[l],s?s.p(h,m):(s=p[l]=i[l](h),s.c()),ue(s,1),s.m(n.parentNode,n)):s=null)},i(h){a||(ue(e.$$.fragment,h),ue(s),a=!0)},o(h){fe(e.$$.fragment,h),fe(s),a=!1},d(h){h&&(_(t),_(n)),Pe(e,h),~l&&p[l].d(h)}}}function Ot(r){let e,t;return e=new et({props:{title:"Player Dashboard",$$slots:{default:[Ht]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},l(l){Ce(e.$$.fragment,l)},m(l,s){Ee(e,l,s),t=!0},p(l,s){const n={};s[0]&16383|s[1]&32768&&(n.$$scope={dirty:s,ctx:l}),e.$set(n)},i(l){t||(ue(e.$$.fragment,l),t=!0)},o(l){fe(e.$$.fragment,l),t=!1},d(l){Pe(e,l)}}}function Je(r){return r.startsWith("0x")?r:`0x${r}`}function Vt(r,e,t){let l,s,n;ye(r,st,u=>t(22,n=u));const{wallet:a,publicClient:i,seasons:p}=nt();ye(r,a,u=>t(3,l=u)),ye(r,p,u=>t(21,s=u));let C,h,m,I=we(u=>t(4,C=u)),b=we(u=>t(5,h=u)),v=we(u=>t(6,m=u)),y=null,o=null,f=!1,c=!1,k=!1,O=0n,N=null,L=null,F,E=[];async function z(u){if(t(12,L=null),u.startsWith("github:")){const P=await(await fetch(`https://api.github.com/user/${u.slice(7)}`)).json();P.login&&t(12,L=`https://github.com/${P.login}`)}}async function X(u){let H=u.get("address")??null,P=u.get("name")??null;H||P?await I(W(H,P)):t(4,C=new Error("No player given"))}async function G(u,H,P){P=P??at(20);const[B,U,Y]=await De({client:i,calls:[{fn:"operators",args:[H,P]},{fn:"playerCodeHash",args:[u,H]},{fn:"canPlayerClaim",args:[H]}]});t(8,f=B||P===H),t(9,c=U!==dt),t(10,k=Y)}async function W(u,H){const P=await fetch(`${rt}/player-stats?${new URLSearchParams({...u?{address:u}:{name:H}})}`);if(!P.ok){if(P.status===404)throw new ee("Player not found");try{throw new ee(await P.json())}catch{throw new ee("Failed to load")}}const B=await P.json(),U=[];for(const Y of B.performance)(U[Y.season]=U[Y.season]??[]).push({...Y,time:new Date(Y.time)});U.reverse();for(const[Y,be]of U.entries())be?be.sort((Ge,Ke)=>Ke.time.getTime()-Ge.time.getTime()):U[Y]=[];t(0,o={playerAddress:B.address,playerName:B.name,seasonResults:U,userId:B.userId})}function q(){b(async()=>{if(!y)throw new ee("Invalid bytecode hex.");let u=y;if(u.startsWith("0x")||(u=`0x${u}`),!/^0x[a-f0-9]*$/i.test(u)&&u.length%2!==0)throw new ee("Invalid bytecode hex.");const H=u,P=it(H),B=await ht(N.publicKey,o.playerAddress,H);let U;try{U=await ot({client:l.client,fn:"submitCode",args:[N.idx,o.playerAddress,P,B]})}catch(Y){if(/rejected/.test(Y.message??""))return null;throw Y}return console.debug(`TX submitted: ${U}`),await ct(i,U),t(9,c=!0),U})}function te(){v(async()=>{if(!l||!o)return;let u=s.filter(P=>P.winner===(o==null?void 0:o.playerAddress)).map(P=>P.idx);if(u.length===0)return;const[...H]=await De({client:l.client,calls:u.map(P=>({fn:"winner",args:[P]}))});u=u.filter((P,B)=>H[B][2]!==0n),u.length!==0&&(await ut({client:l.client,calls:u.map(P=>({fn:"claim",args:[P,l.address]}))}),t(11,O=0n))})}async function ie(u){var P,B;const H=(P=u.dataTransfer)==null?void 0:P.items[0];if(H){if(H.type!=="application/json"&&H.type!=="text/plain"){t(5,h=new ee("Not a JSON compiler artifact."));return}const U=await((B=H.getAsFile())==null?void 0:B.text());try{t(7,y=oe(JSON.parse(U)))}catch(Y){if(Y instanceof ee)throw t(5,h=Y),Y;t(5,h=new ee("Artifact not valid JSON."))}}}function oe(u){var B;const H=/^0x[0-9a-f]*$/;let P=(B=u==null?void 0:u.bytecode)==null?void 0:B.object;if(typeof P=="string"&&H.test(P)||(P=u==null?void 0:u.bytecode,typeof P=="string"&&H.test(P)))return Je(P);throw new ee("Cannot find bytecode in artifact.")}async function ce(){var H;const u=(H=F.files)==null?void 0:H[0];if(!u){t(7,y="0x");return}try{t(7,y=oe(JSON.parse(await(u==null?void 0:u.text()))))}catch{t(5,h=new ee("Not a JSON compiler artifact."))}}function ne(u){We.call(this,r,u)}const Q=()=>te(),de=u=>t(2,E[u]=!0,E);function ae(){y=this.value,t(7,y)}function Z(u){qe[u?"unshift":"push"](()=>{F=u,t(13,F)})}const K=()=>ce(),R=()=>F.click();return r.$$.update=()=>{r.$$.dirty[0]&4194304&&X(n.url.searchParams),r.$$.dirty[0]&2097167&&(t(1,N=s[s.length-1]??null),N&&o&&(t(11,O=s.filter(u=>u.winner===o.playerAddress).map(u=>u.unclaimedPrize).reduce((u,H)=>u+H,0n)),G(N.idx,o.playerAddress,l==null?void 0:l.address)),t(2,E=s.map((u,H)=>E[H]??!1))),r.$$.dirty[0]&1&&o!=null&&o.userId&&z(o.userId)},[o,N,E,l,C,h,m,y,f,c,k,O,L,F,a,i,p,q,te,ie,ce,s,n,ne,Q,de,ae,Z,K,R]}class Kt extends Xe{constructor(e){super(),Qe(this,e,Vt,Ot,Ye,{},null,[-1,-1])}}export{Kt as component}; diff --git a/_app/immutable/nodes/7.lJ7Rfakj.js b/_app/immutable/nodes/7.lJ7Rfakj.js new file mode 100644 index 0000000..fe54e8b --- /dev/null +++ b/_app/immutable/nodes/7.lJ7Rfakj.js @@ -0,0 +1,2 @@ +import{s as au,o as vt,b as rr,e as D,j as er,d as N,f as X,q as Qr,i as P,v as C,k as z,l as M,B as uu,n as dr,t as Q,h as G,x as iu,A as su,m as kr,p as lt,M as Xr}from"../chunks/scheduler.C1FoT2GD.js";import{S as cu,i as ou,c as Pr,b as Wr,m as Mr,t as tr,a as nr,d as qr,g as De,e as Ne}from"../chunks/index.DFmxPlw4.js";import{e as Gr,u as vu,o as lu}from"../chunks/each.Bmx-BImQ.js";import{P as fu,L as pu,C as xn}from"../chunks/page.CWCv2ozC.js";import{p as _u}from"../chunks/stores.uos4ky2n.js";import{r as hu}from"../chunks/entry.CTvLC5-Q.js";import{a as du,g as ft,a3 as pt,P as _t,c as yu}from"../chunks/kit.CACir_b1.js";import{P as mu}from"../chunks/player.rtVQwoeI.js";import{m as $u}from"../chunks/contest.LM7IXEuc.js";import{z as gu}from"../chunks/bytes.BO06K83n.js";var or={},Hr={},q={};Object.defineProperty(q,"__esModule",{value:!0});q.z=q.tau=q.sigma=q.mu=q.epsilon=q.default=q.betaSq=q.beta=void 0;const Te=t=>(t==null?void 0:t.z)??3;q.z=Te;const Le=t=>(t==null?void 0:t.mu)??25;q.mu=Le;const wn=t=>(t==null?void 0:t.tau)??Le(t)/300;q.tau=wn;const On=t=>(t==null?void 0:t.sigma)??Le(t)/Te(t);q.sigma=On;const An=t=>(t==null?void 0:t.epsilon)??1e-4;q.epsilon=An;const Ce=t=>(t==null?void 0:t.beta)??On(t)/2;q.beta=Ce;const be=t=>Ce(t)**2;q.betaSq=be;var xu=t=>({EPSILON:An(t),TWOBETASQ:2*be(t),BETA:Ce(t),BETASQ:be(t),Z:Te(t),TAU:wn(t)});q.default=xu;Object.defineProperty(Hr,"__esModule",{value:!0});Hr.default=void 0;var ht=q;const wu=(t,r={})=>({mu:(t==null?void 0:t.mu)??(0,ht.mu)(r),sigma:(t==null?void 0:t.sigma)??(0,ht.sigma)({...r,mu:t==null?void 0:t.mu})});var Ou=wu;Hr.default=Ou;var Zr={},s={exports:{}},Au=function(){return!1},ku=Au,Su=function(){return!0},Pu=Su,Wu={"@@functional/placeholder":!0};function Mu(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}var Yr=Mu,qu=Yr;function Iu(t){return function r(e){return arguments.length===0||qu(e)?r:t.apply(this,arguments)}}var m=Iu,we=m,wr=Yr;function bu(t){return function r(e,n){switch(arguments.length){case 0:return r;case 1:return wr(e)?r:we(function(a){return t(e,a)});default:return wr(e)&&wr(n)?r:wr(e)?we(function(a){return t(a,n)}):wr(n)?we(function(a){return t(e,a)}):t(e,n)}}}var l=bu,Ru=l,Bu=Ru(function(r,e){return Number(r)+Number(e)}),re=Bu;function Eu(t,r){t=t||[],r=r||[];var e,n=t.length,a=r.length,u=[];for(e=0;e=arguments.length)?c=r[i]:(c=arguments[a],a+=1),n[i]=c,dt(c)||(u-=1),i+=1}return u<=0?e.apply(this,n):Nu(u,kn(t,n,e))}}var Ir=kn,Tu=ar,Lu=m,Cu=l,Fu=Ir,ju=Cu(function(r,e){return r===1?Lu(e):Tu(r,Fu(r,[],e))}),F=ju,Xu=J,zu=m,Uu=F,Vu=zu(function(r){return Uu(r.length,function(){var e=0,n=arguments[0],a=arguments[arguments.length-1],u=Array.prototype.slice.call(arguments,0);return u[0]=function(){var i=n.apply(this,Xu(arguments,[e,a]));return e+=1,i},r.apply(this,u)})}),Ku=Vu,Qu=J,Gu=m,Ju=F,Hu=Gu(function(r){return Ju(r.length,function(){var e=arguments[0],n=arguments[arguments.length-1],a=n.length-1,u=Array.prototype.slice.call(arguments,0);return u[0]=function(){var i=e.apply(this,Qu(arguments,[a,n]));return a-=1,i},r.apply(this,u)})}),Zu=Hu,zr=m,hr=l,j=Yr;function Yu(t){return function r(e,n,a){switch(arguments.length){case 0:return r;case 1:return j(e)?r:hr(function(u,i){return t(e,u,i)});case 2:return j(e)&&j(n)?r:j(e)?hr(function(u,i){return t(u,n,i)}):j(n)?hr(function(u,i){return t(e,u,i)}):zr(function(u){return t(e,n,u)});default:return j(e)&&j(n)&&j(a)?r:j(e)&&j(n)?hr(function(u,i){return t(u,i,a)}):j(e)&&j(a)?hr(function(u,i){return t(u,n,i)}):j(n)&&j(a)?hr(function(u,i){return t(e,u,i)}):j(e)?zr(function(u){return t(u,n,a)}):j(n)?zr(function(u){return t(e,u,a)}):j(a)?zr(function(u){return t(e,n,u)}):t(e,n,a)}}}var x=Yu,ri=J,ei=x,ti=ei(function(r,e,n){var a=n.length;if(r>=a||r<-a)return n;var u=(a+r)%a,i=ri(n);return i[u]=e(n[u]),i}),Sn=ti,U=Array.isArray||function(r){return r!=null&&r.length>=0&&Object.prototype.toString.call(r)==="[object Array]"};function ni(t){return t!=null&&typeof t["@@transducer/step"]=="function"}var Fe=ni,ai=U,ui=Fe;function ii(t,r,e){return function(){if(arguments.length===0)return e();var n=arguments[arguments.length-1];if(!ai(n)){for(var a=0;a=0;)e=gt[n],$t(e,r)&&!Wi(a,e)&&(a[a.length]=e),n-=1;return a}),Z=Mi,qi=m,Ii=qi(function(r){return r===null?"Null":r===void 0?"Undefined":Object.prototype.toString.call(r).slice(8,-1)}),je=Ii,wt=mi,Ot=br,bi=xi,Ri=V,Oe=Wn,At=Z,kt=je;function St(t,r,e,n){var a=wt(t),u=wt(r);function i(c,o){return Xe(c,o,e.slice(),n.slice())}return!Ot(function(c,o){return!Ot(i,o,c)},u,a)}function Xe(t,r,e,n){if(Oe(t,r))return!0;var a=kt(t);if(a!==kt(r))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof r["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](r)&&typeof r["fantasy-land/equals"]=="function"&&r["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof r.equals=="function")return typeof t.equals=="function"&&t.equals(r)&&typeof r.equals=="function"&&r.equals(t);switch(a){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&bi(t.constructor)==="Promise")return t===r;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof r&&Oe(t.valueOf(),r.valueOf())))return!1;break;case"Date":if(!Oe(t.valueOf(),r.valueOf()))return!1;break;case"Error":return t.name===r.name&&t.message===r.message;case"RegExp":if(!(t.source===r.source&&t.global===r.global&&t.ignoreCase===r.ignoreCase&&t.multiline===r.multiline&&t.sticky===r.sticky&&t.unicode===r.unicode))return!1;break}for(var u=e.length-1;u>=0;){if(e[u]===t)return n[u]===r;u-=1}switch(a){case"Map":return t.size!==r.size?!1:St(t.entries(),r.entries(),e.concat([t]),n.concat([r]));case"Set":return t.size!==r.size?!1:St(t.values(),r.values(),e.concat([t]),n.concat([r]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=At(t);if(i.length!==At(r).length)return!1;var c=e.concat([t]),o=n.concat([r]);for(u=i.length-1;u>=0;){var v=i[u];if(!(Ri(v,r)&&Xe(r[v],t[v],c,o)))return!1;u-=1}return!0}var Bi=Xe,Ei=l,Di=Bi,Ni=Ei(function(r,e){return Di(r,e,[],[])}),H=Ni,Ti=H;function Li(t,r,e){var n,a;if(typeof t.indexOf=="function")switch(typeof r){case"number":if(r===0){for(n=1/r;e=0}var ze=Fi;function ji(t,r){for(var e=0,n=r.length,a=Array(n);e":bn(i,c)},n=function(u,i){return Ae(function(c){return ke(c)+": "+e(u[c])},i.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+Ae(e,t).join(", ")+"))";case"[object Array]":return"["+Ae(e,t).concat(n(t,_s(function(u){return/^\d+$/.test(u)},Wt(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+e(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?e(NaN):ke(ps(t)))+")";case"[object Map]":return"new Map("+e(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+e(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+e(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+e(t.valueOf())+")":ke(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var a=t.toString();if(a!=="[object Object]")return a}return"{"+n(t,Wt(t)).join(", ")+"}"}}var Rn=bn,hs=m,ds=Rn,ys=hs(function(r){return ds(r,[])}),mr=ys,ms=l,Mt=mr,$s=ms(function(r,e){if(r===e)return e;function n(o,v){if(o>v!=v>o)return v>o?v:o}var a=n(r,e);if(a!==void 0)return a;var u=n(typeof r,typeof e);if(u!==void 0)return u===typeof r?r:e;var i=Mt(r),c=n(i,Mt(e));return c!==void 0&&c===i?r:e}),lr=$s,qt=E,gs=function(){function t(r,e){this.xf=e,this.f=r}return t.prototype["@@transducer/init"]=qt.init,t.prototype["@@transducer/result"]=qt.result,t.prototype["@@transducer/step"]=function(r,e){return this.xf["@@transducer/step"](r,this.f(e))},t}(),xs=function(r){return function(e){return new gs(r,e)}},Bn=xs,ws=Br,Os=l,As=R,ks=Rr,Ss=Bn,Ps=F,Ws=Z,Ms=Os(As(["fantasy-land/map","map"],Ss,function(r,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return Ps(e.length,function(){return r.call(this,e.apply(this,arguments))});case"[object Object]":return ws(function(n,a){return n[a]=r(e[a]),n},{},Ws(e));default:return ks(r,e)}})),ur=Ms,cr=Number.isInteger||function(r){return r<<0===r};function qs(t){return Object.prototype.toString.call(t)==="[object String]"}var $r=qs,Is=l,bs=$r,Rs=Is(function(r,e){var n=r<0?e.length+r:r;return bs(e)?e.charAt(n):e[n]}),fr=Rs,Bs=l,Es=cr,Ds=fr,Ns=Bs(function(r,e){if(e!=null)return Es(r)?Ds(r,e):e[r]}),pr=Ns,Ts=l,Ls=ur,Cs=pr,Fs=Ts(function(r,e){return Ls(Cs(r),e)}),Dr=Fs,js=m,Xs=U,zs=$r,Us=js(function(r){return Xs(r)?!0:!r||typeof r!="object"||zs(r)?!1:r.length===0?!0:r.length>0?r.hasOwnProperty(0)&&r.hasOwnProperty(r.length-1):!1}),te=Us,Vs=te,It=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function Ks(t,r,e){return function(a,u,i){if(Vs(i))return t(a,u,i);if(i==null)return u;if(typeof i["fantasy-land/reduce"]=="function")return r(a,u,i,"fantasy-land/reduce");if(i[It]!=null)return e(a,u,i[It]());if(typeof i.next=="function")return e(a,u,i);if(typeof i.reduce=="function")return r(a,u,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}var En=Ks;function Qs(t,r,e){for(var n=0,a=e.length;n=0?n:0);eu?1:0}),Ro=bo,Bo=U,Eo=cr;function Do(t,r,e){if(Eo(t)&&Bo(e)){var n=[].concat(e);return n[t]=r,n}var a={};for(var u in e)a[u]=e[u];return a[t]=r,a}var Qe=Do,No=m,To=No(function(r){return r==null}),Nr=To,Lo=x,Co=V,Fo=cr,jo=Qe,Xo=Nr,zo=Lo(function t(r,e,n){if(r.length===0)return e;var a=r[0];if(r.length>1){var u=!Xo(n)&&Co(a,n)&&typeof n[a]=="object"?n[a]:Fo(r[1])?[]:{};e=t(Array.prototype.slice.call(r,1),e,u)}return jo(a,e,n)}),Ge=zo,Uo=x,Vo=Ge,Ko=Uo(function(r,e,n){return Vo([r],e,n)}),Je=Ko,Qo=l,Go=Qo(function(r,e){switch(r){case 0:return function(){return e.call(this)};case 1:return function(n){return e.call(this,n)};case 2:return function(n,a){return e.call(this,n,a)};case 3:return function(n,a,u){return e.call(this,n,a,u)};case 4:return function(n,a,u,i){return e.call(this,n,a,u,i)};case 5:return function(n,a,u,i,c){return e.call(this,n,a,u,i,c)};case 6:return function(n,a,u,i,c,o){return e.call(this,n,a,u,i,c,o)};case 7:return function(n,a,u,i,c,o,v){return e.call(this,n,a,u,i,c,o,v)};case 8:return function(n,a,u,i,c,o,v,f){return e.call(this,n,a,u,i,c,o,v,f)};case 9:return function(n,a,u,i,c,o,v,f,p){return e.call(this,n,a,u,i,c,o,v,f,p)};case 10:return function(n,a,u,i,c,o,v,f,p,g){return e.call(this,n,a,u,i,c,o,v,f,p,g)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}}),ie=Go,Jo=m,Ho=ie,Zo=Jo(function(r){return Ho(2,r)}),Yo=Zo;function rv(t){var r=Object.prototype.toString.call(t);return r==="[object Function]"||r==="[object AsyncFunction]"||r==="[object GeneratorFunction]"||r==="[object AsyncGeneratorFunction]"}var Tr=rv,ev=l,tv=Br,nv=Ke,Rt=F,av=ur,uv=ev(function(r,e){var n=Rt(r,e);return Rt(r,function(){return tv(nv,av(n,arguments[0]),Array.prototype.slice.call(arguments,1))})}),Fn=uv,iv=m,sv=Fn,cv=iv(function(r){return sv(r.length,r)}),se=cv,ov=l,vv=Tr,lv=Tn,fv=se,pv=ov(function(r,e){return vv(r)?function(){return r.apply(this,arguments)&&e.apply(this,arguments)}:fv(lv)(r,e)}),_v=pv,hv=m,dv=hv(function(r){return r.apply(this,Array.prototype.slice.call(arguments,1))}),yv=dv,mv=te;function $v(t){return function r(e){for(var n,a,u,i=[],c=0,o=e.length;ce)throw new Error("min must not be greater than max in clamp(min, max, value)");return ne?e:n}),jv=Fv;function Xv(t){return new RegExp(t.source,t.flags?t.flags:(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":"")+(t.dotAll?"s":""))}var Vn=Xv,zv=Vn,Uv=je;function Kn(t,r,e){if(e||(e=new Kv),Vv(t))return t;var n=function(u){var i=e.get(t);if(i)return i;e.set(t,u);for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(u[c]=r?Kn(t[c],!0,e):t[c]);return u};switch(Uv(t)){case"Object":return n(Object.create(Object.getPrototypeOf(t)));case"Array":return n([]);case"Date":return new Date(t.valueOf());case"RegExp":return zv(t);case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return t.slice();default:return t}}var He=Kn;function Vv(t){var r=typeof t;return t==null||r!="object"&&r!="function"}var Kv=function(){function t(){this.map={},this.length=0}return t.prototype.set=function(r,e){const n=this.hash(r);let a=this.map[n];a||(this.map[n]=a=[]),a.push([r,e]),this.length+=1},t.prototype.hash=function(r){let e=[];for(var n in r)e.push(Object.prototype.toString.call(r[n]));return e.join()},t.prototype.get=function(r){if(this.length<=180){for(const a in this.map){const u=this.map[a];for(let i=0;i10)throw new Error("Constructor with greater than ten arguments");return r===0?function(){return new e}:vf(lf(r,function(n,a,u,i,c,o,v,f,p,g){switch(r){case 1:return new e(n);case 2:return new e(n,a);case 3:return new e(n,a,u);case 4:return new e(n,a,u,i);case 5:return new e(n,a,u,i,c);case 6:return new e(n,a,u,i,c,o);case 7:return new e(n,a,u,i,c,o,v);case 8:return new e(n,a,u,i,c,o,v,f);case 9:return new e(n,a,u,i,c,o,v,f,p);case 10:return new e(n,a,u,i,c,o,v,f,p,g)}}))}),ra=ff,pf=m,_f=ra,hf=pf(function(r){return _f(r.length,r)}),df=hf,yf=l,mf=Rr,$f=F,gf=lr,xf=Dr,wf=sr,Of=yf(function(r,e){return $f(wf(gf,0,xf("length",e)),function(){var n=arguments,a=this;return r.apply(a,mf(function(u){return u.apply(a,n)},e))})}),ea=Of,Af=ue,kf=et,Sf=kf(function(t,r){return Af(function(e,n){return t(n)?e+1:e},0,r)}),Pf=Sf,Wf=He,Mf=V,qf=E,If=function(){function t(r,e,n,a){this.valueFn=r,this.valueAcc=e,this.keyFn=n,this.xf=a,this.inputs={}}return t.prototype["@@transducer/init"]=qf.init,t.prototype["@@transducer/result"]=function(r){var e;for(e in this.inputs)if(Mf(e,this.inputs)&&(r=this.xf["@@transducer/step"](r,this.inputs[e]),r["@@transducer/reduced"])){r=r["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](r)},t.prototype["@@transducer/step"]=function(r,e){var n=this.keyFn(e);return this.inputs[n]=this.inputs[n]||[n,Wf(this.valueAcc,!1)],this.inputs[n][1]=this.valueFn(this.inputs[n][1],e),r},t}();function bf(t,r,e){return function(n){return new If(t,r,e,n)}}var Rf=bf,Bf=He,Ef=Ir,Df=R,Nf=V,Tf=ir,Lf=_r,Cf=Rf,Ff=ne,jf=Ef(4,[],Df([],Cf,function(r,e,n,a){var u=Ff(function(i,c){var o=n(c),v=r(Nf(o,i)?i[o]:Bf(e,!1),c);return v&&v["@@transducer/reduced"]?Tf(i):(i[o]=v,i)});return Lf(u,{},a)})),ve=jf,Xf=ve,zf=Xf(function(t,r){return t+1},0),Uf=zf,Vf=re,Kf=Vf(-1),Qf=Kf,Gf=l,Jf=Gf(function(r,e){return e==null||e!==e?r:e}),tt=Jf,Hf=x,Zf=Hf(function(r,e,n){var a=r(e),u=r(n);return a>u?-1:a0?(this.n-=1,r):this.xf["@@transducer/step"](r,e)},t}();function Wp(t){return function(r){return new Pp(t,r)}}var Mp=Wp,qp=l,Ip=R,bp=Mp,Rp=Y,Bp=qp(Ip(["drop"],bp,function(r,e){return Rp(Math.max(0,r),1/0,e)})),ia=Bp,Ep=ir,Ft=E,Dp=function(){function t(r,e){this.xf=e,this.n=r,this.i=0}return t.prototype["@@transducer/init"]=Ft.init,t.prototype["@@transducer/result"]=Ft.result,t.prototype["@@transducer/step"]=function(r,e){this.i+=1;var n=this.n===0?r:this.xf["@@transducer/step"](r,e);return this.n>=0&&this.i>=this.n?Ep(n):n},t}();function Np(t){return function(r){return new Dp(t,r)}}var Tp=Np,Lp=l,Cp=R,Fp=Tp,jp=Y,Xp=Lp(Cp(["take"],Fp,function(r,e){return jp(0,r<0?1/0:r,e)})),nt=Xp,zp=nt;function Up(t,r){return zp(t=0&&t(r[e]);)e-=1;return n_(0,e+1,r)}var u_=a_,i_=E,s_=_r,c_=function(){function t(r,e){this.f=r,this.retained=[],this.xf=e}return t.prototype["@@transducer/init"]=i_.init,t.prototype["@@transducer/result"]=function(r){return this.retained=null,this.xf["@@transducer/result"](r)},t.prototype["@@transducer/step"]=function(r,e){return this.f(e)?this.retain(r,e):this.flush(r,e)},t.prototype.flush=function(r,e){return r=s_(this.xf,r,this.retained),this.retained=[],this.xf["@@transducer/step"](r,e)},t.prototype.retain=function(r,e){return this.retained.push(e),r},t}();function o_(t){return function(r){return new c_(t,r)}}var v_=o_,l_=l,f_=R,p_=u_,__=v_,h_=l_(f_([],__,p_)),d_=h_,jt=E,y_=function(){function t(r,e){this.xf=e,this.pred=r,this.lastValue=void 0,this.seenFirstValue=!1}return t.prototype["@@transducer/init"]=jt.init,t.prototype["@@transducer/result"]=jt.result,t.prototype["@@transducer/step"]=function(r,e){var n=!1;return this.seenFirstValue?this.pred(this.lastValue,e)&&(n=!0):this.seenFirstValue=!0,this.lastValue=e,n?r:this.xf["@@transducer/step"](r,e)},t}();function m_(t){return function(r){return new y_(t,r)}}var at=m_,$_=fr,g_=$_(-1),sa=g_,x_=l,w_=R,O_=at,A_=sa,k_=x_(w_([],O_,function(r,e){var n=[],a=1,u=e.length;if(u!==0)for(n[0]=e[0];a=0?e.length-r:0,e)}),la=hh,dh=l,yh=H,mh=la,$h=dh(function(t,r){return yh(mh(t.length,r),t)}),gh=$h,xh=x,wh=H,Oh=xh(function(r,e,n){return wh(e[r],n[r])}),Ah=Oh,kh=l,Sh=U,Ph=Er,Wh=kh(function t(r,e){if(!Ph(e)&&!Sh(e))return e;var n=e instanceof Array?[]:{},a,u,i;for(u in e)a=r[u],i=typeof a,n[u]=i==="function"?a(e[u]):a&&i==="object"?t(a,e[u]):e[u];return n}),Mh=Wh,qh=ir,Ih=E,bh=function(){function t(r,e){this.xf=e,this.f=r,this.found=!1}return t.prototype["@@transducer/init"]=Ih.init,t.prototype["@@transducer/result"]=function(r){return this.found||(r=this.xf["@@transducer/step"](r,void 0)),this.xf["@@transducer/result"](r)},t.prototype["@@transducer/step"]=function(r,e){return this.f(e)&&(this.found=!0,r=qh(this.xf["@@transducer/step"](r,e))),r},t}();function Rh(t){return function(r){return new bh(t,r)}}var Bh=Rh,Eh=l,Dh=R,Nh=Bh,Th=Eh(Dh(["find"],Nh,function(r,e){for(var n=0,a=e.length;n=0;){if(r(e[n]))return e[n];n-=1}})),ad=nd,ud=E,id=function(){function t(r,e){this.xf=e,this.f=r,this.idx=-1,this.lastIdx=-1}return t.prototype["@@transducer/init"]=ud.init,t.prototype["@@transducer/result"]=function(r){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](r,this.lastIdx))},t.prototype["@@transducer/step"]=function(r,e){return this.idx+=1,this.f(e)&&(this.lastIdx=this.idx),r},t}();function sd(t){return function(r){return new id(t,r)}}var cd=sd,od=l,vd=R,ld=cd,fd=od(vd([],ld,function(r,e){for(var n=e.length-1;n>=0;){if(r(e[n]))return n;n-=1}return-1})),pd=fd,_d=m,hd=jn,dd=_d(hd(!0)),yd=dd,md=m,$d=F,gd=md(function(r){return $d(r.length,function(e,n){var a=Array.prototype.slice.call(arguments,0);return a[0]=n,a[1]=e,r.apply(this,a)})}),fa=gd,xd=Lr,wd=l,Od=wd(xd("forEach",function(r,e){for(var n=e.length,a=0;ae}),jd=Fd,Xd=l,zd=Xd(function(r,e){return r>=e}),Ud=zd,Vd=l,Kd=V,Vt=Nr,Qd=Vd(function(r,e){if(r.length===0||Vt(e))return!1;for(var n=e,a=0;a=0?r:n.length;var a=Array.prototype.slice.call(n,0);return a.splice(r,0,e),a}),Ry=by,By=x,Ey=By(function(r,e,n){return r=r=0?r:n.length,[].concat(Array.prototype.slice.call(n,0,r),e,Array.prototype.slice.call(n,r))}),Dy=Ey,Ny=Cr,Qt=E,Ty=function(){function t(r,e){this.xf=e,this.f=r,this.set=new Ny}return t.prototype["@@transducer/init"]=Qt.init,t.prototype["@@transducer/result"]=Qt.result,t.prototype["@@transducer/step"]=function(r,e){return this.set.add(this.f(e))?this.xf["@@transducer/step"](r,e):r},t}();function Ly(t){return function(r){return new Ty(t,r)}}var Cy=Ly,Fy=Cr,jy=l,Xy=R,zy=Cy,Uy=jy(Xy([],zy,function(t,r){for(var e=new Fy,n=[],a=0,u,i;a=0;){if(um(e[n],r))return n;n-=1}return-1}),sm=im;function cm(t){return Object.prototype.toString.call(t)==="[object Number]"}var ga=cm,om=m,vm=ga,lm=om(function(r){return r!=null&&vm(r.length)?r.length:NaN}),xa=lm,fm=l,pm=ur,_m=fm(function(r,e){return function(n){return function(a){return pm(function(u){return e(u,a)},n(r(a)))}}}),fe=_m,hm=x,dm=Sn,ym=ae,mm=hm(function(r,e,n){return dm(r,ym(e),n)}),wa=mm,$m=m,gm=fe,xm=fr,wm=wa,Om=$m(function(r){return gm(xm(r),wm(r))}),Am=Om,km=l,Sm=cr,Pm=fr,Wm=km(function(r,e){return r.map(function(n){for(var a=e,u=0,i;u=0;)i=r(i[0],n[a]),u[a]=i[1],a-=1;return[i[0],u]}),e$=r$,t$=Br,n$=l,a$=Z,u$=n$(function(r,e){return t$(function(n,a){return n[a]=r(e[a],a,e),n},{},a$(e))}),i$=u$,s$=l,c$=s$(function(r,e){return e.match(r)||[]}),o$=c$,v$=l,Gt=cr,l$=v$(function(r,e){return Gt(r)?!Gt(e)||e<1?NaN:(r%e+e)%e:NaN}),f$=l$,p$=x,_$=lr,h$=p$(function(r,e,n){var a=r(n);return _$(r(e),a)===a?n:e}),d$=h$,y$=re,m$=sr,$$=m$(y$,0),Aa=$$,g$=m,x$=Aa,w$=g$(function(r){return x$(r)/r.length}),ka=w$,O$=m,A$=ka,k$=O$(function(r){var e=r.length;if(e===0)return NaN;var n=2-e%2,a=(e-n)/2;return A$(Array.prototype.slice.call(r,0).sort(function(u,i){return ui?1:0}).slice(a,a+n))}),S$=k$,P$=ar,W$=l,M$=V,q$=W$(function(r,e){var n={};return P$(e.length,function(){var a=r.apply(this,arguments);return M$(a,n)||(n[a]=e.apply(this,arguments)),n[a]})}),I$=q$,b$=le,R$=m,B$=R$(function(r){return b$.apply(null,[{}].concat(r))}),E$=B$,D$=x,Ur=V,N$=D$(function(r,e,n){var a={},u;e=e||{},n=n||{};for(u in e)Ur(u,e)&&(a[u]=Ur(u,n)?r(u,e[u],n[u]):e[u]);for(u in n)Ur(u,n)&&!Ur(u,a)&&(a[u]=n[u]);return a}),ct=N$,T$=x,Jt=Er,L$=ct,C$=T$(function t(r,e,n){return L$(function(a,u,i){return Jt(u)&&Jt(i)?t(r,u,i):r(a,u,i)},e,n)}),pe=C$,F$=l,j$=pe,X$=F$(function(r,e){return j$(function(n,a,u){return a},r,e)}),z$=X$,U$=l,V$=pe,K$=U$(function(r,e){return V$(function(n,a,u){return u},r,e)}),Sa=K$,Q$=x,G$=pe,J$=Q$(function(r,e,n){return G$(function(a,u,i){return r(u,i)},e,n)}),H$=J$,Z$=le,Y$=l,rg=Y$(function(r,e){return Z$({},e,r)}),eg=rg,tg=le,ng=l,ag=ng(function(r,e){return tg({},r,e)}),ug=ag,ig=x,sg=ct,cg=ig(function(r,e,n){return sg(function(a,u,i){return r(u,i)},e,n)}),og=cg,vg=l,Ht=mr,lg=vg(function(r,e){if(r===e)return r;function n(o,v){if(o=e.length||i<0||i>=e.length?e:[].concat(a.slice(0,i)).concat(c).concat(a.slice(i,e.length))}),Dg=Eg,Ng=l,Tg=Ng(function(r,e){return r*e}),Ma=Tg,Lg=Sa,Cg=l,Fg=Cg((t,r)=>e=>t.call(void 0,Lg(r,e))),jg=Fg,Xg=m,zg=Xg(function(r){return-r}),Ug=zg,Vg=In,Kg=l,Qg=Pn,Gg=Kg(function(r,e){return Qg(Vg(r),e)}),Jg=Gg,Hg=m,Zg=F,Yg=fr,rx=Hg(function(r){var e=r<0?1:r+1;return Zg(e,function(){return Yg(r,arguments)})}),ex=rx,tx=x,nx=tx(function(r,e,n){return r(e(n))}),ax=nx,ux=l,ix=ux(function(r,e){return typeof r["fantasy-land/of"]=="function"?r["fantasy-land/of"](e):typeof r.of=="function"?r.of(e):[e]}),sx=ix,cx=l,ox=cx(function(r,e){for(var n={},a={},u=0,i=r.length;u=0;){if(e=r(n[a],e),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a-=1}return e}),Ta=h2,d2=Ir,y2=_r,m2=ne,$2=ir,g2=d2(4,[],function(r,e,n,a){var u=m2(function(i,c){return r(i,c)?e(i,c):$2(i)});return y2(u,n,a)}),x2=g2,w2=m,O2=ir,A2=w2(O2),k2=A2,S2=l,P2=S2(function(r,e){var n=Number(e),a=0,u;if(n<0||isNaN(n))throw new RangeError("n must be a non-negative number");for(u=[];ai?1:0})}),cw=sw,ow=l,vw=ow(function(r,e){return Array.prototype.slice.call(e,0).sort(function(n,a){for(var u=0,i=0;u===0&&i0&&(n.push(a),a=[]);return n}),Ww=Pw,Mw=l,qw=H,Iw=nt,bw=Mw(function(t,r){return qw(Iw(t.length,r),t)}),Rw=bw,Bw=l,Ew=Bw(function(r,e){return Number(r)-Number(e)}),Dw=Ew,Nw=x,Fa=U,Tw=$r,Lw=Qn,Cw=function(t,r,e){var n=Lw(e),a=Object.getOwnPropertyNames(n);if(a.includes(t)&&a.includes(r)){var u=n[t];n[t]=n[r],n[r]=u}return n},ja=function(t,r,e){var n=e.length,a=e.slice(),u=t<0?n+t:t,i=r<0?n+r:r,c=Math.min(u,i),o=Math.max(u,i);return u<0||u>n||i<0||i>n||u===i||(a=[].concat(a.slice(0,c)).concat(a[o]).concat(a.slice(c+1,o)).concat(a[c]).concat(a.slice(o+1,n))),a},Fw=function(t,r,e){var n=ja(t,r,e);return Fa(n)?n.join(""):n},jw=Nw(function(t,r,e){return Fa(e)?ja(t,r,e):Tw(e)?Fw(t,r,e):Cw(t,r,e)}),Xw=jw,zw=l,Uw=rt,nn=ta,Vw=zw(function(r,e){return Uw(nn(r,e),nn(e,r))}),Kw=Vw,Qw=x,Gw=rt,an=na,Jw=Qw(function(r,e,n){return Gw(an(r,e,n),an(r,n,e))}),Hw=Jw,Zw=l,Yw=Y,rO=Zw(function(r,e){for(var n=e.length-1;n>=0&&r(e[n]);)n-=1;return Yw(n+1,1/0,e)}),eO=rO,tO=ir,un=E,nO=function(){function t(r,e){this.xf=e,this.f=r}return t.prototype["@@transducer/init"]=un.init,t.prototype["@@transducer/result"]=un.result,t.prototype["@@transducer/step"]=function(r,e){return this.f(e)?this.xf["@@transducer/step"](r,e):tO(r)},t}();function aO(t){return function(r){return new nO(t,r)}}var uO=aO,iO=l,sO=R,cO=uO,oO=Y,vO=iO(sO(["takeWhile"],cO,function(r,e){for(var n=0,a=e.length;n"u"&&(n[u]=[]),n[u].push(a[u]),u+=1;e+=1}return n}),ZO=HO,YO=x,rA=ur,eA=Ca,tA=YO(function(r,e,n){var a=typeof r["fantasy-land/of"]=="function"?r["fantasy-land/of"]:typeof r.of=="function"?r.of:r,u={"fantasy-land/of":a};return typeof n["fantasy-land/traverse"]=="function"?n["fantasy-land/traverse"](u,e):typeof n.traverse=="function"?n.traverse(u,e):eA(u,rA(e,n))}),nA=tA,cn=m,Ar=` +\v\f\r                 \u2028\u2029\uFEFF`,aA="​",uA=typeof String.prototype.trim=="function",iA=cn(!uA||Ar.trim()||!aA.trim()?function(r){var e=new RegExp("^["+Ar+"]["+Ar+"]*"),n=new RegExp("["+Ar+"]["+Ar+"]*$");return r.replace(e,"").replace(n,"")}:function(r){return r.trim()}),sA=iA,cA=ar,oA=J,vA=l,lA=vA(function(r,e){return cA(r.length,function(){try{return r.apply(this,arguments)}catch(n){return e.apply(this,oA([n],arguments))}})}),fA=lA,pA=m,_A=pA(function(r){return function(){return r(Array.prototype.slice.call(arguments,0))}}),hA=_A,dA=m,yA=ie,mA=dA(function(r){return yA(1,r)}),$A=mA,gA=l,xA=F,wA=gA(function(r,e){return xA(r,function(){for(var n=1,a=e,u=0,i;n<=r&&typeof a=="function";)i=n===r?arguments.length:u+a.length,a=a.apply(this,Array.prototype.slice.call(arguments,u,i)),n+=1,u=i;return a})}),OA=wA,AA=l,kA=AA(function(r,e){for(var n=r(e),a=[];n&&n.length;)a[a.length]=n[0],n=r(n[1]);return a}),SA=kA,PA=J,WA=l,MA=Hn,qA=it,IA=WA(MA(qA,PA)),bA=IA,RA=br,on=E,BA=function(){function t(r,e){this.xf=e,this.pred=r,this.items=[]}return t.prototype["@@transducer/init"]=on.init,t.prototype["@@transducer/result"]=on.result,t.prototype["@@transducer/step"]=function(r,e){return RA(this.pred,e,this.items)?r:(this.items.push(e),this.xf["@@transducer/step"](r,e))},t}();function EA(t){return function(r){return new BA(t,r)}}var DA=EA,NA=l,TA=R,LA=br,CA=DA,FA=NA(TA([],CA,function(t,r){for(var e=0,n=r.length,a=[],u;en=>{if(n.length===0)return[[],[]];const a=[];n.forEach((c,o)=>{a.push([e[o],o,n[o]])}),a.sort(([c],[o])=>c-o);const u=[],i=[];return a.forEach(([c,o,v])=>{i.push(o),u.push(v)}),[u,i]};t.curried=r,t.default=(e,n)=>(0,t.curried)(e)(n)})(Ua);var Va={},_e={},B={};Object.defineProperty(B,"__esModule",{value:!0});B.utilSumQ=B.utilA=B.sum=B.score=B.rankings=B.ladderPairs=B.gamma=B.default=void 0;var tk=jr,nk=ak(q);function ak(t){return t&&t.__esModule?t:{default:t}}const Sr=(t,r)=>t+r;B.sum=Sr;const uk=(t,r)=>tr?1:.5;B.score=uk;const Ka=(t,r=[])=>{const e=t.map((u,i)=>r[i]||i),n=new Array(t.length);let a=0;for(let u=0;u0&&e[u-1]r=>{const e=Ka(r,t.rank);return r.map((n,a)=>[n.map(({mu:u})=>u).reduce(Sr,0),n.map(({sigma:u})=>u*u).reduce(Sr,0),n,e[a]])},sk=t=>{const r=t.length,e=[void 0,...t.slice(0,r-1)],n=[...t.slice(1),void 0];return(0,tk.zip)(e,n).map(([a,u])=>a!==void 0&&u!==void 0?[a,u]:a!==void 0&&u===void 0?[a]:a===void 0&&u!==void 0?[u]:[])};B.ladderPairs=sk;const ck=t=>{const{BETASQ:r}=(0,nk.default)(t);return e=>Math.sqrt(e.map(([n,a,u,i])=>a+r).reduce(Sr,0))},ok=(t,r)=>t.map(([e,n,a,u])=>t.filter(([i,c,o,v])=>v>=u).map(([i,c,o,v])=>Math.exp(i/r)).reduce(Sr,0));B.utilSumQ=ok;const vk=t=>t.map(([r,e,n,a])=>t.filter(([u,i,c,o])=>a===o).length);B.utilA=vk;const Qa=t=>t.gamma??((r,e,n,a,u,i)=>Math.sqrt(a)/r);B.gamma=Qa;var lk=t=>({utilC:ck(t),teamRating:ik(t),gamma:Qa(t)});B.default=lk;Object.defineProperty(_e,"__esModule",{value:!0});_e.default=void 0;var We=_k(B),fk=pk(q);function pk(t){return t&&t.__esModule?t:{default:t}}function Ga(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,e=new WeakMap;return(Ga=function(n){return n?e:r})(t)}function _k(t,r){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var e=Ga(r);if(e&&e.has(t))return e.get(t);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(u!=="default"&&Object.prototype.hasOwnProperty.call(t,u)){var i=a?Object.getOwnPropertyDescriptor(t,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}const hk=(t,r={})=>{const{EPSILON:e}=(0,fk.default)(r),{utilC:n,teamRating:a,gamma:u}=(0,We.default)(r),i=a(t),c=n(i),o=(0,We.utilSumQ)(i,c),v=(0,We.utilA)(i);return i.map((f,p)=>{const[g,S,I,W]=f,_=Math.exp(g/c),[A,w]=i.filter(([d,$,k,O])=>O<=W).reduce(([d,$],[k],O)=>{const T=_/o[O];return[d+(p===O?1-T:-T)/v[O],$+T*(1-T)/v[O]]},[0,0]),b=u(c,i.length,...f),y=A*(S/c),h=b*w*(S/c**2);return I.map(({mu:d,sigma:$})=>({mu:d+$**2/S*y,sigma:$*Math.sqrt(Math.max(1-$**2/S*h,e))}))})};var dk=hk;_e.default=dk;var he={};Object.defineProperty(he,"__esModule",{value:!0});he.default=void 0;var vn=$k(B),yk=mk(q);function mk(t){return t&&t.__esModule?t:{default:t}}function Ja(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,e=new WeakMap;return(Ja=function(n){return n?e:r})(t)}function $k(t,r){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var e=Ja(r);if(e&&e.has(t))return e.get(t);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(u!=="default"&&Object.prototype.hasOwnProperty.call(t,u)){var i=a?Object.getOwnPropertyDescriptor(t,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}const gk=(t,r={})=>{const{TWOBETASQ:e,EPSILON:n}=(0,yk.default)(r),{teamRating:a,gamma:u}=(0,vn.default)(r),i=a(t);return i.map((c,o)=>{const[v,f,p,g]=c,[S,I]=i.filter((W,_)=>_!==o).reduce(([W,_],[A,w,b,y])=>{const h=Math.sqrt(f+w+e),d=1/(1+Math.exp((A-v)/h)),$=f/h,k=u(h,i.length,...c);return[W+$*((0,vn.score)(y,g)-d),_+k*$/h*d*(1-d)]},[0,0]);return p.map(({mu:W,sigma:_})=>{const A=_*_;return{mu:W+A/f*S,sigma:_*Math.sqrt(Math.max(1-A/f*I,n))}})})};var xk=gk;he.default=xk;var de={};Object.defineProperty(de,"__esModule",{value:!0});de.default=void 0;var wk=jr,Me=kk(B),Ok=Ak(q);function Ak(t){return t&&t.__esModule?t:{default:t}}function Ha(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,e=new WeakMap;return(Ha=function(n){return n?e:r})(t)}function kk(t,r){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var e=Ha(r);if(e&&e.has(t))return e.get(t);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(u!=="default"&&Object.prototype.hasOwnProperty.call(t,u)){var i=a?Object.getOwnPropertyDescriptor(t,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}const Sk=(t,r={})=>{const{TWOBETASQ:e,EPSILON:n}=(0,Ok.default)(r),{teamRating:a,gamma:u}=(0,Me.default)(r),i=a(t),c=(0,Me.ladderPairs)(i);return(0,wk.zip)(i,c).map(([o,v])=>{const[f,p,g,S]=o,[I,W]=v.reduce(([_,A],[w,b,y,h])=>{const d=Math.sqrt(p+b+e),$=1/(1+Math.exp((w-f)/d)),k=p/d,O=u(d,i.length,...o);return[_+k*((0,Me.score)(h,S)-$),A+O*k/d*$*(1-$)]},[0,0]);return g.map(({mu:_,sigma:A})=>{const w=A*A;return{mu:_+w/p*I,sigma:A*Math.sqrt(Math.max(1-w/p*W,n))}})})};var Pk=Sk;de.default=Pk;var ye={},L={},Za={exports:{}},Ya={exports:{}};(function(t,r){(function(e){const n=Math.PI*2;function a(u,i,c=null){var o,v;c?(o=c(),v=c()):(o=Math.random(),v=Math.random());var f=Math.sqrt(-2*Math.log(o))*Math.cos(n*v);return f*i+u}e(a)})(function(e){t.exports=e})})(Ya);var Wk=Ya.exports;(function(t,r){(function(e){const n=Wk;var a=function(v){var f=Math.abs(v),p=1/(1+f/2),g=p*Math.exp(-f*f-1.26551223+p*(1.00002368+p*(.37409196+p*(.09678418+p*(-.18628806+p*(.27886807+p*(-1.13520398+p*(1.48851587+p*(-.82215223+p*.17087277)))))))));return v>=0?g:2-g},u=function(v){if(v>=2)return-100;if(v<=0)return 100;for(var f=v<1?v:2-v,p=Math.sqrt(-2*Math.log(f/2)),g=-.70711*((2.30753+p*.27061)/(1+p*(.99229+p*.04481))-p),S=0;S<2;S++){var I=a(g)-f;g+=I/(1.1283791670955126*Math.exp(-(g*g))-g*I)}return v<1?g:-g},i=function(v,f){if(f<=0)throw new Error("Variance must be > 0 (but was "+f+")");this.mean=v,this.variance=f,this.standardDeviation=Math.sqrt(f)};i.prototype.pdf=function(v){var f=this.standardDeviation*Math.sqrt(2*Math.PI),p=Math.exp(-Math.pow(v-this.mean,2)/(2*this.variance));return p/f},i.prototype.cdf=function(v){return .5*a(-(v-this.mean)/(this.standardDeviation*Math.sqrt(2)))},i.prototype.ppf=function(v){return this.mean-this.standardDeviation*Math.sqrt(2)*u(2*v)},i.prototype.mul=function(v){if(typeof v=="number")return this.scale(v);var f=1/this.variance,p=1/v.variance;return o(f+p,f*this.mean+p*v.mean)},i.prototype.div=function(v){if(typeof v=="number")return this.scale(1/v);var f=1/this.variance,p=1/v.variance;return o(f-p,f*this.mean-p*v.mean)},i.prototype.add=function(v){return c(this.mean+v.mean,this.variance+v.variance)},i.prototype.sub=function(v){return c(this.mean-v.mean,this.variance+v.variance)},i.prototype.scale=function(v){return c(this.mean*v,this.variance*v*v)},i.prototype.random=function(v,f=null){let p=this.mean,g=this.standardDeviation;return Array(v).fill(0).map(()=>n(p,g,f))};var c=function(v,f){return new i(v,f)},o=function(v,f){return c(f/v,1/v)};e(c)})(function(e){t.exports=e})})(Za);var Mk=Za.exports;Object.defineProperty(L,"__esModule",{value:!0});L.wt=L.w=L.vt=L.v=L.phiMinor=L.phiMajorInverse=L.phiMajor=void 0;var qk=Ik(Mk);function Ik(t){return t&&t.__esModule?t:{default:t}}const ot=(0,qk.default)(0,1),vr=t=>ot.cdf(t);L.phiMajor=vr;const bk=t=>ot.ppf(t);L.phiMajorInverse=bk;const yr=t=>ot.pdf(t);L.phiMinor=yr;const Be=(t,r)=>{const e=t-r,n=vr(e);return n{const e=t-r;return vr(e){const e=Math.abs(t),n=vr(r-e)-vr(-r-e);if(n<1e-5)return t<0?-t-r:-t+r;const a=yr(-r-e)-yr(r-e);return(t<0?-a:a)/n};L.vt=Ee;const Bk=(t,r)=>{const e=Math.abs(t),n=vr(r-e)-vr(-r-e);return n{const{TWOBETASQ:e,EPSILON:n}=(0,Dk.default)(r),{teamRating:a,gamma:u}=(0,Ek.default)(r),i=a(t);return i.map((c,o)=>{const[v,f,p,g]=c,[S,I]=i.filter((W,_)=>o!==_).reduce(([W,_],[A,w,b,y])=>{const h=Math.sqrt(f+w+e),d=(v-A)/h,$=f/h,k=u(h,i.length,...c);if(y===g)return[W+$*(0,Vr.vt)(d,n/h),_+k*$/h*(0,Vr.wt)(d,n/h)];const O=y>g?1:-1;return[W+O*$*(0,Vr.v)(O*d,n/h),_+k*$/h*(0,Vr.w)(O*d,n/h)]},[0,0]);return p.map(({mu:W,sigma:_})=>{const A=_*_;return{mu:W+A/f*S,sigma:_*Math.sqrt(Math.max(1-A/f*I,n))}})})};var Tk=Nk;ye.default=Tk;var me={};Object.defineProperty(me,"__esModule",{value:!0});me.default=void 0;var Lk=jr,ln=jk(B),Kr=L,Ck=Fk(q);function Fk(t){return t&&t.__esModule?t:{default:t}}function eu(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,e=new WeakMap;return(eu=function(n){return n?e:r})(t)}function jk(t,r){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var e=eu(r);if(e&&e.has(t))return e.get(t);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(u!=="default"&&Object.prototype.hasOwnProperty.call(t,u)){var i=a?Object.getOwnPropertyDescriptor(t,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}const Xk=(t,r={})=>{const{TWOBETASQ:e,EPSILON:n}=(0,Ck.default)(r),{teamRating:a,gamma:u}=(0,ln.default)(r),i=a(t),c=(0,ln.ladderPairs)(i);return(0,Lk.zip)(i,c).map(([o,v])=>{const[f,p,g,S]=o,[I,W]=v.reduce(([_,A],[w,b,y,h])=>{const d=2*Math.sqrt(p+b+e),$=(f-w)/d,k=p/d,O=u(d,i.length,...o);if(h===S)return[_+k*(0,Kr.vt)($,n/d),A+O*k/d*(0,Kr.wt)($,n/d)];const T=h>S?1:-1;return[_+T*k*(0,Kr.v)(T*$,n/d),A+O*k/d*(0,Kr.w)(T*$,n/d)]},[0,0]);return g.map(({mu:_,sigma:A})=>{const w=A*A;return{mu:_+w/p*I,sigma:A*Math.sqrt(Math.max(1-w/p*W,n))}})})};var zk=Xk;me.default=zk;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bradleyTerryFull",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"bradleyTerryPart",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"plackettLuce",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"thurstoneMostellerFull",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"thurstoneMostellerPart",{enumerable:!0,get:function(){return u.default}});var r=i(_e),e=i(he),n=i(de),a=i(ye),u=i(me);function i(c){return c&&c.__esModule?c:{default:c}}})(Va);Object.defineProperty(Zr,"__esModule",{value:!0});Zr.default=void 0;var qe=jr,fn=Vk(Ua),Uk=Va;function Vk(t){return t&&t.__esModule?t:{default:t}}const Kk=(t,r={})=>{var v;const e=r.model??Uk.plackettLuce;let n=t;if(r.tau){const f=r.tau*r.tau;n=t.map(p=>p.map(g=>({...g,sigma:Math.sqrt(g.sigma*g.sigma+f)})))}const a=r.rank??((v=r.score)==null?void 0:v.map(f=>-f))??(0,qe.range)(1,t.length+1),[u,i]=(0,fn.default)(a,n),c=e(u,{...r,rank:(0,qe.sortBy)(qe.identity,a)});let[o]=(0,fn.default)(i,c);return r.tau&&r.preventSigmaIncrease&&(o=o.map((f,p)=>f.map((g,S)=>({...g,sigma:Math.min(g.sigma,t[p][S].sigma)})))),o};var Qk=Kk;Zr.default=Qk;var $e={};Object.defineProperty($e,"__esModule",{value:!0});$e.default=void 0;var Gk=Jk(q);function Jk(t){return t&&t.__esModule?t:{default:t}}const Hk=(t,r={})=>{const{sigma:e,mu:n}=t,{Z:a}=(0,Gk.default)(r);return n-a*e};var Zk=Hk;$e.default=Zk;var ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.default=void 0;var Yk=tS(q),pn=eS(B),rS=L;function tu(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,e=new WeakMap;return(tu=function(n){return n?e:r})(t)}function eS(t,r){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var e=tu(r);if(e&&e.has(t))return e.get(t);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(u!=="default"&&Object.prototype.hasOwnProperty.call(t,u)){var i=a?Object.getOwnPropertyDescriptor(t,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}function tS(t){return t&&t.__esModule?t:{default:t}}const nS=(t,r={})=>{const{teamRating:e}=(0,pn.default)(r),{BETASQ:n}=(0,Yk.default)(r),a=e(t),u=t.length,i=u*(u-1)/2;return a.map(([c,o],v)=>a.filter((f,p)=>v!==p).map(([f,p])=>(0,rS.phiMajor)((c-f)/Math.sqrt(u*n+o**2+p**2))).reduce(pn.sum,0)/i)};var aS=nS;ge.default=aS;var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.default=void 0;var uS=jr,iS=cS(q),_n=sS(B),Ie=L;function nu(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,e=new WeakMap;return(nu=function(n){return n?e:r})(t)}function sS(t,r){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var e=nu(r);if(e&&e.has(t))return e.get(t);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(u!=="default"&&Object.prototype.hasOwnProperty.call(t,u)){var i=a?Object.getOwnPropertyDescriptor(t,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=t[u]}return n.default=t,e&&e.set(t,n),n}function cS(t){return t&&t.__esModule?t:{default:t}}const oS=(t,r={})=>{const{teamRating:e}=(0,_n.default)(r),{BETASQ:n,BETA:a}=(0,iS.default)(r),u=t.length;if(u===0)return;if(u===1)return 1;const i=u*(u-1)/(u>2?1:2),c=e(t),o=Math.sqrt((0,uS.flatten)(t).length)*a*(0,Ie.phiMajorInverse)((1+1/u)/2);return Math.abs(c.map(([v,f],p)=>c.filter((g,S)=>p!==S).map(([g,S])=>{const I=Math.sqrt(u*n+f**2+S**2);return(0,Ie.phiMajor)((o-v+g)/I)-(0,Ie.phiMajor)((v-g-o)/I)})).flat().reduce(_n.sum,0))/i};var vS=oS;xe.default=vS;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ordinal",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"predictDraw",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"predictWin",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"rate",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"rating",{enumerable:!0,get:function(){return r.default}});var r=i(Hr),e=i(Zr),n=i($e),a=i(ge),u=i(xe);function i(c){return c&&c.__esModule?c:{default:c}}})(or);function hn(t,r,e){const n=t.slice();return n[13]=r[e],n[15]=e,n}function dn(t,r,e){const n=t.slice();return n[16]=r[e][0],n[17]=r[e][1],n}function lS(t){let r,e="Merchants";return{c(){r=D("h1"),r.textContent=e,this.h()},l(n){r=N(n,"H1",{class:!0,"data-svelte-h":!0}),Qr(r)!=="svelte-1twrlt1"&&(r.textContent=e),this.h()},h(){C(r,"class","svelte-6b93ob")},m(n,a){z(n,r,a)},p:dr,d(n){n&&P(r)}}}function yn(t){let r,e,n=t[17]+"",a,u,i;function c(){return t[7](t[16])}return{c(){r=D("div"),e=D("a"),a=Q(n),this.h()},l(o){r=N(o,"DIV",{class:!0});var v=X(r);e=N(v,"A",{href:!0,class:!0});var f=X(e);a=G(f,n),f.forEach(P),v.forEach(P),this.h()},h(){C(e,"href","."),C(e,"class","svelte-6b93ob"),C(r,"class","opt svelte-6b93ob")},m(o,v){z(o,r,v),M(r,e),M(e,a),u||(i=iu(e,"click",su(c)),u=!0)},p(o,v){t=o},d(o){o&&P(r),u=!1,i()}}}function fS(t){let r,e,n,a;const u=[dS,hS],i=[];function c(o,v){return o[1].length?0:1}return e=c(t),n=i[e]=u[e](t),{c(){r=D("div"),n.c(),this.h()},l(o){r=N(o,"DIV",{class:!0});var v=X(r);n.l(v),v.forEach(P),this.h()},h(){C(r,"class","players-list")},m(o,v){z(o,r,v),i[e].m(r,null),a=!0},p(o,v){let f=e;e=c(o),e===f?i[e].p(o,v):(De(),nr(i[f],1,1,()=>{i[f]=null}),Ne(),n=i[e],n?n.p(o,v):(n=i[e]=u[e](o),n.c()),tr(n,1),n.m(r,null))},i(o){a||(tr(n),a=!0)},o(o){nr(n),a=!1},d(o){o&&P(r),i[e].d()}}}function pS(t){let r,e,n,a=ft(t[2])+"",u,i;return e=new xn({props:{failed:!0}}),{c(){r=D("div"),Pr(e.$$.fragment),n=rr(),u=Q(a),this.h()},l(c){r=N(c,"DIV",{class:!0});var o=X(r);Wr(e.$$.fragment,o),n=er(o),u=G(o,a),o.forEach(P),this.h()},h(){C(r,"class","error")},m(c,o){z(c,r,o),Mr(e,r,null),M(r,n),M(r,u),i=!0},p(c,o){(!i||o&4)&&a!==(a=ft(c[2])+"")&&kr(u,a)},i(c){i||(tr(e.$$.fragment,c),i=!0)},o(c){nr(e.$$.fragment,c),i=!1},d(c){c&&P(r),qr(e)}}}function _S(t){let r,e,n;return e=new xn({}),{c(){r=D("div"),Pr(e.$$.fragment),this.h()},l(a){r=N(a,"DIV",{class:!0});var u=X(r);Wr(e.$$.fragment,u),u.forEach(P),this.h()},h(){C(r,"class","spinner")},m(a,u){z(a,r,u),Mr(e,r,null),n=!0},p:dr,i(a){n||(tr(e.$$.fragment,a),n=!0)},o(a){nr(e.$$.fragment,a),n=!1},d(a){a&&P(r),qr(e)}}}function hS(t){let r,e="No registered players.";return{c(){r=D("div"),r.textContent=e},l(n){r=N(n,"DIV",{"data-svelte-h":!0}),Qr(r)!=="svelte-1a0hpm9"&&(r.textContent=e)},m(n,a){z(n,r,a)},p:dr,i:dr,o:dr,d(n){n&&P(r)}}}function dS(t){let r,e=[],n=new Map,a,u=Gr(t[1]);const i=c=>c[13].address;for(let c=0;c0),Xr(n,"decreased",t[13].skillDelta<0),C(r,"class","delta svelte-6b93ob")},m(c,o){z(c,r,o),M(r,e),M(r,n),M(n,u),M(r,i)},p(c,o){o&2&&a!==(a=Math.ceil(Math.abs(c[13].skillDelta)*100)+"")&&kr(u,a),o&2&&Xr(n,"increased",c[13].skillDelta>0),o&2&&Xr(n,"decreased",c[13].skillDelta<0)},d(c){c&&P(r)}}}function $n(t,r){let e,n,a=r[15]+1+"",u,i,c,o,v,f,p,g,S,I,W=r[13].created.toLocaleDateString()+"",_,A,w;v=new mu({props:{name:r[13].name}});function b(d,$){if(d[13].skill!==null)return mS;if(d[13].submitted)return yS}let y=b(r),h=y&&y(r);return{key:t,first:null,c(){e=D("li"),n=D("div"),u=Q(a),i=Q("."),c=rr(),o=D("div"),Pr(v.$$.fragment),f=rr(),p=D("div"),h&&h.c(),g=rr(),S=D("div"),I=Q("Joined "),_=Q(W),A=rr(),this.h()},l(d){e=N(d,"LI",{class:!0});var $=X(e);n=N($,"DIV",{class:!0});var k=X(n);u=G(k,a),i=G(k,"."),k.forEach(P),c=er($),o=N($,"DIV",{class:!0});var O=X(o);Wr(v.$$.fragment,O),O.forEach(P),f=er($),p=N($,"DIV",{class:!0});var T=X(p);h&&h.l(T),T.forEach(P),g=er($),S=N($,"DIV",{class:!0});var K=X(S);I=G(K,"Joined "),_=G(K,W),K.forEach(P),A=er($),$.forEach(P),this.h()},h(){C(n,"class","counter svelte-6b93ob"),C(o,"class","name svelte-6b93ob"),C(p,"class","submitted svelte-6b93ob"),C(S,"class","joined svelte-6b93ob"),C(e,"class","svelte-6b93ob"),this.first=e},m(d,$){z(d,e,$),M(e,n),M(n,u),M(n,i),M(e,c),M(e,o),Mr(v,o,null),M(e,f),M(e,p),h&&h.m(p,null),M(e,g),M(e,S),M(S,I),M(S,_),M(e,A),w=!0},p(d,$){r=d,(!w||$&2)&&a!==(a=r[15]+1+"")&&kr(u,a);const k={};$&2&&(k.name=r[13].name),v.$set(k),y===(y=b(r))&&h?h.p(r,$):(h&&h.d(1),h=y&&y(r),h&&(h.c(),h.m(p,null))),(!w||$&2)&&W!==(W=r[13].created.toLocaleDateString()+"")&&kr(_,W)},i(d){w||(tr(v.$$.fragment,d),w=!0)},o(d){nr(v.$$.fragment,d),w=!1},d(d){d&&P(e),qr(v),h&&h.d()}}}function $S(t){let r,e,n,a,u,i="Sort by",c,o,v,f,p,g,S='(*) "Skill" is a metric based on final ranking from the last 12 tournaments this season, normalized between 0-100.',I;r=new pu({props:{$$slots:{default:[lS]},$$scope:{ctx:t}}});let W=Gr([[t[4].Name,"Name"],[t[4].Joined,"Date joined"],[t[4].Skill,"Skill*"]]),_=[];for(let y=0;y<3;y+=1)_[y]=yn(dn(t,W,y));const A=[_S,pS,fS],w=[];function b(y,h){return y[2]instanceof Promise?0:y[2]instanceof Error?1:2}return v=b(t),f=w[v]=A[v](t),{c(){Pr(r.$$.fragment),e=rr(),n=D("section"),a=D("div"),u=D("div"),u.textContent=i,c=rr();for(let y=0;y<3;y+=1)_[y].c();o=rr(),f.c(),p=rr(),g=D("div"),g.innerHTML=S,this.h()},l(y){Wr(r.$$.fragment,y),e=er(y),n=N(y,"SECTION",{class:!0});var h=X(n);a=N(h,"DIV",{class:!0});var d=X(a);u=N(d,"DIV",{"data-svelte-h":!0}),Qr(u)!=="svelte-17vsuap"&&(u.textContent=i),c=er(d);for(let $=0;$<3;$+=1)_[$].l(d);d.forEach(P),o=er(h),f.l(h),p=er(h),g=N(h,"DIV",{class:!0,"data-svelte-h":!0}),Qr(g)!=="svelte-10uk1by"&&(g.innerHTML=S),h.forEach(P),this.h()},h(){C(a,"class","sort-options svelte-6b93ob"),C(g,"class","disclaimer svelte-6b93ob"),C(n,"class","svelte-6b93ob")},m(y,h){Mr(r,y,h),z(y,e,h),z(y,n,h),M(n,a),M(a,u),M(a,c);for(let d=0;d<3;d+=1)_[d]&&_[d].m(a,null);M(n,o),w[v].m(n,null),M(n,p),M(n,g),I=!0},p(y,h){const d={};if(h&1048576&&(d.$$scope={dirty:h,ctx:y}),r.$set(d),h&17){W=Gr([[y[4].Name,"Name"],[y[4].Joined,"Date joined"],[y[4].Skill,"Skill*"]]);let k;for(k=0;k<3;k+=1){const O=dn(y,W,k);_[k]?_[k].p(O,h):(_[k]=yn(O),_[k].c(),_[k].m(a,null))}for(;k<3;k+=1)_[k].d(1)}let $=v;v=b(y),v===$?w[v].p(y,h):(De(),nr(w[$],1,1,()=>{w[$]=null}),Ne(),f=w[v],f?f.p(y,h):(f=w[v]=A[v](y),f.c()),tr(f,1),f.m(n,p))},i(y){I||(tr(r.$$.fragment,y),tr(f),I=!0)},o(y){nr(r.$$.fragment,y),nr(f),I=!1},d(y){y&&(P(e),P(n)),qr(r,y),uu(_,y),w[v].d()}}}function gS(t){let r,e;return r=new fu({props:{title:"Merchant Dashboard",$$slots:{default:[$S]},$$scope:{ctx:t}}}),{c(){Pr(r.$$.fragment)},l(n){Wr(r.$$.fragment,n)},m(n,a){Mr(r,n,a),e=!0},p(n,[a]){const u={};a&1048583&&(u.$$scope={dirty:a,ctx:n}),r.$set(u)},i(n){e||(tr(r.$$.fragment,n),e=!0)},o(n){nr(r.$$.fragment,n),e=!1},d(n){qr(r,n)}}}function gn(t){if(t.length===0)return[];const[r,e]=t.reduce(([n,a],u)=>[Math.min(n,u),Math.max(a,u)],[t[0],t[0]]);return t.map(n=>(n-r)/(e-r))}function xS(t,r,e){let n,a;vt(t,_u,_=>e(5,n=_));const{publicClient:u,seasons:i}=du();vt(t,i,_=>e(6,a=_));let c;const o=yu(_=>e(2,c=_));var v=(_=>(_.Name="name",_.Joined="joined",_.Skill="skill",_))(v||{});let{sortBy:f=void 0}=r,p=[];async function g(){return o((async()=>{const[_,A]=await Promise.all([pt(`${_t}/players`).catch(()=>{throw new Error("Failed to fetch players.")}),pt(`${_t}/results?season=${a.length==0?0:a.length-1}`).catch(()=>{throw new Error("Failed to fetch players.")})]),[w,b]=S(_.map(h=>h.address),A.map(h=>({time:new Date(h.time).getTime(),rankings:h.rankings.sort((d,$)=>$.score-d.score)})).sort((h,d)=>h.time-d.time).slice(-12).map(h=>h.rankings)),y=_.map((h,d)=>({name:h.name,address:h.address,created:new Date(h.created),submitted:!1,skill:w[d],skillDelta:b[d]}));if(a.length){const h=await $u({client:u,calls:y.map(d=>({fn:"playerCodeHash",args:[a.length-1,d.address]}))});for(let d=0;d({[O]:or.rating()})));let b={};const y={};for(const O of A){Object.assign(y,...O.map(K=>({[K.address]:!0})));const T=O.map(K=>[w[K.address]??or.rating()]);Object.assign(w,...or.rate(T).filter((K,xr)=>!!w[O[xr].address]).map((K,xr)=>({[O[xr].address]:K[0]}))),b=Object.assign({},...O.map((K,xr)=>({[K.address]:T[xr][0]})))}const h=_.map(O=>or.ordinal(w[O])),d=_.map(O=>b[O]?or.ordinal(b[O]):or.ordinal(w[O])),$=gn(h),k=gn(d);return[$.map((O,T)=>y[_[T]]?O:null),k.map((O,T)=>y[_[T]]?$[T]-O:null)]}function I(_,A){return A==="joined"?_.sort((w,b)=>w.created.getTime()-b.created.getTime()):f==="skill"?_.sort((w,b)=>(b.skill??-1)-(w.skill??-1)):_.sort((w,b)=>w.name.localeCompare(b.name)),_}const W=_=>e(0,f=_);return t.$$set=_=>{"sortBy"in _&&e(0,f=_.sortBy)},t.$$.update=()=>{if(t.$$.dirty&33){const _=n.url.searchParams.get("sortBy");f&&_!==f&&(n.url.searchParams.set("sortBy",f),hu(`?${n.url.searchParams.toString()}`,history.state))}t.$$.dirty&64&&a.length&&g(),t.$$.dirty&3&&f&&e(1,p=I(p,f))},[f,p,c,i,v,n,a,W]}class bS extends cu{constructor(r){super(),ou(this,r,xS,gS,au,{sortBy:0})}}export{bS as component}; diff --git a/_app/immutable/nodes/8.Dct53QGN.js b/_app/immutable/nodes/8.Dct53QGN.js new file mode 100644 index 0000000..e3d8ca8 --- /dev/null +++ b/_app/immutable/nodes/8.Dct53QGN.js @@ -0,0 +1,3 @@ +import{s as Fe,o as Me,y as Ye,b as L,e as c,p as Ie,j as N,d as f,f as S,i as d,v as n,k as z,q as J,n as ke,t as G,h as x,z as Ge,l as s,x as oe,A as je,r as Ve,m as Te,w as ve}from"../chunks/scheduler.C1FoT2GD.js";import{S as xe,i as Je,c as Ae,b as Re,m as Oe,t as ge,a as we,d as $e,g as Ke,e as Qe}from"../chunks/index.DFmxPlw4.js";import{P as We,L as Xe,C as Ze}from"../chunks/page.CWCv2ozC.js";import{a as et,r as tt,b as at,d as Se,U as Pe,k as st,s as nt,e as Le,h as rt,c as lt,O as it,g as qe}from"../chunks/kit.CACir_b1.js";import{p as ot}from"../chunks/stores.uos4ky2n.js";import{g as ze}from"../chunks/entry.CTvLC5-Q.js";import{r as ut,w as ct,a as ft,C as dt}from"../chunks/contest.LM7IXEuc.js";import{b as Ne}from"../chunks/paths.2ZvcQRjx.js";function ht(i){let e,t="Registration";return{c(){e=c("h1"),e.textContent=t,this.h()},l(a){e=f(a,"H1",{class:!0,"data-svelte-h":!0}),J(e)!=="svelte-frft4h"&&(e.textContent=t),this.h()},h(){n(e,"class","svelte-weh7pk")},m(a,r){z(a,e,r)},p:ke,d(a){a&&d(e)}}}function pt(i){let e;function t(l,u){return l[11]?vt:_t}let a=t(i),r=a(i);return{c(){r.c(),e=Ie()},l(l){r.l(l),e=Ie()},m(l,u){r.m(l,u),z(l,e,u)},p(l,u){a===(a=t(l))&&r?r.p(l,u):(r.d(1),r=a(l),r&&(r.c(),r.m(e.parentNode,e)))},d(l){l&&d(e),r.d(l)}}}function mt(i){let e,t,a,r,l,u,p,h,I,F,$,g=`I agree to the + Contest Rules and + Privacy Agreement.`,H,b,w,o,m,y,R="I confirm that I am at least 18 years of age.",Z,D,O,ee,ne,T,ue="I agree to compete under only a single player account, whether individually or as part of a team.",Y,j,V,te,M,K,Q="Please reach out to me about opportunities in the Dragonfly portfolio.",_,A,U,C="This game is strictly for nerds 🤓!  Players must have a qualifying Github account to register.",W,E,re,ae,le,de,me;return{c(){e=c("section"),t=c("form"),a=c("iframe"),l=L(),u=c("div"),p=c("div"),h=c("input"),F=L(),$=c("label"),$.innerHTML=g,H=L(),b=c("div"),w=c("input"),m=L(),y=c("label"),y.textContent=R,Z=L(),D=c("div"),O=c("input"),ne=L(),T=c("label"),T.textContent=ue,Y=L(),j=c("div"),V=c("input"),M=L(),K=c("label"),K.textContent=Q,_=L(),A=c("div"),U=c("p"),U.textContent=C,W=L(),E=c("button"),re=G("Connect to Github"),this.h()},l(P){e=f(P,"SECTION",{class:!0});var k=S(e);t=f(k,"FORM",{class:!0});var se=S(t);a=f(se,"IFRAME",{src:!0,title:!0,class:!0}),S(a).forEach(d),l=N(se),u=f(se,"DIV",{class:!0});var X=S(u);p=f(X,"DIV",{});var ie=S(p);h=f(ie,"INPUT",{type:!0,id:!0,class:!0}),F=N(ie),$=f(ie,"LABEL",{for:!0,"data-svelte-h":!0}),J($)!=="svelte-3gvhgk"&&($.innerHTML=g),ie.forEach(d),H=N(X),b=f(X,"DIV",{});var ce=S(b);w=f(ce,"INPUT",{type:!0,id:!0,class:!0}),m=N(ce),y=f(ce,"LABEL",{for:!0,"data-svelte-h":!0}),J(y)!=="svelte-aweph1"&&(y.textContent=R),ce.forEach(d),Z=N(X),D=f(X,"DIV",{});var he=S(D);O=f(he,"INPUT",{type:!0,id:!0,class:!0}),ne=N(he),T=f(he,"LABEL",{for:!0,"data-svelte-h":!0}),J(T)!=="svelte-1g6tqzw"&&(T.textContent=ue),he.forEach(d),Y=N(X),j=f(X,"DIV",{});var B=S(j);V=f(B,"INPUT",{type:!0,id:!0,class:!0}),M=N(B),K=f(B,"LABEL",{for:!0,"data-svelte-h":!0}),J(K)!=="svelte-bheezf"&&(K.textContent=Q),B.forEach(d),X.forEach(d),_=N(se),A=f(se,"DIV",{});var v=S(A);U=f(v,"P",{"data-svelte-h":!0}),J(U)!=="svelte-xr4d5s"&&(U.textContent=C),W=N(v),E=f(v,"BUTTON",{type:!0,"aria-busy":!0,class:!0});var q=S(E);re=x(q,"Connect to Github"),q.forEach(d),v.forEach(d),se.forEach(d),k.forEach(d),this.h()},h(){Ge(a.src,r=`${Ne}/terms/rules.html`)||n(a,"src",r),n(a,"title","rules"),n(a,"class","svelte-weh7pk"),n(h,"type","checkbox"),n(h,"id","terms-agree"),h.disabled=I=i[2]instanceof Promise,n(h,"class","svelte-weh7pk"),n($,"for","terms-agree"),n(w,"type","checkbox"),n(w,"id","adult-agree"),w.disabled=o=i[2]instanceof Promise,n(w,"class","svelte-weh7pk"),n(y,"for","adult-agree"),n(O,"type","checkbox"),n(O,"id","singleton-agree"),O.disabled=ee=i[2]instanceof Promise,n(O,"class","svelte-weh7pk"),n(T,"for","singleton-agree"),n(V,"type","checkbox"),n(V,"id","talent-agree"),V.disabled=te=i[2]instanceof Promise,n(V,"class","svelte-weh7pk"),n(K,"for","talent-agree"),n(u,"class","checkboxes svelte-weh7pk"),n(E,"type","submit"),E.disabled=ae=i[2]instanceof Promise||!i[7]||!i[8]||!i[10],n(E,"aria-busy",le=i[2]instanceof Promise),n(E,"class","svelte-weh7pk"),n(t,"class","auth-form svelte-weh7pk"),n(e,"class","svelte-weh7pk")},m(P,k){z(P,e,k),s(e,t),s(t,a),s(t,l),s(t,u),s(u,p),s(p,h),h.checked=i[7],s(p,F),s(p,$),s(u,H),s(u,b),s(b,w),w.checked=i[8],s(b,m),s(b,y),s(u,Z),s(u,D),s(D,O),O.checked=i[10],s(D,ne),s(D,T),s(u,Y),s(u,j),s(j,V),V.checked=i[9],s(j,M),s(j,K),s(t,_),s(t,A),s(A,U),s(A,W),s(A,E),s(E,re),de||(me=[oe(h,"change",i[15]),oe(w,"change",i[16]),oe(O,"change",i[17]),oe(V,"change",i[18]),oe(t,"submit",je(i[19]))],de=!0)},p(P,k){k[0]&4&&I!==(I=P[2]instanceof Promise)&&(h.disabled=I),k[0]&128&&(h.checked=P[7]),k[0]&4&&o!==(o=P[2]instanceof Promise)&&(w.disabled=o),k[0]&256&&(w.checked=P[8]),k[0]&4&&ee!==(ee=P[2]instanceof Promise)&&(O.disabled=ee),k[0]&1024&&(O.checked=P[10]),k[0]&4&&te!==(te=P[2]instanceof Promise)&&(V.disabled=te),k[0]&512&&(V.checked=P[9]),k[0]&1412&&ae!==(ae=P[2]instanceof Promise||!P[7]||!P[8]||!P[10])&&(E.disabled=ae),k[0]&4&&le!==(le=P[2]instanceof Promise)&&n(E,"aria-busy",le)},d(P){P&&d(e),de=!1,Ve(me)}}}function _t(i){let e,t="

    Connect your wallet to continue

    ";return{c(){e=c("section"),e.innerHTML=t,this.h()},l(a){e=f(a,"SECTION",{class:!0,"data-svelte-h":!0}),J(e)!=="svelte-1tvp30p"&&(e.innerHTML=t),this.h()},h(){n(e,"class","svelte-weh7pk")},m(a,r){z(a,e,r)},p:ke,d(a){a&&d(e)}}}function vt(i){let e,t,a,r=i[11].address+"",l,u,p,h="publicly",I,F,$="You cannot change it afterwards",g,H,b,w='We are required to KYC and potentially collect tax information from winners before they are able to claim their prize. Please provide an active email address where we can reach you in the event that you are declared a winner. Be on the lookout for a "@dragonfly.xyz" email.',o,m,y,R,Z,D,O,ee="Player Name*",ne,T,ue,Y,j,V="Email*",te,M,K,Q,_,A="Twitter/X handle",U,C,W,E,re,ae=i[11].chain.name+"",le,de,me,P,k,se,X,ie,ce,he,B=i[11].chain.id===324&&He(i);return{c(){e=c("section"),t=c("p"),a=G("The connected wallet address ("),l=G(r),u=G(") will "),p=c("em"),p.textContent=h,I=G(" identify your merchant and will be used to make code submissions and claim prizes. You can authorize other addresses to submit code on your behalf, but only this address can ever claim prizes. "),F=c("em"),F.textContent=$,g=G("."),H=L(),b=c("p"),b.textContent=w,o=L(),m=c("section"),y=c("form"),R=c("div"),Z=L(),D=c("div"),O=c("label"),O.textContent=ee,ne=L(),T=c("input"),ue=L(),Y=c("div"),j=c("label"),j.textContent=V,te=L(),M=c("input"),K=L(),Q=c("div"),_=c("label"),_.textContent=A,U=L(),C=c("input"),W=L(),E=c("p"),re=G("Your wallet will need to be supplied with a very small amount of ETH (much less than $1 worth) on the "),le=G(ae),de=G(" network to complete registration and to make all future code submissions."),B&&B.c(),me=L(),P=c("div"),k=c("button"),se=G("Register"),this.h()},l(v){e=f(v,"SECTION",{class:!0});var q=S(e);t=f(q,"P",{});var fe=S(t);a=x(fe,"The connected wallet address ("),l=x(fe,r),u=x(fe,") will "),p=f(fe,"EM",{"data-svelte-h":!0}),J(p)!=="svelte-1mydf0g"&&(p.textContent=h),I=x(fe," identify your merchant and will be used to make code submissions and claim prizes. You can authorize other addresses to submit code on your behalf, but only this address can ever claim prizes. "),F=f(fe,"EM",{"data-svelte-h":!0}),J(F)!=="svelte-1f8dfwi"&&(F.textContent=$),g=x(fe,"."),fe.forEach(d),H=N(q),b=f(q,"P",{"data-svelte-h":!0}),J(b)!=="svelte-1o6yj96"&&(b.textContent=w),q.forEach(d),o=N(v),m=f(v,"SECTION",{class:!0});var Ue=S(m);y=f(Ue,"FORM",{class:!0});var _e=S(y);R=f(_e,"DIV",{class:!0});var pe=S(R);Z=N(pe),D=f(pe,"DIV",{class:!0});var ye=S(D);O=f(ye,"LABEL",{for:!0,"data-svelte-h":!0}),J(O)!=="svelte-1vblqrf"&&(O.textContent=ee),ne=N(ye),T=f(ye,"INPUT",{id:!0,placeholder:!0,pattern:!0,minlength:!0,maxlength:!0,class:!0}),ye.forEach(d),ue=N(pe),Y=f(pe,"DIV",{class:!0});var Ce=S(Y);j=f(Ce,"LABEL",{for:!0,"data-svelte-h":!0}),J(j)!=="svelte-s5ydq0"&&(j.textContent=V),te=N(Ce),M=f(Ce,"INPUT",{id:!0,placeholder:!0,type:!0,minlength:!0,maxlength:!0,class:!0}),Ce.forEach(d),K=N(pe),Q=f(pe,"DIV",{class:!0});var Ee=S(Q);_=f(Ee,"LABEL",{for:!0,"data-svelte-h":!0}),J(_)!=="svelte-elc7uh"&&(_.textContent=A),U=N(Ee),C=f(Ee,"INPUT",{id:!0,placeholder:!0,minlength:!0,maxlength:!0,class:!0}),Ee.forEach(d),pe.forEach(d),W=N(_e),E=f(_e,"P",{});var be=S(E);re=x(be,"Your wallet will need to be supplied with a very small amount of ETH (much less than $1 worth) on the "),le=x(be,ae),de=x(be," network to complete registration and to make all future code submissions."),B&&B.l(be),be.forEach(d),me=N(_e),P=f(_e,"DIV",{});var Be=S(P);k=f(Be,"BUTTON",{type:!0,"aria-busy":!0,class:!0});var De=S(k);se=x(De,"Register"),De.forEach(d),Be.forEach(d),_e.forEach(d),Ue.forEach(d),this.h()},h(){n(e,"class","svelte-weh7pk"),n(O,"for","name"),n(T,"id","name"),n(T,"placeholder","My_merchant"),n(T,"pattern","^[a-z0-9_]+$"),n(T,"minlength","3"),n(T,"maxlength","32"),T.required=!0,n(T,"class","svelte-weh7pk"),n(D,"class","field svelte-weh7pk"),n(j,"for","email"),n(M,"id","email"),n(M,"placeholder","Email"),n(M,"type","email"),n(M,"minlength","3"),n(M,"maxlength","96"),M.required=!0,n(M,"class","svelte-weh7pk"),n(Y,"class","field svelte-weh7pk"),n(_,"for","twitter"),n(C,"id","twitter"),n(C,"placeholder","(optional)"),n(C,"minlength","3"),n(C,"maxlength","96"),n(C,"class","svelte-weh7pk"),n(Q,"class","field svelte-weh7pk"),n(R,"class","inputs svelte-weh7pk"),n(k,"type","submit"),k.disabled=X=i[2]instanceof Promise||i[0],n(k,"aria-busy",ie=i[2]instanceof Promise),n(k,"class","svelte-weh7pk"),n(y,"class","register-form svelte-weh7pk"),n(m,"class","svelte-weh7pk")},m(v,q){z(v,e,q),s(e,t),s(t,a),s(t,l),s(t,u),s(t,p),s(t,I),s(t,F),s(t,g),s(e,H),s(e,b),z(v,o,q),z(v,m,q),s(m,y),s(y,R),s(R,Z),s(R,D),s(D,O),s(D,ne),s(D,T),ve(T,i[1]),s(R,ue),s(R,Y),s(Y,j),s(Y,te),s(Y,M),ve(M,i[5]),s(R,K),s(R,Q),s(Q,_),s(Q,U),s(Q,C),ve(C,i[6]),s(y,W),s(y,E),s(E,re),s(E,le),s(E,de),B&&B.m(E,null),s(y,me),s(y,P),s(P,k),s(k,se),ce||(he=[oe(T,"input",i[21]),oe(M,"input",i[22]),oe(C,"input",i[23]),oe(y,"submit",je(i[24]))],ce=!0)},p(v,q){q[0]&2048&&r!==(r=v[11].address+"")&&Te(l,r),q[0]&2&&T.value!==v[1]&&ve(T,v[1]),q[0]&32&&M.value!==v[5]&&ve(M,v[5]),q[0]&64&&C.value!==v[6]&&ve(C,v[6]),q[0]&2048&&ae!==(ae=v[11].chain.name+"")&&Te(le,ae),v[11].chain.id===324?B?B.p(v,q):(B=He(v),B.c(),B.m(E,null)):B&&(B.d(1),B=null),q[0]&5&&X!==(X=v[2]instanceof Promise||v[0])&&(k.disabled=X),q[0]&4&&ie!==(ie=v[2]instanceof Promise)&&n(k,"aria-busy",ie)},d(v){v&&(d(e),d(o),d(m)),B&&B.d(),ce=!1,Ve(he)}}}function He(i){let e,t=i[11].chain.name+"",a,r,l,u="here",p;return{c(){e=G("You can quickly bridge ETH from Ethereum to "),a=G(t),r=L(),l=c("a"),l.textContent=u,p=G("."),this.h()},l(h){e=x(h,"You can quickly bridge ETH from Ethereum to "),a=x(h,t),r=N(h),l=f(h,"A",{href:!0,target:!0,class:!0,"data-svelte-h":!0}),J(l)!=="svelte-gavom9"&&(l.textContent=u),p=x(h,"."),this.h()},h(){n(l,"href","https://portal.zksync.io/bridge/"),n(l,"target","_blank"),n(l,"class","svelte-weh7pk")},m(h,I){z(h,e,I),z(h,a,I),z(h,r,I),z(h,l,I),z(h,p,I)},p(h,I){I[0]&2048&&t!==(t=h[11].chain.name+"")&&Te(a,t)},d(h){h&&(d(e),d(a),d(r),d(l),d(p))}}}function bt(i){let e,t,a;return t=new Ze({}),{c(){e=c("section"),Ae(t.$$.fragment),this.h()},l(r){e=f(r,"SECTION",{class:!0});var l=S(e);Re(t.$$.fragment,l),l.forEach(d),this.h()},h(){n(e,"class","spinner svelte-weh7pk")},m(r,l){z(r,e,l),Oe(t,e,null),a=!0},p:ke,i(r){a||(ge(t.$$.fragment,r),a=!0)},o(r){we(t.$$.fragment,r),a=!1},d(r){r&&d(e),$e(t)}}}function gt(i){let e,t=qe(i[2])+"",a;return{c(){e=c("section"),a=G(t),this.h()},l(r){e=f(r,"SECTION",{class:!0});var l=S(e);a=x(l,t),l.forEach(d),this.h()},h(){n(e,"class","error svelte-weh7pk")},m(r,l){z(r,e,l),s(e,a)},p(r,l){l[0]&4&&t!==(t=qe(r[2])+"")&&Te(a,t)},i:ke,o:ke,d(r){r&&d(e)}}}function wt(i){let e,t,a,r,l,u,p,h,I;e=new Xe({props:{$$slots:{default:[ht]},$$scope:{ctx:i}}});function F(o,m){if(!o[3]&&!(o[2]instanceof Promise))return mt;if(o[3])return pt}let $=F(i),g=$&&$(i);const H=[gt,bt],b=[];function w(o,m){return o[2]instanceof Error?0:o[2]instanceof Promise?1:-1}return~(u=w(i))&&(p=b[u]=H[u](i)),{c(){Ae(e.$$.fragment),t=L(),a=c("section"),r=L(),g&&g.c(),l=L(),p&&p.c(),h=Ie(),this.h()},l(o){Re(e.$$.fragment,o),t=N(o),a=f(o,"SECTION",{class:!0}),S(a).forEach(d),r=N(o),g&&g.l(o),l=N(o),p&&p.l(o),h=Ie(),this.h()},h(){n(a,"class","svelte-weh7pk")},m(o,m){Oe(e,o,m),z(o,t,m),z(o,a,m),z(o,r,m),g&&g.m(o,m),z(o,l,m),~u&&b[u].m(o,m),z(o,h,m),I=!0},p(o,m){const y={};m[1]&1&&(y.$$scope={dirty:m,ctx:o}),e.$set(y),$===($=F(o))&&g?g.p(o,m):(g&&g.d(1),g=$&&$(o),g&&(g.c(),g.m(l.parentNode,l)));let R=u;u=w(o),u===R?~u&&b[u].p(o,m):(p&&(Ke(),we(b[R],1,1,()=>{b[R]=null}),Qe()),~u?(p=b[u],p?p.p(o,m):(p=b[u]=H[u](o),p.c()),ge(p,1),p.m(h.parentNode,h)):p=null)},i(o){I||(ge(e.$$.fragment,o),ge(p),I=!0)},o(o){we(e.$$.fragment,o),we(p),I=!1},d(o){o&&(d(t),d(a),d(r),d(l),d(h)),$e(e,o),g&&g.d(o),~u&&b[u].d(o)}}}function kt(i){let e,t;return e=new We({props:{title:"Register Merchant",$$slots:{default:[wt]},$$scope:{ctx:i}}}),{c(){Ae(e.$$.fragment)},l(a){Re(e.$$.fragment,a)},m(a,r){Oe(e,a,r),t=!0},p(a,r){const l={};r[0]&4095|r[1]&1&&(l.$$scope={dirty:r,ctx:a}),e.$set(l)},i(a){t||(ge(e.$$.fragment,a),t=!0)},o(a){we(e.$$.fragment,a),t=!1},d(a){$e(e,a)}}}function yt(i,e,t){let a,r;Me(i,ot,_=>t(26,r=_));const{wallet:l,publicClient:u}=et();Me(i,l,_=>t(11,a=_));let p;const h=lt(_=>t(2,p=_)),I=(()=>{const _=new URL(r.url);return _.search="",_.searchParams.append("callback",""),_.toString()})(),F={name:"Nottingham",version:"1",verifyingContract:dt};let $=!1,g=null,H=null,b=null,w=null,o=null,m=null,y=!1,R=!1,Z=!0,D=!1;async function O(){const _=new URL("https://github.com/login/oauth/authorize"),A=tt();localStorage.setItem("ghAuthState",A),_.searchParams.append("prompt","consent"),_.searchParams.append("client_id",at),_.searchParams.append("redirect_uri",I),_.searchParams.append("scope",["user:email"].join(" ")),_.searchParams.append("state",A),window.location.href=_.toString()}Ye(async()=>{g=r.url.searchParams.get("code");const _=r.url.searchParams.get("state");if(!g||!_)return;{const U=new URL(r.url);U.search="",ze(U)}const A=localStorage.getItem("ghAuthState");if(_!==A){console.error("Incorrect state hash from OAuth redirect!");return}await h((async()=>{const U=await fetch(`${Se}/redeem`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({githubAuth:g,redirectUri:I})});if(!U.ok){const{error:W}=await U.json();throw new Pe(`Failed OAuth step: ${W}`)}const C=await U.json();t(3,H={userId:C.userId,email:C.email,hmac:C.hmac}),t(5,o=H.email),t(1,w=C.name.toLowerCase().replaceAll(/[^a-z0-9_]/g,""))})())});async function ee(){!w||!H||await h((async()=>{if(await ut({client:u,fn:"playerRegisteredBlock",args:[a.address]})!==0n)throw new Pe("Address is already registered");let A;{const C=Math.floor(Date.now()/1e3)+it,W=await(a==null?void 0:a.client.signTypedData({account:a==null?void 0:a.address,domain:{...F,chainId:a.chain.id},types:{"Register Request":[{name:"name",type:"string"},{name:"expiry",type:"uint256"},{name:"auth",type:"string"}]},primaryType:"Register Request",message:{name:w,expiry:BigInt(C),auth:st(nt(H.userId))}})),E=await fetch(`${Se}/register`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:w,...H,expiry:C,signature:W,inviteCode:b??void 0,email:o,talentOptIn:Z,twitter:m??void 0})});if(!E.ok){const{error:re}=await E.json();throw new Pe(`Failed to request registration: ${re}`)}A=(await E.json()).confirmation}const U=await ct({client:a.client,fn:"register",args:[a.address,{expiry:A.expiry,nonce:A.nonce,metadata:A.metadata,r:Le(A.signature,0,32),s:Le(A.signature,32,64),v:rt(Le(A.signature,64))}]});console.info(`Registration tx hash: ${U}`),await Promise.all([(async()=>{const C=await fetch(`${Se}/confirm`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({address:a.address,txHash:U})});if(!C.ok){const{error:W}=await C.json();throw new Pe(`Failed to confirm registration: ${W}`)}})(),ft(u,U)]),t(0,$=!0)})())}function ne(){y=this.checked,t(7,y)}function T(){R=this.checked,t(8,R)}function ue(){D=this.checked,t(10,D)}function Y(){Z=this.checked,t(9,Z)}const j=()=>O();function V(){b=this.value,t(4,b)}function te(){w=this.value,t(1,w)}function M(){o=this.value,t(5,o)}function K(){m=this.value,t(6,m)}const Q=()=>ee();return i.$$.update=()=>{i.$$.dirty[0]&3&&$&&w&&ze(`./player?${new URLSearchParams({name:w}).toString()}`)},[$,w,p,H,b,o,m,y,R,Z,D,a,l,O,ee,ne,T,ue,Y,j,V,te,M,K,Q]}class At extends xe{constructor(e){super(),Je(this,e,yt,kt,Fe,{},null,[-1,-1])}}export{At as component}; diff --git a/_app/immutable/nodes/9.EUKtwSR-.js b/_app/immutable/nodes/9.EUKtwSR-.js new file mode 100644 index 0000000..3c45000 --- /dev/null +++ b/_app/immutable/nodes/9.EUKtwSR-.js @@ -0,0 +1,3 @@ +import{s as Se,o as ce,p as G,k as b,i as d,b as j,e as L,j as M,d as V,q as we,f as C,v as U,B as Pe,t as $,h as g,l as h,m as A,n as Ee}from"../chunks/scheduler.C1FoT2GD.js";import{S as Te,i as Le,c as Q,b as J,m as K,t as z,a as B,d as W,g as ne,e as ae}from"../chunks/index.DFmxPlw4.js";import{e as Y,u as Ve,o as Ce}from"../chunks/each.Bmx-BImQ.js";import{b as _e}from"../chunks/paths.2ZvcQRjx.js";import{p as je}from"../chunks/stores.uos4ky2n.js";import{a as Me,U as re,P as Ne,i as ze,c as He,g as me,j as de,f as pe}from"../chunks/kit.CACir_b1.js";import{P as Ae,L as Be,C as Ie}from"../chunks/page.CWCv2ozC.js";import{P as Ue}from"../chunks/player.rtVQwoeI.js";import{S as Fe}from"../chunks/contest.LM7IXEuc.js";function he(n,e,t){const l=n.slice();return l[7]=e[t],l[9]=t,l}function ve(n,e,t){const l=n.slice();return l[10]=e[t],l[9]=t,l}function Re(n){let e,t,l,r="Tournaments",f,a,i;e=new Be({props:{$$slots:{default:[Je]},$$scope:{ctx:n}}});let o=Y(n[1]),u=[];for(let s=0;sB(u[s],1,1,()=>{u[s]=null});return{c(){Q(e.$$.fragment),t=j(),l=L("h2"),l.textContent=r,f=j(),a=L("div");for(let s=0;s0n&&$e(n);return{c(){e=L("h1"),t=$("Season "),r=$(l),f=j(),w.c(),a=j(),i=L("div"),o=$("Started on "),_=$(u),s=j(),S&&S.c(),c=j(),I&&I.c(),k=G(),this.h()},l(m){e=V(m,"H1",{class:!0});var E=C(e);t=g(E,"Season "),r=g(E,l),f=M(E),w.l(E),E.forEach(d),a=M(m),i=V(m,"DIV",{});var T=C(i);o=g(T,"Started on "),_=g(T,u),T.forEach(d),s=M(m),S&&S.l(m),c=M(m),I&&I.l(m),k=G(),this.h()},h(){U(e,"class","svelte-j2bsx1")},m(m,E){b(m,e,E),h(e,t),h(e,r),h(e,f),w.m(e,null),b(m,a,E),b(m,i,E),h(i,o),h(i,_),b(m,s,E),S&&S.m(m,E),b(m,c,E),I&&I.m(m,E),b(m,k,E)},p(m,E){var T,P;E&1&&l!==(l=m[0]+1+"")&&A(r,l),D!==(D=y(m))&&(w.d(1),w=D(m),w&&(w.c(),w.m(e,null))),E&5&&u!==(u=m[2][m[0]].startTime.toLocaleDateString()+"")&&A(_,u),(T=m[2][m[0]])!=null&&T.closedTime?S?S.p(m,E):(S=ke(m),S.c(),S.m(c.parentNode,c)):S&&(S.d(1),S=null),((P=m[2][m[0]])==null?void 0:P.prize)>0n?I?I.p(m,E):(I=$e(m),I.c(),I.m(k.parentNode,k)):I&&(I.d(1),I=null)},d(m){m&&(d(e),d(a),d(i),d(s),d(c),d(k)),w.d(),S&&S.d(m),I&&I.d(m)}}}function Ke(n){let e;return{c(){e=$("Grand Faire")},l(t){e=g(t,"Grand Faire")},m(t,l){b(t,e,l)},p:Ee,d(t){t&&d(e)}}}function We(n){let e,t,l=n[7].marketDayIndex!==void 0&&ge(n);return{c(){e=$("Market Day "),l&&l.c(),t=G()},l(r){e=g(r,"Market Day "),l&&l.l(r),t=G()},m(r,f){b(r,e,f),l&&l.m(r,f),b(r,t,f)},p(r,f){r[7].marketDayIndex!==void 0?l?l.p(r,f):(l=ge(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(r){r&&(d(e),d(t)),l&&l.d(r)}}}function ge(n){let e=n[7].marketDayIndex+1+"",t;return{c(){t=$(e)},l(l){t=g(l,e)},m(l,r){b(l,t,r)},p(l,r){r&2&&e!==(e=l[7].marketDayIndex+1+"")&&A(t,e)},d(l){l&&d(t)}}}function be(n){let e;return{c(){e=$("🏆️")},l(t){e=g(t,"🏆️")},m(t,l){b(t,e,l)},d(t){t&&d(e)}}}function ye(n,e){let t,l,r,f=pe(e[10].score)+"",a,i,o,u;l=new Ue({props:{name:e[10].name}});let _=e[9]===0&&be();return{key:n,first:null,c(){t=L("li"),Q(l.$$.fragment),r=$(`: + `),a=$(f),i=j(),_&&_.c(),o=j(),this.h()},l(s){t=V(s,"LI",{});var c=C(t);J(l.$$.fragment,c),r=g(c,`: + `),a=g(c,f),i=M(c),_&&_.l(c),o=M(c),c.forEach(d),this.h()},h(){this.first=t},m(s,c){b(s,t,c),K(l,t,null),h(t,r),h(t,a),h(t,i),_&&_.m(t,null),h(t,o),u=!0},p(s,c){e=s;const k={};c&2&&(k.name=e[10].name),l.$set(k),(!u||c&2)&&f!==(f=pe(e[10].score)+"")&&A(a,f),e[9]===0?_||(_=be(),_.c(),_.m(t,o)):_&&(_.d(1),_=null)},i(s){u||(z(l.$$.fragment,s),u=!0)},o(s){B(l.$$.fragment,s),u=!1},d(s){s&&d(t),W(l),_&&_.d()}}}function De(n){let e,t,l,r,f,a,i,o,u,_=n[7].time.toLocaleString()+"",s,c,k,y,D=n[7].rankings.length+"",w,S,I,q,F=Math.min(n[7].rankings.length,10)+"",m,E,T,P=[],ie=new Map,Z,R;function se(v,p){return v[7].type==="scrimmage"?We:Ke}let X=se(n),N=X(n),O=Y(n[7].rankings.slice(0,10));const oe=v=>v[10].address;for(let v=0;v> View tournament"),i=j(),o=L("div"),u=$("Time: "),s=$(_),c=j(),k=L("div"),y=$("Players: "),w=$(D),S=j(),I=L("h4"),q=$("Top "),m=$(F),E=j(),T=L("ol");for(let v=0;v> View tournament"),fe.forEach(d),i=M(p),o=V(p,"DIV",{});var x=C(o);u=g(x,"Time: "),s=g(x,_),x.forEach(d),c=M(p),k=V(p,"DIV",{});var ee=C(k);y=g(ee,"Players: "),w=g(ee,D),ee.forEach(d),S=M(p),I=V(p,"H4",{});var te=C(I);q=g(te,"Top "),m=g(te,F),te.forEach(d),E=M(p),T=V(p,"OL",{});var ue=C(T);for(let le=0;le{a[_]=null}),ae()),~e?(t=a[e],t?t.p(o,u):(t=a[e]=f[e](o),t.c()),z(t,1),t.m(l.parentNode,l)):t=null)},i(o){r||(z(t),r=!0)},o(o){B(t),r=!1},d(o){o&&d(l),~e&&a[e].d(o)}}}function Ye(n){let e,t;return e=new Ae({props:{title:"Season Details",$$slots:{default:[Xe]},$$scope:{ctx:n}}}),{c(){Q(e.$$.fragment)},l(l){J(e.$$.fragment,l)},m(l,r){K(e,l,r),t=!0},p(l,[r]){const f={};r&4103&&(f.$$scope={dirty:r,ctx:l}),e.$set(f)},i(l){t||(z(e.$$.fragment,l),t=!0)},o(l){B(e.$$.fragment,l),t=!1},d(l){W(e,l)}}}function Ze(n,e,t){let l,r;ce(n,je,_=>t(4,l=_));const{seasons:f}=Me();ce(n,f,_=>t(2,r=_));let a=null,i;const o=He(_=>t(1,i=_));function u(_){t(0,a=Number(_.get("season")??"1")-1),isNaN(a)&&t(1,i=new re("Invalid season"))}return n.$$.update=()=>{n.$$.dirty&16&&u(l.url.searchParams),n.$$.dirty&1&&a!==null&&o(async()=>{if(a===null)throw new re("Invalid season");const _=await fetch(`${Ne}/results?season=${a}`);if(!_.ok)throw console.error(await _.text()),new Error(_.statusText);const s=await _.json();if(!s)throw new re("Season not found.");const c=s.map(D=>({...D,time:new Date(D.time)})).sort((D,w)=>-ze(D.time,w.time));let y=c.reduce((D,w)=>w.type==="scrimmage"?D+1:D,0);for(const D of c)D.type==="scrimmage"&&(D.marketDayIndex=--y);return c})},[a,i,r,f,l]}class ot extends Te{constructor(e){super(),Le(this,e,Ze,Ye,Se,{})}}export{ot as component}; diff --git a/_app/version.json b/_app/version.json new file mode 100644 index 0000000..97bcb56 --- /dev/null +++ b/_app/version.json @@ -0,0 +1 @@ +{"version":"1719417690221"} \ No newline at end of file diff --git a/aged-paper.png b/aged-paper.png new file mode 100644 index 0000000..70c7918 Binary files /dev/null and b/aged-paper.png differ diff --git a/aristocrat.png b/aristocrat.png new file mode 100644 index 0000000..cbd2684 Binary files /dev/null and b/aristocrat.png differ diff --git a/attention-border.png b/attention-border.png new file mode 100644 index 0000000..b255cd2 Binary files /dev/null and b/attention-border.png differ diff --git a/bracket.html b/bracket.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/bracket.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/button-border.png b/button-border.png new file mode 100644 index 0000000..90620ef Binary files /dev/null and b/button-border.png differ diff --git a/cat-spinner.png b/cat-spinner.png new file mode 100644 index 0000000..e78c51f Binary files /dev/null and b/cat-spinner.png differ diff --git a/cat.png b/cat.png new file mode 100644 index 0000000..46ba62c Binary files /dev/null and b/cat.png differ diff --git a/charcoal-hl.png b/charcoal-hl.png new file mode 100644 index 0000000..31eb064 Binary files /dev/null and b/charcoal-hl.png differ diff --git a/coin-purse.png b/coin-purse.png new file mode 100644 index 0000000..3517930 Binary files /dev/null and b/coin-purse.png differ diff --git a/fair.png b/fair.png new file mode 100644 index 0000000..05765d4 Binary files /dev/null and b/fair.png differ diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..ae0386a Binary files /dev/null and b/favicon.png differ diff --git a/gold-leaf-texture.jpg b/gold-leaf-texture.jpg new file mode 100644 index 0000000..65942da Binary files /dev/null and b/gold-leaf-texture.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/index.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/leaf.png b/leaf.png new file mode 100644 index 0000000..0122f36 Binary files /dev/null and b/leaf.png differ diff --git a/lute.mp3 b/lute.mp3 new file mode 100644 index 0000000..41c76d0 Binary files /dev/null and b/lute.mp3 differ diff --git a/match.html b/match.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/match.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/merchants.png b/merchants.png new file mode 100644 index 0000000..8300bd7 Binary files /dev/null and b/merchants.png differ diff --git a/page-border.png b/page-border.png new file mode 100644 index 0000000..2f19ac9 Binary files /dev/null and b/page-border.png differ diff --git a/player.html b/player.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/player.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/players.html b/players.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/players.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/pointer-active.png b/pointer-active.png new file mode 100644 index 0000000..180226d Binary files /dev/null and b/pointer-active.png differ diff --git a/pointer.png b/pointer.png new file mode 100644 index 0000000..a07ce66 Binary files /dev/null and b/pointer.png differ diff --git a/privacy.html b/privacy.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/privacy.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/register.html b/register.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/register.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/rules.html b/rules.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/rules.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/season.html b/season.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/season.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + + diff --git a/sprites.png b/sprites.png new file mode 100644 index 0000000..597ca7b Binary files /dev/null and b/sprites.png differ diff --git a/terms/privacy.html b/terms/privacy.html new file mode 100644 index 0000000..271c04e --- /dev/null +++ b/terms/privacy.html @@ -0,0 +1,1286 @@ + + + + + + + + + +

     

    +

    DRAGONFLY "SEARCHERS OF NOTTINGHAM" COMPETITION 

    +

    PRIVACY POLICY 

    +

     

    +

    Last Updated June 6, 2024 

    +

     

    +

    Welcome to the website (the “Site”) of the Dragonfly "Searchers of Nottingham" Competition (the “Competition”). Through the Site Dragonfly Operations, LLC (“Company,” “we,” or “our”) administers the Competition and related services (the “Service”).  

    +

     

    +

    This Privacy Policy explains what Personal Data (defined below) we collect, how we use and share that data, and your choices concerning our data practices. This Privacy Policy is incorporated into and forms part of our Official Rules which are available on the Site.  For information on how to enter the Competition and the terms and conditions of entry please visit the Official Rules. 

    +

     

    +

    Before using the Service or submitting any Personal Data to Company, please review this Privacy Policy carefully and contact us if you have any questions. By using the Service, you agree to the practices described in this Privacy Policy. If you do not agree to this Privacy Policy, please do not access the Site or otherwise use the Service. 

    +

     

    +

    1. PERSONAL DATA WE COLLECT 

    +

    We collect information that alone or in combination with other information in our possession could be used to identify you (“Personal Data”) as follows: 

    +

    Personal Data You Provide: We collect Personal Data from you when you sign up to participate in the Competition. The Personal Data we collect includes your email address, Github account, and if you are a winner of the Competition, we will also collect information relevant for tax reporting including, but not limited to, government identification and mailing address. Additionally, we may receive Personal Data from third party sites that are linked with the Service. For example, if you sign up through a third party service such as Github, we may collect other information about you that is made publicly available on such third party service. The Personal Data collected during these interactions may vary based on what you are asked to submit in connection with a particular feature of the Service or that you otherwise choose to share with us.  

    +

    We may also have pages on social media sites like Instagram, Facebook, Twitter, and LinkedIn 

    +

    (“Social Media Pages”). When you interact with our Social Media Pages, we will collect Personal Data that you elect to provide to us, such as your contact details. In addition, the companies that host our Social Media Pages may provide us with aggregate information and analytics regarding the use of our Social Media Pages. 

    +

    Internet Activity Data: When you visit, use, and interact with the Service, we may receive certain information about your visit, use, or interactions. For example, we may monitor the number of people that visit the Service, peak hours of visits, which page(s) are visited, the domains our visitors come from (e.g., google.com, yahoo.com, etc.), and which browsers people use to access the Service (e.g., Chrome, Firefox, Microsoft Internet Explorer, etc.), broad geographical information, and navigation pattern. In particular, the following information is created and automatically logged in our systems:  

    +
      +
    • Log Data: Information that your browser automatically sends whenever you visit the Site. Log Data includes your Internet Protocol address, browser type and settings, the date and time of your request, and how you interacted with the Site.  
    • +
    • Cookies Data: Please see the Cookies section below to learn more about how we use cookies. 
    • +
    • Device Data: Includes name of the device, operating system, and browser you are using. Information collected may depend on the type of device you use and its settings.  
    • +
    • Usage Data: We collect information about how you use our Service, such as the types of content that you view or engage with, the features you use, the actions you take, and the time, frequency, and duration of your activities. 
    • +
    • Location Data: We derive a rough estimate of your location from your IP address.  
    • +
    +

     

    +

    Personal Information We Process on Behalf of Our Business Customers: When you use and interact with the Service, we will have your IP address in order to ensure that you are able to access the Services, and we will collect your browser information so that we may provide any necessary technical support through a third party vendor.  

    +

    Cookies: We use cookies to operate and administer our Site, gather usage data on our Site, and improve your experience on it. A “cookie” is a piece of information sent to your browser by a website you visit. Cookies can be stored on your computer for different periods of time. Some cookies expire after a certain amount of time, or upon logging out (session cookies), others survive after your browser is closed until a defined expiration date set in the cookie (as determined by the third party placing it), and help recognize your computer when you open your browser and browse the Internet again (persistent cookies). 

    +

     

    +

    On most web browsers, you will find a “help” section on the toolbar. Please refer to this section for information on how to receive a notification when you are receiving a new cookie and how to turn cookies off. Please see the links below for guidance on how to modify your web browser’s settings on the most popular browsers: 

    +

     

    +
      +
    • Internet Explorer 
    • +
    • Mozilla Firefox 
    • +
    • Google Chrome 
    • +
    • Apple Safari 
    • +
    +

     

    +

    Please note that if you limit the ability of websites to set cookies, you may be unable to access certain parts of the Site and you may not be able to benefit from the full functionality of the Site. 

    +

     

    +

    Advertising networks may use cookies to collect Personal Data. Most advertising networks offer you a way to opt out of targeted advertising. If you would like to find out more information, please         visit the Network Advertising Initiative’s online resources at http://www.networkadvertising.org and follow the opt-out instructions there. 

    +

    If you access the Site on your mobile device, you may not be able to control tracking technologies through the settings.  

    +

    Online Tracking and Do Not Track Signals: We and our third party service providers, including Amazon Web Services and Vercel, may use cookies, pixels, or other tracking technologies to collect information about your browsing activities over time and across different websites following your use of the Site and use that information to send targeted advertisements. Our Site currently does not respond to “Do Not Track” (“DNT”) signals and operates as described in this Privacy Policy whether or not a DNT signal is received. If we do respond to DNT signals in the future, we will update this Privacy Policy to describe how we do so.  

    +

     

    +

    2. HOW WE USE PERSONAL DATA 

    +

    We may use Personal Data for the following purposes: 

    +

     

    +
      +
    • To provide the Service, including fulfilling any prizes awarded in the Competition, and send you any information you request about our Service; 
    • +
    • To respond to your inquiries, comments, feedback, or questions; 
    • +
    • To send administrative information to you, for example, information regarding the Service and changes to our terms, conditions, and policies; 
    • +
    • To maintain and improve the Service; 
    • +
    • To prevent fraud, criminal activity, or misuses of our Service, and to ensure the security of our IT systems, architecture, and networks; and 
    • +
    • To comply with legal obligations and legal process and to protect our rights, privacy, safety, or property, and/or that of our affiliates, you, or other third parties. 
    • +
    +

     

    +

    Aggregated Information.  We may aggregate Personal Data and use the aggregated  information to analyze the effectiveness of our Service, to improve and add features to our Service, and for other similar purposes. In addition, from time to time, we may analyze the general behavior and characteristics of users of our Service and share aggregated information like general user statistics with prospective business partners. We may collect aggregated information through the Service, through cookies, and through other means described in this Privacy Policy. 

    +


    +


    +

    3. SHARING AND DISCLOSURE OF PERSONAL DATA 

    +

    In certain circumstances we may share the categories of Personal Data described above without further notice to you, unless required by the law, with the following categories of third parties: 

    +

     

    +
      +
    • Prize Fulfillment: In connection with fulfilling the prizes in the Competition, we may share your Personal Data to assist us in fulfilling and delivering prizes to winners of the Competition, including for example the provider of the merchandise that will be awarded during the Competition. 
    • +
    • Vendors and Service Providers: To assist us in meeting business operations needs and to perform certain services and functions, we may share Personal Data with vendors and service providers, including providers of hosting services, cloud services, and other information technology services providers, email communication software and email newsletter services, advertising and marketing services, payment processors, customer relationship management and customer support services, and analytics services. Pursuant to our instructions, these parties will access, process, or store Personal Data in the course of performing their duties to us.  
    • +
    • Business Transfers: If we are involved in a merger, acquisition, financing due diligence, reorganization, bankruptcy, receivership, sale of all or a portion of our assets, or transition of service to another provider (collectively a “Transaction”), your Personal Data and other information may be shared in the diligence process with counterparties and others assisting with the Transaction and transferred to a successor or affiliate as part of that Transaction along with other assets. 
    • +
    • Legal Requirements: If required to do so by law or in the good faith belief that such action is necessary to (i) comply with a legal obligation, including to meet national security or law enforcement requirements, (ii) protect and defend our rights or property, (iii) prevent fraud, (iv) act in urgent circumstances to protect the personal safety of users of the Service, or the public, or (v) protect against legal liability. 
    • +
    +

     

    +

    4. UPDATE YOUR INFORMATION 

    +

    Please contact us if you need to change or correct your Personal Data.  

    +

     

    +

    5. CHILDREN 

    +

    Our Service is not directed to children who are under the age of 18. Company does not knowingly collect Personal Data from children under the age of 18. If you have reason to believe that a child under the age of 16 has provided Personal Data to Company through the Service please contact us and we will endeavor to delete that information from our databases. 

    +

     

    +

    6. LINKS TO OTHER WEBSITES 

    +

    The Service may contain links to other websites not operated or controlled by Company, including social media services (“Third Party Sites”). The information that you share with Third Party Sites will be governed by the specific privacy policies and Official Rules of the Third Party Sites and not by this Privacy Policy. By providing these links we do not imply that we endorse or have reviewed these sites. Please contact the Third Party Sites directly for information on their privacy practices and policies.  

    +

     

    +

    7. SECURITY 

    +

    You use the Service at your own risk. We implement commercially reasonable technical, administrative, and organizational measures to protect Personal Data both online and offline from loss, misuse, and unauthorized access, disclosure, alteration, or destruction. However, no Internet or e-mail transmission is ever fully secure or error free. In particular, e-mail sent to or from us may not be secure. Therefore, you should take special care in deciding what information you send to us via the Service or e-mail. Please keep this in mind when disclosing any Personal Data to Company via the Internet. In addition, we are not responsible for circumvention of any privacy settings or security measures contained on the Service, or third party websites. 

    +

    8. INTERNATIONAL USERS 

    +

    By using our Service, you understand and acknowledge that your Personal Data will be transferred from your location to our facilities and servers in the United States. 

    +

    9. YOUR CHOICES 

    +

    In certain circumstances providing Personal Data is optional. However, if you choose not to provide Personal Data that is needed to use some features of our Service, you may be unable to use those features. You can also contact us to ask us to update or correct your Personal Data. 

    +

    10. CHANGES TO THE PRIVACY POLICY 

    +

    The Service and our business may change from time to time. As a result, we may change this Privacy Policy at any time. When we do, we will post an updated version on this page, unless another type of notice is required by the applicable law. By continuing to use our Service or providing us with Personal Data after we have posted an updated Privacy Policy, or notified you by other means if applicable, you consent to the revised Privacy Policy and practices described in it. 

    +

     

    +

    11. CONTACT US 

    +

    If you have any questions about our Privacy Policy or information practices, please feel free to contact us at privacy@dragonfly.xyz.  

    +


    +


    +

     

    +
    +


    +
    + + + \ No newline at end of file diff --git a/terms/rules.html b/terms/rules.html new file mode 100644 index 0000000..e1345c3 --- /dev/null +++ b/terms/rules.html @@ -0,0 +1 @@ +

    Dragonfly Capture the Flag Competition (“Searchers of Nottingham”) Official Rules

    Date:  June 15, 2024

    THESE OFFICIAL RULES CONTAIN AN ARBITRATION AGREEMENT, WHICH WILL, WITH LIMITED EXCEPTION, REQUIRE YOU TO SUBMIT CLAIMS YOU HAVE AGAINST SPONSOR TO BINDING AND FINAL ARBITRATION. UNDER THE ARBITRATION AGREEMENT, (1) YOU WILL ONLY BE PERMITTED TO PURSUE CLAIMS AGAINST SPONSOR ON AN INDIVIDUAL BASIS, NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY CLASS OR REPRESENTATIVE ACTION OR PROCEEDING, AND (2) YOU WILL ONLY BE PERMITTED TO SEEK RELIEF (INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ON AN INDIVIDUAL BASIS.

    The Dragonfly Capture the Flag Competition “Searchers of Nottingham” (the “Competition”) begins on Saturday, June 15, 2024 at 05:00 PM UTC (the “Competition Start Date”) and ends at 05:00 PM UTC on Sunday, June 30, 2024 (the “Competition End Date”) (such period referred to herein as the “Competition Period”). ENTRANTS ARE RESPONSIBLE FOR DETERMINING THE CORRESPONDING TIME ZONE IN THEIR RESPECTIVE JURISDICTIONS.  The Competition is sponsored by Dragonfly Operations, LLC (the “Sponsor”).

    1. HOW TO ENTER

    NO PURCHASE NECESSARY TO ENTER OR CLAIM PRIZE. VOID WHERE PROHIBITED. A PURCHASE WILL NOT INCREASE YOUR CHANCES OF WINNING. Participation in the Competition is voluntary.  All entries are subject to Sponsor’s privacy policy located at nottingham.dragonfly.xyz/privacy.

    Individuals or teams may participate in the Competition. At any time during the Competition Period, individual or team participants (each a “Participant”) may enter the Competition by completing all required steps in the sign-up process located at https://nottingham.dragonfly.xyz (the “Website”), including without limitation providing the Participant’s github account, name, email address, the names of the other team members (if applicable) and the team name (if applicable). After the Participants complete the sign-up process, they will receive access to the Competition dashboard (the “Dashboard”), which is where the Challenges (as defined below) are made available and where Participants can submit their solutions for each Challenge.

    For teams participating in the Competition, each team must be represented by one (1) team leader (the “Team Leader”). The Team Leader is the sole contact person for purposes of the Competition and is responsible for submitting the sign-up form, generating a team token to distribute to the other team members so that they can join the team and also access the Dashboard, and submitting the solutions to each puzzle.

    During the Competition Period, the Participants may submit a smart contract (each a “Solution”) which will be evaluated against Solutions from other Participants in a series of tournament-style games (each a “Challenge” and collectively, the “Challenges”). The performance of every Participants’ Solutions across Challenges will result in a relative score of all respective Participants. Challenges are hosted on a private EVM environment controlled by us.  Not all Challenges award prizes; each Challenge will specify whether a prize will be given. Three Challenges will occur during the Competition Period which award prizes to the Participant with the highest score.  No illegible, incomplete, forged or altered entries will be accepted. All entries become the property of Sponsor and will not be returned. An individual may not enter both individually and as a member of a team and can only submit one final entry for judging (either individually or as part of a team).  Participants may submit multiple Solutions, but each new Submission (as defined in Section 4) overwrites the previous one, so only one final entry per participant will be judged.

    1. SELECTION OF WINNERS; PRIZE:

    For Challenges that award prizes, Participants will be ranked by a score derived from the relative performance of their Solution against other Participant Solutions. The top Participant(s) in each Challenge based on this score (collectively, the “Winners”) will be eligible to receive prizes ranging from approximately $1,000 USD to $4,000 USD worth of ETH (each a Prize, and collectively, the “Prizes”). To receive the applicable Prize, (i) each potential Winner must have and communicate a wallet address that will allow the Winner to receive a Prize, (ii) each potential Winner must submit information sufficient to verify identity for purposes of determining eligibility, including without limitation name, address, date of birth, and government ID, all of which must be submitted within 2 weeks of their receiving the notice in Section 6 (such date, the “Due Date”). In the event of a tie between two or more Participants, a Winner will be selected pseudorandomly, based on the configuration of the software conducting Challenges.

    In the case of a Participant that is a team, the prize(s) will only be awarded to the Team Leader. The Team Leader is solely responsible for complying with all requirements applicable to receipt of such prize. The Team Leader is also solely liable and responsible for sharing the prize with the other members of its team, at the Team Leader’s sole discretion. Sponsor will not be liable for any action or omission by any Team Leader, including without limitation any Team Leader’s failure to share a prize with the other team members.

    Allow 3-4 weeks after validation of eligibility for receipt of prize. Odds of winning are affected by the number of eligible entries received by the Competition End Date. The Winners will be solely responsible for all other expenses not specifically set forth herein. The Sponsor reserves the right to substitute prizes of equal or greater value (based on the fair market value at the Competition End Date. No other substitution or transfer of prizes permitted. To receive a prize, the Participants may be required to provide proof of identification, including name, age, address and date of birth, and agree to provide any other information reasonably requested by Sponsor in order to deliver the prize. In order to receive the ETH prize, Winners may be required to provide any information reasonably requested by Sponsor in order to fulfill and deliver the prize including their wallet address (as applicable), name, date of birth, mailing address, taxpayer information, and a copy of their passport or other valid proof of identity. All federal, state, and local or other taxes on any prize, including income and/or sales taxes, are the sole responsibility of the Winner. Any Winner who receives a prize with a value of $600 or greater will be issued an IRS Form Misc-1099 for the actual value of the prize, and are advised to seek independent counsel regarding the tax implications of the prize winnings; provided, however, Sponsor may elect to gross up the prize to cover the Winner’s taxes for such prize.

    1. ELIGIBILITY:

    The Competition is only open to individuals who are (i) over eighteen (18) years of age at the time of entry and (ii) reside in a jurisdiction other than any jurisdiction comprehensively sanctioned by the United States Office of Foreign Asset Control (“OFAC”) at the time the entry is submitted (the list of sanctions programs administered by OFAC is available at https://www.treasury.gov/resource-center/sanctions/programs/pages/programs.aspx) and whom is not otherwise subject to OFAC sanctions. In addition, in order to be eligible to receive a prize, each potential winner must comply with the requirements set forth in Section 2. By participating in the Competition, each Participant accepts the conditions stated in these Official Rules, agrees to be bound by the decisions of Sponsor and warrants that she/he is eligible to participate in the Competition. Employees, independent contractors, interns, officers, and directors of Sponsor, affiliates, subsidiaries, advertising, Competition, and fulfillment agencies, and legal advisors, and their immediate family members and persons living in the same household, are not eligible to participate in the Competition. THE COMPETITION IS VOID WHERE PROHIBITED OR RESTRICTED BY LAW and is subject to applicable international, federal, state and local laws and regulations.

    1. USE OF CONTENT/SUBMISSIONS.

    By submitting solutions to the Challenges (“Submissions”) to Sponsor in connection with this Competition, you automatically represent and warrant that you have the right to grant, and do hereby grant, to Sponsor the paid-up, royalty-free, perpetual, irrevocable, sublicensable, non-exclusive right and license to (a) use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, perform and display any such Submissions (in whole or in part) worldwide and/or to incorporate all or any portion of it in other works in any form, media or technology now known or later developed for the full term of any patent, trademark, trade secret, copyright or other proprietary rights of any party that may exist in such Submissions; and (b) use the Submissions, including without limitation, the right and license to make, use, sell, offer for sale, and import any products and/or services which practice or embody, or are configured for use in practicing, all or any portion of the Submissions and the right to practice. BY SUBMITTING AN ENTRY, EACH PARTICIPANT ACKNOWLEDGES THAT HIS/HER ENTRY MAY BE POSTED ON SPONSOR’S WEBSITE, SOCIAL MEDIA CHANNELS AND OTHER CHANNELS, AND EDITED, IN SPONSOR’S DISCRETION. Inclusion of Submissions on Sponsor’s website, social media channels or other channels will include attribution to the photographer and you hereby grant Sponsor the paid-up, royalty-free, perpetual, irrevocable, sublicensable, non-exclusive right and license to use your name and other likeness for such purpose. Under no circumstances will Sponsor be required to treat any Submissions as confidential. Sponsor will be entitled to use the Submissions for any purpose whatsoever without compensation to you or any other person. For the avoidance of doubt, Sponsor will not be liable to you or any other person for any ideas for Sponsor’s business (including, without limitation, product designs or ideas) derived from the Submissions and will not incur any liability as a result of any similarities to the Submissions that may appear in any future products or services of Sponsor. You warrant that the content in the Submission has not been copied from any third party and its use by Sponsor will not infringe or involve the misappropriation of any third party rights and agree to indemnify and hold harmless Sponsor and all other third parties licensed above from and against any breach of this warranty.

    1. LIMITATION OF LIABILITY & DISCLAIMER OF WARRANTIES: 

    IN NO EVENT WILL SPONSOR OR ITS AFFILIATES, SUBSIDIARIES AND RELATED COMPANIES, OR THEIR RESPECTIVE OFFICERS, DIRECTORS, EMPLOYEES, REPRESENTATIVES AND AGENTS, BE RESPONSIBLE OR LIABLE FOR ANY DAMAGES OR LOSSES OF ANY KIND, INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL OR PUNITIVE DAMAGES ARISING OUT OF YOUR PARTICIPATION IN THE COMPETITION OR FOR ANY ACTION OR OMISSION MADE IN CONNECTION WITH THE COMPETITION. WITHOUT LIMITING THE FOREGOING, EVERYTHING IN THESE RULES AND IN THIS COMPETITION, INCLUDING THE PRIZES AWARDED, IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. SOME JURISDICTIONS MAY NOT ALLOW THE LIMITATIONS OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES OR EXCLUSION OF IMPLIED WARRANTIES SO SOME OF THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU. CHECK YOUR LOCAL LAWS FOR ANY RESTRICTIONS OR LIMITATIONS REGARDING THESE LIMITATIONS OR EXCLUSIONS.

    1. NOTIFICATION OF WINNERS:

    The Winners will be notified by email using the information provided when the Participant entered the Competition, within approximately thirty (30) days of the Competition End Date.  Such notification to the Winners shall include instructions for proper acceptance of the prize by such Winner.  In the event a Winner does not accept a prize, a Winner is ineligible, or the prize or prize notification is not deliverable, an alternate Winner may be selected.  Sponsor is not responsible for and shall not be liable for late, lost, misdirected or unsuccessful efforts to notify a Winner.  Each Participant agrees to Sponsor’s use of their name, address, likeness, and/or prize information for promotional purposes in any medium without additional compensation to the extent permitted by law.  Where lawful, each Winner may be required to sign and return an Affidavit of Eligibility, Release of Liability, and Publicity Release.  All Participants will be notified of the points they earn from each Challenge (if any) through the Dashboard.

    The Sponsor is not responsible for notifying or distributing the prize or redeemed merchandise amongst the other team members.

    1. WINNERS LIST:  

    The list of Winners  may be posted on the Sponsor’s website and social media accounts within approximately 5 days of the Competition End Date.

    1. WARRANTY, INDMENITY AND RELEASE:

    Sponsor and its respective agents, directors, officers, shareholders, employees, insurers, servants, parents, subsidiaries, divisions, affiliates, predecessors, successors, representatives, advertising, Competition, and fulfillment agencies, and legal advisors (the “Released Entities”), are not responsible for, shall not be liable for, and hereby disclaim all liability arising from or relating to: (i) late, lost, delayed, damaged, misdirected, misaddressed, incomplete, or unintelligible entries; (ii) telephone, electronic, hardware or software program, network, Internet, computer or other malfunctions, failures, or difficulties of any kind, whether human or technical; (iii) failed, incomplete, garbled, or delayed computer or e-mail transmissions; (iv) any condition caused by events beyond the control of Sponsor; (v) any injuries, losses, or damages of any kind arising in connection with or as a result of any prize, or any portion thereof that may have been awarded, or acceptance, possession, or use of any prize, or any portion thereof that may have been awarded, or from participation in the Competition; (vi) any printing or typographical errors in any materials associated with the Competition; or (v) the Competition. Sponsor reserves the right, in its sole discretion, to suspend, modify or cancel the Competition should any unauthorized human intervention or other causes beyond Sponsor’s control corrupt or affect the administration, security, fairness or proper conduct of the Competition. In the event that proper administration of the Competition is prevented by such causes as contemplated above, Sponsor will pick the Winners from all eligible, non-suspect entries received prior to such action. By participating in the Competition, Participants and Winners agree to release, discharge and hold harmless the Released Entities, and all others associated with the development and execution of the Competition, from any and all losses, damages, rights, claims and actions of any kind arising out of or relating to the Competition, participation in the Competition, any prize, or any portion thereof that may have been awarded, and/or acceptance, possession, use or misuse of any prize, or any portion thereof that may have been awarded, including but not limited to statutory and common law claims for misappropriation or Participant’s right of publicity.

    1. GOVERNING LAW:

    The Sponsor’s computer is the official clock for the Competition. This Competition shall be governed by New York law.

    1. RIGHT TO CANCEL:

    If for any reason the Competition not capable of running as planned, including tampering, unauthorized intervention, fraud, technical failures, printing errors, or any other causes which corrupt or affect the administration, security, fairness, integrity, or proper conduct of the Competition, Sponsor reserves the right at its sole discretion to cancel, terminate, modify or suspend the Competition. Sponsor further reserves the right to disqualify any Participant who tampers with the submission process or contest, cheats, deceives, abuses, annoys, threatens any other Participants or judges, or otherwise violates any law or behaves in an unfit manner as determined by Sponsor.

    1. ARBITRATION AGREEMENT

    PLEASE READ THIS SECTION CAREFULLY AS IT AFFECTS YOUR RIGHTS.

    1. Agreement to Arbitrate. This Section 10 is referred to in these Official Rules as the “Arbitration Agreement.” You agree that any and all disputes or claims that have arisen or may arise between you and Sponsor, whether arising out of or relating to these Official Rules (including any alleged breach thereof), any advertising, any aspect of the relationship or transactions between us, shall be resolved exclusively through final and binding arbitration, rather than a court, in accordance with the terms of this Arbitration Agreement, except that you may assert individual claims in small claims court, if your claims qualify. Further, this Arbitration Agreement does not preclude you from bringing issues to the attention of federal, state, or local agencies, and such agencies can, if the law allows, seek relief against us on your behalf. You agree that, by entering into these Official Rules, you and Sponsor are each waiving the right to a trial by jury or to participate in a class action. Your rights will be determined by a neutral arbitrator, not a judge or jury. The Federal Arbitration Act governs the interpretation and enforcement of this Arbitration Agreement.

    1. Prohibition of Class and Representative Actions and Non-Individualized ReliefYOU AND SPONSOR AGREE THAT EACH OF US MAY BRING CLAIMS AGAINST THE OTHER ONLY ON AN INDIVIDUAL BASIS AND NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY PURPORTED CLASS OR REPRESENTATIVE ACTION OR PROCEEDING. UNLESS BOTH YOU AND SPONSOR AGREE OTHERWISE, THE ARBITRATOR MAY NOT CONSOLIDATE OR JOIN MORE THAN ONE PERSON’S OR PARTY’S CLAIMS AND MAY NOT OTHERWISE PRESIDE OVER ANY FORM OF A CONSOLIDATED, REPRESENTATIVE, OR CLASS PROCEEDING. ALSO, THE ARBITRATOR MAY AWARD RELIEF (INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ONLY IN FAVOR OF THE INDIVIDUAL PARTY SEEKING RELIEF AND ONLY TO THE EXTENT NECESSARY TO PROVIDE RELIEF NECESSITATED BY THAT PARTY’S INDIVIDUAL CLAIM(S).

    1. Pre-Arbitration Dispute Resolution.        Sponsor is always interested in resolving disputes amicably and efficiently, and most customer concerns can be resolved quickly and to the customer’s satisfaction by emailing Dragonfly at privacy@dragonfly.xyz. If such efforts prove unsuccessful, a party who intends to seek arbitration must first send to the other, by certified mail, a written Notice of Dispute (“Notice”). The Notice to Sponsor should be sent to Dragonfly Operations, LLC at 447 Sutter Street Ste 405, #475, San Francisco, CA 94108 (“Notice Address”). The Notice must (i) describe the nature and basis of the claim or dispute and (ii) set forth the specific relief sought. If Sponsor and you do not resolve the claim within sixty (60) calendar days after the Notice is received, you or Sponsor may commence an arbitration proceeding. During the arbitration, the amount of any settlement offer made by Sponsor or you shall not be disclosed to the arbitrator until after the arbitrator determines the amount, if any, to which you or Sponsor is entitled.

    1. Arbitration Procedures. Arbitration will be conducted by a neutral arbitrator in accordance with the American Arbitration Association’s (“AAA”) rules and procedures, including the AAA’s Supplementary Procedures for Consumer-Related Disputes (collectively, the “AAA Rules”), as modified by this Arbitration Agreement. For information on the AAA, please visit its website, http://www.adr.org. Information about the AAA Rules and fees for consumer disputes can be found at the AAA’s consumer arbitration page, http://www.adr.org/consumer_arbitration. If there is any inconsistency between any term of the AAA Rules and any term of this Arbitration Agreement, the applicable terms of this Arbitration Agreement will control unless the arbitrator determines that the application of the inconsistent Arbitration Agreement terms would not result in a fundamentally fair arbitration. The arbitrator must also follow the provisions of these Official Rules as a court would. All issues are for the arbitrator to decide, including, but not limited to, issues relating to the scope, enforceability, and arbitrability of this Arbitration Agreement. Although arbitration proceedings are usually simpler and more streamlined than trials and other judicial proceedings, the arbitrator can award the same damages and relief on an individual basis that a court can award to an individual under these Official Rules and applicable law. Decisions by the arbitrator are enforceable in court and may be overturned by a court only for very limited reasons.

    Unless Sponsor and you agree otherwise, any arbitration hearings will take place in a reasonably convenient location for both parties with due consideration of their ability to travel and other pertinent circumstances. If the parties are unable to agree on a location, the determination shall be made by AAA. If your claim is for $10,000 or less, Sponsor agrees that you may choose whether the arbitration will be conducted solely on the basis of documents submitted to the arbitrator, through a telephonic hearing, or by an in-person hearing as established by the AAA Rules. If your claim exceeds $10,000, the right to a hearing will be determined by the AAA Rules. Regardless of the manner in which the arbitration is conducted, the arbitrator shall issue a reasoned written decision sufficient to explain the essential findings and conclusions on which the award is based.

    1. Costs of Arbitration. Payment of all filing, administration, and arbitrator fees (collectively, the “Arbitration Fees”) will be governed by the AAA Rules, unless otherwise provided in this Arbitration Agreement. If the value of the relief sought is $75,000 or less, at your request, Sponsor will pay all Arbitration Fees. If the value of relief sought is more than $75,000 and you are able to demonstrate to the arbitrator that you are economically unable to pay your portion of the Arbitration Fees or if the arbitrator otherwise determines for any reason that you should not be required to pay your portion of the Arbitration Fees, Sponsor will pay your portion of such fees. In addition, if you demonstrate to the arbitrator that the costs of arbitration will be prohibitive as compared to the costs of litigation, Sponsor will pay as much of the Arbitration Fees as the arbitrator deems necessary to prevent the arbitration from being cost-prohibitive. Finally, if the value of the relief sought is $75,000 or less, Sponsor will pay reasonable attorneys’ fees should you prevail. Sponsor will not seek attorneys’ fees from you. But, if you initiate an arbitration in which you seek more than $75,000 in relief, the payment of attorneys’ fees will be governed by the AAA Rules.

    1. Confidentiality. All aspects of the arbitration proceeding, and any ruling, decision, or award by the arbitrator, will be strictly confidential for the benefit of all parties.

    1. Severability. Without limiting the severability provision in Section 10 of the these Official Rules, if a court or the arbitrator decides that any term or provision of this Arbitration Agreement other than Section 10(b) above is invalid or unenforceable, the parties agree to replace such term or provision with a term or provision that is valid and enforceable and that comes closest to expressing the intention of the invalid or unenforceable term or provision, and this Arbitration Agreement shall be enforceable as so modified. If a court decides that any of the provisions of Section 10(b) is invalid or unenforceable, then the entirety of this Arbitration Agreement shall be null and void.  The remainder of these Official Rules will continue to apply.

    1. Future Changes to Arbitration Agreement. Notwithstanding any provision in these Official Rules to the contrary, Sponsor agrees that if it makes any future change to this Arbitration Agreement (other than a change to the Notice Address) while you are a user of the Services, you may reject any such change by sending Sponsor written notice within thirty (30) calendar days of the change to the Notice Address provided above. By rejecting any future change, you are agreeing that you will arbitrate any dispute between us in accordance with the language of this Arbitration Agreement.
    1. SPONSOR:  

    This Competition is sponsored by Dragonfly Operations, LLC at 447 Sutter Street Ste 405, #475, San Francisco, CA 94108.

    1. NOTICE:

    Sponsor reserves the right to prosecute and seek damages against any individual who attempts to deliberately undermine the proper operation of the Competition in violation of these Official Rules and/or criminal and/or civil law.

    1. PUBLICITY: 

    By entering, Participant agrees and consents to permit Sponsor and its agencies to use his or her name, photographs and/or likeness, code and any provided or recorded/streamed video for advertising and promotional purposes without additional compensation.

    FLAG-YOURE-IT

    \ No newline at end of file diff --git a/text-input-border.png b/text-input-border.png new file mode 100644 index 0000000..aada104 Binary files /dev/null and b/text-input-border.png differ diff --git a/tournament.html b/tournament.html new file mode 100644 index 0000000..f24a47a --- /dev/null +++ b/tournament.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    + +
    + +