diff --git a/snaps-simulator/staging/main.js b/snaps-simulator/staging/main.js
index 5a0115b207..4de735ceca 100644
--- a/snaps-simulator/staging/main.js
+++ b/snaps-simulator/staging/main.js
@@ -202,4 +202,4 @@ ${e}
`}table(e,t){return t&&(t=`
${t}`),"\n"}tablerow(e){return`
${e}
`}tablecell(e,t){let r=t.header?"th":"td",n=t.align?`<${r} align="${t.align}">`:`<${r}>`;return n+e+`${r}>
-`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}
`}br(){return"
"}del(e){return`${e}`}link(e,t,r){let n=om(e);if(null===n)return r;let i='"+r+""}image(e,t,r){let n=om(e);if(null===n)return r;let i=`"}text(e){return e}}class o8{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class o7{options;renderer;textRenderer;constructor(e){this.options=e||oi,this.options.renderer=this.options.renderer||new o5,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new o8}static parse(e,t){let r=new o7(t);return r.parse(e)}static parseInline(e,t){let r=new o7(t);return r.parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""));continue;case"code":r+=this.renderer.code(i.text,i.lang,!!i.escaped);continue;case"table":{let e="",t="";for(let e=0;e0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):s+=e+" "}s+=this.parse(t.tokens,n),o+=this.renderer.listitem(s,a,!!r)}r+=this.renderer.list(o,e,t);continue}case"html":r+=this.renderer.html(i.text,i.block);continue;case"paragraph":r+=this.renderer.paragraph(this.parseInline(i.tokens));continue;case"text":{let o=i,a=o.tokens?this.parseInline(o.tokens):o.text;for(;n+1{let i=e[n].flat(1/0);r=r.concat(this.walkTokens(i,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new o5(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if("options"===r)continue;let n=e.renderer[r],i=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ov(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let n=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new o9;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if("options"===r)continue;let n=e.hooks[r],i=t[r];o9.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(n.call(t,e)).then(e=>i.call(t,e));let r=n.call(t,e);return i.call(t,r)}:t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return o6.lex(e,t??this.defaults)}parser(e,t){return o7.parse(e,t??this.defaults)}#e(e,t){return(r,n)=>{let i={...n},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);let a=this.#t(!!o.silent,!!o.async);if(null==r)return a(Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(t=>e(t,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>t(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let n=e(r,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let i=t(n,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return a(e)}}}#t(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="An error occurred:
"+op(r.message+"",!0)+"
";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}}let at=new ae;function ar(e,t){return at.parse(e,t)}ar.options=ar.setOptions=function(e){return at.setOptions(e),ar.defaults=at.defaults,oi=ar.defaults,ar},ar.getDefaults=on,ar.defaults=oi,ar.use=function(...e){return at.use(...e),ar.defaults=at.defaults,oi=ar.defaults,ar},ar.walkTokens=function(e,t){return at.walkTokens(e,t)},ar.parseInline=at.parseInline,ar.Parser=o7,ar.parser=o7.parse,ar.Renderer=o5,ar.TextRenderer=o8,ar.Lexer=o6,ar.lexer=o6.lex,ar.Tokenizer=ov,ar.Hooks=o9,ar.parse=ar,ar.options,ar.setOptions,ar.use;let an=ar.walkTokens;ar.parseInline,o7.parse;let ai=o6.lex;function ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r0?a_(e.tokens.flatMap(am)):e.href});case"text":return e.text;case"strong":return i4(i7,{children:af(e.tokens)});case"em":return i4(i9,{children:af(e.tokens)});default:return null}}function ah(e,t,r){try{var n=new URL(e);if((0,_.assert)(ad.includes(n.protocol),"Protocol must be one of: ".concat(ad.join(", "),".")),"metamask:"===n.protocol){var i=function(e){var t=new URL(e),r=t.protocol;if("metamask:"!==r)throw Error('Unable to parse URL. Expected the protocol to be "metamask:", but received "'.concat(r,'".'));var n=aa(t.href.replace("metamask://","").split("/")),i=n[0],o=n.slice(1),a="/".concat(o.join("/"));switch(i){case"client":return(0,_.assert)(as.includes(a),'Unable to navigate to "'.concat(a,'". The provided path is not allowed.')),{authority:i,path:a};case"snap":return function(e){var t,r="Invalid MetaMask url:",n=e5(e.slice(1)),i=e.slice(1).startsWith("npm:")?"npm:":"local:",o=n.startsWith("@"),a=n.split("/"),s="/".concat(a[a.length-1]);if("local:"===i){var l=aa(a.slice(0,-1)),u=l[0],c=l.slice(2);t="".concat(u,"//").concat(c.join("/")),(0,_.assert)(al.includes(s),"".concat(r," invalid snap path."))}else t=o?"".concat(a[0],"/").concat(a[1]):a[0],(0,_.assert)(o?3===a.length&&al.includes(s):2===a.length&&al.includes(s),"".concat(r," invalid snap path."));var p="".concat(i).concat(t);return(0,_.assertStruct)(p,e4,"Invalid snap ID"),{authority:"snap",snapId:p,path:s}}(a);default:throw Error('Expected "metamask:" URL to start with "client" or "snap", but received "'.concat(i,'".'))}}(e);i.snapId&&(0,_.assert)(r(i.snapId),"The Snap being navigated to is not installed.")}else if("mailto:"===n.protocol){var o=n.pathname.split(","),a=!0,s=!1,l=void 0;try{for(var u,c=o[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var p=u.value.split("@")[1];(0,_.assert)(!p.includes(":"));var d="https://".concat(p);(0,_.assert)(!t(d),"The specified URL is not allowed.")}}catch(e){s=!0,l=e}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}return}(0,_.assert)(!t(n.href),"The specified URL is not allowed.")}catch(e){throw Error("Invalid URL: ".concat((null==e?void 0:e.code)==="ERR_ASSERTION"?e.message:"Unable to parse URL."))}}function ay(e){return(0,_.hasProperty)(e.props,"children")}function ag(e){return!!e&&!0!==e}function ab(e){if(ay(e)){if(Array.isArray(e.props.children))return e.props.children.filter(ag).flat(1/0);if(e.props.children)return[e.props.children]}return[]}function av(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(Array.isArray(e)){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var l=a.value,u=av(l,t,r);if(void 0!==u)return u}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return}var c=t(e,r);if(void 0!==c)return c;if((0,_.hasProperty)(e,"props")&&(0,_.isPlainObject)(e.props)&&(0,_.hasProperty)(e.props,"children")){var p=ab(e),d=!0,f=!1,m=void 0;try{for(var h,y=p[Symbol.iterator]();!(d=(h=y.next()).done);d=!0){var g=h.value;if((0,_.isPlainObject)(g)){var b=av(g,t,r+1);if(void 0!==b)return b}}}catch(e){f=!0,m=e}finally{try{d||null==y.return||y.return()}finally{if(f)throw m}}}}function ax(e){return Object.entries(e).filter(function(e){return"children"!==ac(e,1)[0]}).sort(function(e,t){var r=ac(e,1)[0],n=ac(t,1)[0];return r.localeCompare(n)}).map(function(e){var t=ac(e,2),r=t[0],n=t[1];return" ".concat(r,"=").concat("string"==typeof n?'"'.concat(n,'"'):"{".concat(JSON.stringify(n),"}"))}).join("")}var aD=r(8261),aS=r.n(aD),aT=r(9691),aE=r.n(aT);function aw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1?"move":"default",children:[(0,d.jsx)(P,{icon:r.data.type.toLowerCase(),width:"16px"}),(0,d.jsx)(j.Text,{fontWeight:"500",fontSize:"sm",textTransform:"capitalize",color:"text.muted",display:"inline-block",minWidth:"65px",children:r.data.type}),i,Number(r.id)>=2&&(0,d.jsx)(P,{icon:"cross",width:"11px",marginX:"0.5",marginLeft:"auto",cursor:"pointer",onClick:function(){null==o||o(r)}})]})};function aI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aO(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var n=arguments.length,i=Array(n),o=0;oe.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r ul":{display:"flex",flexDirection:"column",flex:1,marginY:"4","& > li":{display:"flex",flexDirection:"column",flex:1,marginTop:"0"}},ul:{listStyleType:"none"},li:{marginTop:"2"}},children:(0,d.jsx)(n6.Tree,{ref:n,tree:t,rootId:0,render:function(e,r){var n=r.depth,a=r.isDragging;return t.length<=1?(0,d.jsx)(aQ,{}):(0,d.jsx)(aW,{node:e,depth:n,onChange:i,onClose:o,isDragging:a})},insertDroppableFirst:!1,canDrag:function(e){return!!e&&Number(e.id)>=2},canDrop:function(e,t){var r=t.dropTarget,n=t.dropTargetId,i=t.dragSource;return!!n&&null!=i&&!!i.data&&function(e,t){if(!e||!t)return!1;switch(e.type){case"Box":return aA(t);case"Form":return aC(t);case"Field":return aM(t);default:return!1}}(null==r?void 0:r.data,null==i?void 0:i.data)&&(null==r?void 0:r.droppable)&&Number(n)>0},onDrop:function(e){r(e)},initialOpen:!0,sort:!1,extraAcceptTypes:["template"],placeholderRender:function(){return(0,d.jsx)(j.Box,{width:"100%",height:"20px"})}})})},a0=function(e){var t=e.snapName,r=F(nn),n=r&&new Blob([r.value],{type:"image/svg+xml"}),i=n&&URL.createObjectURL(n);return(0,d.jsxs)(j.Box,{position:"relative",children:[(0,d.jsx)(j.Avatar,{src:i,name:t.slice(0,1).toUpperCase(),fontSize:"md",background:"background.alternative",color:"text.alternative",size:"sm",margin:"1"}),(0,d.jsx)(P,{icon:"snap",width:"16px",height:"16px",position:"absolute",bottom:"0px",right:"0px"})]})},a1=function(e){var t=e.snapName,r=e.snapId;return(0,d.jsxs)(j.Flex,{gap:"2",marginX:"4",marginY:"4",border:"1px solid",borderColor:"border.default",borderRadius:"32px",padding:"1",alignItems:"center",children:[(0,d.jsx)(a0,{snapName:t}),(0,d.jsxs)(j.Flex,{direction:"column",justify:"center",children:[(0,d.jsx)(j.Text,{fontSize:"sm",lineHeight:"157%",fontFamily:"custom",children:t}),(0,d.jsx)(j.Text,{fontSize:"xs",lineHeight:"167%",fontFamily:"custom",color:"text.alternative",children:r})]})]})},a2=function(e){var t=e.snapName,r=e.snapId,n=e.children,i=e.showAuthorship;return(0,d.jsxs)(j.Flex,{direction:"column",boxShadow:"lg",maxWidth:"360px",height:"600px",paddingY:"4",overflowY:"scroll",children:[(void 0===i||i)&&(0,d.jsx)(a1,{snapName:t,snapId:r}),n]})};!function(e){e.Content="content",e.Error="error",e.Insights="insights"}(cY||(cY={}));var a3=function(e,t){switch(e){case cY.Insights:return"Insights from ".concat(t);case cY.Error:return"Error from ".concat(t);default:return"Content from ".concat(t)}},a4=function(e){var t=e.type,r=e.snapName,n=e.children,i=t===cY.Error;return(0,d.jsxs)(j.Box,{border:"1px solid",borderColor:"border.default",borderRadius:"md",backgroundColor:i?"error.muted":void 0,children:[(0,d.jsxs)(j.Flex,{direction:"row",alignItems:"center",padding:"1.5",borderBottom:"1px solid",borderColor:"border.default",children:[(0,d.jsx)(P,{icon:i?"snapError":"snap",width:"16px",marginRight:"1"}),(0,d.jsx)(j.Text,{fontFamily:"custom",fontSize:"xs",color:i?"text.error":void 0,children:a3(t,r)})]}),(0,d.jsx)(j.Box,{padding:"3",children:n})]})};function a6(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{let t=sD();sx(!0);try{let r=!1,n=sb(()=>{let t=e();return null!==t&&"object"==typeof t&&"function"==typeof t.then&&(r=!0),t});if(r)return{then:(e,r)=>{n.then(r=>{sx(t),e(r)},e=>{sx(t),r(e)})}};return sx(t),n}catch(e){throw sx(t),e}},sT=function(){return(0,sy.BX)(...arguments)};Object.keys(sy.BX).forEach(e=>{sT[e]=function(){return sy.BX[e](...arguments)}});let sE=sT.mouseEnter,sw=sT.mouseLeave;sT.mouseEnter=function(){return sE(...arguments),sT.mouseOver(...arguments)},sT.mouseLeave=function(){return sw(...arguments),sT.mouseOut(...arguments)};let sA=sT.pointerEnter,sC=sT.pointerLeave;sT.pointerEnter=function(){return sA(...arguments),sT.pointerOver(...arguments)},sT.pointerLeave=function(){return sC(...arguments),sT.pointerOut(...arguments)};let sM=sT.select;sT.select=(e,t)=>{sM(e,t),e.focus(),sT.keyUp(e,t)};let sN=sT.blur,sk=sT.focus;sT.blur=function(){return sT.focusOut(...arguments),sN(...arguments)},sT.focus=function(){return sT.focusIn(...arguments),sk(...arguments)},(0,sy.jQ)({unstable_advanceTimersWrapper:e=>sS(e),asyncWrapper:async e=>{let t=sD();sx(!1);try{let t=await e();return await new Promise(e=>{setTimeout(()=>{e()},0),"undefined"!=typeof jest&&null!==jest&&(!0===setTimeout._isMockFunction||Object.prototype.hasOwnProperty.call(setTimeout,"clock"))&&jest.advanceTimersByTime(0)}),t}finally{sx(t)}},eventWrapper:e=>{let t;return sS(()=>{t=e()}),t}});let sj=new Set,sI=[];function sO(){sI.forEach(e=>{let{root:t,container:r}=e;sS(()=>{t.unmount()}),r.parentNode===document.body&&document.body.removeChild(r)}),sI.length=0,sj.clear()}if((void 0===sg||!sg.env?.RTL_SKIP_AUTO_CLEANUP)&&("function"==typeof afterEach?afterEach(()=>{sO()}):"function"==typeof teardown&&teardown(()=>{sO()}),"function"==typeof beforeAll&&"function"==typeof afterAll)){let e=sD();beforeAll(()=>{e=sD(),sx(!0)}),afterAll(()=>{sx(e)})}var sP=r(3724),sF=r(816),sL=r.n(sF),sz={primary:"primary",destructive:"outline"},sR=function(e){var t,r=e.node,n=e.id;i3(r),(0,_.assert)("Button"===r.type,"Expected value to be a button component.");var i=sm().handleEvent,o=r.props;return(0,d.jsx)(j.Button,{width:"100%",variant:sz[null!==(t=o.variant)&&void 0!==t?t:"primary"],marginBottom:"4",type:o.type,onClick:function(e){o.type===cK.Button&&e.preventDefault(),i({event:cW.ButtonClickEvent,name:o.name})},children:o.children},"".concat(n,"-button"))},sB=function(e){var t=e.node,r=e.id,n=e.form,i=sm(),o=i.handleInputChange,a=i.getValue;i3(t),(0,_.assert)("Input"===t.type,"Expected value to be an input component.");var s=t.props,l=a(s.name,n);return(0,d.jsx)(j.Input,{value:l,type:s.type,placeholder:s.placeholder,onChange:function(e){o(s.name,e.target.value,n)}},"".concat(r,"-input"))},sU={Bold:function(e){var t=e.node,r=e.id;return i3(t),(0,_.assert)("Bold"===t.type,"Expected value to be a bold component."),(0,d.jsx)(j.Text,{fontFamily:"custom",fontSize:"sm",paddingBottom:"1",as:"b",children:sJ(ab(t),r)},"".concat(r,"-text"))},Box:function(e){var t=e.node,r=e.id;return i3(t),(0,_.assert)("Box"===t.type,"Expected value to be a Box component."),(0,d.jsx)(j.Box,{children:ab(t).map(function(e,t){return(0,d.jsx)(sq,{node:e},"".concat(r,"-panel-child-").concat(t))})},r)},Button:sR,Copyable:function(e){var t=e.node,r=e.id;i3(t),(0,_.assert)("Copyable"===t.type,"Expected value to be a copyable component.");var n=t.props;return(0,d.jsx)(a5,{value:n.value},"".concat(r,"-copyable"))},Divider:function(e){var t=e.id;return(0,d.jsx)(j.Divider,{orientation:"horizontal",marginTop:"3",marginBottom:"4",borderColor:"border.default"},"".concat(t,"-divider"))},Field:function(e){var t=e.node,r=e.id,n=e.form;i3(t),(0,_.assert)("Field"===t.type,"Expected value to be a field component.");var i=ab(t),o=i[0],a=i[1],s=t.props;return(0,d.jsxs)(j.FormControl,{isInvalid:!!s.error,children:[s.label&&(0,d.jsx)(j.FormLabel,{children:s.label}),(0,d.jsx)(sB,{id:r,node:o,form:n}),a&&(0,d.jsx)(sR,{id:r,node:a}),(0,d.jsx)(j.FormErrorMessage,{children:s.error})]},"".concat(r,"-field"))},Form:function(e){var t=e.node,r=e.id;i3(t),(0,_.assert)("Form"===t.type,"Expected value to be a form component.");var n=sm().handleEvent,i=t.props;return(0,d.jsx)(j.Box,{as:"form",onSubmit:function(e){e.preventDefault(),n({event:cW.FormSubmitEvent,name:i.name})},children:ab(t).map(function(e,n){return(0,d.jsx)(sq,{node:e,form:t.props.name},"".concat(r,"-form-child-").concat(n))})},r)},Heading:function(e){var t=e.node,r=e.id;i3(t),(0,_.assert)("Heading"===t.type,"Expected value to be a heading component.");var n=t.props;return(0,d.jsx)(j.Heading,{fontFamily:"custom",fontSize:"x-large",fontWeight:"bold",paddingBottom:"4",children:n.children},"".concat(r,"-heading"))},Input:sB,Italic:function(e){var t=e.node,r=e.id;return i3(t),(0,_.assert)("Italic"===t.type,"Expected value to be an italic component."),(0,d.jsx)(j.Text,{fontFamily:"custom",fontSize:"sm",paddingBottom:"1",as:"i",children:sJ(ab(t),r)},r)},Link:function(e){var t=e.node,r=e.id;i3(t),(0,_.assert)("Link"===t.type,"Expected value to be a link component.");var n=t.props;return(0,d.jsxs)(j.Link,{href:n.href,target:"_blank",fontFamily:"custom",fontSize:"sm",isExternal:!0,color:"link.default",display:"inline",children:[sJ(ab(t),r),(0,d.jsx)(P,{icon:"linkOut",width:"14px",marginLeft:"2px",display:"inline",verticalAlign:"middle"})]})},Spinner:function(e){var t=e.id;return(0,d.jsx)(j.Spinner,{},"".concat(t,"-spinner"))},Text:function(e){var t=e.node,r=e.id;return i3(t),(0,_.assert)("Text"===t.type,"Expected value to be a text component."),(0,d.jsx)(j.Text,{fontFamily:"custom",fontSize:"sm",paddingBottom:"1",children:sJ(ab(t),r)},r)},Image:function(e){var t=e.id,r=e.node;i3(r),(0,_.assert)("Image"===r.type,"Expected value to be a image component.");var n=r.props,i="data:image/svg+xml;utf8,".concat(encodeURIComponent(n.src));return(0,d.jsx)(j.Image,{src:i,alt:n.alt},"".concat(t,"-image"))}},sq=function(e){var t=e.node,r=e.form,n=e.map,i=void 0===n?{}:n,o=e.id;if(!t)return null;var a=null!=o?o:sK(i,t),s=sU[t.type];if(!s)throw Error("Unknown component type: ".concat(t.type,"."));return(0,d.jsx)(s,{id:a,node:t,form:r},a)};function sJ(e,t){return e.map(function(e,r){return"string"==typeof e?(0,sP.unescape)(e):(0,d.jsx)(sq,{id:"".concat(t,"-text-child-").concat(r),node:e},"".concat(t,"-text-child-").concat(r))})}var s$=sL()(function(e){var t=e.type,r=e.props.name,n=function(e){if(!ay(e))return null;var t,r=e.props.children;return"string"==typeof r?r.slice(0,5e3):Array.isArray(r)?r.map(function(e){return{type:null!==(t=null==e?void 0:e.type)&&void 0!==t?t:null}}):r}(e);return(0,_.remove0x)((0,_.bytesToHex)(eM(JSON.stringify({type:t,name:null!=r?r:null,children:n}))))});function sK(e,t){var r,n=s$(t),i=(null!==(r=e[n])&&void 0!==r?r:0)+1;return e[n]=i,"".concat(n,"_").concat(i)}var sV=function(e){var t=e.content,r=sK({},t);return(0,d.jsx)(sf,{children:(0,d.jsx)(sq,{node:t,id:r})})};function sY(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["name","onClick"]);return(0,d.jsx)(n0,{cursor:"pointer",onClick:function(){r(n)},children:t})},lO=function(e){var t=e.onClick;return(0,d.jsxs)(j.Box,{marginBottom:"4",children:[(0,d.jsx)(j.Text,{fontWeight:"500",fontSize:"xs",marginBottom:"1",children:"Transaction presets"}),(0,d.jsx)(j.Flex,{gap:"2",children:lj.map(function(e,r){var n,i,o=e.name,a=e.transaction;return(0,m.createElement)(lI,(n=function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var lL={chainId:"eip155:1",origin:"metamask.io",from:"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",to:"0x9f2817015caF6607C1198fB943A8241652EE8906",value:"0.01",gas:"21000",nonce:"5",maxFeePerGas:"10",maxPriorityFeePerGas:"1",data:"0x"},lz=function(){var e,t,r,n,i,o,a,s,l,u,c,p=F(lC).request,_=null!==(c=null==p?void 0:p.params)&&void 0!==c?c:{},f=_.chainId,m=_.transactionOrigin,h=_.transaction;lL.chainId,lL.origin;var y=lF(lL,["chainId","origin"]),g=(0,ls.useForm)({defaultValues:lP({chainId:null!=f?f:lL.chainId,transactionOrigin:null!=m?m:lL.origin},null!=h?h:y)}),b=g.handleSubmit,v=g.register,x=g.setValue,D=g.formState.errors,S=k();return(0,d.jsxs)(j.Flex,{as:"form",flexDirection:"column",flex:"1",onSubmit:b(function(e){var t=e.chainId,r=e.transactionOrigin,n=lF(e,["chainId","transactionOrigin"]);S(r3({origin:"",handler:cM.OnTransaction,request:{jsonrpc:"2.0",method:"onTransaction",params:{chainId:t,transaction:lk(n),transactionOrigin:r}}}))}),id:"request-form",children:[(0,d.jsx)(lO,{onClick:function(e){x("chainId",e.chainId),x("transactionOrigin",e.transactionOrigin),x("from",e.from),x("to",e.to),x("value",e.value),x("data",e.data),x("gas",e.gas),x("maxFeePerGas",e.maxFeePerGas),x("maxPriorityFeePerGas",e.maxPriorityFeePerGas),x("nonce",e.nonce)}}),(0,d.jsxs)(j.Flex,{gap:"2",children:[(0,d.jsxs)(j.FormControl,{isInvalid:!!D.chainId,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"chainId",children:"Chain ID"}),(0,d.jsx)(j.Input,lP({id:"chainId",placeholder:lL.chainId,fontFamily:"code"},v("chainId"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(e=D.chainId)||void 0===e?void 0:e.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.transactionOrigin,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"origin",children:"Transaction Origin"}),(0,d.jsx)(j.Input,lP({id:"origin",placeholder:lL.origin,fontFamily:"code"},v("transactionOrigin"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(t=D.transactionOrigin)||void 0===t?void 0:t.message})]})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.from,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"from",children:"From Address"}),(0,d.jsx)(j.Input,lP({id:"from",placeholder:lL.from,fontFamily:"code"},v("from"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(r=D.from)||void 0===r?void 0:r.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.to,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"to",children:"To Address"}),(0,d.jsx)(j.Input,lP({id:"to",placeholder:lL.to,fontFamily:"code"},v("to"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(n=D.to)||void 0===n?void 0:n.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.value,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"value",children:"Value"}),(0,d.jsxs)(j.InputGroup,{children:[(0,d.jsx)(j.Input,lP({id:"value",placeholder:lL.value,fontFamily:"code"},v("value"))),(0,d.jsx)(j.InputRightAddon,{children:"ETH",fontSize:"sm"})]}),(0,d.jsx)(j.FormErrorMessage,{children:null===(i=D.value)||void 0===i?void 0:i.message})]}),(0,d.jsxs)(j.Flex,{gap:"2",children:[(0,d.jsxs)(j.FormControl,{isInvalid:!!D.gas,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"gas",children:"Gas Limit"}),(0,d.jsx)(j.Input,lP({id:"gas",placeholder:lL.gas,fontFamily:"code"},v("gas"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(o=D.gas)||void 0===o?void 0:o.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.nonce,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"nonce",children:"Nonce"}),(0,d.jsx)(j.Input,lP({id:"nonce",placeholder:lL.nonce,fontFamily:"code"},v("nonce"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(a=D.nonce)||void 0===a?void 0:a.message})]})]}),(0,d.jsxs)(j.Flex,{gap:"2",children:[(0,d.jsxs)(j.FormControl,{isInvalid:!!D.maxFeePerGas,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"maxFeePerGas",children:"Max Fee Per Gas"}),(0,d.jsxs)(j.InputGroup,{children:[(0,d.jsx)(j.Input,lP({id:"maxFeePerGas",placeholder:lL.maxFeePerGas,fontFamily:"code"},v("maxFeePerGas"))),(0,d.jsx)(j.InputRightAddon,{children:"GWEI",fontSize:"sm"})]}),(0,d.jsx)(j.FormErrorMessage,{children:null===(s=D.maxFeePerGas)||void 0===s?void 0:s.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.maxPriorityFeePerGas,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"maxPriorityFeePerGas",children:"Max Priority Fee Per Gas"}),(0,d.jsxs)(j.InputGroup,{children:[(0,d.jsx)(j.Input,lP({id:"maxPriorityFeePerGas",placeholder:lL.maxPriorityFeePerGas,fontFamily:"code"},v("maxPriorityFeePerGas"))),(0,d.jsx)(j.InputRightAddon,{children:"GWEI",fontSize:"sm"})]}),(0,d.jsx)(j.FormErrorMessage,{children:null===(l=D.maxPriorityFeePerGas)||void 0===l?void 0:l.message})]})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.data,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"data",children:"Data"}),(0,d.jsx)(j.Textarea,lP({id:"data",placeholder:lL.data,fontFamily:"code"},v("data"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(u=D.data)||void 0===u?void 0:u.message})]})]})},lR=(0,h.createHashRouter)((0,h.createRoutesFromElements)((0,d.jsxs)(h.Route,{element:(0,d.jsx)(function(){return(0,d.jsxs)(j.Flex,{direction:"column",height:"100vh",children:[(0,d.jsx)(nf,{}),(0,d.jsxs)(j.Flex,{direction:"row",flex:"1",overflow:"hidden",children:[(0,d.jsx)(nP,{}),(0,d.jsxs)(j.Flex,{direction:"column",width:"full",children:[(0,d.jsx)(j.Flex,{flex:"1",overflow:"hidden",children:(0,d.jsx)(h.Outlet,{})}),(0,d.jsx)(V,{})]})]})]})},{}),children:[(0,d.jsx)(h.Route,{path:"/",element:(0,d.jsx)(h.Navigate,{to:"/handler/".concat(cM.OnRpcRequest),replace:!0})}),(0,d.jsx)(h.Route,{path:"/builder",element:(0,d.jsx)(function(){var e,t,r=sX((0,m.useState)(2),2),n=r[0],i=r[1],o=sX((0,m.useState)([{id:1,parent:0,text:"Box",droppable:!0,data:nz({children:null})}]),2),a=o[0],s=o[1];return(0,d.jsx)(j.Flex,{width:"100%",direction:"column",overflow:"hidden",children:(0,d.jsxs)(j.Flex,{direction:"row",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.Flex,{direction:"column",flex:"1",width:"50%",overflow:"hidden",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabList,{children:(0,d.jsx)(j.Tab,{children:"Builder"})}),(0,d.jsx)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:(0,d.jsxs)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",overflowY:"auto",children:[(0,d.jsx)(n4,{nextId:n,incrementId:function(){i(function(e){return e+1})}}),(0,d.jsx)(aX,{items:a,setItems:s})]})})]})}),(0,d.jsx)(j.Box,{display:"flex",flexDirection:"column",flex:"1",width:"50%",borderLeft:"1px solid",borderColor:"border.default",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsxs)(j.TabList,{children:[(0,d.jsx)(j.Tab,{children:"Result"}),(0,d.jsx)(j.Tab,{children:"Code"})]}),(0,d.jsxs)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"4",children:(0,d.jsx)(sG,{items:a})}),(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"0",children:(0,d.jsx)(nJ,{border:"none",value:(t=(function e(t){var r=new Set;r.add(t.type);var n=ab(t),i=!0,o=!1,a=void 0;try{for(var s,l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;if("string"!=typeof u&&(r.add(u.type),ay(t))){var c=e(u),p=!0,d=!1,_=void 0;try{for(var f,m=c[Symbol.iterator]();!(p=(f=m.next()).done);p=!0){var h=f.value;r.add(h)}}catch(e){d=!0,_=e}finally{try{p||null==m.return||m.return()}finally{if(d)throw _}}}}}catch(e){o=!0,a=e}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return Array.from(r).sort(function(e,t){return e.localeCompare(t)})})(e=ak(a)).join(", "),aE().format("\n import { ".concat(t," } from '@metamask/snaps-sdk/jsx';\n\n const Component = () => (").concat(function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(Array.isArray(t))return t.map(function(t){return e(t,r)}).join("");var n=" ".repeat(r);if("string"==typeof t)return"".concat(n).concat(t,"\n");if(!t)return"";var i=t.type,o=t.props,a=r>0?"\n":"";if((0,_.hasProperty)(o,"children")){var s=e(o.children,r+1);return"".concat(n,"<").concat(i).concat(ax(o),">\n").concat(s).concat(n,"").concat(i,">").concat(a)}return"".concat(n,"<").concat(i).concat(ax(o)," />").concat(a)}(e),");\n"),{parser:"typescript",plugins:[aS()],printWidth:80,tabWidth:2,singleQuote:!0,trailingComma:"all"})),language:"typescript",options:{readOnly:!0}})})]})]})})]})})},{})}),(0,d.jsx)(h.Route,{path:"/manifest",element:(0,d.jsx)(function(){var e=F(nl);return(0,d.jsx)(j.Flex,{width:"100%",direction:"column",overflow:"hidden",children:(0,d.jsxs)(j.Flex,{direction:"row",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.Flex,{direction:"column",flex:"1",width:"50%",overflow:"hidden",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabList,{children:(0,d.jsx)(j.Tab,{children:"Validation"})}),(0,d.jsx)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"0",children:(0,d.jsx)(s2,{})})})]})}),(0,d.jsx)(j.Box,{display:"flex",flexDirection:"column",flex:"1",width:"50%",borderLeft:"1px solid",borderColor:"border.default",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabList,{children:(0,d.jsx)(j.Tab,{children:"Manifest"})}),(0,d.jsx)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"0",children:(0,d.jsx)(nJ,{border:"none",value:JSON.stringify(e,null,2),options:{readOnly:!0,wordWrap:"on"}})})})]})})]})})},{})}),(0,d.jsxs)(h.Route,{path:"/handler",element:(0,d.jsx)(function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,m.useState)(0))||function(e,t){var r,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,s=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,n=e}finally{try{a||null==i.return||i.return()}finally{if(s)throw n}}return o}}(e,2)||function(e,t){if(e){if("string"==typeof e)return lc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lc(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],n=t[1],i=F(ni);return(0,d.jsx)(j.Flex,{width:"100%",direction:"column",overflow:"hidden",children:(0,d.jsxs)(j.Flex,{direction:"row",flex:"1",overflow:"hidden",children:[(0,d.jsx)(s3,{isTest:!1,children:(0,d.jsx)(j.Flex,{direction:"column",flex:"1",width:"50%",overflow:"hidden",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",isLazy:!0,onChange:n,children:[(0,d.jsx)(lr,{}),(0,d.jsxs)(j.TabList,{alignItems:"center",children:[(0,d.jsx)(j.Tab,{children:"Request"}),(0,d.jsx)(j.Tab,{children:"History"}),0===r&&(0,d.jsx)(j.Box,{marginLeft:"auto",children:(0,d.jsx)(lt,{})})]}),(0,d.jsxs)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",overflowY:"auto","data-testid":"tab-request",children:(0,d.jsx)(h.Outlet,{})}),(0,d.jsx)(j.TabPanel,{padding:"0",display:"flex",flexDirection:"column",flex:"1",overflowY:"auto",children:(0,d.jsx)(s7,{})})]})]})})}),(0,d.jsx)(j.Box,{display:"flex",flexDirection:"column",flex:"1",width:"50%",borderLeft:"1px solid",borderColor:"border.default",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(lr,{}),(0,d.jsx)(ln,{}),(0,d.jsxs)(j.TabList,{children:[(0,d.jsx)(j.Tab,{children:"Response"}),i&&(0,d.jsx)(j.Tab,{children:"UI"})]}),(0,d.jsxs)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"0","data-testid":"tab-response",children:(0,d.jsx)(li,{})}),i&&(0,d.jsx)(j.TabPanel,{overflowY:"auto","data-testid":"tab-ui",children:(0,d.jsx)(lu,{})})]})]})})]})})},{}),children:[(0,d.jsx)(h.Route,{path:"/handler/".concat(cM.OnRpcRequest),element:(0,d.jsx)(function(){return(0,d.jsx)(lh,{})},{})}),(0,d.jsx)(h.Route,{path:"/handler/".concat(cM.OnCronjob),element:(0,d.jsx)(function(){return(0,d.jsx)(lT,{})},{})}),(0,d.jsx)(h.Route,{path:"/handler/".concat(cM.OnTransaction),element:(0,d.jsx)(function(){return(0,d.jsx)(lz,{})},{})})]})]})));function lB(e){for(var t=1;t1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n2?r-2:0),i=2;i2?i-2:0),a=2;a2?r-2:0),i=2;i1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:ca(e)?2:cs(e)?3:0}function ci(e,t){return 2===cn(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function co(e,t,r){var n=cn(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function ca(e){return c6&&e instanceof Map}function cs(e){return c5&&e instanceof Set}function cl(e){return e.o||e.t}function cu(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=pn(e);delete t[pe];for(var r=pr(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=cp),Object.freeze(e),t&&cr(e,function(e,t){return cc(t,!0)},!0)),e}function cp(){u9(2)}function cd(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function c_(e){var t=pi[e];return t||u9(18,e),t}function cf(e,t){t&&(c_("Patches"),e.u=[],e.s=[],e.v=t)}function cm(e){ch(e),e.p.forEach(cg),e.p=null}function ch(e){e===c3&&(c3=e.l)}function cy(e){return c3={p:[],l:c3,h:e,m:!0,_:0}}function cg(e){var t=e[pe];0===t.i||1===t.i?t.j():t.g=!0}function cb(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.O||c_("ES5").S(t,e,n),n?(r[pe].P&&(cm(t),u9(4)),ct(e)&&(e=cv(t,e),t.l||cD(t,e)),t.u&&c_("Patches").M(r[pe].t,e,t.u,t.s)):e=cv(t,r,[]),cm(t),t.u&&t.v(t.u,t.s),e!==c7?e:void 0}function cv(e,t,r){if(cd(t))return t;var n=t[pe];if(!n)return cr(t,function(i,o){return cx(e,n,t,i,o,r)},!0),t;if(n.A!==e)return t;if(!n.P)return cD(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=4===n.i||5===n.i?n.o=cu(n.k):n.o,o=i,a=!1;3===n.i&&(o=new Set(i),i.clear(),a=!0),cr(o,function(t,o){return cx(e,n,i,t,o,r,a)}),cD(e,i,!1),r&&e.u&&c_("Patches").N(n,r,e.u,e.s)}return n.o}function cx(e,t,r,n,i,o,a){if(ce(i)){var s=cv(e,i,o&&t&&3!==t.i&&!ci(t.R,n)?o.concat(n):void 0);if(co(r,n,s),!ce(s))return;e.m=!1}else a&&r.add(i);if(ct(i)&&!cd(i)){if(!e.h.D&&e._<1)return;cv(e,i),t&&t.A.l||cD(e,i)}}function cD(e,t,r){void 0===r&&(r=!1),!e.l&&e.h.D&&e.m&&cc(t,r)}function cS(e,t){var r=e[pe];return(r?cl(r):e)[t]}function cT(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function cE(e){e.P||(e.P=!0,e.l&&cE(e.l))}function cw(e){e.o||(e.o=cu(e.t))}function cA(e,t,r){var n,i,o,a,s,l,u,c=ca(t)?c_("MapSet").F(t,r):cs(t)?c_("MapSet").T(t,r):e.O?(o=i={i:(n=Array.isArray(t))?1:0,A:r?r.A:c3,P:!1,I:!1,R:{},l:r,t:t,k:null,o:null,j:null,C:!1},a=po,n&&(o=[i],a=pa),l=(s=Proxy.revocable(o,a)).revoke,u=s.proxy,i.k=u,i.j=l,u):c_("ES5").J(t,r);return(r?r.A:c3).p.push(c),c}function cC(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return cu(e)}!function(e){e.Insight="Insight",e.Dialog="Dialog",e.Notification="Notification",e.HomePage="HomePage"}(c1||(c1={}));var cM,cN,ck,cj,cI,cO,cP,cF,cL,cz,cR,cB,cU,cq,cJ,c$,cK,cV,cY,cW,cQ,cH,cG,cZ,cX,c0,c1,c2,c3,c4="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),c6="undefined"!=typeof Map,c5="undefined"!=typeof Set,c8="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,c7=c4?Symbol.for("immer-nothing"):((c2={})["immer-nothing"]=!0,c2),c9=c4?Symbol.for("immer-draftable"):"__$immer_draftable",pe=c4?Symbol.for("immer-state"):"__$immer_state",pt=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),pr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,pn=Object.getOwnPropertyDescriptors||function(e){var t={};return pr(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},pi={},po={get:function(e,t){if(t===pe)return e;var r,n,i=cl(e);if(!ci(i,t))return(n=cT(i,t))?"value"in n?n.value:null===(r=n.get)||void 0===r?void 0:r.call(e.k):void 0;var o=i[t];return e.I||!ct(o)?o:o===cS(e.t,t)?(cw(e),e.o[t]=cA(e.A.h,o,e)):o},has:function(e,t){return t in cl(e)},ownKeys:function(e){return Reflect.ownKeys(cl(e))},set:function(e,t,r){var n=cT(cl(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=cS(cl(e),t),o=null==i?void 0:i[pe];if(o&&o.t===r)return e.o[t]=r,e.R[t]=!1,!0;if((r===i?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==r||ci(e.t,t)))return!0;cw(e),cE(e)}return e.o[t]===r&&(void 0!==r||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==cS(e.t,t)||t in e.t?(e.R[t]=!1,cw(e),cE(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=cl(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){u9(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){u9(12)}},pa={};cr(po,function(e,t){pa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),pa.deleteProperty=function(e,t){return pa.set.call(this,e,t,void 0)},pa.set=function(e,t,r){return po.set.call(this,e[0],t,r,e[0])};var ps=new(function(){function e(e){var t=this;this.O=c8,this.D=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var i,o=r;return r=e,function(e){var n=this;void 0===e&&(e=o);for(var i=arguments.length,a=Array(i>1?i-1:0),s=1;s1?n-1:0),o=1;o=0;r--){var r,n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var i=c_("Patches").$;return ce(e)?i(e,t):this.produce(e,function(e){return i(e,t)})},e}());ps.produce,ps.produceWithPatches.bind(ps),ps.setAutoFreeze.bind(ps),ps.setUseProxies.bind(ps),ps.applyPatches.bind(ps),ps.createDraft.bind(ps),ps.finishDraft.bind(ps);let pl=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function pu(e){var t;return(0,_.isPlainObject)(e)&&(0,_.hasProperty)(e,"type")&&(0,_.hasProperty)(e,"props")&&(0,_.hasProperty)(e,"key")?e:(t=function e(t){switch(t.type){case cq.Panel:return t.children.reduce(function(t,r){return t+e(r)},0);case cq.Row:return e(t.value);case cq.Text:return t.value.length;default:return 0}}(e),(0,_.assert)(t<=5e4,"The text in a Snap UI may not be larger than ".concat(50," kB.")),function e(t){switch(t.type){case cq.Address:return i4(oe,{address:t.value});case cq.Button:return i4(nQ,{name:t.name,variant:function(e){switch(e){case"primary":return"primary";case"secondary":return"destructive";default:return}}(t.variant),type:t.buttonType,children:t.value});case cq.Copyable:return i4(nY,{value:t.value,sensitive:t.sensitive});case cq.Divider:return i4(nV,{});case cq.Form:return i4(nH,{name:t.name,children:a_(t.children.map(e))});case cq.Heading:return i4(n$,{children:t.value});case cq.Image:return i4(nW,{src:t.value});case cq.Input:return i4(nG,{label:t.label,error:t.error,children:i4(nZ,{name:t.name,type:t.inputType,value:t.value,placeholder:t.placeholder})});case cq.Panel:return i4(nz,{children:a_(t.children.map(e))});case cq.Row:return i4(ot,{label:t.label,variant:t.variant,children:e(t.value)});case cq.Spinner:return i4(or,{});case cq.Text:var r,n;return i4(nK,{children:a_((r=ai(t.value,{gfm:!1}),n=[],an(r,function(e){if("paragraph"===e.type){n.length>0&&n.push("\n\n");var t,r=e.tokens;n.push.apply(n,function(e){if(Array.isArray(e))return au(e)}(t=r.flatMap(am))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||ap(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}),n.filter(function(e){return null!==e})))});default:return(0,_.assertExhaustive)(t)}}(e))}function pc(e,t){(0,_.assert)(void 0===e[t],'Duplicate component names are not allowed, found multiple instances of: "'.concat(t,'".'))}function pp(e,t,r){var n,i,o,a=r?e[r]:e,s=null==a?void 0:a[t.props.name];return"FileInput"===t.type?null!=s?s:null:null!==(o=null!==(i=null!==(n="Checkbox"===t.type?t.props.checked:t.props.value)&&void 0!==n?n:s)&&void 0!==i?i:function(e){var t,r,n;switch(e.type){case"Dropdown":return null===(t=ab(e)[0])||void 0===t?void 0:t.props.value;case"RadioGroup":return null===(r=ab(e)[0])||void 0===r?void 0:r.props.value;case"Selector":return null===(n=ab(e)[0])||void 0===n?void 0:n.props.value;case"Checkbox":return!1;default:return null}}(t))&&void 0!==o?o:null}function pd(e,t){var r={},n=[];return av(t,function(t,i){var o=n[n.length-1];if(o&&i<=o.depth&&(n.pop(),o=n[n.length-1]),"Form"===t.type){pc(r,t.props.name),n.push({name:t.props.name,depth:i}),r[t.props.name]={};return}if(o&&("Input"===t.type||"Dropdown"===t.type||"RadioGroup"===t.type||"FileInput"===t.type||"Checkbox"===t.type||"Selector"===t.type)){var a=r[o.name];pc(a,t.props.name),a[t.props.name]=pp(e,t,o.name);return}("Input"===t.type||"Dropdown"===t.type||"RadioGroup"===t.type||"FileInput"===t.type||"Checkbox"===t.type||"Selector"===t.type)&&(pc(r,t.props.name),r[t.props.name]=pp(e,t))}),r}function p_(e){if(e){var t=e7(e);(0,_.assert)(t<=1e6,"A Snap interface context may not be larger than ".concat(1," MB."))}}function pf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=-32099&&e<=-32e3)return"Unspecified server error."}return t}function p6(e){return Object.getOwnPropertyNames(e).reduce((t,r)=>{let n=e[r];return(0,_.isValidJson)(n)&&(t[r]=n),t},{})}p4(p3);let p5=function(e){return e?.__esModule?e.default:e}(p0());class p8 extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a non-empty string.');(function(e){return(0,_.isObject)(e)&&(0,_.hasProperty)(e,"cause")&&(0,_.isObject)(e.cause)})(r)?(super(t,{cause:r.cause}),(0,_.hasProperty)(this,"cause")||Object.assign(this,{cause:r.cause})):super(t),void 0!==r&&(this.data=r),this.code=e}serialize(){var e;let t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data,(0,_.isPlainObject)(this.data)&&(t.data.cause=Array.isArray(e=this.data.cause)?e.map(e=>(0,_.isValidJson)(e)?e:(0,_.isObject)(e)?p6(e):null):(0,_.isObject)(e)?p6(e):(0,_.isValidJson)(e)?e:null)),this.stack&&(t.stack=this.stack),t}toString(){return p5(this.serialize(),p9,2)}}class p7 extends p8{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function p9(e,t){if("[Circular]"!==t)return t}function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1?r-1:0),i=1;i=0,TypeError("Can't start a timer with negative time")),this.state={value:"stopped",remaining:e}}return e=[{key:"status",get:function(){return this.state.value}},{key:"remaining",get:function(){return this.state.remaining}},{key:"cancel",value:function(){(0,_.assert)("paused"===this.status||"running"===this.status,Error("Tried to cancel a not running Timer")),this.onFinish(!1)}},{key:"finish",value:function(){(0,_.assert)("finished"!==this.status,Error("Tried to finish a finished Timer.")),this.onFinish(!0)}},{key:"pause",value:function(){(0,_.assert)("running"===this.state.value,Error("Tried to pause a not running Timer"));var e=this.state,t=e.callback,r=e.start,n=e.timeout,i=e.remaining;void 0!==n&&clearTimeout(n),this.state={value:"paused",callback:t,remaining:i-(Date.now()-r)}}},{key:"start",value:function(e){(0,_.assert)("stopped"===this.state.value,Error("Tried to start an already running Timer"));var t=this.state.remaining;this.state={value:"paused",remaining:t,callback:e},this.resume()}},{key:"resume",value:function(){var e,t=this;(0,_.assert)("paused"===this.state.value,Error("Tried to resume not paused Timer"));var r=this.state,n=r.remaining,i=r.callback,o=Date.now();n!==Number.POSITIVE_INFINITY&&(e=setTimeout(function(){return t.onFinish(!0)},n)),this.state={value:"running",callback:i,remaining:n,start:o,timeout:e}}},{key:"onFinish",value:function(e){(0,_.assert)("running"===this.state.value||"paused"===this.state.value),"running"===this.state.value&&void 0!==this.state.timeout&&clearTimeout(this.state.timeout);var t=this.state,r=t.callback,n=t.remaining;this.state={value:"finished",remaining:"running"===this.state.value?n-(Date.now()-this.state.start):n},e&&r()}}],di(r.prototype,e),t&&di(r,t),r}();function ds(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function dl(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){ds(o,n,i,a,s,"next",e)}function s(e){ds(o,n,i,a,s,"throw",e)}a(void 0)})}}function du(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]dX(p1.rpc.parse,e),invalidRequest:e=>dX(p1.rpc.invalidRequest,e),invalidParams:e=>dX(p1.rpc.invalidParams,e),methodNotFound:e=>dX(p1.rpc.methodNotFound,e),internal:e=>dX(p1.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code <= -32005');return dX(t,e)},invalidInput:e=>dX(p1.rpc.invalidInput,e),resourceNotFound:e=>dX(p1.rpc.resourceNotFound,e),resourceUnavailable:e=>dX(p1.rpc.resourceUnavailable,e),transactionRejected:e=>dX(p1.rpc.transactionRejected,e),methodNotSupported:e=>dX(p1.rpc.methodNotSupported,e),limitExceeded:e=>dX(p1.rpc.limitExceeded,e)},dZ={userRejectedRequest:e=>d0(p1.provider.userRejectedRequest,e),unauthorized:e=>d0(p1.provider.unauthorized,e),unsupportedMethod:e=>d0(p1.provider.unsupportedMethod,e),disconnected:e=>d0(p1.provider.disconnected,e),chainDisconnected:e=>d0(p1.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw Error('"message" must be a nonempty string');return new p7(t,r,n)}};function dX(e,t){let[r,n]=d1(t);return new p8(e,r??p4(e),n)}function d0(e,t){let[r,n]=d1(t);return new p7(e,r??p4(e),n)}function d1(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t??void 0,r]}}return[]}function d2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,["maxRequestTime"]));return a?(n=function(e){for(var t=1;t0),{caveats:t}})),_N(o,_a.targetName,d6(function(e){return{caveats:[{type:ck.KeyringOrigin,value:e}]}})),_N(o,_S.targetName,d6(function(e){return!e||!(0,_.isObject)(e)||(0,_.isObject)(e)&&0===Object.keys(e).length?{caveats:null}:{caveats:[{type:ck.SignatureOrigin,value:(0,_.hasProperty)(e,"allowSignatureOrigin")&&e.allowSignatureOrigin}]}})),_N(o,_u.targetName,d4),_N(o,_i.targetName,d4),_N(o,_x.targetName,d4),o);_N(a={},cM.OnRpcRequest,_g.targetName),_N(a,cM.OnTransaction,_w.targetName),_N(a,cM.OnCronjob,d9.targetName),_N(a,cM.OnNameLookup,_d.targetName),_N(a,cM.OnInstall,_u.targetName),_N(a,cM.OnUpdate,_u.targetName),_N(a,cM.OnKeyringRequest,_a.targetName),_N(a,cM.OnHomePage,_i.targetName),_N(a,cM.OnSettingsPage,_x.targetName),_N(a,cM.OnSignature,_S.targetName),_N(a,cM.OnUserInput,null);let _O=BigInt(4294967296-1),_P=BigInt(32),_F=(e,t,r)=>e<>>32-r,_L=(e,t,r)=>t<>>32-r,_z=(e,t,r)=>t<>>64-r,_R=(e,t,r)=>e<>>64-r,_B=[],_U=[],_q=[],_J=BigInt(0),_$=BigInt(1),_K=BigInt(2),_V=BigInt(7),_Y=BigInt(256),_W=BigInt(113);for(let e=0,t=_$,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],_B.push(2*(5*n+r)),_U.push((e+1)*(e+2)/2%64);let i=_J;for(let e=0;e<7;e++)(t=(t<<_$^(t>>_V)*_W)%_Y)&_K&&(i^=_$<<(_$<>_P&_O)}:{h:0|Number(e>>_P&_O),l:0|Number(e&_O)}}(e[i],t);[r[i],n[i]]=[o,a]}return[r,n]}(_q,!0),_G=(e,t,r)=>r>32?_z(e,t,r):_F(e,t,r),_Z=(e,t,r)=>r>32?_R(e,t,r):_L(e,t,r);class _X extends ev{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,eu(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=e_(this.state)}keccak(){eh||eg(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,o=r[i],a=r[i+1],s=_G(o,a,1)^r[n],l=_Z(o,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=s,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=_U[r],o=_G(t,i,n),a=_Z(t,i,n),s=_B[r];t=e[s],i=e[s+1],e[s]=o,e[s+1]=a}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=_Q[n],e[1]^=_H[n]}r.fill(0)}(this.state32,this.rounds),eh||eg(this.state32),this.posOut=0,this.pos=0}update(e){ep(this);let{blockLen:t,state:r}=this;e=eb(e);let n=e.length;for(let i=0;i=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return eu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ed(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new _X(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}let _0=ex(()=>new _X(136,1,32));function _1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>0;t.push("bip32:".concat(i-2147483648,"'"))}return t}(_0((0,_.concatBytes)([s,_0(l)]))),[4,e9.SLIP10Node.fromDerivationPath({derivationPath:[i,"bip32:".concat(o)].concat(_4(u)),curve:"secp256k1"},a)];case 1:return c=p.sent().privateKey,(0,_.assert)(c,"Failed to derive the entropy."),[2,(0,_.add0x)(c)]}})})).apply(this,arguments)}function _9(e){return fe.apply(this,arguments)}function fe(){return(fe=_3(function(e){var t,r,n,i,o;return _6(this,function(a){switch(a.label){case 0:return t=e.curve,r=e.secretRecoveryPhrase,n=e.path,i=e.cryptographicFunctions,o=function(e){switch(e){case"secp256k1":return"bip32";case"ed25519":return"slip10";case"ed25519Bip32":return"cip3";default:return(0,_.assertExhaustive)(e)}}(t),[4,e9.SLIP10Node.fromDerivationPath({curve:t,derivationPath:[r].concat(_4(n.slice(1).map(function(e){return"".concat(o,":").concat(e)})))},i)];case 1:return[2,a.sent()]}})})).apply(this,arguments)}var ft=(0,H.refine)((0,H.string)(),"state key",function(e){return!!(void 0===e||e.split(".").every(function(e){return e.length>0}))||"Invalid state key. Each part of the key must be non-empty."});function fr(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}var fn="snap_getBip32Entropy",fi=Object.freeze({targetName:fn,specificationBuilder:function(e){var t,r,n,i,o,a=e.methodHooks;return{permissionType:ts.PermissionType.RestrictedMethod,targetName:fn,allowedCaveats:[ck.PermittedDerivationPaths],methodImplementation:(n=a.getMnemonic,i=a.getUnlockPromise,o=a.getClientCryptography,t=function(e){var t,r;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2147483647)throw dG.invalidParams({message:'Invalid "coinType" parameter. Coin type must be a non-negative integer.'});if(tL.includes(e.coinType))throw dG.invalidParams({message:"Coin type ".concat(e.coinType," is forbidden.")})}var fv=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},ck.PermittedCoinTypes,Object.freeze({type:ck.PermittedCoinTypes,decorator:function(e,t){var r,n;return r=function(r){var n;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2&&void 0!==arguments[2]?arguments[2]:104857600;if(!(0,_.isObject)(e))throw dG.invalidParams({message:"Expected params to be a single object."});var i=e.operation,o=e.newState,a=e.encrypted;if(!i||"string"!=typeof i||!Object.values(u).includes(i))throw dG.invalidParams({message:'Must specify a valid manage state "operation".'});if(void 0!==a&&"boolean"!=typeof a)throw dG.invalidParams({message:'"encrypted" parameter must be a boolean if specified.'});if(i===u.UpdateState){if(!(0,_.isObject)(o))throw dG.invalidParams({message:"Invalid ".concat(t,' "updateState" parameter: The new state must be a plain object.'),data:{receivedNewState:void 0===o?"undefined":o}});try{r=(0,_.getJsonSize)(o)}catch(e){throw dG.invalidParams({message:"Invalid ".concat(t,' "updateState" parameter: The new state must be JSON serializable.'),data:{receivedNewState:void 0===o?"undefined":o}})}if(r>n)throw dG.invalidParams({message:"Invalid ".concat(t,' "updateState" parameter: The new state must not exceed ').concat(n," bytes in size."),data:{receivedNewState:void 0===o?"undefined":o}})}return e}(r,s)).encrypted)||void 0===p||p)&&c.operation!==u.ClearState))return[3,2];return[4,n(!0)];case 1:f.sent(),f.label=2;case 2:switch(c.operation){case u.ClearState:return[3,3];case u.GetState:return[3,4];case u.UpdateState:return[3,6]}return[3,8];case 3:return i(l,d),[2,null];case 4:return[4,o(l,d)];case 5:return[2,f.sent()];case 6:return[4,a(l,c.newState,d)];case 7:return f.sent(),[2,null];case 8:throw dG.invalidParams("Invalid ".concat(s,' operation: "').concat(c.operation,'"'));case 9:return[2]}})},r=function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(e){f5(o,n,i,a,s,"next",e)}function s(e){f5(o,n,i,a,s,"throw",e)}a(void 0)})},function(e){return r.apply(this,arguments)}),subjectTypes:[ts.SubjectType.Snap]}},methodHooks:{getUnlockPromise:!0,clearSnapState:!0,getSnapState:!0,updateSnapState:!0}});function f9(e){return(0,_.isObject)(e)&&(0,_.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:String(e)}function me(e){if((0,_.isObject)(e)&&(0,_.hasProperty)(e,"stack")&&"string"==typeof e.stack)return e.stack}function mt(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}var mr="snap_notify",mn=(0,H.object)({type:tE(cG.Native),message:(0,H.string)()}),mi=tw([(0,H.object)({type:tE(cG.InApp),message:(0,H.string)()}),(0,H.object)({type:tE(cG.InApp),message:(0,H.string)(),content:u8,title:(0,H.string)(),footerLink:(0,H.optional)((0,H.object)({href:(0,H.string)(),text:(0,H.string)()}))}),mn]),mo=Object.freeze({targetName:mr,specificationBuilder:function(e){var t,r,n,i,o,a,s,l,u=e.allowedCaveats,c=e.methodHooks;return{permissionType:ts.PermissionType.RestrictedMethod,targetName:mr,allowedCaveats:void 0===u?null:u,methodImplementation:(n=c.showNativeNotification,i=c.showInAppNotification,o=c.isOnPhishingList,a=c.maybeUpdatePhishingList,s=c.createInterface,l=c.getSnap,t=function(e){var t,r,u,c;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=50))throw dG.invalidParams({message:'Must specify a non-empty string "message" less than 50 characters long.'});if(n===cG.InApp&&(o||i.length>=500))throw dG.invalidParams({message:'Must specify a non-empty string "message" less than 500 characters long.'});try{var a=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,_.assert)(t.schema,"Expected a struct with a schema. Make sure to use `union` from `@metamask/snaps-sdk`."),(0,_.assert)(t.schema.length>0,"Expected a non-empty array of structs.");var i=t.schema.map(function(e){return e.schema[r]}),o=(0,H.type)(tk({},r,tw(i))),a=tj((0,H.validate)(e,o,{coerce:n}),1)[0];if(a)throw Error(tO(o,a.failures()[0],!1));var s=t.schema.filter(function(t){return(0,H.is)(e[r],t.schema[r])});(0,_.assert)(s.length>0,"Expected a struct to match the value.");var l=s.map(function(t){return(0,H.validate)(e,t,{coerce:n})}),u=l.find(function(e){return!tj(e,1)[0]});if(u)return u[1];throw(0,_.assert)(l[0][0],"Expected at least one error."),Error(tO(t,l.reduce(function(e,t){var r=tj(t,1)[0];return((0,_.assert)(r,"Expected an error."),r.failures().lengthe.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0?_:1e3+_))/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let hM={},hN={};function hk(e,t={}){let r=JSON.stringify([e,t]),n=hN[r];return n||(n=new Intl.DateTimeFormat(e,t),hN[r]=n),n}let hj={},hI={},hO=null,hP={};function hF(e,t,r,n){let i=e.listingMode();return"error"===i?null:"en"===i?r(t):n(t)}class hL{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;let{padTo:n,floor:i,...o}=r;if(!t||Object.keys(o).length>0){let t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){let r=JSON.stringify([e,t]),n=hj[r];return n||(n=new Intl.NumberFormat(e,t),hj[r]=n),n}(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}{let t=this.floor?Math.floor(e):yS(e,3);return yb(t,this.padTo)}}}class hz{constructor(e,t,r){let n;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){let t=-1*(e.offset/60),r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&hC.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||n,this.dtf=hk(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"!==e.type)return e;{let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class hR{constructor(e,t,r){this.opts={style:"long",...r},!t&&y_()&&(this.rtf=function(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),o=hI[i];return o||(o=new Intl.RelativeTimeFormat(e,t),hI[i]=o),o}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&o){let r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${i[e][0]}`;case -1:return r?"yesterday":`last ${i[e][0]}`;case 0:return r?"today":`this ${i[e][0]}`}}let a=Object.is(t,-0)||t<0,s=Math.abs(t),l=1===s,u=i[e],c=n?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return a?`${s} ${c} ago`:`in ${s} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}let hB={firstDay:1,minimalDays:4,weekend:[6,7]};class hU{static fromOpts(e){return hU.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,i=!1){let o=e||h6.defaultLocale,a=o||(i?"en-US":hO||(hO=new Intl.DateTimeFormat().resolvedOptions().locale)),s=t||h6.defaultNumberingSystem,l=r||h6.defaultOutputCalendar,u=yy(n)||h6.defaultWeekSettings;return new hU(a,s,l,u,o)}static resetCache(){hO=null,hN={},hj={},hI={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return hU.create(e,t,r,n)}constructor(e,t,r,n,i){let[o,a,s]=function(e){let t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=hk(e).resolvedOptions(),n=e}catch(o){let i=e.substring(0,r);t=hk(i).resolvedOptions(),n=i}let{numberingSystem:i,calendar:o}=t;return[n,i,o]}}(e);this.locale=o,this.numberingSystem=t||a||null,this.outputCalendar=r||s||null,this.weekSettings=n,this.intl=function(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return null==this.fastNumbersCached&&(this.fastNumbersCached=(!this.numberingSystem||"latn"===this.numberingSystem)&&("latn"===this.numberingSystem||!this.locale||this.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(this.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(null===this.numberingSystem||"latn"===this.numberingSystem)&&(null===this.outputCalendar||"gregory"===this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?hU.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,yy(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return hF(this,e,yB,()=>{let r=t?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=function(e){let t=[];for(let r=1;r<=12;r++){let n=bb.utc(2009,r,1);t.push(e(n))}return t}(e=>this.extract(e,r,"month"))),this.monthsCache[n][e]})}weekdays(e,t=!1){return hF(this,e,y$,()=>{let r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){let t=[];for(let r=1;r<=7;r++){let n=bb.utc(2016,11,13+r);t.push(e(n))}return t}(e=>this.extract(e,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return hF(this,void 0,()=>yK,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[bb.utc(2016,11,13,9),bb.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return hF(this,e,yQ,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[bb.utc(-40,1,1),bb.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){let n=this.dtFormatter(e,t),i=n.formatToParts(),o=i.find(e=>e.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new hL(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new hz(e,this.intl,t)}relFormatter(e={}){return new hR(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){let r=JSON.stringify([e,t]),n=hM[r];return n||(n=new Intl.ListFormat(e,t),hM[r]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:yf()?function(e){let t=hP[e];if(!t){let r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,hP[e]=t}return t}(this.locale):hB}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let hq=null;class hJ extends hD{static get utcInstance(){return null===hq&&(hq=new hJ(0)),hq}static instance(e){return 0===e?hJ.utcInstance:new hJ(e)}static parseSpecifier(e){if(e){let t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new hJ(yj(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${yP(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${yP(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return yP(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class h$ extends hD{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function hK(e,t){if(yc(e)||null===e)return t;if(e instanceof hD)return e;if("string"==typeof e){let r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?hT.instance:"utc"===r||"gmt"===r?hJ.utcInstance:hJ.parseSpecifier(r)||hC.create(e)}return yp(e)?hJ.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new h$(e)}let hV={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},hY={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},hW=hV.hanidec.replace(/[\[|\]]/g,"").split(""),hQ={};function hH({numberingSystem:e},t=""){let r=e||"latn";return hQ[r]||(hQ[r]={}),hQ[r][t]||(hQ[r][t]=RegExp(`${hV[r]}${t}`)),hQ[r][t]}let hG=()=>Date.now(),hZ="system",hX=null,h0=null,h1=null,h2=60,h3,h4=null;class h6{static get now(){return hG}static set now(e){hG=e}static set defaultZone(e){hZ=e}static get defaultZone(){return hK(hZ,hT.instance)}static get defaultLocale(){return hX}static set defaultLocale(e){hX=e}static get defaultNumberingSystem(){return h0}static set defaultNumberingSystem(e){h0=e}static get defaultOutputCalendar(){return h1}static set defaultOutputCalendar(e){h1=e}static get defaultWeekSettings(){return h4}static set defaultWeekSettings(e){h4=yy(e)}static get twoDigitCutoffYear(){return h2}static set twoDigitCutoffYear(e){h2=e%100}static get throwOnInvalid(){return h3}static set throwOnInvalid(e){h3=e}static resetCaches(){hU.resetCache(),hC.resetCache(),bb.resetCache(),hQ={}}}class h5{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}let h8=[0,31,59,90,120,151,181,212,243,273,304,334],h7=[0,31,60,91,121,152,182,213,244,274,305,335];function h9(e,t){return new h5("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ye(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return 0===i?7:i}function yt(e,t){let r=yT(e)?h7:h8,n=r.findIndex(e=>eyM(n,t,r)?(u=n+1,l=1):u=n,{weekYear:u,weekNumber:l,weekday:s,...yF(e)}}function yi(e,t=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=e,a=yr(ye(n,1,t),r),s=yE(n),l=7*i+o-a-7+t,u;l<1?l+=yE(u=n-1):l>s?(u=n+1,l-=yE(n)):u=n;let{month:c,day:p}=yt(u,l);return{year:u,month:c,day:p,...yF(e)}}function yo(e){let{year:t,month:r,day:n}=e,i=n+(yT(t)?h7:h8)[r-1];return{year:t,ordinal:i,...yF(e)}}function ya(e){let{year:t,ordinal:r}=e,{month:n,day:i}=yt(t,r);return{year:t,month:n,day:i,...yF(e)}}function ys(e,t){let r=!yc(e.localWeekday)||!yc(e.localWeekNumber)||!yc(e.localWeekYear);if(!r)return{minDaysInFirstWeek:4,startOfWeek:1};{let r=!yc(e.weekday)||!yc(e.weekNumber)||!yc(e.weekYear);if(r)throw new m3("Cannot mix locale-based week fields with ISO-based week fields");return yc(e.localWeekday)||(e.weekday=e.localWeekday),yc(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),yc(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}}function yl(e){let t=yd(e.year),r=yg(e.month,1,12),n=yg(e.day,1,yw(e.year,e.month));return t?r?!n&&h9("day",e.day):h9("month",e.month):h9("year",e.year)}function yu(e){let{hour:t,minute:r,second:n,millisecond:i}=e,o=yg(t,0,23)||24===t&&0===r&&0===n&&0===i,a=yg(r,0,59),s=yg(n,0,59),l=yg(i,0,999);return o?a?s?!l&&h9("millisecond",i):h9("second",n):h9("minute",r):h9("hour",t)}function yc(e){return void 0===e}function yp(e){return"number"==typeof e}function yd(e){return"number"==typeof e&&e%1==0}function y_(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function yf(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function ym(e,t,r){if(0!==e.length)return e.reduce((e,n)=>{let i=[t(n),n];return e&&r(e[0],i[0])===e[0]?e:i},null)[1]}function yh(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function yy(e){if(null==e)return null;if("object"!=typeof e)throw new m6("Week settings must be an object");if(!yg(e.firstDay,1,7)||!yg(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!yg(e,1,7)))throw new m6("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function yg(e,t,r){return yd(e)&&e>=t&&e<=r}function yb(e,t=2){return e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function yv(e){if(!yc(e)&&null!==e&&""!==e)return parseInt(e,10)}function yx(e){if(!yc(e)&&null!==e&&""!==e)return parseFloat(e)}function yD(e){if(!yc(e)&&null!==e&&""!==e){let t=1e3*parseFloat("0."+e);return Math.floor(t)}}function yS(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function yT(e){return e%4==0&&(e%100!=0||e%400==0)}function yE(e){return yT(e)?366:365}function yw(e,t){var r;let n=(r=t-1)-12*Math.floor(r/12)+1;return 2===n?yT(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function yA(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function yC(e,t,r){let n=yr(ye(e,1,t),r);return-n+t-1}function yM(e,t=4,r=1){let n=yC(e,t,r),i=yC(e+1,t,r);return(yE(e)-n+i)/7}function yN(e){return e>99?e:e>h6.twoDigitCutoffYear?1900+e:2e3+e}function yk(e,t,r,n=null){let i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);let a={timeZoneName:t,...o},s=new Intl.DateTimeFormat(r,a).formatToParts(i).find(e=>"timezonename"===e.type.toLowerCase());return s?s.value:null}function yj(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return 60*r+i}function yI(e){let t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new m6(`Invalid unit value ${e}`);return t}function yO(e,t){let r={};for(let n in e)if(yh(e,n)){let i=e[n];if(null==i)continue;r[t(n)]=yI(i)}return r}function yP(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${yb(r,2)}:${yb(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${yb(r,2)}${yb(n,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function yF(e){return["hour","minute","second","millisecond"].reduce((t,r)=>(t[r]=e[r],t),{})}let yL=["January","February","March","April","May","June","July","August","September","October","November","December"],yz=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yR=["J","F","M","A","M","J","J","A","S","O","N","D"];function yB(e){switch(e){case"narrow":return[...yR];case"short":return[...yz];case"long":return[...yL];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}let yU=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],yq=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yJ=["M","T","W","T","F","S","S"];function y$(e){switch(e){case"narrow":return[...yJ];case"short":return[...yq];case"long":return[...yU];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}let yK=["AM","PM"],yV=["Before Christ","Anno Domini"],yY=["BC","AD"],yW=["B","A"];function yQ(e){switch(e){case"narrow":return[...yW];case"short":return[...yY];case"long":return[...yV];default:return null}}function yH(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}let yG={D:he,DD:ht,DDD:hn,DDDD:hi,t:ho,tt:ha,ttt:hs,tttt:hl,T:hu,TT:hc,TTT:hp,TTTT:hd,f:h_,ff:hm,fff:hg,ffff:hv,F:hf,FF:hh,FFF:hb,FFFF:hx};class yZ{static create(e,t={}){return new yZ(e,t)}static parseFormat(e){let t=null,r="",n=!1,i=[];for(let o=0;o0&&i.push({literal:n||/^\s+$/.test(r),val:r}),t=null,r="",n=!n):n?r+=a:a===t?r+=a:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=a,t=a)}return r.length>0&&i.push({literal:n||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(e){return yG[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());let r=this.systemLoc.dtFormatter(e,{...this.opts,...t});return r.format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){let r=this.dtFormatter(e.start,t);return r.dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return yb(e,t);let r={...this.opts};return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){let r="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,i=(t,r)=>this.loc.extract(e,t,r),o=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",a=()=>r?yK[e.hour<12?0:1]:i({hour:"numeric",hourCycle:"h12"},"dayperiod"),s=(t,n)=>r?yB(t)[e.month-1]:i(n?{month:t}:{month:t,day:"numeric"},"month"),l=(t,n)=>r?y$(t)[e.weekday-1]:i(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),u=t=>{let r=yZ.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},c=t=>r?yQ(t)[e.year<0?0:1]:i({era:t},"era");return yH(yZ.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return n?i({day:"numeric"},"day"):this.num(e.day);case"dd":return n?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return s("short",!0);case"LLLL":return s("long",!0);case"LLLLL":return s("narrow",!0);case"M":return n?i({month:"numeric"},"month"):this.num(e.month);case"MM":return n?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return s("short",!1);case"MMMM":return s("long",!1);case"MMMMM":return s("narrow",!1);case"y":return n?i({year:"numeric"},"year"):this.num(e.year);case"yy":return n?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(t)}})}formatDurationFromString(e,t){let r=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=yZ.parseFormat(t),i=n.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),o=e.shiftTo(...i.map(r).filter(e=>e));return yH(n,e=>{let t=r(e);return t?this.num(o.get(t),e.length):e})}}let yX=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function y0(...e){let t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function y1(...e){return t=>e.reduce(([e,r,n],i)=>{let[o,a,s]=i(t,n);return[{...e,...o},a||r,s]},[{},null,1]).slice(0,2)}function y2(e,...t){if(null==e)return[null,null];for(let[r,n]of t){let t=r.exec(e);if(t)return n(t)}return[null,null]}function y3(...e){return(t,r)=>{let n;let i={};for(n=0;nvoid 0!==e&&(t||e&&c)?-e:e;return[{years:d(yx(r)),months:d(yx(n)),weeks:d(yx(i)),days:d(yx(o)),hours:d(yx(a)),minutes:d(yx(s)),seconds:d(yx(l),"-0"===l),milliseconds:d(yD(u),p)}]}let gc={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function gp(e,t,r,n,i,o,a){let s={year:2===t.length?yN(yv(t)):yv(t),month:yz.indexOf(r)+1,day:yv(n),hour:yv(i),minute:yv(o)};return a&&(s.second=yv(a)),e&&(s.weekday=e.length>3?yU.indexOf(e)+1:yq.indexOf(e)+1),s}let gd=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function g_(e){let t;let[,r,n,i,o,a,s,l,u,c,p,d]=e,_=gp(r,o,i,n,a,s,l);return t=u?gc[u]:c?0:yj(p,d),[_,new hJ(t)]}let gf=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,gm=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,gh=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function gy(e){let[,t,r,n,i,o,a,s]=e,l=gp(t,i,n,r,o,a,s);return[l,hJ.utcInstance]}function gg(e){let[,t,r,n,i,o,a,s]=e,l=gp(t,s,r,n,i,o,a);return[l,hJ.utcInstance]}let gb=y0(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,y7),gv=y0(/(\d{4})-?W(\d\d)(?:-?(\d))?/,y7),gx=y0(/(\d{4})-?(\d{3})/,y7),gD=y0(y8),gS=y1(function(e,t){let r={year:gn(e,t),month:gn(e,t+1,1),day:gn(e,t+2,1)};return[r,null,t+3]},gi,go,ga),gT=y1(y9,gi,go,ga),gE=y1(ge,gi,go,ga),gw=y1(gi,go,ga),gA=y1(gi),gC=y0(/(\d{4})-(\d\d)-(\d\d)/,gr),gM=y0(gt),gN=y1(gi,go,ga),gk="Invalid Duration",gj={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},gI={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...gj},gO={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:31556952,milliseconds:31556952e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:7889238,milliseconds:7889238e3},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...gj},gP=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],gF=gP.slice(0).reverse();function gL(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new gB(n)}function gz(e,t){let r=t.milliseconds??0;for(let n of gF.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function gR(e,t){let r=0>gz(e,t)?-1:1;gP.reduceRight((n,i)=>{if(yc(t[i]))return n;if(n){let o=t[n]*r,a=e[i][n],s=Math.floor(o/a);t[i]+=s*r,t[n]-=s*a*r}return i},null),gP.reduce((r,n)=>{if(yc(t[n]))return r;if(r){let i=t[r]%1;t[r]-=i,t[n]+=i*e[r][n]}return n},null)}class gB{constructor(e){let t="longterm"===e.conversionAccuracy,r=t?gO:gI;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||hU.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return gB.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new m6(`Duration.fromObject: argument expected to be an object, got ${null===e?"null":typeof e}`);return new gB({values:yO(e,gB.normalizeUnit),loc:hU.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(yp(e))return gB.fromMillis(e);if(gB.isDuration(e))return e;if("object"==typeof e)return gB.fromObject(e);throw new m6(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){let[r]=y2(e,[gl,gu]);return r?gB.fromObject(r,t):gB.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){let[r]=y2(e,[gs,gA]);return r?gB.fromObject(r,t):gB.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new m6("need to specify a reason the Duration is invalid");let r=e instanceof h5?e:new h5(e,t);if(!h6.throwOnInvalid)return new gB({invalid:r});throw new m2(r)}static normalizeUnit(e){let t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new m4(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?yZ.create(this.loc,r).formatDurationFromString(this,e):gk}toHuman(e={}){if(!this.isValid)return gk;let t=gP.map(t=>{let r=this.values[t];return yc(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),(0!==this.months||0!==this.quarters)&&(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),(0!==this.hours||0!==this.minutes||0!==this.seconds||0!==this.milliseconds)&&(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),(0!==this.seconds||0!==this.milliseconds)&&(e+=yS(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};let r=bb.fromMillis(t,{zone:"UTC"});return r.toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?gz(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let t=gB.fromDurationLike(e),r={};for(let e of gP)(yh(t.values,e)||yh(this.values,e))&&(r[e]=t.get(e)+this.get(e));return gL(this,{values:r},!0)}minus(e){if(!this.isValid)return this;let t=gB.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=yI(e(this.values[r],r));return gL(this,{values:t},!0)}get(e){return this[gB.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let t={...this.values,...yO(e,gB.normalizeUnit)};return gL(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){let i=this.loc.clone({locale:e,numberingSystem:t});return gL(this,{loc:i,matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return gR(this.matrix,e),gL(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=function(e){let t={};for(let[r,n]of Object.entries(e))0!==n&&(t[r]=n);return t}(this.normalize().shiftToAll().toObject());return gL(this,{values:e},!0)}shiftTo(...e){let t;if(!this.isValid||0===e.length)return this;e=e.map(e=>gB.normalizeUnit(e));let r={},n={},i=this.toObject();for(let o of gP)if(e.indexOf(o)>=0){t=o;let e=0;for(let t in n)e+=this.matrix[t][o]*n[t],n[t]=0;yp(i[o])&&(e+=i[o]);let a=Math.trunc(e);r[o]=a,n[o]=(1e3*e-1e3*a)/1e3}else yp(i[o])&&(n[o]=i[o]);for(let e in n)0!==n[e]&&(r[t]+=e===t?n[e]:n[e]/this.matrix[t][e]);return gR(this.matrix,r),gL(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return gL(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;for(let n of gP){var t,r;if(t=this.values[n],r=e.values[n],void 0===t||0===t?void 0!==r&&0!==r:t!==r)return!1}return!0}}let gU="Invalid Interval";class gq{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new m6("need to specify a reason the Interval is invalid");let r=e instanceof h5?e:new h5(e,t);if(!h6.throwOnInvalid)return new gq({invalid:r});throw new m1(r)}static fromDateTimes(e,t){let r=bv(e),n=bv(t),i=r&&r.isValid?n&&n.isValid?ne}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&this.s<=e&&this.e>e}set({start:e,end:t}={}){return this.isValid?gq.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];let t=e.map(bv).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[],{s:n}=this,i=0;for(;n+this.e?this.e:e;r.push(gq.fromDateTimes(n,o)),n=o,i+=1}return r}splitBy(e){let t=gB.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let{s:r}=this,n=1,i,o=[];for(;re*n));i=+e>+this.e?this.e:e,o.push(gq.fromDateTimes(r,i)),r=i,n+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e}equals(e){return!!this.isValid&&!!e.isValid&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let t=this.s>e.s?this.s:e.s,r=this.e=r?null:gq.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;let t=this.se.e?this.e:e.e;return gq.fromDateTimes(t,r)}static merge(e){let[t,r]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0,n=[],i=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),o=Array.prototype.concat(...i),a=o.sort((e,t)=>e.time-t.time);for(let e of a)1===(r+="s"===e.type?1:-1)?t=e.time:(t&&+t!=+e.time&&n.push(gq.fromDateTimes(t,e.time)),t=null);return gq.merge(n)}difference(...e){return gq.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:gU}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=he,t={}){return this.isValid?yZ.create(this.s.loc.clone(t),e).formatInterval(this):gU}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:gU}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:gU}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:gU}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:gU}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):gB.invalid(this.invalidReason)}mapEndpoints(e){return gq.fromDateTimes(e(this.s),e(this.e))}}class gJ{static hasDST(e=h6.defaultZone){let t=bb.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return hC.isValidZone(e)}static normalizeZone(e){return hK(e,h6.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||hU.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||hU.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||hU.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:i="gregory"}={}){return(n||hU.create(t,r,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:i="gregory"}={}){return(n||hU.create(t,r,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||hU.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||hU.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return hU.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return hU.create(t,null,"gregory").eras(e)}static features(){return{relative:y_(),localeWeek:yf()}}}function g$(e,t){let r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(gB.fromMillis(n).as("days"))}function gK(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(!isNaN(t))return t;t="";for(let r=0;r=r&&n<=i&&(t+=n-r)}}return parseInt(t,10)}(e))}}let gV=String.fromCharCode(160),gY=`[ ${gV}]`,gW=RegExp(gY,"g");function gQ(e){return e.replace(/\./g,"\\.?").replace(gW,gY)}function gH(e){return e.replace(/\./g,"").replace(gW," ").toLowerCase()}function gG(e,t){return null===e?null:{regex:RegExp(e.map(gQ).join("|")),deser:([r])=>e.findIndex(e=>gH(r)===gH(e))+t}}function gZ(e,t){return{regex:e,deser:([,e,t])=>yj(e,t),groups:t}}function gX(e){return{regex:e,deser:([e])=>e}}let g0={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}},g1=null;function g2(e,t){return Array.prototype.concat(...e.map(e=>(function(e,t){if(e.literal)return e;let r=yZ.macroTokenToFormatOpts(e.val),n=g6(r,t);return null==n||n.includes(void 0)?e:n})(e,t)))}class g3{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=g2(yZ.parseFormat(t),e),this.units=this.tokens.map(t=>(function(e,t){let r=hH(t),n=hH(t,"{2}"),i=hH(t,"{3}"),o=hH(t,"{4}"),a=hH(t,"{6}"),s=hH(t,"{1,2}"),l=hH(t,"{1,3}"),u=hH(t,"{1,6}"),c=hH(t,"{1,9}"),p=hH(t,"{2,4}"),d=hH(t,"{4,6}"),_=e=>({regex:RegExp(e.val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")),deser:([e])=>e,literal:!0}),f=(f=>{if(e.literal)return _(f);switch(f.val){case"G":return gG(t.eras("short"),0);case"GG":return gG(t.eras("long"),0);case"y":return gK(u);case"yy":case"kk":return gK(p,yN);case"yyyy":case"kkkk":return gK(o);case"yyyyy":return gK(d);case"yyyyyy":return gK(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return gK(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return gK(n);case"MMM":return gG(t.months("short",!0),1);case"MMMM":return gG(t.months("long",!0),1);case"LLL":return gG(t.months("short",!1),1);case"LLLL":return gG(t.months("long",!1),1);case"o":case"S":return gK(l);case"ooo":case"SSS":return gK(i);case"u":return gX(c);case"uu":return gX(s);case"uuu":case"E":case"c":return gK(r);case"a":return gG(t.meridiems(),0);case"EEE":return gG(t.weekdays("short",!1),1);case"EEEE":return gG(t.weekdays("long",!1),1);case"ccc":return gG(t.weekdays("short",!0),1);case"cccc":return gG(t.weekdays("long",!0),1);case"Z":case"ZZ":return gZ(RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return gZ(RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return gX(/[a-z_+-/]{1,256}?/i);case" ":return gX(/[^\S\n\r]/);default:return _(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f})(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=function(e){let t=e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"");return[`^${t}$`,e]}(this.units);this.regex=RegExp(e,"i"),this.handlers=t}}explainFromTokens(e){if(!this.isValid)return{input:e,tokens:this.tokens,invalidReason:this.invalidReason};{let[t,r]=function(e,t,r){let n=e.match(t);if(!n)return[n,{}];{let e={},t=1;for(let i in r)if(yh(r,i)){let o=r[i],a=o.groups?o.groups+1:1;!o.literal&&o.token&&(e[o.token.val[0]]=o.deser(n.slice(t,t+a))),t+=a}return[n,e]}}(e,this.regex,this.handlers),[n,i,o]=r?function(e){let t;let r=e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},n=null;yc(e.z)||(n=hC.create(e.z)),yc(e.Z)||(n||(n=new hJ(e.Z)),t=e.Z),yc(e.q)||(e.M=(e.q-1)*3+1),yc(e.h)||(e.h<12&&1===e.a?e.h+=12:12!==e.h||0!==e.a||(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),yc(e.u)||(e.S=yD(e.u));let i=Object.keys(e).reduce((t,n)=>{let i=r(n);return i&&(t[i]=e[n]),t},{});return[i,n,t]}(r):[null,null,void 0];if(yh(r,"a")&&yh(r,"H"))throw new m3("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:n,zone:i,specificOffset:o}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function g4(e,t,r){let n=new g3(e,r);return n.explainFromTokens(t)}function g6(e,t){if(!e)return null;let r=yZ.create(t,e),n=r.dtFormatter((g1||(g1=bb.fromMillis(1555555555555)),g1)),i=n.formatToParts(),o=n.resolvedOptions();return i.map(t=>(function(e,t,r){let{type:n,value:i}=e;if("literal"===n){let e=/^\s+$/.test(i);return{literal:!e,val:e?" ":i}}let o=t[n],a=n;"hour"===n&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let s=g0[a];if("object"==typeof s&&(s=s[o]),s)return{literal:!1,val:s}})(t,e,o))}let g5="Invalid DateTime";function g8(e){return new h5("unsupported zone",`the zone "${e.name}" is not supported`)}function g7(e){return null===e.weekData&&(e.weekData=yn(e.c)),e.weekData}function g9(e){return null===e.localWeekData&&(e.localWeekData=yn(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function be(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new bb({...r,...t,old:r})}function bt(e,t,r){let n=e-6e4*t,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*6e4;let o=r.offset(n);return i===o?[n,i]:[e-6e4*Math.min(i,o),Math.max(i,o)]}function br(e,t){e+=6e4*t;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function bn(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o={...e.c,year:n,month:i,day:Math.min(e.c.day,yw(n,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},a=gB.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=yA(o),[l,u]=bt(s,r,e.zone);return 0!==a&&(l+=a,u=e.zone.offset(l)),{ts:l,o:u}}function bi(e,t,r,n,i,o){let{setZone:a,zone:s}=r;if((!e||0===Object.keys(e).length)&&!t)return bb.invalid(new h5("unparsable",`the input "${i}" can't be parsed as ${n}`));{let n=t||s,i=bb.fromObject(e,{...r,zone:n,specificOffset:o});return a?i:i.setZone(s)}}function bo(e,t,r=!0){return e.isValid?yZ.create(hU.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ba(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=yb(e.c.year,r?6:4),t?n+="-"+yb(e.c.month)+"-"+yb(e.c.day):n+=yb(e.c.month)+yb(e.c.day),n}function bs(e,t,r,n,i,o){let a=yb(e.c.hour);return t?(a+=":"+yb(e.c.minute),0===e.c.millisecond&&0===e.c.second&&r||(a+=":")):a+=yb(e.c.minute),0===e.c.millisecond&&0===e.c.second&&r||(a+=yb(e.c.second),0===e.c.millisecond&&n||(a+="."+yb(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?a+="Z":e.o<0?a+="-"+yb(Math.trunc(-e.o/60))+":"+yb(Math.trunc(-e.o%60)):a+="+"+yb(Math.trunc(e.o/60))+":"+yb(Math.trunc(e.o%60))),o&&(a+="["+e.zone.ianaName+"]"),a}let bl={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},bu={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},bc={ordinal:1,hour:0,minute:0,second:0,millisecond:0},bp=["year","month","day","hour","minute","second","millisecond"],bd=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],b_=["year","ordinal","hour","minute","second","millisecond"];function bf(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new m4(e);return t}(e)}}function bm(t,r){let n,i;let o=hK(r.zone,h6.defaultZone);if(!o.isValid)return bb.invalid(g8(o));let a=hU.fromObject(r);if(yc(t.year))n=h6.now();else{for(let e of bp)yc(t[e])&&(t[e]=bl[e]);let r=yl(t)||yu(t);if(r)return bb.invalid(r);let a=(bg[o]||(void 0===e&&(e=h6.now()),bg[o]=o.offset(e)),bg[o]);[n,i]=bt(yA(t),a,o)}return new bb({ts:n,zone:o,loc:a,o:i})}function bh(e,t,r){let n=!!yc(r.round)||r.round,i=(e,i)=>{e=yS(e,n||r.calendary?0:2,!0);let o=t.loc.clone(r).relFormatter(r);return o.format(e,i)},o=n=>r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(r.unit)return i(o(r.unit),r.unit);for(let e of r.units){let t=o(e);if(Math.abs(t)>=1)return i(t,e)}return i(e>t?-0:0,r.units[r.units.length-1])}function by(e){let t={},r;return e.length>0&&"object"==typeof e[e.length-1]?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}let bg={};class bb{constructor(e){let t=e.zone||h6.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new h5("invalid input"):null)||(t.isValid?null:g8(t));this.ts=yc(e.ts)?h6.now():e.ts;let n=null,i=null;if(!r){let o=e.old&&e.old.ts===this.ts&&e.old.zone.equals(t);if(o)[n,i]=[e.old.c,e.old.o];else{let o=yp(e.o)&&!e.old?e.o:t.offset(this.ts);n=(r=Number.isNaN((n=br(this.ts,o)).year)?new h5("invalid input"):null)?null:n,i=r?null:o}}this._zone=t,this.loc=e.loc||hU.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=i,this.isLuxonDateTime=!0}static now(){return new bb({})}static local(){let[e,t]=by(arguments),[r,n,i,o,a,s,l]=t;return bm({year:r,month:n,day:i,hour:o,minute:a,second:s,millisecond:l},e)}static utc(){let[e,t]=by(arguments),[r,n,i,o,a,s,l]=t;return e.zone=hJ.utcInstance,bm({year:r,month:n,day:i,hour:o,minute:a,second:s,millisecond:l},e)}static fromJSDate(e,t={}){let r="[object Date]"===Object.prototype.toString.call(e)?e.valueOf():NaN;if(Number.isNaN(r))return bb.invalid("invalid input");let n=hK(t.zone,h6.defaultZone);return n.isValid?new bb({ts:r,zone:n,loc:hU.fromObject(t)}):bb.invalid(g8(n))}static fromMillis(e,t={}){if(yp(e))return e<-864e13||e>864e13?bb.invalid("Timestamp out of range"):new bb({ts:e,zone:hK(t.zone,h6.defaultZone),loc:hU.fromObject(t)});throw new m6(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(yp(e))return new bb({ts:1e3*e,zone:hK(t.zone,h6.defaultZone),loc:hU.fromObject(t)});throw new m6("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};let r=hK(t.zone,h6.defaultZone);if(!r.isValid)return bb.invalid(g8(r));let n=hU.fromObject(t),i=yO(e,bf),{minDaysInFirstWeek:o,startOfWeek:a}=ys(i,n),s=h6.now(),l=yc(t.specificOffset)?r.offset(s):t.specificOffset,u=!yc(i.ordinal),c=!yc(i.year),p=!yc(i.month)||!yc(i.day),d=c||p,_=i.weekYear||i.weekNumber;if((d||u)&&_)throw new m3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&u)throw new m3("Can't mix ordinal dates with month/day");let f=_||i.weekday&&!d,m,h,y=br(s,l);f?(m=bd,h=bu,y=yn(y,o,a)):u?(m=b_,h=bc,y=yo(y)):(m=bp,h=bl);let g=!1;for(let e of m){let t=i[e];yc(t)?g?i[e]=h[e]:i[e]=y[e]:g=!0}let b=f?function(e,t=4,r=1){let n=yd(e.weekYear),i=yg(e.weekNumber,1,yM(e.weekYear,t,r)),o=yg(e.weekday,1,7);return n?i?!o&&h9("weekday",e.weekday):h9("week",e.weekNumber):h9("weekYear",e.weekYear)}(i,o,a):u?function(e){let t=yd(e.year),r=yg(e.ordinal,1,yE(e.year));return t?!r&&h9("ordinal",e.ordinal):h9("year",e.year)}(i):yl(i),v=b||yu(i);if(v)return bb.invalid(v);let x=f?yi(i,o,a):u?ya(i):i,[D,S]=bt(yA(x),l,r),T=new bb({ts:D,zone:r,o:S,loc:n});return i.weekday&&d&&e.weekday!==T.weekday?bb.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${T.toISO()}`):T.isValid?T:bb.invalid(T.invalid)}static fromISO(e,t={}){let[r,n]=y2(e,[gb,gS],[gv,gT],[gx,gE],[gD,gw]);return bi(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){let[r,n]=y2(e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim(),[gd,g_]);return bi(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){let[r,n]=y2(e,[gf,gy],[gm,gy],[gh,gg]);return bi(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(yc(e)||yc(t))throw new m6("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:i=null}=r,o=hU.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0}),[a,s,l,u]=function(e,t,r){let{result:n,zone:i,specificOffset:o,invalidReason:a}=g4(e,t,r);return[n,i,o,a]}(o,e,t);return u?bb.invalid(u):bi(a,s,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return bb.fromFormat(e,t,r)}static fromSQL(e,t={}){let[r,n]=y2(e,[gC,gS],[gM,gN]);return bi(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new m6("need to specify a reason the DateTime is invalid");let r=e instanceof h5?e:new h5(e,t);if(!h6.throwOnInvalid)return new bb({invalid:r});throw new m0(r)}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let r=g6(e,hU.fromObject(t));return r?r.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){let r=g2(yZ.parseFormat(e),hU.fromObject(t));return r.map(e=>e.val).join("")}static resetCache(){e=void 0,bg={}}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?g7(this).weekYear:NaN}get weekNumber(){return this.isValid?g7(this).weekNumber:NaN}get weekday(){return this.isValid?g7(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?g9(this).weekday:NaN}get localWeekNumber(){return this.isValid?g9(this).weekNumber:NaN}get localWeekYear(){return this.isValid?g9(this).weekYear:NaN}get ordinal(){return this.isValid?yo(this.c).ordinal:NaN}get monthShort(){return this.isValid?gJ.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?gJ.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?gJ.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?gJ.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=yA(this.c),t=this.zone.offset(e-864e5),r=this.zone.offset(e+864e5),n=this.zone.offset(e-6e4*t),i=this.zone.offset(e-6e4*r);if(n===i)return[this];let o=e-6e4*n,a=e-6e4*i,s=br(o,n),l=br(a,i);return s.hour===l.hour&&s.minute===l.minute&&s.second===l.second&&s.millisecond===l.millisecond?[be(this,{ts:o}),be(this,{ts:a})]:[this]}get isInLeapYear(){return yT(this.year)}get daysInMonth(){return yw(this.year,this.month)}get daysInYear(){return this.isValid?yE(this.year):NaN}get weeksInWeekYear(){return this.isValid?yM(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?yM(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:r,calendar:n}=yZ.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(hJ.instance(e),t)}toLocal(){return this.setZone(h6.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=hK(e,h6.defaultZone)).equals(this.zone))return this;if(!e.isValid)return bb.invalid(g8(e));{let i=this.ts;if(t||r){var n;let t=e.offset(this.ts),r=this.toObject();[i]=(n=e,bt(yA(r),t,n))}return be(this,{ts:i,zone:e})}}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){let n=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return be(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){var t,r,n;let i;if(!this.isValid)return this;let o=yO(e,bf),{minDaysInFirstWeek:a,startOfWeek:s}=ys(o,this.loc),l=!yc(o.weekYear)||!yc(o.weekNumber)||!yc(o.weekday),u=!yc(o.ordinal),c=!yc(o.year),p=!yc(o.month)||!yc(o.day),d=o.weekYear||o.weekNumber;if((c||p||u)&&d)throw new m3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&u)throw new m3("Can't mix ordinal dates with month/day");l?i=yi({...yn(this.c,a,s),...o},a,s):yc(o.ordinal)?(i={...this.toObject(),...o},yc(o.day)&&(i.day=Math.min(yw(i.year,i.month),i.day))):i=ya({...yo(this.c),...o});let[_,f]=(t=i,r=this.o,n=this.zone,bt(yA(t),r,n));return be(this,{ts:_,o:f})}plus(e){if(!this.isValid)return this;let t=gB.fromDurationLike(e);return be(this,bn(this,t))}minus(e){if(!this.isValid)return this;let t=gB.fromDurationLike(e).negate();return be(this,bn(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let r={},n=gB.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===n){if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;tthis.valueOf(),a=function(e,t,r,n){let[i,o,a,s]=function(e,t,r){let n,i;let o=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],["months",(e,t)=>t.month-e.month+(t.year-e.year)*12],["weeks",(e,t)=>{let r=g$(e,t);return(r-r%7)/7}],["days",g$]],a={},s=e;for(let[l,u]of o)r.indexOf(l)>=0&&(n=l,a[l]=u(e,t),(i=s.plus(a))>t?(a[l]--,(e=s.plus(a))>t&&(i=e,a[l]--,e=s.plus(a))):e=i);return[e,a,i,n]}(e,t,r),l=t-i,u=r.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===u.length&&(a0?gB.fromMillis(l,n).shiftTo(...u).plus(c):c}(o?this:e,o?e:this,i,n);return o?a.negate():a}diffNow(e="milliseconds",t={}){return this.diff(bb.now(),e,t)}until(e){return this.isValid?gq.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;let n=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,r)<=n&&n<=i.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let t=e.base||bb.fromObject({},{zone:this.zone}),r=e.padding?thise.valueOf(),Math.min)}static max(...e){if(!e.every(bb.isDateTime))throw new m6("max requires all arguments be DateTimes");return ym(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){let{locale:n=null,numberingSystem:i=null}=r,o=hU.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});return g4(o,e,t)}static fromStringExplain(e,t,r={}){return bb.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){let{locale:r=null,numberingSystem:n=null}=t,i=hU.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0});return new g3(i,e)}static fromFormatParser(e,t,r={}){if(yc(e)||yc(t))throw new m6("fromFormatParser requires an input string and a format parser");let{locale:n=null,numberingSystem:i=null}=r,o=hU.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});if(!o.equals(t.locale))throw new m6(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);let{result:a,zone:s,specificOffset:l,invalidReason:u}=t.explainFromTokens(e);return u?bb.invalid(u):bi(a,s,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return he}static get DATE_MED(){return ht}static get DATE_MED_WITH_WEEKDAY(){return hr}static get DATE_FULL(){return hn}static get DATE_HUGE(){return hi}static get TIME_SIMPLE(){return ho}static get TIME_WITH_SECONDS(){return ha}static get TIME_WITH_SHORT_OFFSET(){return hs}static get TIME_WITH_LONG_OFFSET(){return hl}static get TIME_24_SIMPLE(){return hu}static get TIME_24_WITH_SECONDS(){return hc}static get TIME_24_WITH_SHORT_OFFSET(){return hp}static get TIME_24_WITH_LONG_OFFSET(){return hd}static get DATETIME_SHORT(){return h_}static get DATETIME_SHORT_WITH_SECONDS(){return hf}static get DATETIME_MED(){return hm}static get DATETIME_MED_WITH_SECONDS(){return hh}static get DATETIME_MED_WITH_WEEKDAY(){return hy}static get DATETIME_FULL(){return hg}static get DATETIME_FULL_WITH_SECONDS(){return hb}static get DATETIME_HUGE(){return hv}static get DATETIME_HUGE_WITH_SECONDS(){return hx}}function bv(e){if(bb.isDateTime(e))return e;if(e&&e.valueOf&&yp(e.valueOf()))return bb.fromJSDate(e);if(e&&"object"==typeof e)return bb.fromObject(e);throw new m6(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function bx(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}var bD=RegExp("Z|([+-]\\d{2}:?\\d{2})$","u"),bS=(0,H.object)({date:(0,H.refine)((0,H.string)(),"date",function(e){return bb.fromISO(e).isValid?!!bD.test(e)||"ISO 8601 date must have timezone information":"Not a valid ISO 8601 date"}),request:tr}),bT=(0,H.object)({duration:(0,H.refine)((0,H.string)(),"duration",function(e){return!!gB.fromISO(e).isValid||"Not a valid ISO 8601 duration"}),request:tr}),bE=tC(function(e){return(0,_.hasProperty)(e,"date")?bS:bT});function bw(){var e;return e=function(e,r,n,i,o){var a,s,l,u,c,p,d;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&void 0!==a[1]?a[1]:p.Base64,[4,uC(nc)];case 1:if(n=s.sent(),i=t4(e),!(o=null===(r=n.find(function(e){return e.path===i}))||void 0===r?void 0:r.toString("base64")))return[2,null];return[4,uE(bV,o,t)];case 2:return[2,s.sent()]}})}function b2(e,t){return bQ(this,function(r){switch(r.label){case 0:return[4,uC(r9)];case 1:return[4,uE([r.sent(),"createInterface"],e,t)];case 2:return[2,r.sent()]}})}function b3(e,t){return bQ(this,function(r){switch(r.label){case 0:return[4,uC(r9)];case 1:return[4,uE([r.sent(),"getInterface"],e,t)];case 2:return[2,r.sent()]}})}function b4(e,t,r){return bQ(this,function(n){switch(n.label){case 0:return[4,uC(r9)];case 1:return[4,uE([n.sent(),"updateInterface"],e,t,r)];case 2:return n.sent(),[4,uE(b3,e,t)];case 3:return[4,uD(rG(bW({id:t},n.sent())))];case 4:return n.sent(),[2]}})}function b6(e,t){return bQ(this,function(r){switch(r.label){case 0:return[4,uC(r9)];case 1:return[4,uE([r.sent(),"getInterface"],e,t)];case 2:return[2,r.sent().state]}})}function b5(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function b8(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){b5(o,n,i,a,s,"next",e)}function s(e){b5(o,n,i,a,s,"throw",e)}a(void 0)})}}function b7(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2?r-2:0),i=2;i0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,r),vA(this,"cache",new Map),vA(this,"validatedManifest",void 0),vA(this,"url",void 0),vA(this,"fetchFn",void 0),vA(this,"fetchOptions",void 0),(0,_.assertStruct)(e.toString(),e3,"Invalid Snap Id: "),this.fetchFn=null!==(t=n.fetch)&&void 0!==t?t:globalThis.fetch.bind(void 0),this.fetchOptions=n.fetchOptions,this.url=e}return e=[{key:"manifest",value:function(){var e=this;return vE(function(){var t,r,n,i,o;return vC(this,function(a){switch(a.label){case 0:if(e.validatedManifest)return[2,e.validatedManifest.clone()];return t=new URL(cj.Manifest,e.url).toString(),[4,e.fetchFn(t,e.fetchOptions)];case 1:if(!(r=a.sent()).ok)throw Error('Failed to fetch "'.concat(t,'". Status code: ').concat(r.status,"."));return[4,r.text()];case 2:return i=e8(n=a.sent()),o=new eP({value:n,result:t3(i),path:cj.Manifest,data:{canonicalPath:t}}),e.validatedManifest=o,[2,e.manifest()]}})})()}},{key:"fetch",value:function(e){var t=this;return vE(function(){var r,n,i,o,a,s;return vC(this,function(l){switch(l.label){case 0:if(r=t4(e),void 0!==(n=t.cache.get(r)))return[2,n.clone()];return i=t.toCanonical(r).toString(),[4,t.fetchFn(i,t.fetchOptions)];case 1:if(!(o=l.sent()).ok)throw Error('Failed to fetch "'.concat(i,'". Status code: ').concat(o.status,"."));return[4,o.arrayBuffer()];case 2:return a=l.sent(),s=new eP({value:new Uint8Array(a),path:r,data:{canonicalPath:i}}),(0,_.assert)(!t.cache.has(r),"Corrupted cache, multiple files with same path."),t.cache.set(r,s),[2,t.fetch(r)]}})})()}},{key:"root",get:function(){return new URL(this.url)}},{key:"toCanonical",value:function(e){return(0,_.assert)(!e.startsWith("/"),"Tried to parse absolute path."),new URL(e,this.url)}}],vw(r.prototype,e),t&&vw(r,t),r}();function vN(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function vk(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){vN(o,n,i,a,s,"next",e)}function s(e){vN(o,n,i,a,s,"throw",e)}a(void 0)})}}function vj(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function vI(e,t){var r=vj(e,t,"get");return r.get?r.get.call(e):r.value}function vO(e,t){for(var r=0;r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,r),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,vF),vF.set(this,{writable:!0,value:void 0}),(0,_.assertStruct)(e.toString(),e1,"Invalid Snap Id"),(0,_.assert)(void 0===o.fetchOptions,"Currently adding fetch options to local: is unsupported."),i=new vM(new URL(e.toString().slice(cI.local.length)),(t=function(e){for(var t=1;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?[2,r.join("\n")]:[2,!0]})});return function(t,r){return e.apply(this,arguments)}}()},{name:"Checksum",manifestName:"source.shasum",validator:function(){var e=vX(function(e,t){var r,n,i,o,a,s,l;return v1(this,function(u){switch(u.label){case 0:if(r=t.sourceCode,n=t.icon,i=t.auxiliaryFiles,o=t.localizationFiles,!e)return[3,2];return s=null===(a=e.result)||void 0===a?void 0:a.source.shasum,[4,function(e){return eZ.apply(this,arguments)}({manifest:e,sourceCode:r,svgIcon:n,auxiliaryFiles:i,localizationFiles:o})];case 1:if(l=u.sent(),s!==l)return[2,'Checksum mismatch - expected "'.concat(l,'" got "').concat(s,'"')];u.label=2;case 2:return[2,!0]}})});return function(t,r){return e.apply(this,arguments)}}()},{name:"Bundle",manifestName:"filePath",validator:function(){var e=vX(function(e,t){var r,n,i,o,a,s,l;return v1(this,function(u){return(r=t.sourceCode,l=v0(t2.schema.source.schema.location.schema.npm.schema.filePath.validate(null===(s=e)||void 0===s?void 0:null===(a=s.result)||void 0===a?void 0:null===(o=a.source)||void 0===o?void 0:null===(i=o.location)||void 0===i?void 0:null===(n=i.npm)||void 0===n?void 0:n.filePath),1)[0])?[2,l.message]:r?[2,!0]:[2,"Unable to load bundle."]})});return function(t,r){return e.apply(this,arguments)}}()}];function v3(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]${e}`}em(e){return`${e}`}codespan(e){return`${e}
`}br(){return"
"}del(e){return`${e}`}link(e,t,r){let n=om(e);if(null===n)return r;let i='"+r+""}image(e,t,r){let n=om(e);if(null===n)return r;let i=`"}text(e){return e}}class o8{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class o7{options;renderer;textRenderer;constructor(e){this.options=e||oi,this.options.renderer=this.options.renderer||new o5,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new o8}static parse(e,t){let r=new o7(t);return r.parse(e)}static parseInline(e,t){let r=new o7(t);return r.parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""));continue;case"code":r+=this.renderer.code(i.text,i.lang,!!i.escaped);continue;case"table":{let e="",t="";for(let e=0;e0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):s+=e+" "}s+=this.parse(t.tokens,n),o+=this.renderer.listitem(s,a,!!r)}r+=this.renderer.list(o,e,t);continue}case"html":r+=this.renderer.html(i.text,i.block);continue;case"paragraph":r+=this.renderer.paragraph(this.parseInline(i.tokens));continue;case"text":{let o=i,a=o.tokens?this.parseInline(o.tokens):o.text;for(;n+1{let i=e[n].flat(1/0);r=r.concat(this.walkTokens(i,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new o5(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if("options"===r)continue;let n=e.renderer[r],i=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ov(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let n=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new o9;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if("options"===r)continue;let n=e.hooks[r],i=t[r];o9.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(n.call(t,e)).then(e=>i.call(t,e));let r=n.call(t,e);return i.call(t,r)}:t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return o6.lex(e,t??this.defaults)}parser(e,t){return o7.parse(e,t??this.defaults)}#e(e,t){return(r,n)=>{let i={...n},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);let a=this.#t(!!o.silent,!!o.async);if(null==r)return a(Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return a(Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(t=>e(t,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>t(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let n=e(r,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let i=t(n,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return a(e)}}}#t(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="An error occurred:
"+op(r.message+"",!0)+"
";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}}let at=new ae;function ar(e,t){return at.parse(e,t)}ar.options=ar.setOptions=function(e){return at.setOptions(e),ar.defaults=at.defaults,oi=ar.defaults,ar},ar.getDefaults=on,ar.defaults=oi,ar.use=function(...e){return at.use(...e),ar.defaults=at.defaults,oi=ar.defaults,ar},ar.walkTokens=function(e,t){return at.walkTokens(e,t)},ar.parseInline=at.parseInline,ar.Parser=o7,ar.parser=o7.parse,ar.Renderer=o5,ar.TextRenderer=o8,ar.Lexer=o6,ar.lexer=o6.lex,ar.Tokenizer=ov,ar.Hooks=o9,ar.parse=ar,ar.options,ar.setOptions,ar.use;let an=ar.walkTokens;ar.parseInline,o7.parse;let ai=o6.lex;function ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r0?a_(e.tokens.flatMap(am)):e.href});case"text":return e.text;case"strong":return i4(i7,{children:af(e.tokens)});case"em":return i4(i9,{children:af(e.tokens)});default:return null}}function ah(e,t,r){try{var n=new URL(e);if((0,_.assert)(ad.includes(n.protocol),"Protocol must be one of: ".concat(ad.join(", "),".")),"metamask:"===n.protocol){var i=function(e){var t=new URL(e),r=t.protocol;if("metamask:"!==r)throw Error('Unable to parse URL. Expected the protocol to be "metamask:", but received "'.concat(r,'".'));var n=aa(t.href.replace("metamask://","").split("/")),i=n[0],o=n.slice(1),a="/".concat(o.join("/"));switch(i){case"client":return(0,_.assert)(as.includes(a),'Unable to navigate to "'.concat(a,'". The provided path is not allowed.')),{authority:i,path:a};case"snap":return function(e){var t,r="Invalid MetaMask url:",n=e5(e.slice(1)),i=e.slice(1).startsWith("npm:")?"npm:":"local:",o=n.startsWith("@"),a=n.split("/"),s="/".concat(a[a.length-1]);if("local:"===i){var l=aa(a.slice(0,-1)),u=l[0],c=l.slice(2);t="".concat(u,"//").concat(c.join("/")),(0,_.assert)(al.includes(s),"".concat(r," invalid snap path."))}else t=o?"".concat(a[0],"/").concat(a[1]):a[0],(0,_.assert)(o?3===a.length&&al.includes(s):2===a.length&&al.includes(s),"".concat(r," invalid snap path."));var p="".concat(i).concat(t);return(0,_.assertStruct)(p,e4,"Invalid snap ID"),{authority:"snap",snapId:p,path:s}}(a);default:throw Error('Expected "metamask:" URL to start with "client" or "snap", but received "'.concat(i,'".'))}}(e);i.snapId&&(0,_.assert)(r(i.snapId),"The Snap being navigated to is not installed.")}else if("mailto:"===n.protocol){var o=n.pathname.split(","),a=!0,s=!1,l=void 0;try{for(var u,c=o[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var p=u.value.split("@")[1];(0,_.assert)(!p.includes(":"));var d="https://".concat(p);(0,_.assert)(!t(d),"The specified URL is not allowed.")}}catch(e){s=!0,l=e}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}return}(0,_.assert)(!t(n.href),"The specified URL is not allowed.")}catch(e){throw Error("Invalid URL: ".concat((null==e?void 0:e.code)==="ERR_ASSERTION"?e.message:"Unable to parse URL."))}}function ay(e){return(0,_.hasProperty)(e.props,"children")}function ag(e){return!!e&&!0!==e}function ab(e){if(ay(e)){if(Array.isArray(e.props.children))return e.props.children.filter(ag).flat(1/0);if(e.props.children)return[e.props.children]}return[]}function av(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(Array.isArray(e)){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var l=a.value,u=av(l,t,r);if(void 0!==u)return u}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return}var c=t(e,r);if(void 0!==c)return c;if((0,_.hasProperty)(e,"props")&&(0,_.isPlainObject)(e.props)&&(0,_.hasProperty)(e.props,"children")){var p=ab(e),d=!0,f=!1,m=void 0;try{for(var h,y=p[Symbol.iterator]();!(d=(h=y.next()).done);d=!0){var g=h.value;if((0,_.isPlainObject)(g)){var b=av(g,t,r+1);if(void 0!==b)return b}}}catch(e){f=!0,m=e}finally{try{d||null==y.return||y.return()}finally{if(f)throw m}}}}function ax(e){return Object.entries(e).filter(function(e){return"children"!==ac(e,1)[0]}).sort(function(e,t){var r=ac(e,1)[0],n=ac(t,1)[0];return r.localeCompare(n)}).map(function(e){var t=ac(e,2),r=t[0],n=t[1];return" ".concat(r,"=").concat("string"==typeof n?'"'.concat(n,'"'):"{".concat(JSON.stringify(n),"}"))}).join("")}var aD=r(8261),aS=r.n(aD),aT=r(9691),aE=r.n(aT);function aw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1?"move":"default",children:[(0,d.jsx)(P,{icon:r.data.type.toLowerCase(),width:"16px"}),(0,d.jsx)(j.Text,{fontWeight:"500",fontSize:"sm",textTransform:"capitalize",color:"text.muted",display:"inline-block",minWidth:"65px",children:r.data.type}),i,Number(r.id)>=2&&(0,d.jsx)(P,{icon:"cross",width:"11px",marginX:"0.5",marginLeft:"auto",cursor:"pointer",onClick:function(){null==o||o(r)}})]})};function aI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aO(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var n=arguments.length,i=Array(n),o=0;oe.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r ul":{display:"flex",flexDirection:"column",flex:1,marginY:"4","& > li":{display:"flex",flexDirection:"column",flex:1,marginTop:"0"}},ul:{listStyleType:"none"},li:{marginTop:"2"}},children:(0,d.jsx)(n6.Tree,{ref:n,tree:t,rootId:0,render:function(e,r){var n=r.depth,a=r.isDragging;return t.length<=1?(0,d.jsx)(aQ,{}):(0,d.jsx)(aW,{node:e,depth:n,onChange:i,onClose:o,isDragging:a})},insertDroppableFirst:!1,canDrag:function(e){return!!e&&Number(e.id)>=2},canDrop:function(e,t){var r=t.dropTarget,n=t.dropTargetId,i=t.dragSource;return!!n&&null!=i&&!!i.data&&function(e,t){if(!e||!t)return!1;switch(e.type){case"Box":return aA(t);case"Form":return aC(t);case"Field":return aM(t);default:return!1}}(null==r?void 0:r.data,null==i?void 0:i.data)&&(null==r?void 0:r.droppable)&&Number(n)>0},onDrop:function(e){r(e)},initialOpen:!0,sort:!1,extraAcceptTypes:["template"],placeholderRender:function(){return(0,d.jsx)(j.Box,{width:"100%",height:"20px"})}})})},a0=function(e){var t=e.snapName,r=F(nn),n=r&&new Blob([r.value],{type:"image/svg+xml"}),i=n&&URL.createObjectURL(n);return(0,d.jsxs)(j.Box,{position:"relative",children:[(0,d.jsx)(j.Avatar,{src:i,name:t.slice(0,1).toUpperCase(),fontSize:"md",background:"background.alternative",color:"text.alternative",size:"sm",margin:"1"}),(0,d.jsx)(P,{icon:"snap",width:"16px",height:"16px",position:"absolute",bottom:"0px",right:"0px"})]})},a1=function(e){var t=e.snapName,r=e.snapId;return(0,d.jsxs)(j.Flex,{gap:"2",marginX:"4",marginY:"4",border:"1px solid",borderColor:"border.default",borderRadius:"32px",padding:"1",alignItems:"center",children:[(0,d.jsx)(a0,{snapName:t}),(0,d.jsxs)(j.Flex,{direction:"column",justify:"center",children:[(0,d.jsx)(j.Text,{fontSize:"sm",lineHeight:"157%",fontFamily:"custom",children:t}),(0,d.jsx)(j.Text,{fontSize:"xs",lineHeight:"167%",fontFamily:"custom",color:"text.alternative",children:r})]})]})},a2=function(e){var t=e.snapName,r=e.snapId,n=e.children,i=e.showAuthorship;return(0,d.jsxs)(j.Flex,{direction:"column",boxShadow:"lg",maxWidth:"360px",height:"600px",paddingY:"4",overflowY:"scroll",children:[(void 0===i||i)&&(0,d.jsx)(a1,{snapName:t,snapId:r}),n]})};!function(e){e.Content="content",e.Error="error",e.Insights="insights"}(cY||(cY={}));var a3=function(e,t){switch(e){case cY.Insights:return"Insights from ".concat(t);case cY.Error:return"Error from ".concat(t);default:return"Content from ".concat(t)}},a4=function(e){var t=e.type,r=e.snapName,n=e.children,i=t===cY.Error;return(0,d.jsxs)(j.Box,{border:"1px solid",borderColor:"border.default",borderRadius:"md",backgroundColor:i?"error.muted":void 0,children:[(0,d.jsxs)(j.Flex,{direction:"row",alignItems:"center",padding:"1.5",borderBottom:"1px solid",borderColor:"border.default",children:[(0,d.jsx)(P,{icon:i?"snapError":"snap",width:"16px",marginRight:"1"}),(0,d.jsx)(j.Text,{fontFamily:"custom",fontSize:"xs",color:i?"text.error":void 0,children:a3(t,r)})]}),(0,d.jsx)(j.Box,{padding:"3",children:n})]})};function a6(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{let t=sD();sx(!0);try{let r=!1,n=sb(()=>{let t=e();return null!==t&&"object"==typeof t&&"function"==typeof t.then&&(r=!0),t});if(r)return{then:(e,r)=>{n.then(r=>{sx(t),e(r)},e=>{sx(t),r(e)})}};return sx(t),n}catch(e){throw sx(t),e}},sT=function(){return(0,sy.BX)(...arguments)};Object.keys(sy.BX).forEach(e=>{sT[e]=function(){return sy.BX[e](...arguments)}});let sE=sT.mouseEnter,sw=sT.mouseLeave;sT.mouseEnter=function(){return sE(...arguments),sT.mouseOver(...arguments)},sT.mouseLeave=function(){return sw(...arguments),sT.mouseOut(...arguments)};let sA=sT.pointerEnter,sC=sT.pointerLeave;sT.pointerEnter=function(){return sA(...arguments),sT.pointerOver(...arguments)},sT.pointerLeave=function(){return sC(...arguments),sT.pointerOut(...arguments)};let sM=sT.select;sT.select=(e,t)=>{sM(e,t),e.focus(),sT.keyUp(e,t)};let sN=sT.blur,sk=sT.focus;sT.blur=function(){return sT.focusOut(...arguments),sN(...arguments)},sT.focus=function(){return sT.focusIn(...arguments),sk(...arguments)},(0,sy.jQ)({unstable_advanceTimersWrapper:e=>sS(e),asyncWrapper:async e=>{let t=sD();sx(!1);try{let t=await e();return await new Promise(e=>{setTimeout(()=>{e()},0),"undefined"!=typeof jest&&null!==jest&&(!0===setTimeout._isMockFunction||Object.prototype.hasOwnProperty.call(setTimeout,"clock"))&&jest.advanceTimersByTime(0)}),t}finally{sx(t)}},eventWrapper:e=>{let t;return sS(()=>{t=e()}),t}});let sj=new Set,sI=[];function sO(){sI.forEach(e=>{let{root:t,container:r}=e;sS(()=>{t.unmount()}),r.parentNode===document.body&&document.body.removeChild(r)}),sI.length=0,sj.clear()}if((void 0===sg||!sg.env?.RTL_SKIP_AUTO_CLEANUP)&&("function"==typeof afterEach?afterEach(()=>{sO()}):"function"==typeof teardown&&teardown(()=>{sO()}),"function"==typeof beforeAll&&"function"==typeof afterAll)){let e=sD();beforeAll(()=>{e=sD(),sx(!0)}),afterAll(()=>{sx(e)})}var sP=r(3724),sF=r(816),sL=r.n(sF),sz={primary:"primary",destructive:"outline"},sR=function(e){var t,r=e.node,n=e.id;i3(r),(0,_.assert)("Button"===r.type,"Expected value to be a button component.");var i=sm().handleEvent,o=r.props;return(0,d.jsx)(j.Button,{width:"100%",variant:sz[null!==(t=o.variant)&&void 0!==t?t:"primary"],marginBottom:"4",type:o.type,onClick:function(e){o.type===cK.Button&&e.preventDefault(),i({event:cW.ButtonClickEvent,name:o.name})},children:o.children},"".concat(n,"-button"))},sB=function(e){var t=e.node,r=e.id,n=e.form,i=sm(),o=i.handleInputChange,a=i.getValue;i3(t),(0,_.assert)("Input"===t.type,"Expected value to be an input component.");var s=t.props,l=a(s.name,n);return(0,d.jsx)(j.Input,{value:l,type:s.type,placeholder:s.placeholder,onChange:function(e){o(s.name,e.target.value,n)}},"".concat(r,"-input"))},sU={Bold:function(e){var t=e.node,r=e.id;return i3(t),(0,_.assert)("Bold"===t.type,"Expected value to be a bold component."),(0,d.jsx)(j.Text,{fontFamily:"custom",fontSize:"sm",paddingBottom:"1",as:"b",children:sJ(ab(t),r)},"".concat(r,"-text"))},Box:function(e){var t=e.node,r=e.id;return i3(t),(0,_.assert)("Box"===t.type,"Expected value to be a Box component."),(0,d.jsx)(j.Box,{children:ab(t).map(function(e,t){return(0,d.jsx)(sq,{node:e},"".concat(r,"-panel-child-").concat(t))})},r)},Button:sR,Copyable:function(e){var t=e.node,r=e.id;i3(t),(0,_.assert)("Copyable"===t.type,"Expected value to be a copyable component.");var n=t.props;return(0,d.jsx)(a5,{value:n.value},"".concat(r,"-copyable"))},Divider:function(e){var t=e.id;return(0,d.jsx)(j.Divider,{orientation:"horizontal",marginTop:"3",marginBottom:"4",borderColor:"border.default"},"".concat(t,"-divider"))},Field:function(e){var t=e.node,r=e.id,n=e.form;i3(t),(0,_.assert)("Field"===t.type,"Expected value to be a field component.");var i=ab(t),o=i[0],a=i[1],s=t.props;return(0,d.jsxs)(j.FormControl,{isInvalid:!!s.error,children:[s.label&&(0,d.jsx)(j.FormLabel,{children:s.label}),(0,d.jsx)(sB,{id:r,node:o,form:n}),a&&(0,d.jsx)(sR,{id:r,node:a}),(0,d.jsx)(j.FormErrorMessage,{children:s.error})]},"".concat(r,"-field"))},Form:function(e){var t=e.node,r=e.id;i3(t),(0,_.assert)("Form"===t.type,"Expected value to be a form component.");var n=sm().handleEvent,i=t.props;return(0,d.jsx)(j.Box,{as:"form",onSubmit:function(e){e.preventDefault(),n({event:cW.FormSubmitEvent,name:i.name})},children:ab(t).map(function(e,n){return(0,d.jsx)(sq,{node:e,form:t.props.name},"".concat(r,"-form-child-").concat(n))})},r)},Heading:function(e){var t=e.node,r=e.id;i3(t),(0,_.assert)("Heading"===t.type,"Expected value to be a heading component.");var n=t.props;return(0,d.jsx)(j.Heading,{fontFamily:"custom",fontSize:"x-large",fontWeight:"bold",paddingBottom:"4",children:n.children},"".concat(r,"-heading"))},Input:sB,Italic:function(e){var t=e.node,r=e.id;return i3(t),(0,_.assert)("Italic"===t.type,"Expected value to be an italic component."),(0,d.jsx)(j.Text,{fontFamily:"custom",fontSize:"sm",paddingBottom:"1",as:"i",children:sJ(ab(t),r)},r)},Link:function(e){var t=e.node,r=e.id;i3(t),(0,_.assert)("Link"===t.type,"Expected value to be a link component.");var n=t.props;return(0,d.jsxs)(j.Link,{href:n.href,target:"_blank",fontFamily:"custom",fontSize:"sm",isExternal:!0,color:"link.default",display:"inline",children:[sJ(ab(t),r),(0,d.jsx)(P,{icon:"linkOut",width:"14px",marginLeft:"2px",display:"inline",verticalAlign:"middle"})]})},Spinner:function(e){var t=e.id;return(0,d.jsx)(j.Spinner,{},"".concat(t,"-spinner"))},Text:function(e){var t=e.node,r=e.id;return i3(t),(0,_.assert)("Text"===t.type,"Expected value to be a text component."),(0,d.jsx)(j.Text,{fontFamily:"custom",fontSize:"sm",paddingBottom:"1",children:sJ(ab(t),r)},r)},Image:function(e){var t=e.id,r=e.node;i3(r),(0,_.assert)("Image"===r.type,"Expected value to be a image component.");var n=r.props,i="data:image/svg+xml;utf8,".concat(encodeURIComponent(n.src));return(0,d.jsx)(j.Image,{src:i,alt:n.alt},"".concat(t,"-image"))}},sq=function(e){var t=e.node,r=e.form,n=e.map,i=void 0===n?{}:n,o=e.id;if(!t)return null;var a=null!=o?o:sK(i,t),s=sU[t.type];if(!s)throw Error("Unknown component type: ".concat(t.type,"."));return(0,d.jsx)(s,{id:a,node:t,form:r},a)};function sJ(e,t){return e.map(function(e,r){return"string"==typeof e?(0,sP.unescape)(e):(0,d.jsx)(sq,{id:"".concat(t,"-text-child-").concat(r),node:e},"".concat(t,"-text-child-").concat(r))})}var s$=sL()(function(e){var t=e.type,r=e.props.name,n=function(e){if(!ay(e))return null;var t,r=e.props.children;return"string"==typeof r?r.slice(0,5e3):Array.isArray(r)?r.map(function(e){return{type:null!==(t=null==e?void 0:e.type)&&void 0!==t?t:null}}):r}(e);return(0,_.remove0x)((0,_.bytesToHex)(eM(JSON.stringify({type:t,name:null!=r?r:null,children:n}))))});function sK(e,t){var r,n=s$(t),i=(null!==(r=e[n])&&void 0!==r?r:0)+1;return e[n]=i,"".concat(n,"_").concat(i)}var sV=function(e){var t=e.content,r=sK({},t);return(0,d.jsx)(sf,{children:(0,d.jsx)(sq,{node:t,id:r})})};function sY(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["name","onClick"]);return(0,d.jsx)(n0,{cursor:"pointer",onClick:function(){r(n)},children:t})},lO=function(e){var t=e.onClick;return(0,d.jsxs)(j.Box,{marginBottom:"4",children:[(0,d.jsx)(j.Text,{fontWeight:"500",fontSize:"xs",marginBottom:"1",children:"Transaction presets"}),(0,d.jsx)(j.Flex,{gap:"2",children:lj.map(function(e,r){var n,i,o=e.name,a=e.transaction;return(0,m.createElement)(lI,(n=function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var lL={chainId:"eip155:1",origin:"metamask.io",from:"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",to:"0x9f2817015caF6607C1198fB943A8241652EE8906",value:"0.01",gas:"21000",nonce:"5",maxFeePerGas:"10",maxPriorityFeePerGas:"1",data:"0x"},lz=function(){var e,t,r,n,i,o,a,s,l,u,c,p=F(lC).request,_=null!==(c=null==p?void 0:p.params)&&void 0!==c?c:{},f=_.chainId,m=_.transactionOrigin,h=_.transaction;lL.chainId,lL.origin;var y=lF(lL,["chainId","origin"]),g=(0,ls.useForm)({defaultValues:lP({chainId:null!=f?f:lL.chainId,transactionOrigin:null!=m?m:lL.origin},null!=h?h:y)}),b=g.handleSubmit,v=g.register,x=g.setValue,D=g.formState.errors,S=k();return(0,d.jsxs)(j.Flex,{as:"form",flexDirection:"column",flex:"1",onSubmit:b(function(e){var t=e.chainId,r=e.transactionOrigin,n=lF(e,["chainId","transactionOrigin"]);S(r3({origin:"",handler:cM.OnTransaction,request:{jsonrpc:"2.0",method:"onTransaction",params:{chainId:t,transaction:lk(n),transactionOrigin:r}}}))}),id:"request-form",children:[(0,d.jsx)(lO,{onClick:function(e){x("chainId",e.chainId),x("transactionOrigin",e.transactionOrigin),x("from",e.from),x("to",e.to),x("value",e.value),x("data",e.data),x("gas",e.gas),x("maxFeePerGas",e.maxFeePerGas),x("maxPriorityFeePerGas",e.maxPriorityFeePerGas),x("nonce",e.nonce)}}),(0,d.jsxs)(j.Flex,{gap:"2",children:[(0,d.jsxs)(j.FormControl,{isInvalid:!!D.chainId,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"chainId",children:"Chain ID"}),(0,d.jsx)(j.Input,lP({id:"chainId",placeholder:lL.chainId,fontFamily:"code"},v("chainId"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(e=D.chainId)||void 0===e?void 0:e.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.transactionOrigin,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"origin",children:"Transaction Origin"}),(0,d.jsx)(j.Input,lP({id:"origin",placeholder:lL.origin,fontFamily:"code"},v("transactionOrigin"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(t=D.transactionOrigin)||void 0===t?void 0:t.message})]})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.from,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"from",children:"From Address"}),(0,d.jsx)(j.Input,lP({id:"from",placeholder:lL.from,fontFamily:"code"},v("from"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(r=D.from)||void 0===r?void 0:r.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.to,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"to",children:"To Address"}),(0,d.jsx)(j.Input,lP({id:"to",placeholder:lL.to,fontFamily:"code"},v("to"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(n=D.to)||void 0===n?void 0:n.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.value,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"value",children:"Value"}),(0,d.jsxs)(j.InputGroup,{children:[(0,d.jsx)(j.Input,lP({id:"value",placeholder:lL.value,fontFamily:"code"},v("value"))),(0,d.jsx)(j.InputRightAddon,{children:"ETH",fontSize:"sm"})]}),(0,d.jsx)(j.FormErrorMessage,{children:null===(i=D.value)||void 0===i?void 0:i.message})]}),(0,d.jsxs)(j.Flex,{gap:"2",children:[(0,d.jsxs)(j.FormControl,{isInvalid:!!D.gas,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"gas",children:"Gas Limit"}),(0,d.jsx)(j.Input,lP({id:"gas",placeholder:lL.gas,fontFamily:"code"},v("gas"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(o=D.gas)||void 0===o?void 0:o.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.nonce,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"nonce",children:"Nonce"}),(0,d.jsx)(j.Input,lP({id:"nonce",placeholder:lL.nonce,fontFamily:"code"},v("nonce"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(a=D.nonce)||void 0===a?void 0:a.message})]})]}),(0,d.jsxs)(j.Flex,{gap:"2",children:[(0,d.jsxs)(j.FormControl,{isInvalid:!!D.maxFeePerGas,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"maxFeePerGas",children:"Max Fee Per Gas"}),(0,d.jsxs)(j.InputGroup,{children:[(0,d.jsx)(j.Input,lP({id:"maxFeePerGas",placeholder:lL.maxFeePerGas,fontFamily:"code"},v("maxFeePerGas"))),(0,d.jsx)(j.InputRightAddon,{children:"GWEI",fontSize:"sm"})]}),(0,d.jsx)(j.FormErrorMessage,{children:null===(s=D.maxFeePerGas)||void 0===s?void 0:s.message})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.maxPriorityFeePerGas,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"maxPriorityFeePerGas",children:"Max Priority Fee Per Gas"}),(0,d.jsxs)(j.InputGroup,{children:[(0,d.jsx)(j.Input,lP({id:"maxPriorityFeePerGas",placeholder:lL.maxPriorityFeePerGas,fontFamily:"code"},v("maxPriorityFeePerGas"))),(0,d.jsx)(j.InputRightAddon,{children:"GWEI",fontSize:"sm"})]}),(0,d.jsx)(j.FormErrorMessage,{children:null===(l=D.maxPriorityFeePerGas)||void 0===l?void 0:l.message})]})]}),(0,d.jsxs)(j.FormControl,{isInvalid:!!D.data,children:[(0,d.jsx)(j.FormLabel,{htmlFor:"data",children:"Data"}),(0,d.jsx)(j.Textarea,lP({id:"data",placeholder:lL.data,fontFamily:"code"},v("data"))),(0,d.jsx)(j.FormErrorMessage,{children:null===(u=D.data)||void 0===u?void 0:u.message})]})]})},lR=(0,h.createHashRouter)((0,h.createRoutesFromElements)((0,d.jsxs)(h.Route,{element:(0,d.jsx)(function(){return(0,d.jsxs)(j.Flex,{direction:"column",height:"100vh",children:[(0,d.jsx)(nf,{}),(0,d.jsxs)(j.Flex,{direction:"row",flex:"1",overflow:"hidden",children:[(0,d.jsx)(nP,{}),(0,d.jsxs)(j.Flex,{direction:"column",width:"full",children:[(0,d.jsx)(j.Flex,{flex:"1",overflow:"hidden",children:(0,d.jsx)(h.Outlet,{})}),(0,d.jsx)(V,{})]})]})]})},{}),children:[(0,d.jsx)(h.Route,{path:"/",element:(0,d.jsx)(h.Navigate,{to:"/handler/".concat(cM.OnRpcRequest),replace:!0})}),(0,d.jsx)(h.Route,{path:"/builder",element:(0,d.jsx)(function(){var e,t,r=sX((0,m.useState)(2),2),n=r[0],i=r[1],o=sX((0,m.useState)([{id:1,parent:0,text:"Box",droppable:!0,data:nz({children:null})}]),2),a=o[0],s=o[1];return(0,d.jsx)(j.Flex,{width:"100%",direction:"column",overflow:"hidden",children:(0,d.jsxs)(j.Flex,{direction:"row",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.Flex,{direction:"column",flex:"1",width:"50%",overflow:"hidden",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabList,{children:(0,d.jsx)(j.Tab,{children:"Builder"})}),(0,d.jsx)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:(0,d.jsxs)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",overflowY:"auto",children:[(0,d.jsx)(n4,{nextId:n,incrementId:function(){i(function(e){return e+1})}}),(0,d.jsx)(aX,{items:a,setItems:s})]})})]})}),(0,d.jsx)(j.Box,{display:"flex",flexDirection:"column",flex:"1",width:"50%",borderLeft:"1px solid",borderColor:"border.default",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsxs)(j.TabList,{children:[(0,d.jsx)(j.Tab,{children:"Result"}),(0,d.jsx)(j.Tab,{children:"Code"})]}),(0,d.jsxs)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"4",children:(0,d.jsx)(sG,{items:a})}),(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"0",children:(0,d.jsx)(nJ,{border:"none",value:(t=(function e(t){var r=new Set;r.add(t.type);var n=ab(t),i=!0,o=!1,a=void 0;try{for(var s,l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;if("string"!=typeof u&&(r.add(u.type),ay(t))){var c=e(u),p=!0,d=!1,_=void 0;try{for(var f,m=c[Symbol.iterator]();!(p=(f=m.next()).done);p=!0){var h=f.value;r.add(h)}}catch(e){d=!0,_=e}finally{try{p||null==m.return||m.return()}finally{if(d)throw _}}}}}catch(e){o=!0,a=e}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return Array.from(r).sort(function(e,t){return e.localeCompare(t)})})(e=ak(a)).join(", "),aE().format("\n import { ".concat(t," } from '@metamask/snaps-sdk/jsx';\n\n const Component = () => (").concat(function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(Array.isArray(t))return t.map(function(t){return e(t,r)}).join("");var n=" ".repeat(r);if("string"==typeof t)return"".concat(n).concat(t,"\n");if(!t)return"";var i=t.type,o=t.props,a=r>0?"\n":"";if((0,_.hasProperty)(o,"children")){var s=e(o.children,r+1);return"".concat(n,"<").concat(i).concat(ax(o),">\n").concat(s).concat(n,"").concat(i,">").concat(a)}return"".concat(n,"<").concat(i).concat(ax(o)," />").concat(a)}(e),");\n"),{parser:"typescript",plugins:[aS()],printWidth:80,tabWidth:2,singleQuote:!0,trailingComma:"all"})),language:"typescript",options:{readOnly:!0}})})]})]})})]})})},{})}),(0,d.jsx)(h.Route,{path:"/manifest",element:(0,d.jsx)(function(){var e=F(nl);return(0,d.jsx)(j.Flex,{width:"100%",direction:"column",overflow:"hidden",children:(0,d.jsxs)(j.Flex,{direction:"row",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.Flex,{direction:"column",flex:"1",width:"50%",overflow:"hidden",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabList,{children:(0,d.jsx)(j.Tab,{children:"Validation"})}),(0,d.jsx)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"0",children:(0,d.jsx)(s2,{})})})]})}),(0,d.jsx)(j.Box,{display:"flex",flexDirection:"column",flex:"1",width:"50%",borderLeft:"1px solid",borderColor:"border.default",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabList,{children:(0,d.jsx)(j.Tab,{children:"Manifest"})}),(0,d.jsx)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"0",children:(0,d.jsx)(nJ,{border:"none",value:JSON.stringify(e,null,2),options:{readOnly:!0,wordWrap:"on"}})})})]})})]})})},{})}),(0,d.jsxs)(h.Route,{path:"/handler",element:(0,d.jsx)(function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,m.useState)(0))||function(e,t){var r,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,s=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,n=e}finally{try{a||null==i.return||i.return()}finally{if(s)throw n}}return o}}(e,2)||function(e,t){if(e){if("string"==typeof e)return lc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lc(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],n=t[1],i=F(ni);return(0,d.jsx)(j.Flex,{width:"100%",direction:"column",overflow:"hidden",children:(0,d.jsxs)(j.Flex,{direction:"row",flex:"1",overflow:"hidden",children:[(0,d.jsx)(s3,{isTest:!1,children:(0,d.jsx)(j.Flex,{direction:"column",flex:"1",width:"50%",overflow:"hidden",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",isLazy:!0,onChange:n,children:[(0,d.jsx)(lr,{}),(0,d.jsxs)(j.TabList,{alignItems:"center",children:[(0,d.jsx)(j.Tab,{children:"Request"}),(0,d.jsx)(j.Tab,{children:"History"}),0===r&&(0,d.jsx)(j.Box,{marginLeft:"auto",children:(0,d.jsx)(lt,{})})]}),(0,d.jsxs)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",overflowY:"auto","data-testid":"tab-request",children:(0,d.jsx)(h.Outlet,{})}),(0,d.jsx)(j.TabPanel,{padding:"0",display:"flex",flexDirection:"column",flex:"1",overflowY:"auto",children:(0,d.jsx)(s7,{})})]})]})})}),(0,d.jsx)(j.Box,{display:"flex",flexDirection:"column",flex:"1",width:"50%",borderLeft:"1px solid",borderColor:"border.default",children:(0,d.jsxs)(j.Tabs,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(lr,{}),(0,d.jsx)(ln,{}),(0,d.jsxs)(j.TabList,{children:[(0,d.jsx)(j.Tab,{children:"Response"}),i&&(0,d.jsx)(j.Tab,{children:"UI"})]}),(0,d.jsxs)(j.TabPanels,{display:"flex",flexDirection:"column",flex:"1",overflow:"hidden",children:[(0,d.jsx)(j.TabPanel,{display:"flex",flexDirection:"column",flex:"1",padding:"0","data-testid":"tab-response",children:(0,d.jsx)(li,{})}),i&&(0,d.jsx)(j.TabPanel,{overflowY:"auto","data-testid":"tab-ui",children:(0,d.jsx)(lu,{})})]})]})})]})})},{}),children:[(0,d.jsx)(h.Route,{path:"/handler/".concat(cM.OnRpcRequest),element:(0,d.jsx)(function(){return(0,d.jsx)(lh,{})},{})}),(0,d.jsx)(h.Route,{path:"/handler/".concat(cM.OnCronjob),element:(0,d.jsx)(function(){return(0,d.jsx)(lT,{})},{})}),(0,d.jsx)(h.Route,{path:"/handler/".concat(cM.OnTransaction),element:(0,d.jsx)(function(){return(0,d.jsx)(lz,{})},{})})]})]})));function lB(e){for(var t=1;t1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n2?r-2:0),i=2;i2?i-2:0),a=2;a2?r-2:0),i=2;i1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:ca(e)?2:cs(e)?3:0}function ci(e,t){return 2===cn(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function co(e,t,r){var n=cn(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function ca(e){return c6&&e instanceof Map}function cs(e){return c5&&e instanceof Set}function cl(e){return e.o||e.t}function cu(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=pn(e);delete t[pe];for(var r=pr(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=cp),Object.freeze(e),t&&cr(e,function(e,t){return cc(t,!0)},!0)),e}function cp(){u9(2)}function cd(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function c_(e){var t=pi[e];return t||u9(18,e),t}function cf(e,t){t&&(c_("Patches"),e.u=[],e.s=[],e.v=t)}function cm(e){ch(e),e.p.forEach(cg),e.p=null}function ch(e){e===c3&&(c3=e.l)}function cy(e){return c3={p:[],l:c3,h:e,m:!0,_:0}}function cg(e){var t=e[pe];0===t.i||1===t.i?t.j():t.g=!0}function cb(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.O||c_("ES5").S(t,e,n),n?(r[pe].P&&(cm(t),u9(4)),ct(e)&&(e=cv(t,e),t.l||cD(t,e)),t.u&&c_("Patches").M(r[pe].t,e,t.u,t.s)):e=cv(t,r,[]),cm(t),t.u&&t.v(t.u,t.s),e!==c7?e:void 0}function cv(e,t,r){if(cd(t))return t;var n=t[pe];if(!n)return cr(t,function(i,o){return cx(e,n,t,i,o,r)},!0),t;if(n.A!==e)return t;if(!n.P)return cD(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=4===n.i||5===n.i?n.o=cu(n.k):n.o,o=i,a=!1;3===n.i&&(o=new Set(i),i.clear(),a=!0),cr(o,function(t,o){return cx(e,n,i,t,o,r,a)}),cD(e,i,!1),r&&e.u&&c_("Patches").N(n,r,e.u,e.s)}return n.o}function cx(e,t,r,n,i,o,a){if(ce(i)){var s=cv(e,i,o&&t&&3!==t.i&&!ci(t.R,n)?o.concat(n):void 0);if(co(r,n,s),!ce(s))return;e.m=!1}else a&&r.add(i);if(ct(i)&&!cd(i)){if(!e.h.D&&e._<1)return;cv(e,i),t&&t.A.l||cD(e,i)}}function cD(e,t,r){void 0===r&&(r=!1),!e.l&&e.h.D&&e.m&&cc(t,r)}function cS(e,t){var r=e[pe];return(r?cl(r):e)[t]}function cT(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function cE(e){e.P||(e.P=!0,e.l&&cE(e.l))}function cw(e){e.o||(e.o=cu(e.t))}function cA(e,t,r){var n,i,o,a,s,l,u,c=ca(t)?c_("MapSet").F(t,r):cs(t)?c_("MapSet").T(t,r):e.O?(o=i={i:(n=Array.isArray(t))?1:0,A:r?r.A:c3,P:!1,I:!1,R:{},l:r,t:t,k:null,o:null,j:null,C:!1},a=po,n&&(o=[i],a=pa),l=(s=Proxy.revocable(o,a)).revoke,u=s.proxy,i.k=u,i.j=l,u):c_("ES5").J(t,r);return(r?r.A:c3).p.push(c),c}function cC(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return cu(e)}!function(e){e.Insight="Insight",e.Dialog="Dialog",e.Notification="Notification",e.HomePage="HomePage"}(c1||(c1={}));var cM,cN,ck,cj,cI,cO,cP,cF,cL,cz,cR,cB,cU,cq,cJ,c$,cK,cV,cY,cW,cQ,cH,cG,cZ,cX,c0,c1,c2,c3,c4="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),c6="undefined"!=typeof Map,c5="undefined"!=typeof Set,c8="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,c7=c4?Symbol.for("immer-nothing"):((c2={})["immer-nothing"]=!0,c2),c9=c4?Symbol.for("immer-draftable"):"__$immer_draftable",pe=c4?Symbol.for("immer-state"):"__$immer_state",pt=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),pr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,pn=Object.getOwnPropertyDescriptors||function(e){var t={};return pr(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},pi={},po={get:function(e,t){if(t===pe)return e;var r,n,i=cl(e);if(!ci(i,t))return(n=cT(i,t))?"value"in n?n.value:null===(r=n.get)||void 0===r?void 0:r.call(e.k):void 0;var o=i[t];return e.I||!ct(o)?o:o===cS(e.t,t)?(cw(e),e.o[t]=cA(e.A.h,o,e)):o},has:function(e,t){return t in cl(e)},ownKeys:function(e){return Reflect.ownKeys(cl(e))},set:function(e,t,r){var n=cT(cl(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=cS(cl(e),t),o=null==i?void 0:i[pe];if(o&&o.t===r)return e.o[t]=r,e.R[t]=!1,!0;if((r===i?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==r||ci(e.t,t)))return!0;cw(e),cE(e)}return e.o[t]===r&&(void 0!==r||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==cS(e.t,t)||t in e.t?(e.R[t]=!1,cw(e),cE(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=cl(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){u9(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){u9(12)}},pa={};cr(po,function(e,t){pa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),pa.deleteProperty=function(e,t){return pa.set.call(this,e,t,void 0)},pa.set=function(e,t,r){return po.set.call(this,e[0],t,r,e[0])};var ps=new(function(){function e(e){var t=this;this.O=c8,this.D=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var i,o=r;return r=e,function(e){var n=this;void 0===e&&(e=o);for(var i=arguments.length,a=Array(i>1?i-1:0),s=1;s1?n-1:0),o=1;o=0;r--){var r,n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var i=c_("Patches").$;return ce(e)?i(e,t):this.produce(e,function(e){return i(e,t)})},e}());ps.produce,ps.produceWithPatches.bind(ps),ps.setAutoFreeze.bind(ps),ps.setUseProxies.bind(ps),ps.applyPatches.bind(ps),ps.createDraft.bind(ps),ps.finishDraft.bind(ps);let pl=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function pu(e){var t;return(0,_.isPlainObject)(e)&&(0,_.hasProperty)(e,"type")&&(0,_.hasProperty)(e,"props")&&(0,_.hasProperty)(e,"key")?e:(t=function e(t){switch(t.type){case cq.Panel:return t.children.reduce(function(t,r){return t+e(r)},0);case cq.Row:return e(t.value);case cq.Text:return t.value.length;default:return 0}}(e),(0,_.assert)(t<=5e4,"The text in a Snap UI may not be larger than ".concat(50," kB.")),function e(t){switch(t.type){case cq.Address:return i4(oe,{address:t.value});case cq.Button:return i4(nQ,{name:t.name,variant:function(e){switch(e){case"primary":return"primary";case"secondary":return"destructive";default:return}}(t.variant),type:t.buttonType,children:t.value});case cq.Copyable:return i4(nY,{value:t.value,sensitive:t.sensitive});case cq.Divider:return i4(nV,{});case cq.Form:return i4(nH,{name:t.name,children:a_(t.children.map(e))});case cq.Heading:return i4(n$,{children:t.value});case cq.Image:return i4(nW,{src:t.value});case cq.Input:return i4(nG,{label:t.label,error:t.error,children:i4(nZ,{name:t.name,type:t.inputType,value:t.value,placeholder:t.placeholder})});case cq.Panel:return i4(nz,{children:a_(t.children.map(e))});case cq.Row:return i4(ot,{label:t.label,variant:t.variant,children:e(t.value)});case cq.Spinner:return i4(or,{});case cq.Text:var r,n;return i4(nK,{children:a_((r=ai(t.value,{gfm:!1}),n=[],an(r,function(e){if("paragraph"===e.type){n.length>0&&n.push("\n\n");var t,r=e.tokens;n.push.apply(n,function(e){if(Array.isArray(e))return au(e)}(t=r.flatMap(am))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||ap(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}),n.filter(function(e){return null!==e})))});default:return(0,_.assertExhaustive)(t)}}(e))}function pc(e,t){(0,_.assert)(void 0===e[t],'Duplicate component names are not allowed, found multiple instances of: "'.concat(t,'".'))}function pp(e,t,r){var n,i,o,a=r?e[r]:e,s=null==a?void 0:a[t.props.name];return"FileInput"===t.type?null!=s?s:null:null!==(o=null!==(i=null!==(n="Checkbox"===t.type?t.props.checked:t.props.value)&&void 0!==n?n:s)&&void 0!==i?i:function(e){var t,r,n;switch(e.type){case"Dropdown":return null===(t=ab(e)[0])||void 0===t?void 0:t.props.value;case"RadioGroup":return null===(r=ab(e)[0])||void 0===r?void 0:r.props.value;case"Selector":return null===(n=ab(e)[0])||void 0===n?void 0:n.props.value;case"Checkbox":return!1;default:return null}}(t))&&void 0!==o?o:null}function pd(e,t){var r={},n=[];return av(t,function(t,i){var o=n[n.length-1];if(o&&i<=o.depth&&(n.pop(),o=n[n.length-1]),"Form"===t.type){pc(r,t.props.name),n.push({name:t.props.name,depth:i}),r[t.props.name]={};return}if(o&&("Input"===t.type||"Dropdown"===t.type||"RadioGroup"===t.type||"FileInput"===t.type||"Checkbox"===t.type||"Selector"===t.type)){var a=r[o.name];pc(a,t.props.name),a[t.props.name]=pp(e,t,o.name);return}("Input"===t.type||"Dropdown"===t.type||"RadioGroup"===t.type||"FileInput"===t.type||"Checkbox"===t.type||"Selector"===t.type)&&(pc(r,t.props.name),r[t.props.name]=pp(e,t))}),r}function p_(e){if(e){var t=e7(e);(0,_.assert)(t<=1e6,"A Snap interface context may not be larger than ".concat(1," MB."))}}function pf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=-32099&&e<=-32e3)return"Unspecified server error."}return t}function p6(e){return Object.getOwnPropertyNames(e).reduce((t,r)=>{let n=e[r];return(0,_.isValidJson)(n)&&(t[r]=n),t},{})}p4(p3);let p5=function(e){return e?.__esModule?e.default:e}(p0());class p8 extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a non-empty string.');(function(e){return(0,_.isObject)(e)&&(0,_.hasProperty)(e,"cause")&&(0,_.isObject)(e.cause)})(r)?(super(t,{cause:r.cause}),(0,_.hasProperty)(this,"cause")||Object.assign(this,{cause:r.cause})):super(t),void 0!==r&&(this.data=r),this.code=e}serialize(){var e;let t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data,(0,_.isPlainObject)(this.data)&&(t.data.cause=Array.isArray(e=this.data.cause)?e.map(e=>(0,_.isValidJson)(e)?e:(0,_.isObject)(e)?p6(e):null):(0,_.isObject)(e)?p6(e):(0,_.isValidJson)(e)?e:null)),this.stack&&(t.stack=this.stack),t}toString(){return p5(this.serialize(),p9,2)}}class p7 extends p8{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function p9(e,t){if("[Circular]"!==t)return t}function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1?r-1:0),i=1;i=0,TypeError("Can't start a timer with negative time")),this.state={value:"stopped",remaining:e}}return e=[{key:"status",get:function(){return this.state.value}},{key:"remaining",get:function(){return this.state.remaining}},{key:"cancel",value:function(){(0,_.assert)("paused"===this.status||"running"===this.status,Error("Tried to cancel a not running Timer")),this.onFinish(!1)}},{key:"finish",value:function(){(0,_.assert)("finished"!==this.status,Error("Tried to finish a finished Timer.")),this.onFinish(!0)}},{key:"pause",value:function(){(0,_.assert)("running"===this.state.value,Error("Tried to pause a not running Timer"));var e=this.state,t=e.callback,r=e.start,n=e.timeout,i=e.remaining;void 0!==n&&clearTimeout(n),this.state={value:"paused",callback:t,remaining:i-(Date.now()-r)}}},{key:"start",value:function(e){(0,_.assert)("stopped"===this.state.value,Error("Tried to start an already running Timer"));var t=this.state.remaining;this.state={value:"paused",remaining:t,callback:e},this.resume()}},{key:"resume",value:function(){var e,t=this;(0,_.assert)("paused"===this.state.value,Error("Tried to resume not paused Timer"));var r=this.state,n=r.remaining,i=r.callback,o=Date.now();n!==Number.POSITIVE_INFINITY&&(e=setTimeout(function(){return t.onFinish(!0)},n)),this.state={value:"running",callback:i,remaining:n,start:o,timeout:e}}},{key:"onFinish",value:function(e){(0,_.assert)("running"===this.state.value||"paused"===this.state.value),"running"===this.state.value&&void 0!==this.state.timeout&&clearTimeout(this.state.timeout);var t=this.state,r=t.callback,n=t.remaining;this.state={value:"finished",remaining:"running"===this.state.value?n-(Date.now()-this.state.start):n},e&&r()}}],di(r.prototype,e),t&&di(r,t),r}();function ds(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function dl(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){ds(o,n,i,a,s,"next",e)}function s(e){ds(o,n,i,a,s,"throw",e)}a(void 0)})}}function du(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]dX(p1.rpc.parse,e),invalidRequest:e=>dX(p1.rpc.invalidRequest,e),invalidParams:e=>dX(p1.rpc.invalidParams,e),methodNotFound:e=>dX(p1.rpc.methodNotFound,e),internal:e=>dX(p1.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code <= -32005');return dX(t,e)},invalidInput:e=>dX(p1.rpc.invalidInput,e),resourceNotFound:e=>dX(p1.rpc.resourceNotFound,e),resourceUnavailable:e=>dX(p1.rpc.resourceUnavailable,e),transactionRejected:e=>dX(p1.rpc.transactionRejected,e),methodNotSupported:e=>dX(p1.rpc.methodNotSupported,e),limitExceeded:e=>dX(p1.rpc.limitExceeded,e)},dZ={userRejectedRequest:e=>d0(p1.provider.userRejectedRequest,e),unauthorized:e=>d0(p1.provider.unauthorized,e),unsupportedMethod:e=>d0(p1.provider.unsupportedMethod,e),disconnected:e=>d0(p1.provider.disconnected,e),chainDisconnected:e=>d0(p1.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw Error('"message" must be a nonempty string');return new p7(t,r,n)}};function dX(e,t){let[r,n]=d1(t);return new p8(e,r??p4(e),n)}function d0(e,t){let[r,n]=d1(t);return new p7(e,r??p4(e),n)}function d1(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t??void 0,r]}}return[]}function d2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,["maxRequestTime"]));return a?(n=function(e){for(var t=1;t0),{caveats:t}})),_N(o,_a.targetName,d6(function(e){return{caveats:[{type:ck.KeyringOrigin,value:e}]}})),_N(o,_S.targetName,d6(function(e){return!e||!(0,_.isObject)(e)||(0,_.isObject)(e)&&0===Object.keys(e).length?{caveats:null}:{caveats:[{type:ck.SignatureOrigin,value:(0,_.hasProperty)(e,"allowSignatureOrigin")&&e.allowSignatureOrigin}]}})),_N(o,_u.targetName,d4),_N(o,_i.targetName,d4),_N(o,_x.targetName,d4),o);_N(a={},cM.OnRpcRequest,_g.targetName),_N(a,cM.OnTransaction,_w.targetName),_N(a,cM.OnCronjob,d9.targetName),_N(a,cM.OnNameLookup,_d.targetName),_N(a,cM.OnInstall,_u.targetName),_N(a,cM.OnUpdate,_u.targetName),_N(a,cM.OnKeyringRequest,_a.targetName),_N(a,cM.OnHomePage,_i.targetName),_N(a,cM.OnSettingsPage,_x.targetName),_N(a,cM.OnSignature,_S.targetName),_N(a,cM.OnUserInput,null);let _O=BigInt(4294967296-1),_P=BigInt(32),_F=(e,t,r)=>e<>>32-r,_L=(e,t,r)=>t<>>32-r,_z=(e,t,r)=>t<>>64-r,_R=(e,t,r)=>e<>>64-r,_B=[],_U=[],_q=[],_J=BigInt(0),_$=BigInt(1),_K=BigInt(2),_V=BigInt(7),_Y=BigInt(256),_W=BigInt(113);for(let e=0,t=_$,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],_B.push(2*(5*n+r)),_U.push((e+1)*(e+2)/2%64);let i=_J;for(let e=0;e<7;e++)(t=(t<<_$^(t>>_V)*_W)%_Y)&_K&&(i^=_$<<(_$<>_P&_O)}:{h:0|Number(e>>_P&_O),l:0|Number(e&_O)}}(e[i],t);[r[i],n[i]]=[o,a]}return[r,n]}(_q,!0),_G=(e,t,r)=>r>32?_z(e,t,r):_F(e,t,r),_Z=(e,t,r)=>r>32?_R(e,t,r):_L(e,t,r);class _X extends ev{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,eu(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=e_(this.state)}keccak(){eh||eg(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,o=r[i],a=r[i+1],s=_G(o,a,1)^r[n],l=_Z(o,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=s,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=_U[r],o=_G(t,i,n),a=_Z(t,i,n),s=_B[r];t=e[s],i=e[s+1],e[s]=o,e[s+1]=a}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=_Q[n],e[1]^=_H[n]}r.fill(0)}(this.state32,this.rounds),eh||eg(this.state32),this.posOut=0,this.pos=0}update(e){ep(this);let{blockLen:t,state:r}=this;e=eb(e);let n=e.length;for(let i=0;i=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return eu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ed(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new _X(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}let _0=ex(()=>new _X(136,1,32));function _1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>0;t.push("bip32:".concat(i-2147483648,"'"))}return t}(_0((0,_.concatBytes)([s,_0(l)]))),[4,e9.SLIP10Node.fromDerivationPath({derivationPath:[i,"bip32:".concat(o)].concat(_4(u)),curve:"secp256k1"},a)];case 1:return c=p.sent().privateKey,(0,_.assert)(c,"Failed to derive the entropy."),[2,(0,_.add0x)(c)]}})})).apply(this,arguments)}function _9(e){return fe.apply(this,arguments)}function fe(){return(fe=_3(function(e){var t,r,n,i,o;return _6(this,function(a){switch(a.label){case 0:return t=e.curve,r=e.secretRecoveryPhrase,n=e.path,i=e.cryptographicFunctions,o=function(e){switch(e){case"secp256k1":return"bip32";case"ed25519":return"slip10";case"ed25519Bip32":return"cip3";default:return(0,_.assertExhaustive)(e)}}(t),[4,e9.SLIP10Node.fromDerivationPath({curve:t,derivationPath:[r].concat(_4(n.slice(1).map(function(e){return"".concat(o,":").concat(e)})))},i)];case 1:return[2,a.sent()]}})})).apply(this,arguments)}var ft=(0,H.refine)((0,H.string)(),"state key",function(e){return!!(void 0===e||e.split(".").every(function(e){return e.length>0}))||"Invalid state key. Each part of the key must be non-empty."});function fr(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}var fn="snap_getBip32Entropy",fi=Object.freeze({targetName:fn,specificationBuilder:function(e){var t,r,n,i,o,a=e.methodHooks;return{permissionType:ts.PermissionType.RestrictedMethod,targetName:fn,allowedCaveats:[ck.PermittedDerivationPaths],methodImplementation:(n=a.getMnemonic,i=a.getUnlockPromise,o=a.getClientCryptography,t=function(e){var t,r;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2147483647)throw dG.invalidParams({message:'Invalid "coinType" parameter. Coin type must be a non-negative integer.'});if(tL.includes(e.coinType))throw dG.invalidParams({message:"Coin type ".concat(e.coinType," is forbidden.")})}var fv=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},ck.PermittedCoinTypes,Object.freeze({type:ck.PermittedCoinTypes,decorator:function(e,t){var r,n;return r=function(r){var n;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2&&void 0!==arguments[2]?arguments[2]:104857600;if(!(0,_.isObject)(e))throw dG.invalidParams({message:"Expected params to be a single object."});var i=e.operation,o=e.newState,a=e.encrypted;if(!i||"string"!=typeof i||!Object.values(u).includes(i))throw dG.invalidParams({message:'Must specify a valid manage state "operation".'});if(void 0!==a&&"boolean"!=typeof a)throw dG.invalidParams({message:'"encrypted" parameter must be a boolean if specified.'});if(i===u.UpdateState){if(!(0,_.isObject)(o))throw dG.invalidParams({message:"Invalid ".concat(t,' "updateState" parameter: The new state must be a plain object.'),data:{receivedNewState:void 0===o?"undefined":o}});try{r=(0,_.getJsonSize)(o)}catch(e){throw dG.invalidParams({message:"Invalid ".concat(t,' "updateState" parameter: The new state must be JSON serializable.'),data:{receivedNewState:void 0===o?"undefined":o}})}if(r>n)throw dG.invalidParams({message:"Invalid ".concat(t,' "updateState" parameter: The new state must not exceed ').concat(n," bytes in size."),data:{receivedNewState:void 0===o?"undefined":o}})}return e}(r,s)).encrypted)||void 0===p||p)&&c.operation!==u.ClearState))return[3,2];return[4,n(!0)];case 1:f.sent(),f.label=2;case 2:switch(c.operation){case u.ClearState:return[3,3];case u.GetState:return[3,4];case u.UpdateState:return[3,6]}return[3,8];case 3:return i(l,d),[2,null];case 4:return[4,o(l,d)];case 5:return[2,f.sent()];case 6:return[4,a(l,c.newState,d)];case 7:return f.sent(),[2,null];case 8:throw dG.invalidParams("Invalid ".concat(s,' operation: "').concat(c.operation,'"'));case 9:return[2]}})},r=function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(e){f5(o,n,i,a,s,"next",e)}function s(e){f5(o,n,i,a,s,"throw",e)}a(void 0)})},function(e){return r.apply(this,arguments)}),subjectTypes:[ts.SubjectType.Snap]}},methodHooks:{getUnlockPromise:!0,clearSnapState:!0,getSnapState:!0,updateSnapState:!0}});function f9(e){return(0,_.isObject)(e)&&(0,_.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:String(e)}function me(e){if((0,_.isObject)(e)&&(0,_.hasProperty)(e,"stack")&&"string"==typeof e.stack)return e.stack}function mt(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}var mr="snap_notify",mn=(0,H.object)({type:tE(cG.Native),message:(0,H.string)()}),mi=tw([(0,H.object)({type:tE(cG.InApp),message:(0,H.string)()}),(0,H.object)({type:tE(cG.InApp),message:(0,H.string)(),content:u8,title:(0,H.string)(),footerLink:(0,H.optional)((0,H.object)({href:(0,H.string)(),text:(0,H.string)()}))}),mn]),mo=Object.freeze({targetName:mr,specificationBuilder:function(e){var t,r,n,i,o,a,s,l,u=e.allowedCaveats,c=e.methodHooks;return{permissionType:ts.PermissionType.RestrictedMethod,targetName:mr,allowedCaveats:void 0===u?null:u,methodImplementation:(n=c.showNativeNotification,i=c.showInAppNotification,o=c.isOnPhishingList,a=c.maybeUpdatePhishingList,s=c.createInterface,l=c.getSnap,t=function(e){var t,r,u,c;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=50))throw dG.invalidParams({message:'Must specify a non-empty string "message" less than 50 characters long.'});if(n===cG.InApp&&(o||i.length>=500))throw dG.invalidParams({message:'Must specify a non-empty string "message" less than 500 characters long.'});try{var a=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,_.assert)(t.schema,"Expected a struct with a schema. Make sure to use `union` from `@metamask/snaps-sdk`."),(0,_.assert)(t.schema.length>0,"Expected a non-empty array of structs.");var i=t.schema.map(function(e){return e.schema[r]}),o=(0,H.type)(tk({},r,tw(i))),a=tj((0,H.validate)(e,o,{coerce:n}),1)[0];if(a)throw Error(tO(o,a.failures()[0],!1));var s=t.schema.filter(function(t){return(0,H.is)(e[r],t.schema[r])});(0,_.assert)(s.length>0,"Expected a struct to match the value.");var l=s.map(function(t){return(0,H.validate)(e,t,{coerce:n})}),u=l.find(function(e){return!tj(e,1)[0]});if(u)return u[1];throw(0,_.assert)(l[0][0],"Expected at least one error."),Error(tO(t,l.reduce(function(e,t){var r=tj(t,1)[0];return((0,_.assert)(r,"Expected an error."),r.failures().lengthe.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0?_:1e3+_))/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let hM={},hN={};function hk(e,t={}){let r=JSON.stringify([e,t]),n=hN[r];return n||(n=new Intl.DateTimeFormat(e,t),hN[r]=n),n}let hj={},hI={},hO=null,hP={};function hF(e,t,r,n){let i=e.listingMode();return"error"===i?null:"en"===i?r(t):n(t)}class hL{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;let{padTo:n,floor:i,...o}=r;if(!t||Object.keys(o).length>0){let t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){let r=JSON.stringify([e,t]),n=hj[r];return n||(n=new Intl.NumberFormat(e,t),hj[r]=n),n}(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}{let t=this.floor?Math.floor(e):yS(e,3);return yb(t,this.padTo)}}}class hz{constructor(e,t,r){let n;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){let t=-1*(e.offset/60),r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&hC.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||n,this.dtf=hk(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"!==e.type)return e;{let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class hR{constructor(e,t,r){this.opts={style:"long",...r},!t&&y_()&&(this.rtf=function(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),o=hI[i];return o||(o=new Intl.RelativeTimeFormat(e,t),hI[i]=o),o}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&o){let r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${i[e][0]}`;case -1:return r?"yesterday":`last ${i[e][0]}`;case 0:return r?"today":`this ${i[e][0]}`}}let a=Object.is(t,-0)||t<0,s=Math.abs(t),l=1===s,u=i[e],c=n?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return a?`${s} ${c} ago`:`in ${s} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}let hB={firstDay:1,minimalDays:4,weekend:[6,7]};class hU{static fromOpts(e){return hU.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,i=!1){let o=e||h6.defaultLocale,a=o||(i?"en-US":hO||(hO=new Intl.DateTimeFormat().resolvedOptions().locale)),s=t||h6.defaultNumberingSystem,l=r||h6.defaultOutputCalendar,u=yy(n)||h6.defaultWeekSettings;return new hU(a,s,l,u,o)}static resetCache(){hO=null,hN={},hj={},hI={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return hU.create(e,t,r,n)}constructor(e,t,r,n,i){let[o,a,s]=function(e){let t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=hk(e).resolvedOptions(),n=e}catch(o){let i=e.substring(0,r);t=hk(i).resolvedOptions(),n=i}let{numberingSystem:i,calendar:o}=t;return[n,i,o]}}(e);this.locale=o,this.numberingSystem=t||a||null,this.outputCalendar=r||s||null,this.weekSettings=n,this.intl=function(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return null==this.fastNumbersCached&&(this.fastNumbersCached=(!this.numberingSystem||"latn"===this.numberingSystem)&&("latn"===this.numberingSystem||!this.locale||this.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(this.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(null===this.numberingSystem||"latn"===this.numberingSystem)&&(null===this.outputCalendar||"gregory"===this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?hU.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,yy(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return hF(this,e,yB,()=>{let r=t?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=function(e){let t=[];for(let r=1;r<=12;r++){let n=bb.utc(2009,r,1);t.push(e(n))}return t}(e=>this.extract(e,r,"month"))),this.monthsCache[n][e]})}weekdays(e,t=!1){return hF(this,e,y$,()=>{let r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){let t=[];for(let r=1;r<=7;r++){let n=bb.utc(2016,11,13+r);t.push(e(n))}return t}(e=>this.extract(e,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return hF(this,void 0,()=>yK,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[bb.utc(2016,11,13,9),bb.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return hF(this,e,yQ,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[bb.utc(-40,1,1),bb.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){let n=this.dtFormatter(e,t),i=n.formatToParts(),o=i.find(e=>e.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new hL(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new hz(e,this.intl,t)}relFormatter(e={}){return new hR(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){let r=JSON.stringify([e,t]),n=hM[r];return n||(n=new Intl.ListFormat(e,t),hM[r]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:yf()?function(e){let t=hP[e];if(!t){let r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,hP[e]=t}return t}(this.locale):hB}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let hq=null;class hJ extends hD{static get utcInstance(){return null===hq&&(hq=new hJ(0)),hq}static instance(e){return 0===e?hJ.utcInstance:new hJ(e)}static parseSpecifier(e){if(e){let t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new hJ(yj(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${yP(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${yP(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return yP(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class h$ extends hD{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function hK(e,t){if(yc(e)||null===e)return t;if(e instanceof hD)return e;if("string"==typeof e){let r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?hT.instance:"utc"===r||"gmt"===r?hJ.utcInstance:hJ.parseSpecifier(r)||hC.create(e)}return yp(e)?hJ.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new h$(e)}let hV={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},hY={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},hW=hV.hanidec.replace(/[\[|\]]/g,"").split(""),hQ={};function hH({numberingSystem:e},t=""){let r=e||"latn";return hQ[r]||(hQ[r]={}),hQ[r][t]||(hQ[r][t]=RegExp(`${hV[r]}${t}`)),hQ[r][t]}let hG=()=>Date.now(),hZ="system",hX=null,h0=null,h1=null,h2=60,h3,h4=null;class h6{static get now(){return hG}static set now(e){hG=e}static set defaultZone(e){hZ=e}static get defaultZone(){return hK(hZ,hT.instance)}static get defaultLocale(){return hX}static set defaultLocale(e){hX=e}static get defaultNumberingSystem(){return h0}static set defaultNumberingSystem(e){h0=e}static get defaultOutputCalendar(){return h1}static set defaultOutputCalendar(e){h1=e}static get defaultWeekSettings(){return h4}static set defaultWeekSettings(e){h4=yy(e)}static get twoDigitCutoffYear(){return h2}static set twoDigitCutoffYear(e){h2=e%100}static get throwOnInvalid(){return h3}static set throwOnInvalid(e){h3=e}static resetCaches(){hU.resetCache(),hC.resetCache(),bb.resetCache(),hQ={}}}class h5{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}let h8=[0,31,59,90,120,151,181,212,243,273,304,334],h7=[0,31,60,91,121,152,182,213,244,274,305,335];function h9(e,t){return new h5("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ye(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return 0===i?7:i}function yt(e,t){let r=yT(e)?h7:h8,n=r.findIndex(e=>eyM(n,t,r)?(u=n+1,l=1):u=n,{weekYear:u,weekNumber:l,weekday:s,...yF(e)}}function yi(e,t=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=e,a=yr(ye(n,1,t),r),s=yE(n),l=7*i+o-a-7+t,u;l<1?l+=yE(u=n-1):l>s?(u=n+1,l-=yE(n)):u=n;let{month:c,day:p}=yt(u,l);return{year:u,month:c,day:p,...yF(e)}}function yo(e){let{year:t,month:r,day:n}=e,i=n+(yT(t)?h7:h8)[r-1];return{year:t,ordinal:i,...yF(e)}}function ya(e){let{year:t,ordinal:r}=e,{month:n,day:i}=yt(t,r);return{year:t,month:n,day:i,...yF(e)}}function ys(e,t){let r=!yc(e.localWeekday)||!yc(e.localWeekNumber)||!yc(e.localWeekYear);if(!r)return{minDaysInFirstWeek:4,startOfWeek:1};{let r=!yc(e.weekday)||!yc(e.weekNumber)||!yc(e.weekYear);if(r)throw new m3("Cannot mix locale-based week fields with ISO-based week fields");return yc(e.localWeekday)||(e.weekday=e.localWeekday),yc(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),yc(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}}function yl(e){let t=yd(e.year),r=yg(e.month,1,12),n=yg(e.day,1,yw(e.year,e.month));return t?r?!n&&h9("day",e.day):h9("month",e.month):h9("year",e.year)}function yu(e){let{hour:t,minute:r,second:n,millisecond:i}=e,o=yg(t,0,23)||24===t&&0===r&&0===n&&0===i,a=yg(r,0,59),s=yg(n,0,59),l=yg(i,0,999);return o?a?s?!l&&h9("millisecond",i):h9("second",n):h9("minute",r):h9("hour",t)}function yc(e){return void 0===e}function yp(e){return"number"==typeof e}function yd(e){return"number"==typeof e&&e%1==0}function y_(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function yf(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function ym(e,t,r){if(0!==e.length)return e.reduce((e,n)=>{let i=[t(n),n];return e&&r(e[0],i[0])===e[0]?e:i},null)[1]}function yh(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function yy(e){if(null==e)return null;if("object"!=typeof e)throw new m6("Week settings must be an object");if(!yg(e.firstDay,1,7)||!yg(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!yg(e,1,7)))throw new m6("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function yg(e,t,r){return yd(e)&&e>=t&&e<=r}function yb(e,t=2){return e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function yv(e){if(!yc(e)&&null!==e&&""!==e)return parseInt(e,10)}function yx(e){if(!yc(e)&&null!==e&&""!==e)return parseFloat(e)}function yD(e){if(!yc(e)&&null!==e&&""!==e){let t=1e3*parseFloat("0."+e);return Math.floor(t)}}function yS(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function yT(e){return e%4==0&&(e%100!=0||e%400==0)}function yE(e){return yT(e)?366:365}function yw(e,t){var r;let n=(r=t-1)-12*Math.floor(r/12)+1;return 2===n?yT(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function yA(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function yC(e,t,r){let n=yr(ye(e,1,t),r);return-n+t-1}function yM(e,t=4,r=1){let n=yC(e,t,r),i=yC(e+1,t,r);return(yE(e)-n+i)/7}function yN(e){return e>99?e:e>h6.twoDigitCutoffYear?1900+e:2e3+e}function yk(e,t,r,n=null){let i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);let a={timeZoneName:t,...o},s=new Intl.DateTimeFormat(r,a).formatToParts(i).find(e=>"timezonename"===e.type.toLowerCase());return s?s.value:null}function yj(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return 60*r+i}function yI(e){let t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new m6(`Invalid unit value ${e}`);return t}function yO(e,t){let r={};for(let n in e)if(yh(e,n)){let i=e[n];if(null==i)continue;r[t(n)]=yI(i)}return r}function yP(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${yb(r,2)}:${yb(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${yb(r,2)}${yb(n,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function yF(e){return["hour","minute","second","millisecond"].reduce((t,r)=>(t[r]=e[r],t),{})}let yL=["January","February","March","April","May","June","July","August","September","October","November","December"],yz=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yR=["J","F","M","A","M","J","J","A","S","O","N","D"];function yB(e){switch(e){case"narrow":return[...yR];case"short":return[...yz];case"long":return[...yL];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}let yU=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],yq=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yJ=["M","T","W","T","F","S","S"];function y$(e){switch(e){case"narrow":return[...yJ];case"short":return[...yq];case"long":return[...yU];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}let yK=["AM","PM"],yV=["Before Christ","Anno Domini"],yY=["BC","AD"],yW=["B","A"];function yQ(e){switch(e){case"narrow":return[...yW];case"short":return[...yY];case"long":return[...yV];default:return null}}function yH(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}let yG={D:he,DD:ht,DDD:hn,DDDD:hi,t:ho,tt:ha,ttt:hs,tttt:hl,T:hu,TT:hc,TTT:hp,TTTT:hd,f:h_,ff:hm,fff:hg,ffff:hv,F:hf,FF:hh,FFF:hb,FFFF:hx};class yZ{static create(e,t={}){return new yZ(e,t)}static parseFormat(e){let t=null,r="",n=!1,i=[];for(let o=0;o0&&i.push({literal:n||/^\s+$/.test(r),val:r}),t=null,r="",n=!n):n?r+=a:a===t?r+=a:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=a,t=a)}return r.length>0&&i.push({literal:n||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(e){return yG[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());let r=this.systemLoc.dtFormatter(e,{...this.opts,...t});return r.format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){let r=this.dtFormatter(e.start,t);return r.dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return yb(e,t);let r={...this.opts};return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){let r="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,i=(t,r)=>this.loc.extract(e,t,r),o=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",a=()=>r?yK[e.hour<12?0:1]:i({hour:"numeric",hourCycle:"h12"},"dayperiod"),s=(t,n)=>r?yB(t)[e.month-1]:i(n?{month:t}:{month:t,day:"numeric"},"month"),l=(t,n)=>r?y$(t)[e.weekday-1]:i(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),u=t=>{let r=yZ.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},c=t=>r?yQ(t)[e.year<0?0:1]:i({era:t},"era");return yH(yZ.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return n?i({day:"numeric"},"day"):this.num(e.day);case"dd":return n?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return s("short",!0);case"LLLL":return s("long",!0);case"LLLLL":return s("narrow",!0);case"M":return n?i({month:"numeric"},"month"):this.num(e.month);case"MM":return n?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return s("short",!1);case"MMMM":return s("long",!1);case"MMMMM":return s("narrow",!1);case"y":return n?i({year:"numeric"},"year"):this.num(e.year);case"yy":return n?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(t)}})}formatDurationFromString(e,t){let r=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=yZ.parseFormat(t),i=n.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),o=e.shiftTo(...i.map(r).filter(e=>e));return yH(n,e=>{let t=r(e);return t?this.num(o.get(t),e.length):e})}}let yX=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function y0(...e){let t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function y1(...e){return t=>e.reduce(([e,r,n],i)=>{let[o,a,s]=i(t,n);return[{...e,...o},a||r,s]},[{},null,1]).slice(0,2)}function y2(e,...t){if(null==e)return[null,null];for(let[r,n]of t){let t=r.exec(e);if(t)return n(t)}return[null,null]}function y3(...e){return(t,r)=>{let n;let i={};for(n=0;nvoid 0!==e&&(t||e&&c)?-e:e;return[{years:d(yx(r)),months:d(yx(n)),weeks:d(yx(i)),days:d(yx(o)),hours:d(yx(a)),minutes:d(yx(s)),seconds:d(yx(l),"-0"===l),milliseconds:d(yD(u),p)}]}let gc={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function gp(e,t,r,n,i,o,a){let s={year:2===t.length?yN(yv(t)):yv(t),month:yz.indexOf(r)+1,day:yv(n),hour:yv(i),minute:yv(o)};return a&&(s.second=yv(a)),e&&(s.weekday=e.length>3?yU.indexOf(e)+1:yq.indexOf(e)+1),s}let gd=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function g_(e){let t;let[,r,n,i,o,a,s,l,u,c,p,d]=e,_=gp(r,o,i,n,a,s,l);return t=u?gc[u]:c?0:yj(p,d),[_,new hJ(t)]}let gf=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,gm=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,gh=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function gy(e){let[,t,r,n,i,o,a,s]=e,l=gp(t,i,n,r,o,a,s);return[l,hJ.utcInstance]}function gg(e){let[,t,r,n,i,o,a,s]=e,l=gp(t,s,r,n,i,o,a);return[l,hJ.utcInstance]}let gb=y0(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,y7),gv=y0(/(\d{4})-?W(\d\d)(?:-?(\d))?/,y7),gx=y0(/(\d{4})-?(\d{3})/,y7),gD=y0(y8),gS=y1(function(e,t){let r={year:gn(e,t),month:gn(e,t+1,1),day:gn(e,t+2,1)};return[r,null,t+3]},gi,go,ga),gT=y1(y9,gi,go,ga),gE=y1(ge,gi,go,ga),gw=y1(gi,go,ga),gA=y1(gi),gC=y0(/(\d{4})-(\d\d)-(\d\d)/,gr),gM=y0(gt),gN=y1(gi,go,ga),gk="Invalid Duration",gj={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},gI={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...gj},gO={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:31556952,milliseconds:31556952e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:7889238,milliseconds:7889238e3},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...gj},gP=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],gF=gP.slice(0).reverse();function gL(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new gB(n)}function gz(e,t){let r=t.milliseconds??0;for(let n of gF.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function gR(e,t){let r=0>gz(e,t)?-1:1;gP.reduceRight((n,i)=>{if(yc(t[i]))return n;if(n){let o=t[n]*r,a=e[i][n],s=Math.floor(o/a);t[i]+=s*r,t[n]-=s*a*r}return i},null),gP.reduce((r,n)=>{if(yc(t[n]))return r;if(r){let i=t[r]%1;t[r]-=i,t[n]+=i*e[r][n]}return n},null)}class gB{constructor(e){let t="longterm"===e.conversionAccuracy,r=t?gO:gI;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||hU.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return gB.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new m6(`Duration.fromObject: argument expected to be an object, got ${null===e?"null":typeof e}`);return new gB({values:yO(e,gB.normalizeUnit),loc:hU.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(yp(e))return gB.fromMillis(e);if(gB.isDuration(e))return e;if("object"==typeof e)return gB.fromObject(e);throw new m6(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){let[r]=y2(e,[gl,gu]);return r?gB.fromObject(r,t):gB.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){let[r]=y2(e,[gs,gA]);return r?gB.fromObject(r,t):gB.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new m6("need to specify a reason the Duration is invalid");let r=e instanceof h5?e:new h5(e,t);if(!h6.throwOnInvalid)return new gB({invalid:r});throw new m2(r)}static normalizeUnit(e){let t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new m4(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?yZ.create(this.loc,r).formatDurationFromString(this,e):gk}toHuman(e={}){if(!this.isValid)return gk;let t=gP.map(t=>{let r=this.values[t];return yc(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),(0!==this.months||0!==this.quarters)&&(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),(0!==this.hours||0!==this.minutes||0!==this.seconds||0!==this.milliseconds)&&(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),(0!==this.seconds||0!==this.milliseconds)&&(e+=yS(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};let r=bb.fromMillis(t,{zone:"UTC"});return r.toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?gz(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let t=gB.fromDurationLike(e),r={};for(let e of gP)(yh(t.values,e)||yh(this.values,e))&&(r[e]=t.get(e)+this.get(e));return gL(this,{values:r},!0)}minus(e){if(!this.isValid)return this;let t=gB.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=yI(e(this.values[r],r));return gL(this,{values:t},!0)}get(e){return this[gB.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let t={...this.values,...yO(e,gB.normalizeUnit)};return gL(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){let i=this.loc.clone({locale:e,numberingSystem:t});return gL(this,{loc:i,matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return gR(this.matrix,e),gL(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=function(e){let t={};for(let[r,n]of Object.entries(e))0!==n&&(t[r]=n);return t}(this.normalize().shiftToAll().toObject());return gL(this,{values:e},!0)}shiftTo(...e){let t;if(!this.isValid||0===e.length)return this;e=e.map(e=>gB.normalizeUnit(e));let r={},n={},i=this.toObject();for(let o of gP)if(e.indexOf(o)>=0){t=o;let e=0;for(let t in n)e+=this.matrix[t][o]*n[t],n[t]=0;yp(i[o])&&(e+=i[o]);let a=Math.trunc(e);r[o]=a,n[o]=(1e3*e-1e3*a)/1e3}else yp(i[o])&&(n[o]=i[o]);for(let e in n)0!==n[e]&&(r[t]+=e===t?n[e]:n[e]/this.matrix[t][e]);return gR(this.matrix,r),gL(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return gL(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;for(let n of gP){var t,r;if(t=this.values[n],r=e.values[n],void 0===t||0===t?void 0!==r&&0!==r:t!==r)return!1}return!0}}let gU="Invalid Interval";class gq{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new m6("need to specify a reason the Interval is invalid");let r=e instanceof h5?e:new h5(e,t);if(!h6.throwOnInvalid)return new gq({invalid:r});throw new m1(r)}static fromDateTimes(e,t){let r=bv(e),n=bv(t),i=r&&r.isValid?n&&n.isValid?ne}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&this.s<=e&&this.e>e}set({start:e,end:t}={}){return this.isValid?gq.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];let t=e.map(bv).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[],{s:n}=this,i=0;for(;n+this.e?this.e:e;r.push(gq.fromDateTimes(n,o)),n=o,i+=1}return r}splitBy(e){let t=gB.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let{s:r}=this,n=1,i,o=[];for(;re*n));i=+e>+this.e?this.e:e,o.push(gq.fromDateTimes(r,i)),r=i,n+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e}equals(e){return!!this.isValid&&!!e.isValid&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let t=this.s>e.s?this.s:e.s,r=this.e=r?null:gq.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;let t=this.se.e?this.e:e.e;return gq.fromDateTimes(t,r)}static merge(e){let[t,r]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0,n=[],i=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),o=Array.prototype.concat(...i),a=o.sort((e,t)=>e.time-t.time);for(let e of a)1===(r+="s"===e.type?1:-1)?t=e.time:(t&&+t!=+e.time&&n.push(gq.fromDateTimes(t,e.time)),t=null);return gq.merge(n)}difference(...e){return gq.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:gU}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=he,t={}){return this.isValid?yZ.create(this.s.loc.clone(t),e).formatInterval(this):gU}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:gU}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:gU}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:gU}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:gU}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):gB.invalid(this.invalidReason)}mapEndpoints(e){return gq.fromDateTimes(e(this.s),e(this.e))}}class gJ{static hasDST(e=h6.defaultZone){let t=bb.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return hC.isValidZone(e)}static normalizeZone(e){return hK(e,h6.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||hU.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||hU.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||hU.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:i="gregory"}={}){return(n||hU.create(t,r,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:i="gregory"}={}){return(n||hU.create(t,r,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||hU.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||hU.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return hU.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return hU.create(t,null,"gregory").eras(e)}static features(){return{relative:y_(),localeWeek:yf()}}}function g$(e,t){let r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(gB.fromMillis(n).as("days"))}function gK(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(!isNaN(t))return t;t="";for(let r=0;r=r&&n<=i&&(t+=n-r)}}return parseInt(t,10)}(e))}}let gV=String.fromCharCode(160),gY=`[ ${gV}]`,gW=RegExp(gY,"g");function gQ(e){return e.replace(/\./g,"\\.?").replace(gW,gY)}function gH(e){return e.replace(/\./g,"").replace(gW," ").toLowerCase()}function gG(e,t){return null===e?null:{regex:RegExp(e.map(gQ).join("|")),deser:([r])=>e.findIndex(e=>gH(r)===gH(e))+t}}function gZ(e,t){return{regex:e,deser:([,e,t])=>yj(e,t),groups:t}}function gX(e){return{regex:e,deser:([e])=>e}}let g0={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}},g1=null;function g2(e,t){return Array.prototype.concat(...e.map(e=>(function(e,t){if(e.literal)return e;let r=yZ.macroTokenToFormatOpts(e.val),n=g6(r,t);return null==n||n.includes(void 0)?e:n})(e,t)))}class g3{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=g2(yZ.parseFormat(t),e),this.units=this.tokens.map(t=>(function(e,t){let r=hH(t),n=hH(t,"{2}"),i=hH(t,"{3}"),o=hH(t,"{4}"),a=hH(t,"{6}"),s=hH(t,"{1,2}"),l=hH(t,"{1,3}"),u=hH(t,"{1,6}"),c=hH(t,"{1,9}"),p=hH(t,"{2,4}"),d=hH(t,"{4,6}"),_=e=>({regex:RegExp(e.val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")),deser:([e])=>e,literal:!0}),f=(f=>{if(e.literal)return _(f);switch(f.val){case"G":return gG(t.eras("short"),0);case"GG":return gG(t.eras("long"),0);case"y":return gK(u);case"yy":case"kk":return gK(p,yN);case"yyyy":case"kkkk":return gK(o);case"yyyyy":return gK(d);case"yyyyyy":return gK(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return gK(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return gK(n);case"MMM":return gG(t.months("short",!0),1);case"MMMM":return gG(t.months("long",!0),1);case"LLL":return gG(t.months("short",!1),1);case"LLLL":return gG(t.months("long",!1),1);case"o":case"S":return gK(l);case"ooo":case"SSS":return gK(i);case"u":return gX(c);case"uu":return gX(s);case"uuu":case"E":case"c":return gK(r);case"a":return gG(t.meridiems(),0);case"EEE":return gG(t.weekdays("short",!1),1);case"EEEE":return gG(t.weekdays("long",!1),1);case"ccc":return gG(t.weekdays("short",!0),1);case"cccc":return gG(t.weekdays("long",!0),1);case"Z":case"ZZ":return gZ(RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return gZ(RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return gX(/[a-z_+-/]{1,256}?/i);case" ":return gX(/[^\S\n\r]/);default:return _(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f})(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=function(e){let t=e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"");return[`^${t}$`,e]}(this.units);this.regex=RegExp(e,"i"),this.handlers=t}}explainFromTokens(e){if(!this.isValid)return{input:e,tokens:this.tokens,invalidReason:this.invalidReason};{let[t,r]=function(e,t,r){let n=e.match(t);if(!n)return[n,{}];{let e={},t=1;for(let i in r)if(yh(r,i)){let o=r[i],a=o.groups?o.groups+1:1;!o.literal&&o.token&&(e[o.token.val[0]]=o.deser(n.slice(t,t+a))),t+=a}return[n,e]}}(e,this.regex,this.handlers),[n,i,o]=r?function(e){let t;let r=e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},n=null;yc(e.z)||(n=hC.create(e.z)),yc(e.Z)||(n||(n=new hJ(e.Z)),t=e.Z),yc(e.q)||(e.M=(e.q-1)*3+1),yc(e.h)||(e.h<12&&1===e.a?e.h+=12:12!==e.h||0!==e.a||(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),yc(e.u)||(e.S=yD(e.u));let i=Object.keys(e).reduce((t,n)=>{let i=r(n);return i&&(t[i]=e[n]),t},{});return[i,n,t]}(r):[null,null,void 0];if(yh(r,"a")&&yh(r,"H"))throw new m3("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:n,zone:i,specificOffset:o}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function g4(e,t,r){let n=new g3(e,r);return n.explainFromTokens(t)}function g6(e,t){if(!e)return null;let r=yZ.create(t,e),n=r.dtFormatter((g1||(g1=bb.fromMillis(1555555555555)),g1)),i=n.formatToParts(),o=n.resolvedOptions();return i.map(t=>(function(e,t,r){let{type:n,value:i}=e;if("literal"===n){let e=/^\s+$/.test(i);return{literal:!e,val:e?" ":i}}let o=t[n],a=n;"hour"===n&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let s=g0[a];if("object"==typeof s&&(s=s[o]),s)return{literal:!1,val:s}})(t,e,o))}let g5="Invalid DateTime";function g8(e){return new h5("unsupported zone",`the zone "${e.name}" is not supported`)}function g7(e){return null===e.weekData&&(e.weekData=yn(e.c)),e.weekData}function g9(e){return null===e.localWeekData&&(e.localWeekData=yn(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function be(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new bb({...r,...t,old:r})}function bt(e,t,r){let n=e-6e4*t,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*6e4;let o=r.offset(n);return i===o?[n,i]:[e-6e4*Math.min(i,o),Math.max(i,o)]}function br(e,t){e+=6e4*t;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function bn(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o={...e.c,year:n,month:i,day:Math.min(e.c.day,yw(n,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},a=gB.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=yA(o),[l,u]=bt(s,r,e.zone);return 0!==a&&(l+=a,u=e.zone.offset(l)),{ts:l,o:u}}function bi(e,t,r,n,i,o){let{setZone:a,zone:s}=r;if((!e||0===Object.keys(e).length)&&!t)return bb.invalid(new h5("unparsable",`the input "${i}" can't be parsed as ${n}`));{let n=t||s,i=bb.fromObject(e,{...r,zone:n,specificOffset:o});return a?i:i.setZone(s)}}function bo(e,t,r=!0){return e.isValid?yZ.create(hU.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ba(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=yb(e.c.year,r?6:4),t?n+="-"+yb(e.c.month)+"-"+yb(e.c.day):n+=yb(e.c.month)+yb(e.c.day),n}function bs(e,t,r,n,i,o){let a=yb(e.c.hour);return t?(a+=":"+yb(e.c.minute),0===e.c.millisecond&&0===e.c.second&&r||(a+=":")):a+=yb(e.c.minute),0===e.c.millisecond&&0===e.c.second&&r||(a+=yb(e.c.second),0===e.c.millisecond&&n||(a+="."+yb(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?a+="Z":e.o<0?a+="-"+yb(Math.trunc(-e.o/60))+":"+yb(Math.trunc(-e.o%60)):a+="+"+yb(Math.trunc(e.o/60))+":"+yb(Math.trunc(e.o%60))),o&&(a+="["+e.zone.ianaName+"]"),a}let bl={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},bu={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},bc={ordinal:1,hour:0,minute:0,second:0,millisecond:0},bp=["year","month","day","hour","minute","second","millisecond"],bd=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],b_=["year","ordinal","hour","minute","second","millisecond"];function bf(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new m4(e);return t}(e)}}function bm(t,r){let n,i;let o=hK(r.zone,h6.defaultZone);if(!o.isValid)return bb.invalid(g8(o));let a=hU.fromObject(r);if(yc(t.year))n=h6.now();else{for(let e of bp)yc(t[e])&&(t[e]=bl[e]);let r=yl(t)||yu(t);if(r)return bb.invalid(r);let a=(bg[o]||(void 0===e&&(e=h6.now()),bg[o]=o.offset(e)),bg[o]);[n,i]=bt(yA(t),a,o)}return new bb({ts:n,zone:o,loc:a,o:i})}function bh(e,t,r){let n=!!yc(r.round)||r.round,i=(e,i)=>{e=yS(e,n||r.calendary?0:2,!0);let o=t.loc.clone(r).relFormatter(r);return o.format(e,i)},o=n=>r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(r.unit)return i(o(r.unit),r.unit);for(let e of r.units){let t=o(e);if(Math.abs(t)>=1)return i(t,e)}return i(e>t?-0:0,r.units[r.units.length-1])}function by(e){let t={},r;return e.length>0&&"object"==typeof e[e.length-1]?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}let bg={};class bb{constructor(e){let t=e.zone||h6.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new h5("invalid input"):null)||(t.isValid?null:g8(t));this.ts=yc(e.ts)?h6.now():e.ts;let n=null,i=null;if(!r){let o=e.old&&e.old.ts===this.ts&&e.old.zone.equals(t);if(o)[n,i]=[e.old.c,e.old.o];else{let o=yp(e.o)&&!e.old?e.o:t.offset(this.ts);n=(r=Number.isNaN((n=br(this.ts,o)).year)?new h5("invalid input"):null)?null:n,i=r?null:o}}this._zone=t,this.loc=e.loc||hU.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=i,this.isLuxonDateTime=!0}static now(){return new bb({})}static local(){let[e,t]=by(arguments),[r,n,i,o,a,s,l]=t;return bm({year:r,month:n,day:i,hour:o,minute:a,second:s,millisecond:l},e)}static utc(){let[e,t]=by(arguments),[r,n,i,o,a,s,l]=t;return e.zone=hJ.utcInstance,bm({year:r,month:n,day:i,hour:o,minute:a,second:s,millisecond:l},e)}static fromJSDate(e,t={}){let r="[object Date]"===Object.prototype.toString.call(e)?e.valueOf():NaN;if(Number.isNaN(r))return bb.invalid("invalid input");let n=hK(t.zone,h6.defaultZone);return n.isValid?new bb({ts:r,zone:n,loc:hU.fromObject(t)}):bb.invalid(g8(n))}static fromMillis(e,t={}){if(yp(e))return e<-864e13||e>864e13?bb.invalid("Timestamp out of range"):new bb({ts:e,zone:hK(t.zone,h6.defaultZone),loc:hU.fromObject(t)});throw new m6(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(yp(e))return new bb({ts:1e3*e,zone:hK(t.zone,h6.defaultZone),loc:hU.fromObject(t)});throw new m6("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};let r=hK(t.zone,h6.defaultZone);if(!r.isValid)return bb.invalid(g8(r));let n=hU.fromObject(t),i=yO(e,bf),{minDaysInFirstWeek:o,startOfWeek:a}=ys(i,n),s=h6.now(),l=yc(t.specificOffset)?r.offset(s):t.specificOffset,u=!yc(i.ordinal),c=!yc(i.year),p=!yc(i.month)||!yc(i.day),d=c||p,_=i.weekYear||i.weekNumber;if((d||u)&&_)throw new m3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&u)throw new m3("Can't mix ordinal dates with month/day");let f=_||i.weekday&&!d,m,h,y=br(s,l);f?(m=bd,h=bu,y=yn(y,o,a)):u?(m=b_,h=bc,y=yo(y)):(m=bp,h=bl);let g=!1;for(let e of m){let t=i[e];yc(t)?g?i[e]=h[e]:i[e]=y[e]:g=!0}let b=f?function(e,t=4,r=1){let n=yd(e.weekYear),i=yg(e.weekNumber,1,yM(e.weekYear,t,r)),o=yg(e.weekday,1,7);return n?i?!o&&h9("weekday",e.weekday):h9("week",e.weekNumber):h9("weekYear",e.weekYear)}(i,o,a):u?function(e){let t=yd(e.year),r=yg(e.ordinal,1,yE(e.year));return t?!r&&h9("ordinal",e.ordinal):h9("year",e.year)}(i):yl(i),v=b||yu(i);if(v)return bb.invalid(v);let x=f?yi(i,o,a):u?ya(i):i,[D,S]=bt(yA(x),l,r),T=new bb({ts:D,zone:r,o:S,loc:n});return i.weekday&&d&&e.weekday!==T.weekday?bb.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${T.toISO()}`):T.isValid?T:bb.invalid(T.invalid)}static fromISO(e,t={}){let[r,n]=y2(e,[gb,gS],[gv,gT],[gx,gE],[gD,gw]);return bi(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){let[r,n]=y2(e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim(),[gd,g_]);return bi(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){let[r,n]=y2(e,[gf,gy],[gm,gy],[gh,gg]);return bi(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(yc(e)||yc(t))throw new m6("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:i=null}=r,o=hU.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0}),[a,s,l,u]=function(e,t,r){let{result:n,zone:i,specificOffset:o,invalidReason:a}=g4(e,t,r);return[n,i,o,a]}(o,e,t);return u?bb.invalid(u):bi(a,s,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return bb.fromFormat(e,t,r)}static fromSQL(e,t={}){let[r,n]=y2(e,[gC,gS],[gM,gN]);return bi(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new m6("need to specify a reason the DateTime is invalid");let r=e instanceof h5?e:new h5(e,t);if(!h6.throwOnInvalid)return new bb({invalid:r});throw new m0(r)}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let r=g6(e,hU.fromObject(t));return r?r.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){let r=g2(yZ.parseFormat(e),hU.fromObject(t));return r.map(e=>e.val).join("")}static resetCache(){e=void 0,bg={}}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?g7(this).weekYear:NaN}get weekNumber(){return this.isValid?g7(this).weekNumber:NaN}get weekday(){return this.isValid?g7(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?g9(this).weekday:NaN}get localWeekNumber(){return this.isValid?g9(this).weekNumber:NaN}get localWeekYear(){return this.isValid?g9(this).weekYear:NaN}get ordinal(){return this.isValid?yo(this.c).ordinal:NaN}get monthShort(){return this.isValid?gJ.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?gJ.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?gJ.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?gJ.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=yA(this.c),t=this.zone.offset(e-864e5),r=this.zone.offset(e+864e5),n=this.zone.offset(e-6e4*t),i=this.zone.offset(e-6e4*r);if(n===i)return[this];let o=e-6e4*n,a=e-6e4*i,s=br(o,n),l=br(a,i);return s.hour===l.hour&&s.minute===l.minute&&s.second===l.second&&s.millisecond===l.millisecond?[be(this,{ts:o}),be(this,{ts:a})]:[this]}get isInLeapYear(){return yT(this.year)}get daysInMonth(){return yw(this.year,this.month)}get daysInYear(){return this.isValid?yE(this.year):NaN}get weeksInWeekYear(){return this.isValid?yM(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?yM(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:r,calendar:n}=yZ.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(hJ.instance(e),t)}toLocal(){return this.setZone(h6.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=hK(e,h6.defaultZone)).equals(this.zone))return this;if(!e.isValid)return bb.invalid(g8(e));{let i=this.ts;if(t||r){var n;let t=e.offset(this.ts),r=this.toObject();[i]=(n=e,bt(yA(r),t,n))}return be(this,{ts:i,zone:e})}}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){let n=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return be(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){var t,r,n;let i;if(!this.isValid)return this;let o=yO(e,bf),{minDaysInFirstWeek:a,startOfWeek:s}=ys(o,this.loc),l=!yc(o.weekYear)||!yc(o.weekNumber)||!yc(o.weekday),u=!yc(o.ordinal),c=!yc(o.year),p=!yc(o.month)||!yc(o.day),d=o.weekYear||o.weekNumber;if((c||p||u)&&d)throw new m3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&u)throw new m3("Can't mix ordinal dates with month/day");l?i=yi({...yn(this.c,a,s),...o},a,s):yc(o.ordinal)?(i={...this.toObject(),...o},yc(o.day)&&(i.day=Math.min(yw(i.year,i.month),i.day))):i=ya({...yo(this.c),...o});let[_,f]=(t=i,r=this.o,n=this.zone,bt(yA(t),r,n));return be(this,{ts:_,o:f})}plus(e){if(!this.isValid)return this;let t=gB.fromDurationLike(e);return be(this,bn(this,t))}minus(e){if(!this.isValid)return this;let t=gB.fromDurationLike(e).negate();return be(this,bn(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let r={},n=gB.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===n){if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;tthis.valueOf(),a=function(e,t,r,n){let[i,o,a,s]=function(e,t,r){let n,i;let o=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],["months",(e,t)=>t.month-e.month+(t.year-e.year)*12],["weeks",(e,t)=>{let r=g$(e,t);return(r-r%7)/7}],["days",g$]],a={},s=e;for(let[l,u]of o)r.indexOf(l)>=0&&(n=l,a[l]=u(e,t),(i=s.plus(a))>t?(a[l]--,(e=s.plus(a))>t&&(i=e,a[l]--,e=s.plus(a))):e=i);return[e,a,i,n]}(e,t,r),l=t-i,u=r.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===u.length&&(a0?gB.fromMillis(l,n).shiftTo(...u).plus(c):c}(o?this:e,o?e:this,i,n);return o?a.negate():a}diffNow(e="milliseconds",t={}){return this.diff(bb.now(),e,t)}until(e){return this.isValid?gq.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;let n=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,r)<=n&&n<=i.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let t=e.base||bb.fromObject({},{zone:this.zone}),r=e.padding?thise.valueOf(),Math.min)}static max(...e){if(!e.every(bb.isDateTime))throw new m6("max requires all arguments be DateTimes");return ym(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){let{locale:n=null,numberingSystem:i=null}=r,o=hU.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});return g4(o,e,t)}static fromStringExplain(e,t,r={}){return bb.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){let{locale:r=null,numberingSystem:n=null}=t,i=hU.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0});return new g3(i,e)}static fromFormatParser(e,t,r={}){if(yc(e)||yc(t))throw new m6("fromFormatParser requires an input string and a format parser");let{locale:n=null,numberingSystem:i=null}=r,o=hU.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});if(!o.equals(t.locale))throw new m6(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);let{result:a,zone:s,specificOffset:l,invalidReason:u}=t.explainFromTokens(e);return u?bb.invalid(u):bi(a,s,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return he}static get DATE_MED(){return ht}static get DATE_MED_WITH_WEEKDAY(){return hr}static get DATE_FULL(){return hn}static get DATE_HUGE(){return hi}static get TIME_SIMPLE(){return ho}static get TIME_WITH_SECONDS(){return ha}static get TIME_WITH_SHORT_OFFSET(){return hs}static get TIME_WITH_LONG_OFFSET(){return hl}static get TIME_24_SIMPLE(){return hu}static get TIME_24_WITH_SECONDS(){return hc}static get TIME_24_WITH_SHORT_OFFSET(){return hp}static get TIME_24_WITH_LONG_OFFSET(){return hd}static get DATETIME_SHORT(){return h_}static get DATETIME_SHORT_WITH_SECONDS(){return hf}static get DATETIME_MED(){return hm}static get DATETIME_MED_WITH_SECONDS(){return hh}static get DATETIME_MED_WITH_WEEKDAY(){return hy}static get DATETIME_FULL(){return hg}static get DATETIME_FULL_WITH_SECONDS(){return hb}static get DATETIME_HUGE(){return hv}static get DATETIME_HUGE_WITH_SECONDS(){return hx}}function bv(e){if(bb.isDateTime(e))return e;if(e&&e.valueOf&&yp(e.valueOf()))return bb.fromJSDate(e);if(e&&"object"==typeof e)return bb.fromObject(e);throw new m6(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function bx(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}var bD=RegExp("Z|([+-]\\d{2}:?\\d{2})$","u"),bS=(0,H.object)({date:(0,H.refine)((0,H.string)(),"date",function(e){return bb.fromISO(e).isValid?!!bD.test(e)||"ISO 8601 date must have timezone information":"Not a valid ISO 8601 date"}),request:tr}),bT=(0,H.object)({duration:(0,H.refine)((0,H.string)(),"duration",function(e){return!!gB.fromISO(e).isValid||"Not a valid ISO 8601 duration"}),request:tr}),bE=tC(function(e){return(0,_.hasProperty)(e,"date")?bS:bT});function bw(){var e;return e=function(e,r,n,i,o){var a,s,l,u,c,p,d;return function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&void 0!==a[1]?a[1]:p.Base64,[4,uC(nc)];case 1:if(n=s.sent(),i=t4(e),!(o=null===(r=n.find(function(e){return e.path===i}))||void 0===r?void 0:r.toString("base64")))return[2,null];return[4,uE(bV,o,t)];case 2:return[2,s.sent()]}})}function b2(e,t){return bQ(this,function(r){switch(r.label){case 0:return[4,uC(r9)];case 1:return[4,uE([r.sent(),"createInterface"],e,t)];case 2:return[2,r.sent()]}})}function b3(e,t){return bQ(this,function(r){switch(r.label){case 0:return[4,uC(r9)];case 1:return[4,uE([r.sent(),"getInterface"],e,t)];case 2:return[2,r.sent()]}})}function b4(e,t,r){return bQ(this,function(n){switch(n.label){case 0:return[4,uC(r9)];case 1:return[4,uE([n.sent(),"updateInterface"],e,t,r)];case 2:return n.sent(),[4,uE(b3,e,t)];case 3:return[4,uD(rG(bW({id:t},n.sent())))];case 4:return n.sent(),[2]}})}function b6(e,t){return bQ(this,function(r){switch(r.label){case 0:return[4,uC(r9)];case 1:return[4,uE([r.sent(),"getInterface"],e,t)];case 2:return[2,r.sent().state]}})}function b5(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function b8(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){b5(o,n,i,a,s,"next",e)}function s(e){b5(o,n,i,a,s,"throw",e)}a(void 0)})}}function b7(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2?r-2:0),i=2;i0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,r),vA(this,"cache",new Map),vA(this,"validatedManifest",void 0),vA(this,"url",void 0),vA(this,"fetchFn",void 0),vA(this,"fetchOptions",void 0),(0,_.assertStruct)(e.toString(),e3,"Invalid Snap Id: "),this.fetchFn=null!==(t=n.fetch)&&void 0!==t?t:globalThis.fetch.bind(void 0),this.fetchOptions=n.fetchOptions,this.url=e}return e=[{key:"manifest",value:function(){var e=this;return vE(function(){var t,r,n,i,o;return vC(this,function(a){switch(a.label){case 0:if(e.validatedManifest)return[2,e.validatedManifest.clone()];return t=new URL(cj.Manifest,e.url).toString(),[4,e.fetchFn(t,e.fetchOptions)];case 1:if(!(r=a.sent()).ok)throw Error('Failed to fetch "'.concat(t,'". Status code: ').concat(r.status,"."));return[4,r.text()];case 2:return i=e8(n=a.sent()),o=new eP({value:n,result:t3(i),path:cj.Manifest,data:{canonicalPath:t}}),e.validatedManifest=o,[2,e.manifest()]}})})()}},{key:"fetch",value:function(e){var t=this;return vE(function(){var r,n,i,o,a,s;return vC(this,function(l){switch(l.label){case 0:if(r=t4(e),void 0!==(n=t.cache.get(r)))return[2,n.clone()];return i=t.toCanonical(r).toString(),[4,t.fetchFn(i,t.fetchOptions)];case 1:if(!(o=l.sent()).ok)throw Error('Failed to fetch "'.concat(i,'". Status code: ').concat(o.status,"."));return[4,o.arrayBuffer()];case 2:return a=l.sent(),s=new eP({value:new Uint8Array(a),path:r,data:{canonicalPath:i}}),(0,_.assert)(!t.cache.has(r),"Corrupted cache, multiple files with same path."),t.cache.set(r,s),[2,t.fetch(r)]}})})()}},{key:"root",get:function(){return new URL(this.url)}},{key:"toCanonical",value:function(e){return(0,_.assert)(!e.startsWith("/"),"Tried to parse absolute path."),new URL(e,this.url)}}],vw(r.prototype,e),t&&vw(r,t),r}();function vN(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function vk(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){vN(o,n,i,a,s,"next",e)}function s(e){vN(o,n,i,a,s,"throw",e)}a(void 0)})}}function vj(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function vI(e,t){var r=vj(e,t,"get");return r.get?r.get.call(e):r.value}function vO(e,t){for(var r=0;r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,r),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,vF),vF.set(this,{writable:!0,value:void 0}),(0,_.assertStruct)(e.toString(),e1,"Invalid Snap Id"),(0,_.assert)(void 0===o.fetchOptions,"Currently adding fetch options to local: is unsupported."),i=new vM(new URL(e.toString().slice(cI.local.length)),(t=function(e){for(var t=1;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?[2,r.join("\n")]:[2,!0]})});return function(t,r){return e.apply(this,arguments)}}()},{name:"Checksum",manifestName:"source.shasum",validator:function(){var e=vX(function(e,t){var r,n,i,o,a,s,l;return v1(this,function(u){switch(u.label){case 0:if(r=t.sourceCode,n=t.icon,i=t.auxiliaryFiles,o=t.localizationFiles,!e)return[3,2];return s=null===(a=e.result)||void 0===a?void 0:a.source.shasum,[4,function(e){return eZ.apply(this,arguments)}({manifest:e,sourceCode:r,svgIcon:n,auxiliaryFiles:i,localizationFiles:o})];case 1:if(l=u.sent(),s!==l)return[2,'Checksum mismatch - expected "'.concat(l,'" got "').concat(s,'"')];u.label=2;case 2:return[2,!0]}})});return function(t,r){return e.apply(this,arguments)}}()},{name:"Bundle",manifestName:"filePath",validator:function(){var e=vX(function(e,t){var r,n,i,o,a,s,l;return v1(this,function(u){return(r=t.sourceCode,l=v0(t2.schema.source.schema.location.schema.npm.schema.filePath.validate(null===(s=e)||void 0===s?void 0:null===(a=s.result)||void 0===a?void 0:null===(o=a.source)||void 0===o?void 0:null===(i=o.location)||void 0===i?void 0:null===(n=i.npm)||void 0===n?void 0:n.filePath),1)[0])?[2,l.message]:r?[2,!0]:[2,"Unable to load bundle."]})});return function(t,r){return e.apply(this,arguments)}}()}];function v3(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]